8

[docs] [NFC] Clarify the datalayout documentation

 2 years ago
source link: https://reviews.llvm.org/D108962
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

llvm/docs/LangRef.rst

  • This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 LinesShow All 2,554 Lines▼ Show 20 Lines``S<size>`` alignment to avoid dynamic stack realignment. The stack alignment alignment to avoid dynamic stack realignment. The stack alignment must be a multiple of 8-bits. If omitted, the natural stack must be a multiple of 8-bits. If omitted, the natural stack alignment defaults to "unspecified", which does not prevent any alignment defaults to "unspecified", which does not prevent any alignment promotions. alignment promotions. ``P<address space>`` ``P<address space>`` Specifies the address space that corresponds to program memory. Specifies the address space that corresponds to program memory. Harvard architectures can use this to specify what space LLVM Harvard architectures can use this to specify what space LLVM should place things such as functions into. If omitted, the should place things such as functions into. If omitted, the program memory space defaults to the default address space of 0, program memory space defaults to the default address space of 0,

Pre-existing, but there seems to be some words missing here. "is the size of the index that is used"?

Yeah, that reads awkwardly to me. Fixed.

which corresponds to a Von Neumann architecture that has code which corresponds to a Von Neumann architecture that has code and data in the same space. and data in the same space. ``G<address space>`` ``G<address space>`` Specifies the address space to be used by default when creating global Specifies the address space to be used by default when creating global variables. If omitted, the globals address space defaults to the default variables. If omitted, the globals address space defaults to the default address space 0. address space 0. Note: variable declarations without an address space are always created in Note: variable declarations without an address space are always created in address space 0, this property only affects the default value to be used address space 0, this property only affects the default value to be used when creating globals without additional contextual information (e.g. in when creating globals without additional contextual information (e.g. in LLVM passes). LLVM passes). ``A<address space>`` ``A<address space>`` Specifies the address space of objects created by '``alloca``'. Specifies the address space of objects created by '``alloca``'. Defaults to the default address space of 0. Defaults to the default address space of 0. ``p[n]:<size>:<abi>:<pref>:<idx>`` ``p[n]:<size>:<abi>[:<pref>][:<idx>]`` This specifies the *size* of a pointer and its ``<abi>`` and This specifies the *size* of a pointer and its ``<abi>`` and ``<pref>``\erred alignments for address space ``n``. The fourth parameter ``<pref>``\erred alignments for address space ``n``. ``<pref>`` is optional ``<idx>`` is a size of index that used for address calculation. If not and defaults to ``<abi>``. The fourth parameter ``<idx>`` is the size of the index that used for address calculation. If not specified, the default index size is equal to the pointer size. All sizes specified, the default index size is equal to the pointer size. All sizes are in bits. The address space, ``n``, is optional, and if not specified, 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 denotes the default address space 0. The value of ``n`` must be in the range [1,2^23). in the range [1,2^23). ``i<size>:<abi>:<pref>`` ``i<size>:<abi>[:<pref>]`` This specifies the alignment for an integer type of a given bit This specifies the alignment for an integer type of a given bit ``<size>``. The value of ``<size>`` must be in the range [1,2^23). ``<size>``. The value of ``<size>`` must be in the range [1,2^23). ``v<size>:<abi>:<pref>`` ``<pref>`` is optional and defaults to ``<abi>``. ``v<size>:<abi>[:<pref>]`` This specifies the alignment for a vector type of a given bit This specifies the alignment for a vector type of a given bit ``<size>``. ``<size>``. The value of ``<size>`` must be in the range [1,2^23). ``f<size>:<abi>:<pref>`` ``<pref>`` is optional and defaults to ``<abi>``. ``f<size>:<abi>[:<pref>]`` This specifies the alignment for a floating-point type of a given bit This specifies the alignment for a floating-point type of a given bit ``<size>``. Only values of ``<size>`` that are supported by the target ``<size>``. Only values of ``<size>`` that are supported by the target will work. 32 (float) and 64 (double) are supported on all targets; 80 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 or 128 (different flavors of long double) are also supported on some targets. targets. The value of ``<size>`` must be in the range [1,2^23). ``a:<abi>:<pref>`` ``<pref>`` is optional and defaults to ``<abi>``. ``a:<abi>[:<pref>]`` This specifies the alignment for an object of aggregate type. This specifies the alignment for an object of aggregate type. ``<pref>`` is optional and defaults to ``<abi>``. ``F<type><abi>`` ``F<type><abi>`` This specifies the alignment for function pointers. This specifies the alignment for function pointers. The options for ``<type>`` are: The options for ``<type>`` are:

* ``i``: The alignment of function pointers is independent of the alignment * ``i``: The alignment of function pointers is independent of the alignment of functions, and is a multiple of ``<abi>``. of functions, and is a multiple of ``<abi>``. * ``n``: The alignment of function pointers is a multiple of the explicit * ``n``: The alignment of function pointers is a multiple of the explicit alignment specified on the function, and is a multiple of ``<abi>``. alignment specified on the function, and is a multiple of ``<abi>``. ▲ Show 20 LinesShow All 21,004 LinesShow Last 20 Lines


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK