📄 tm.texi
字号:
Define this macro if @code{WORDS_BIG_ENDIAN} is not constant. This must be aconstant value with the same meaning as @code{WORDS_BIG_ENDIAN}, which will beused only when compiling @file{libgcc2.c}. Typically the value will be setbased on preprocessor defines.@end defmac@defmac FLOAT_WORDS_BIG_ENDIANDefine this macro to have the value 1 if @code{DFmode}, @code{XFmode} or@code{TFmode} floating point numbers are stored in memory with the wordcontaining the sign bit at the lowest address; otherwise define it tohave the value 0. This macro need not be a constant.You need not define this macro if the ordering is the same as formulti-word integers.@end defmac@defmac BITS_PER_UNITDefine this macro to be the number of bits in an addressable storageunit (byte). If you do not define this macro the default is 8.@end defmac@defmac BITS_PER_WORDNumber of bits in a word. If you do not define this macro, the defaultis @code{BITS_PER_UNIT * UNITS_PER_WORD}.@end defmac@defmac MAX_BITS_PER_WORDMaximum number of bits in a word. If this is undefined, the default is@code{BITS_PER_WORD}. Otherwise, it is the constant value that is thelargest value that @code{BITS_PER_WORD} can have at run-time.@end defmac@defmac UNITS_PER_WORDNumber of storage units in a word; normally the size of a general-purposeregister, a power of two from 1 or 8.@end defmac@defmac MIN_UNITS_PER_WORDMinimum number of units in a word. If this is undefined, the default is@code{UNITS_PER_WORD}. Otherwise, it is the constant value that is thesmallest value that @code{UNITS_PER_WORD} can have at run-time.@end defmac@defmac UNITS_PER_SIMD_WORDNumber of units in the vectors that the vectorizer can produce.The default is equal to @code{UNITS_PER_WORD}, because the vectorizercan do some transformations even in absence of specialized @acronym{SIMD}hardware.@end defmac@defmac POINTER_SIZEWidth of a pointer, in bits. You must specify a value no wider than thewidth of @code{Pmode}. If it is not equal to the width of @code{Pmode},you must define @code{POINTERS_EXTEND_UNSIGNED}. If you do not specifya value the default is @code{BITS_PER_WORD}.@end defmac@defmac POINTERS_EXTEND_UNSIGNEDA C expression that determines how pointers should be extended from@code{ptr_mode} to either @code{Pmode} or @code{word_mode}. It isgreater than zero if pointers should be zero-extended, zero if theyshould be sign-extended, and negative if some other sort of conversionis needed. In the last case, the extension is done by the target's@code{ptr_extend} instruction.You need not define this macro if the @code{ptr_mode}, @code{Pmode}and @code{word_mode} are all the same width.@end defmac@defmac PROMOTE_MODE (@var{m}, @var{unsignedp}, @var{type})A macro to update @var{m} and @var{unsignedp} when an object whose typeis @var{type} and which has the specified mode and signedness is to bestored in a register. This macro is only called when @var{type} is ascalar type.On most RISC machines, which only have operations that operate on a fullregister, define this macro to set @var{m} to @code{word_mode} if@var{m} is an integer mode narrower than @code{BITS_PER_WORD}. In mostcases, only integer modes should be widened because wider-precisionfloating-point operations are usually more expensive than their narrowercounterparts.For most machines, the macro definition does not change @var{unsignedp}.However, some machines, have instructions that preferentially handleeither signed or unsigned quantities of certain modes. For example, onthe DEC Alpha, 32-bit loads from memory and 32-bit add instructionssign-extend the result to 64 bits. On such machines, set@var{unsignedp} according to which kind of extension is more efficient.Do not define this macro if it would never modify @var{m}.@end defmac@defmac PROMOTE_FUNCTION_MODELike @code{PROMOTE_MODE}, but is applied to outgoing function arguments orfunction return values, as specified by @code{TARGET_PROMOTE_FUNCTION_ARGS}and @code{TARGET_PROMOTE_FUNCTION_RETURN}, respectively.The default is @code{PROMOTE_MODE}.@end defmac@deftypefn {Target Hook} bool TARGET_PROMOTE_FUNCTION_ARGS (tree @var{fntype})This target hook should return @code{true} if the promotion described by@code{PROMOTE_FUNCTION_MODE} should be done for outgoing functionarguments.@end deftypefn@deftypefn {Target Hook} bool TARGET_PROMOTE_FUNCTION_RETURN (tree @var{fntype})This target hook should return @code{true} if the promotion described by@code{PROMOTE_FUNCTION_MODE} should be done for the return value offunctions.If this target hook returns @code{true}, @code{TARGET_FUNCTION_VALUE}must perform the same promotions done by @code{PROMOTE_FUNCTION_MODE}.@end deftypefn@defmac PARM_BOUNDARYNormal alignment required for function parameters on the stack, inbits. All stack parameters receive at least this much alignmentregardless of data type. On most machines, this is the same as thesize of an integer.@end defmac@defmac STACK_BOUNDARYDefine this macro to the minimum alignment enforced by hardware for thestack pointer on this machine. The definition is a C expression for thedesired alignment (measured in bits). This value is used as a defaultif @code{PREFERRED_STACK_BOUNDARY} is not defined. On most machines,this should be the same as @code{PARM_BOUNDARY}.@end defmac@defmac PREFERRED_STACK_BOUNDARYDefine this macro if you wish to preserve a certain alignment for thestack pointer, greater than what the hardware enforces. The definitionis a C expression for the desired alignment (measured in bits). Thismacro must evaluate to a value equal to or larger than@code{STACK_BOUNDARY}.@end defmac@defmac FUNCTION_BOUNDARYAlignment required for a function entry point, in bits.@end defmac@defmac BIGGEST_ALIGNMENTBiggest alignment that any data type can require on this machine, inbits. Note that this is not the biggest alignment that is supported,just the biggest alignment that, when violated, may cause a fault.@end defmac@defmac MINIMUM_ATOMIC_ALIGNMENTIf defined, the smallest alignment, in bits, that can be given to anobject that can be referenced in one operation, without disturbing anynearby object. Normally, this is @code{BITS_PER_UNIT}, but may be largeron machines that don't have byte or half-word store operations.@end defmac@defmac BIGGEST_FIELD_ALIGNMENTBiggest alignment that any structure or union field can require on thismachine, in bits. If defined, this overrides @code{BIGGEST_ALIGNMENT} forstructure and union fields only, unless the field alignment has been setby the @code{__attribute__ ((aligned (@var{n})))} construct.@end defmac@defmac ADJUST_FIELD_ALIGN (@var{field}, @var{computed})An expression for the alignment of a structure field @var{field} if thealignment computed in the usual way (including applying of@code{BIGGEST_ALIGNMENT} and @code{BIGGEST_FIELD_ALIGNMENT} to thealignment) is @var{computed}. It overrides alignment only if thefield alignment has not been set by the@code{__attribute__ ((aligned (@var{n})))} construct.@end defmac@defmac MAX_OFILE_ALIGNMENTBiggest alignment supported by the object file format of this machine.Use this macro to limit the alignment which can be specified using the@code{__attribute__ ((aligned (@var{n})))} construct. If not defined,the default value is @code{BIGGEST_ALIGNMENT}.On systems that use ELF, the default (in @file{config/elfos.h}) isthe largest supported 32-bit ELF section alignment representable ona 32-bit host e.g. @samp{(((unsigned HOST_WIDEST_INT) 1 << 28) * 8)}.On 32-bit ELF the largest supported section alignment in bits is@samp{(0x80000000 * 8)}, but this is not representable on 32-bit hosts.@end defmac@defmac DATA_ALIGNMENT (@var{type}, @var{basic-align})If defined, a C expression to compute the alignment for a variable inthe static store. @var{type} is the data type, and @var{basic-align} isthe alignment that the object would ordinarily have. The value of thismacro is used instead of that alignment to align the object.If this macro is not defined, then @var{basic-align} is used.@findex strcpyOne use of this macro is to increase alignment of medium-size data tomake it all fit in fewer cache lines. Another is to cause characterarrays to be word-aligned so that @code{strcpy} calls that copyconstants to character arrays can be done inline.@end defmac@defmac CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})If defined, a C expression to compute the alignment given to a constantthat is being placed in memory. @var{constant} is the constant and@var{basic-align} is the alignment that the object would ordinarilyhave. The value of this macro is used instead of that alignment toalign the object.If this macro is not defined, then @var{basic-align} is used.The typical use of this macro is to increase alignment for stringconstants to be word aligned so that @code{strcpy} calls that copyconstants can be done inline.@end defmac@defmac LOCAL_ALIGNMENT (@var{type}, @var{basic-align})If defined, a C expression to compute the alignment for a variable inthe local store. @var{type} is the data type, and @var{basic-align} isthe alignment that the object would ordinarily have. The value of thismacro is used instead of that alignment to align the object.If this macro is not defined, then @var{basic-align} is used.One use of this macro is to increase alignment of medium-size data tomake it all fit in fewer cache lines.@end defmac@defmac EMPTY_FIELD_BOUNDARYAlignment in bits to be given to a structure bit-field that follows anempty field such as @code{int : 0;}.If @code{PCC_BITFIELD_TYPE_MATTERS} is true, it overrides this macro.@end defmac@defmac STRUCTURE_SIZE_BOUNDARYNumber of bits which any structure or union's size must be a multiple of.Each structure or union's size is rounded up to a multiple of this.If you do not define this macro, the default is the same as@code{BITS_PER_UNIT}.@end defmac@defmac STRICT_ALIGNMENTDefine this macro to be the value 1 if instructions will fail to workif given data not on the nominal alignment. If instructions will merelygo slower in that case, define this macro as 0.@end defmac@defmac PCC_BITFIELD_TYPE_MATTERSDefine this if you wish to imitate the way many other C compilers handlealignment of bit-fields and the structures that contain them.The behavior is that the type written for a named bit-field (@code{int},@code{short}, or other integer type) imposes an alignment for the entirestructure, as if the structure really did contain an ordinary field ofthat type. In addition, the bit-field is placed within the structure sothat it would fit within such a field, not crossing a boundary for it.Thus, on most machines, a named bit-field whose type is written as@code{int} would not cross a four-byte boundary, and would forcefour-byte alignment for the whole structure. (The alignment used maynot be four bytes; it is controlled by the other alignment parameters.)An unnamed bit-field will not affect the alignment of the containingstructure.If the macro is defined, its definition should be a C expression;a nonzero value for the expression enables this behavior.Note that if this macro is not defined, or its value is zero, somebit-fields may cross more than one alignment boundary. The compiler cansupport such references if there are @samp{insv}, @samp{extv}, and@samp{extzv} insns that can directly reference memory.The other known way of making bit-fields work is to define@code{STRUCTURE_SIZE_BOUNDARY} as large as @code{BIGGEST_ALIGNMENT}.Then every structure can be accessed with fullwords.Unless the machine has bit-field instructions or you define@code{STRUCTURE_SIZE_BOUNDARY} that way, you must define@code{PCC_BITFIELD_TYPE_MATTERS} to have a nonzero value.If your aim is to make GCC use the same conventions for laying outbit-fields as are used by another compiler, here is how to investigatewhat the other compiler does. Compile and run this program:@smallexamplestruct foo1@{ char x; char :0; char y;@};struct foo2@{ char x; int :0; char y;@};main ()@{ printf ("Size of foo1 is %d\n", sizeof (struct foo1)); printf ("Size of foo2 is %d\n", sizeof (struct foo2)); exit (0);@}@end smallexampleIf this prints 2 and 5, then the compiler's behavior is what you wouldget from @code{PCC_BITFIELD_TYPE_MATTERS}.@end defmac@defmac BITFIELD_NBYTES_LIMITEDLike @code{PCC_BITFIELD_TYPE_MATTERS} except that its effect is limitedto aligning a bit-field within the structure.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -