-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[LangRef/DataLayout] Spell out requirements for alignment values #104705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
7c87913
b5150ad
416c78c
2ffb292
27a55a4
241ffc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3030,8 +3030,10 @@ as follows: | |
| ``S<size>`` | ||
| Specifies the natural alignment of the stack in bits. Alignment | ||
| promotion of stack variables is limited to the natural stack | ||
| alignment to avoid dynamic stack realignment. The stack alignment | ||
| must be a multiple of 8-bits. If omitted, the natural stack | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do not delete the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is implied in the added paragraph. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an 8-bit per byte world and your downstream target differs from that assumption. Don't play games.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please be constructive in your criticism. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not resolved. You substitute 8-bit by byte to remove the 8-bit restriction. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. constructive criticism? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cheap trick
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's fine omit the 8-bit mention here. It's only mentioned once for
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LangRef probably should mention somewhere that bytes are 8 bits large in LLVM -- this just isn't the right place, as it's a global assumption, not specific to only this one thing. Not sure it makes sense to actually add that note now though, if there are plans to lift this restriction in the near future. |
||
| alignment to avoid dynamic stack realignment. | ||
| The stack alignment must be must be in the range [1,2^16) | ||
| and must be a power of two times the byte width. | ||
|
||
| If omitted, the natural stack | ||
| alignment defaults to "unspecified", which does not prevent any | ||
| alignment promotions. | ||
| ``P<address space>`` | ||
|
|
@@ -3065,26 +3067,37 @@ as follows: | |
| are in bits. The address space, ``n``, is optional, and if not specified, | ||
| denotes the default address space 0. The value of ``n`` must be | ||
| in the range [1,2^24). | ||
| The values of ``<abi>`` and ``<pref>`` must be in the range [1,2^16) | ||
| and must be powers of two times the byte width. | ||
| ``i<size>:<abi>[:<pref>]`` | ||
| This specifies the alignment for an integer type of a given bit | ||
| ``<size>``. The value of ``<size>`` must be in the range [1,2^24). | ||
| ``<pref>`` is optional and defaults to ``<abi>``. | ||
| The values of ``<abi>`` and ``<pref>`` must be in the range [1,2^16) | ||
| and must be powers of two times the byte width. | ||
| For ``i8``, the ``<abi>`` value must equal 8, | ||
| that is, ``i8`` must be naturally aligned. | ||
| ``v<size>:<abi>[:<pref>]`` | ||
| This specifies the alignment for a vector type of a given bit | ||
| ``<size>``. The value of ``<size>`` must be in the range [1,2^24). | ||
| ``<pref>`` is optional and defaults to ``<abi>``. | ||
| The values of ``<abi>`` and ``<pref>`` must be in the range [1,2^16) | ||
| and must be powers of two times the byte width. | ||
| ``f<size>:<abi>[:<pref>]`` | ||
| This specifies the alignment for a floating-point type of a given bit | ||
| ``<size>``. Only values of ``<size>`` that are supported by the target | ||
| will work. 32 (float) and 64 (double) are supported on all targets; 80 | ||
| or 128 (different flavors of long double) are also supported on some | ||
| targets. The value of ``<size>`` must be in the range [1,2^24). | ||
| ``<pref>`` is optional and defaults to ``<abi>``. | ||
| The values of ``<abi>`` and ``<pref>`` must be in the range [1,2^16) | ||
| and must be powers of two times the byte width. | ||
| ``a:<abi>[:<pref>]`` | ||
| This specifies the alignment for an object of aggregate type. | ||
| ``<pref>`` is optional and defaults to ``<abi>``. | ||
| The values of ``<abi>`` and ``<pref>`` must be in the range [1,2^16) | ||
| and must be powers of two times the byte width. | ||
| The value of ``<<abi>>` may also be zero meaning one byte alignment. | ||
| ``F<type><abi>`` | ||
| This specifies the alignment for function pointers. | ||
| The options for ``<type>`` are: | ||
|
|
@@ -3093,6 +3106,8 @@ as follows: | |
| of functions, and is a multiple of ``<abi>``. | ||
| * ``n``: The alignment of function pointers is a multiple of the explicit | ||
| alignment specified on the function, and is a multiple of ``<abi>``. | ||
| The values of ``<abi>`` and ``<pref>`` must be in the range [1,2^16) | ||
| and must be powers of two times the byte width. | ||
| ``m:<mangling>`` | ||
| If present, specifies that llvm names are mangled in the output. Symbols | ||
| prefixed with the mangling escape character ``\01`` are passed through | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we say once at the top that all alignment specs must be powers of two etc, rather than repeating it for each use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that because size and address spaces requirements are repeated too, but I don't feel like I should be moving them in this PR. (Or should I?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved the repeated sentences to the bottom, next to the other text that talks about alignments.