📄 tm.texi
字号:
@table @code@findex CPP_PREDEFINES@item CPP_PREDEFINESDefine this to be a string constant containing @samp{-D} options todefine the predefined macros that identify this machine and system.These macros will be predefined unless the @samp{-ansi} option isspecified.In addition, a parallel set of macros are predefined, whose names aremade by appending @samp{__} at the beginning and at the end. These@samp{__} macros are permitted by the ANSI standard, so they arepredefined regardless of whether @samp{-ansi} is specified.For example, on the Sun, one can use the following value:@example"-Dmc68000 -Dsun -Dunix"@end exampleThe result is to define the macros @code{__mc68000__}, @code{__sun__}and @code{__unix__} unconditionally, and the macros @code{mc68000},@code{sun} and @code{unix} provided @samp{-ansi} is not specified.@findex STDC_VALUE@item STDC_VALUEDefine the value to be assigned to the built-in macro @code{__STDC__}.The default is the value @samp{1}.@findex extern int target_flags@item extern int target_flags;This declaration should be present.@cindex optional hardware or system features@cindex features, optional, in system conventions@item TARGET_@dots{}This series of macros is to allow compiler command arguments toenable or disable the use of optional features of the target machine.For example, one machine description serves both the 68000 andthe 68020; a command argument tells the compiler whether it shoulduse 68020-only instructions or not. This command argument worksby means of a macro @code{TARGET_68020} that tests a bit in@code{target_flags}.Define a macro @code{TARGET_@var{featurename}} for each such option.Its definition should test a bit in @code{target_flags}; for example:@example#define TARGET_68020 (target_flags & 1)@end exampleOne place where these macros are used is in the condition-expressionsof instruction patterns. Note how @code{TARGET_68020} appearsfrequently in the 68000 machine description file, @file{m68k.md}.Another place they are used is in the definitions of the othermacros in the @file{@var{machine}.h} file.@findex TARGET_SWITCHES@item TARGET_SWITCHESThis macro defines names of command options to set and clearbits in @code{target_flags}. Its definition is an initializerwith a subgrouping for each command option.Each subgrouping contains a string constant, that defines the optionname, and a number, which contains the bits to set in@code{target_flags}. A negative number says to clear bits instead;the negative of the number is which bits to clear. The actual optionname is made by appending @samp{-m} to the specified name.One of the subgroupings should have a null string. The number inthis grouping is the default value for @code{target_flags}. Anytarget options act starting with that value.Here is an example which defines @samp{-m68000} and @samp{-m68020}with opposite meanings, and picks the latter as the default:@example#define TARGET_SWITCHES \ @{ @{ "68020", 1@}, \ @{ "68000", -1@}, \ @{ "", 1@}@}@end example@findex TARGET_OPTIONS@item TARGET_OPTIONSThis macro is similar to @code{TARGET_SWITCHES} but defines names of commandoptions that have values. Its definition is an initializer with asubgrouping for each command option. Each subgrouping contains a string constant, that defines the fixed partof the option name, and the address of a variable. The variable, type@code{char *}, is set to the variable part of the given option if the fixedpart matches. The actual option name is made by appending @samp{-m} to thespecified name. Here is an example which defines @samp{-mshort-data-@var{number}}. If thegiven option is @samp{-mshort-data-512}, the variable @code{m88k_short_data}will be set to the string @code{"512"}. @exampleextern char *m88k_short_data;#define TARGET_OPTIONS @{ @{ "short-data-", &m88k_short_data @} @}@end example@findex TARGET_VERSION@item TARGET_VERSIONThis macro is a C statement to print on @code{stderr} a stringdescribing the particular machine description choice. Every machinedescription should define @code{TARGET_VERSION}. For example:@example#ifdef MOTOROLA#define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)");#else#define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)");#endif@end example@findex OVERRIDE_OPTIONS@item OVERRIDE_OPTIONSSometimes certain combinations of command options do not make sense ona particular target machine. You can define a macro@code{OVERRIDE_OPTIONS} to take account of this. This macro, ifdefined, is executed once just after all the command options have beenparsed.Don't use this macro to turn on various extra optimizations for@samp{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.@findex OPTIMIZATION_OPTIONS@item OPTIMIZATION_OPTIONS (@var{level})Some machines may desire to change what optimizations are performed forvarious optimization levels. This macro, if defined, is executed oncejust after the optimization level is determined and before the remainderof the command options have been parsed. Values set in this macro areused as the default values for the other command line options.@var{level} is the optimization level specified; 2 if -O2 is specified,1 if -O is specified, and 0 if neither is specified.@strong{Do not examine @code{write_symbols} in this macro!}The debugging options are not supposed to alter the generated code.@end table@node Storage Layout@section Storage Layout@cindex storage layoutNote that the definitions of the macros in this table which are sizes oralignments measured in bits do not need to be constant. They can be Cexpressions that refer to static variables, such as the @code{target_flags}.@xref{Run-time Target}.@table @code@findex BITS_BIG_ENDIAN@item BITS_BIG_ENDIANDefine this macro to be the value 1 if the most significant bit in abyte has the lowest number; otherwise define it to be the value zero.This means that bit-field instructions count from the most significantbit. If the machine has no bit-field instructions, this macro isirrelevant.This macro does not affect the way structure fields are packed intobytes or words; that is controlled by @code{BYTES_BIG_ENDIAN}.@findex BYTES_BIG_ENDIAN@item BYTES_BIG_ENDIANDefine this macro to be 1 if the most significant byte in a word has thelowest number.@findex WORDS_BIG_ENDIAN@item WORDS_BIG_ENDIANDefine this macro to be 1 if, in a multiword object, the mostsignificant word has the lowest number. This applies to both memorylocations and registers; GNU CC fundamentally assumes that the order ofwords in memory is the same as the order in registers.@findex BITS_PER_UNIT@item BITS_PER_UNITNumber of bits in an addressable storage unit (byte); normally 8.@findex BITS_PER_WORD@item BITS_PER_WORDNumber of bits in a word; normally 32.@findex MAX_BITS_PER_WORD@item 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.@findex UNITS_PER_WORD@item UNITS_PER_WORDNumber of storage units in a word; normally 4.@findex POINTER_SIZE@item POINTER_SIZEWidth of a pointer, in bits.@findex PROMOTE_MODE@item 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 quanities 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}.@findex PROMOTE_FUNCTION_ARGS@item PROMOTE_FUNCTION_ARGSDefine this macro if the promotion described by @code{PROMOTE_MODE}should also be done for outgoing function arguments. @findex PROMOTE_FUNCTION_RETURN@item PROMOTE_FUNCTION_RETURNDefine this macro if the promotion described by @code{PROMOTE_MODE}should also be done for the return value of functions.If this macro is defined, @code{FUNCTION_VALUE} must perform the samepromotions done by @code{PROMOTE_MODE}.@findex PARM_BOUNDARY@item 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.@findex STACK_BOUNDARY@item STACK_BOUNDARYDefine this macro if you wish to preserve a certain alignment forthe stack pointer. The definition is a C expressionfor the desired alignment (measured in bits).@cindex @code{PUSH_ROUNDING}, interaction with @code{STACK_BOUNDARY}If @code{PUSH_ROUNDING} is not defined, the stack will always be alignedto the specified boundary. If @code{PUSH_ROUNDING} is defined and specifies aless strict alignment than @code{STACK_BOUNDARY}, the stack may bemomentarily unaligned while pushing arguments.@findex FUNCTION_BOUNDARY@item FUNCTION_BOUNDARYAlignment required for a function entry point, in bits.@findex BIGGEST_ALIGNMENT@item BIGGEST_ALIGNMENTBiggest alignment that any data type can require on this machine, in bits.@findex BIGGEST_FIELD_ALIGNMENT@item BIGGEST_FIELD_ALIGNMENTBiggest alignment that any structure field can require on this machine,in bits. If defined, this overrides @code{BIGGEST_ALIGNMENT} forstructure fields only.@findex MAX_OFILE_ALIGNMENT@item 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}.@findex DATA_ALIGNMENT@item DATA_ALIGNMENT (@var{type}, @var{basic-align})If defined, a C expression to compute the alignment for a staticvariable. @var{type} is the data type, and @var{basic-align} is thealignment 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.@findex CONSTANT_ALIGNMENT@item 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.@findex EMPTY_FIELD_BOUNDARY@item EMPTY_FIELD_BOUNDARYAlignment in bits to be given to a structure bit field that follows anempty field such as @code{int : 0;}.Note that @code{PCC_BITFIELD_TYPE_MATTERS} also affects the alignmentthat results from an empty field.@findex STRUCTURE_SIZE_BOUNDARY@item 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}.@findex STRICT_ALIGNMENT@item 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.@findex PCC_BITFIELD_TYPE_MATTERS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -