home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / emx / gnu / doc / tm.tex < prev   
Encoding:
Text File  |  1992-10-23  |  238.4 KB  |  5,655 lines

  1. @c Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc.
  2. @c This is part of the GCC manual.
  3. @c For copying conditions, see the file gcc.texi.
  4.  
  5. @ifset INTERNALS
  6. @node Target Macros
  7. @chapter Target Description Macros
  8. @cindex machine description macros
  9. @cindex target description macros
  10. @cindex macros, target description
  11. @cindex @file{tm.h} macros
  12.  
  13. In addition to the file @file{@var{machine}.md}, a machine description
  14. includes a C header file conventionally given the name
  15. @file{@var{machine}.h}.  This header file defines numerous macros
  16. that convey the information about the target machine that does not fit
  17. into the scheme of the @file{.md} file.  The file @file{tm.h} should be
  18. a link to @file{@var{machine}.h}.  The header file @file{config.h}
  19. includes @file{tm.h} and most compiler source files include
  20. @file{config.h}.
  21.  
  22. @menu
  23. * Driver::              Controlling how the driver runs the compilation passes.
  24. * Run-time Target::     Defining @samp{-m} options like @samp{-m68000} and @samp{-m68020}.
  25. * Storage Layout::      Defining sizes and alignments of data.
  26. * Type Layout::         Defining sizes and properties of basic user data types.
  27. * Registers::           Naming and describing the hardware registers.
  28. * Register Classes::    Defining the classes of hardware registers.
  29. * Stack and Calling::   Defining which way the stack grows and by how much.
  30. * Varargs::        Defining the varargs macros.
  31. * Trampolines::         Code set up at run time to enter a nested function.
  32. * Library Calls::       Controlling how library routines are implicitly called.
  33. * Addressing Modes::    Defining addressing modes valid for memory operands.
  34. * Condition Code::      Defining how insns update the condition code.
  35. * Costs::               Defining relative costs of different operations.
  36. * Sections::            Dividing storage into text, data, and other sections.
  37. * PIC::            Macros for position independent code.
  38. * Assembler Format::    Defining how to write insns and pseudo-ops to output.
  39. * Debugging Info::      Defining the format of debugging output.
  40. * Cross-compilation::   Handling floating point for cross-compilers.
  41. * Misc::                Everything else.
  42. @end menu
  43.  
  44. @node Driver
  45. @section Controlling the Compilation Driver, @file{gcc}
  46. @cindex driver
  47. @cindex controlling the compilation driver
  48.  
  49. @table @code
  50. @findex SWITCH_TAKES_ARG
  51. @item SWITCH_TAKES_ARG (@var{char})
  52. A C expression which determines whether the option @samp{-@var{char}}
  53. takes arguments.  The value should be the number of arguments that
  54. option takes--zero, for many options.
  55.  
  56. By default, this macro is defined to handle the standard options
  57. properly.  You need not define it unless you wish to add additional
  58. options which take arguments.
  59.  
  60. @findex WORD_SWITCH_TAKES_ARG
  61. @item WORD_SWITCH_TAKES_ARG (@var{name})
  62. A C expression which determines whether the option @samp{-@var{name}}
  63. takes arguments.  The value should be the number of arguments that
  64. option takes--zero, for many options.  This macro rather than
  65. @code{SWITCH_TAKES_ARG} is used for multi-character option names.
  66.  
  67. By default, this macro is defined to handle the standard options
  68. properly.  You need not define it unless you wish to add additional
  69. options which take arguments.
  70.  
  71. @findex SWITCHES_NEED_SPACES
  72. @item SWITCHES_NEED_SPACES
  73. A string-valued C expression which is nonempty if the linker needs a
  74. space between the @samp{-L} or @samp{-o} option and its argument.
  75.  
  76. If this macro is not defined, the default value is 0.
  77.  
  78. @findex CPP_SPEC
  79. @item CPP_SPEC
  80. A C string constant that tells the GNU CC driver program options to
  81. pass to CPP.  It can also specify how to translate options you
  82. give to GNU CC into options for GNU CC to pass to the CPP.
  83.  
  84. Do not define this macro if it does not need to do anything.
  85.  
  86. @findex SIGNED_CHAR_SPEC
  87. @item SIGNED_CHAR_SPEC
  88. A C string constant that tells the GNU CC driver program options to
  89. pass to CPP.  By default, this macro is defined to pass the option
  90. @samp{-D__CHAR_UNSIGNED__} to CPP if @code{char} will be treated as
  91. @code{unsigned char} by @code{cc1}.
  92.  
  93. Do not define this macro unless you need to override the default
  94. definition.
  95.  
  96. @findex CC1_SPEC
  97. @item CC1_SPEC
  98. A C string constant that tells the GNU CC driver program options to
  99. pass to @code{cc1}.  It can also specify how to translate options you
  100. give to GNU CC into options for GNU CC to pass to the @code{cc1}.
  101.  
  102. Do not define this macro if it does not need to do anything.
  103.  
  104. @findex CC1PLUS_SPEC
  105. @item CC1PLUS_SPEC
  106. A C string constant that tells the GNU CC driver program options to
  107. pass to @code{cc1plus}.  It can also specify how to translate options you
  108. give to GNU CC into options for GNU CC to pass to the @code{cc1plus}.
  109.  
  110. Do not define this macro if it does not need to do anything.
  111.  
  112. @findex ASM_SPEC
  113. @item ASM_SPEC
  114. A C string constant that tells the GNU CC driver program options to
  115. pass to the assembler.  It can also specify how to translate options
  116. you give to GNU CC into options for GNU CC to pass to the assembler.
  117. See the file @file{sun3.h} for an example of this.
  118.  
  119. Do not define this macro if it does not need to do anything.
  120.  
  121. @findex ASM_FINAL_SPEC
  122. @item ASM_FINAL_SPEC
  123. A C string constant that tells the GNU CC driver program how to
  124. run any programs which cleanup after the normal assembler.
  125. Normally, this is not needed.  See the file @file{mips.h} for
  126. an example of this.
  127.  
  128. Do not define this macro if it does not need to do anything.
  129.  
  130. @findex LINK_SPEC
  131. @item LINK_SPEC
  132. A C string constant that tells the GNU CC driver program options to
  133. pass to the linker.  It can also specify how to translate options you
  134. give to GNU CC into options for GNU CC to pass to the linker.
  135.  
  136. Do not define this macro if it does not need to do anything.
  137.  
  138. @findex LIB_SPEC
  139. @item LIB_SPEC
  140. Another C string constant used much like @code{LINK_SPEC}.  The difference
  141. between the two is that @code{LIB_SPEC} is used at the end of the
  142. command given to the linker.
  143.  
  144. If this macro is not defined, a default is provided that
  145. loads the standard C library from the usual place.  See @file{gcc.c}.
  146.  
  147. @findex STARTFILE_SPEC
  148. @item STARTFILE_SPEC
  149. Another C string constant used much like @code{LINK_SPEC}.  The
  150. difference between the two is that @code{STARTFILE_SPEC} is used at
  151. the very beginning of the command given to the linker.
  152.  
  153. If this macro is not defined, a default is provided that loads the
  154. standard C startup file from the usual place.  See @file{gcc.c}.
  155.  
  156. @findex ENDFILE_SPEC
  157. @item ENDFILE_SPEC
  158. Another C string constant used much like @code{LINK_SPEC}.  The
  159. difference between the two is that @code{ENDFILE_SPEC} is used at
  160. the very end of the command given to the linker.
  161.  
  162. Do not define this macro if it does not need to do anything.
  163.  
  164. @findex LINK_LIBGCC_SPECIAL
  165. @item LINK_LIBGCC_SPECIAL
  166. Define this macro meaning that @code{gcc} should find the
  167. library @file{libgcc.a} by hand, rather than passing the argument
  168. @samp{-lgcc} to tell the linker to do the search.
  169.  
  170. @findex RELATIVE_PREFIX_NOT_LINKDIR
  171. @item RELATIVE_PREFIX_NOT_LINKDIR
  172. Define this macro to tell @code{gcc} that it should only translate
  173. a @samp{-B} prefix into a @samp{-L} linker option if the prefix
  174. indicates an absolute file name.
  175.  
  176. @findex STANDARD_EXEC_PREFIX
  177. @item STANDARD_EXEC_PREFIX
  178. Define this macro as a C string constant if you wish to override the
  179. standard choice of @file{/usr/local/lib/gcc-lib/} as the default prefix to
  180. try when searching for the executable files of the compiler.
  181.  
  182. @findex MD_EXEC_PREFIX
  183. @item MD_EXEC_PREFIX
  184. If defined, this macro is an additional prefix to try after
  185. @code{STANDARD_EXEC_PREFIX}.  @code{MD_EXEC_PREFIX} is not searched
  186. when the @samp{-b} option is used, or the compiler is built as a cross
  187. compiler.
  188.  
  189. @findex STANDARD_STARTFILE_PREFIX
  190. @item STANDARD_STARTFILE_PREFIX
  191. Define this macro as a C string constant if you wish to override the
  192. standard choice of @file{/usr/local/lib/} as the default prefix to
  193. try when searching for startup files such as @file{crt0.o}.
  194.  
  195. @findex MD_STARTFILE_PREFIX
  196. @item MD_STARTFILE_PREFIX
  197. If defined, this macro supplies an additional prefix to try after the
  198. standard prefixes.  @code{MD_EXEC_PREFIX} is not searched when the
  199. @samp{-b} option is used, or when the compiler is built as a cross
  200. compiler.
  201.  
  202. @findex MD_STARTFILE_PREFIX_1
  203. @item MD_STARTFILE_PREFIX_1
  204. If defined, this macro supplies yet another prefix to try after the
  205. standard prefixes.  It is not searched when the @samp{-b} option is
  206. used, or when the compiler is built as a cross compiler.
  207.  
  208. @findex LOCAL_INCLUDE_DIR
  209. @item LOCAL_INCLUDE_DIR
  210. Define this macro as a C string constant if you wish to override the
  211. standard choice of @file{/usr/local/include} as the default prefix to
  212. try when searching for local header files.  @code{LOCAL_INCLUDE_DIR}
  213. comes before @code{SYSTEM_INCLUDE_DIR} in the search order.
  214.  
  215. Cross compilers do not use this macro and do not search either
  216. @file{/usr/local/include} or its replacement.
  217.  
  218. @findex SYSTEM_INCLUDE_DIR
  219. @item SYSTEM_INCLUDE_DIR
  220. Define this macro as a C string constant if you wish to specify a
  221. system-specific directory to search for header files before the standard
  222. directory.  @code{SYSTEM_INCLUDE_DIR} comes before
  223. @code{STANDARD_INCLUDE_DIR} in the search order.
  224.  
  225. Cross compilers do not use this macro and do not search the directory
  226. specified.
  227.  
  228. @findex STANDARD_INCLUDE_DIR
  229. @item STANDARD_INCLUDE_DIR
  230. Define this macro as a C string constant if you wish to override the
  231. standard choice of @file{/usr/include} as the default prefix to
  232. try when searching for header files.
  233.  
  234. Cross compilers do not use this macro and do not search either
  235. @file{/usr/include} or its replacement.
  236.  
  237. @findex INCLUDE_DEFAULTS
  238. @item INCLUDE_DEFAULTS
  239. Define this macro if you wish to override the entire default search path
  240. for include files.  The default search path includes
  241. @code{GPLUSPLUS_INCLUDE_DIR}, @code{GCC_INCLUDE_DIR},
  242. @code{LOCAL_INCLUDE_DIR}, @code{SYSTEM_INCLUDE_DIR}, and
  243. @code{STANDARD_INCLUDE_DIR}.  In addition, the macros
  244. @code{GPLUSPLUS_INCLUDE_DIR} and @code{GCC_INCLUDE_DIR} are defined
  245. automatically by @file{Makefile}, and specify private search areas for
  246. GCC.  The directory @code{GPLUSPLUS_INCLUDE_DIR} is used only for C++
  247. programs.
  248.  
  249. The definition should be an initializer for an array of structures.
  250. Each array element should have two elements: the directory name (a
  251. string constant) and a flag for C++-only directories.  Mark the end of
  252. the array with a null element.  For example, here is the definition used
  253. for VMS:
  254.  
  255. @example
  256. #define INCLUDE_DEFAULTS \
  257. @{                                       \
  258.   @{ "GNU_GXX_INCLUDE:", 1@},             \
  259.   @{ "GNU_CC_INCLUDE:", 0@},              \
  260.   @{ "SYS$SYSROOT:[SYSLIB.]", 0@},        \
  261.   @{ ".", 0@},                            \
  262.   @{ 0, 0@}                               \
  263. @}
  264. @end example
  265. @end table
  266.  
  267. Here is the order of prefixes tried for exec files:
  268.  
  269. @enumerate
  270. @item
  271. Any prefixes specified by the user with @samp{-B}.
  272.  
  273. @item
  274. The environment variable @code{GCC_EXEC_PREFIX}, if any.
  275.  
  276. @item
  277. The directories specified by the environment variable @code{COMPILER_PATH}.
  278.  
  279. @item
  280. The macro @code{STANDARD_EXEC_PREFIX}.
  281.  
  282. @item
  283. @file{/usr/lib/gcc/}.
  284.  
  285. @item
  286. The macro @code{MD_EXEC_PREFIX}, if any.
  287. @end enumerate
  288.  
  289. Here is the order of prefixes tried for startfiles:
  290.  
  291. @enumerate
  292. @item
  293. Any prefixes specified by the user with @samp{-B}.
  294.  
  295. @item
  296. The environment variable @code{GCC_EXEC_PREFIX}, if any.
  297.  
  298. @item
  299. The directories specified by the environment variable @code{LIBRARY_PATH}.
  300.  
  301. @item
  302. The macro @code{STANDARD_EXEC_PREFIX}.
  303.  
  304. @item
  305. @file{/usr/lib/gcc/}.
  306.  
  307. @item
  308. The macro @code{MD_EXEC_PREFIX}, if any.
  309.  
  310. @item
  311. The macro @code{MD_STARTFILE_PREFIX}, if any.
  312.  
  313. @item
  314. The macro @code{STANDARD_STARTFILE_PREFIX}.
  315.  
  316. @item
  317. @file{/lib/}.
  318.  
  319. @item
  320. @file{/usr/lib/}.
  321. @end enumerate
  322.  
  323. @node Run-time Target
  324. @section Run-time Target Specification
  325. @cindex run-time target specification
  326. @cindex predefined macros
  327. @cindex target specifications
  328.  
  329. @table @code
  330. @findex CPP_PREDEFINES
  331. @item CPP_PREDEFINES
  332. Define this to be a string constant containing @samp{-D} options to
  333. define the predefined macros that identify this machine and system.
  334. These macros will be predefined unless the @samp{-ansi} option is
  335. specified.
  336.  
  337. In addition, a parallel set of macros are predefined, whose names are
  338. made by appending @samp{__} at the beginning and at the end.  These
  339. @samp{__} macros are permitted by the ANSI standard, so they are
  340. predefined regardless of whether @samp{-ansi} is specified.
  341.  
  342. For example, on the Sun, one can use the following value:
  343.  
  344. @example
  345. "-Dmc68000 -Dsun -Dunix"
  346. @end example
  347.  
  348. The result is to define the macros @code{__mc68000__}, @code{__sun__}
  349. and @code{__unix__} unconditionally, and the macros @code{mc68000},
  350. @code{sun} and @code{unix} provided @samp{-ansi} is not specified.
  351.  
  352. @findex STDC_VALUE
  353. @item STDC_VALUE
  354. Define the value to be assigned to the built-in macro @code{__STDC__}.
  355. The default is the value @samp{1}.
  356.  
  357. @findex extern int target_flags
  358. @item extern int target_flags;
  359. This declaration should be present.
  360.  
  361. @cindex optional hardware or system features
  362. @cindex features, optional, in system conventions
  363. @item TARGET_@dots{}
  364. This series of macros is to allow compiler command arguments to
  365. enable or disable the use of optional features of the target machine.
  366. For example, one machine description serves both the 68000 and
  367. the 68020; a command argument tells the compiler whether it should
  368. use 68020-only instructions or not.  This command argument works
  369. by means of a macro @code{TARGET_68020} that tests a bit in
  370. @code{target_flags}.
  371.  
  372. Define a macro @code{TARGET_@var{featurename}} for each such option.
  373. Its definition should test a bit in @code{target_flags}; for example:
  374.  
  375. @example
  376. #define TARGET_68020 (target_flags & 1)
  377. @end example
  378.  
  379. One place where these macros are used is in the condition-expressions
  380. of instruction patterns.  Note how @code{TARGET_68020} appears
  381. frequently in the 68000 machine description file, @file{m68k.md}.
  382. Another place they are used is in the definitions of the other
  383. macros in the @file{@var{machine}.h} file.
  384.  
  385. @findex TARGET_SWITCHES
  386. @item TARGET_SWITCHES
  387. This macro defines names of command options to set and clear
  388. bits in @code{target_flags}.  Its definition is an initializer
  389. with a subgrouping for each command option.
  390.  
  391. Each subgrouping contains a string constant, that defines the option
  392. name, and a number, which contains the bits to set in
  393. @code{target_flags}.  A negative number says to clear bits instead;
  394. the negative of the number is which bits to clear.  The actual option
  395. name is made by appending @samp{-m} to the specified name.
  396.  
  397. One of the subgroupings should have a null string.  The number in
  398. this grouping is the default value for @code{target_flags}.  Any
  399. target options act starting with that value.
  400.  
  401. Here is an example which defines @samp{-m68000} and @samp{-m68020}
  402. with opposite meanings, and picks the latter as the default:
  403.  
  404. @example
  405. #define TARGET_SWITCHES \
  406.   @{ @{ "68020", 1@},      \
  407.     @{ "68000", -1@},     \
  408.     @{ "", 1@}@}
  409. @end example
  410.  
  411. @findex TARGET_OPTIONS
  412. @item TARGET_OPTIONS
  413. This macro is similar to @code{TARGET_SWITCHES} but defines names of command
  414. options that have values.  Its definition is an initializer with a
  415. subgrouping for each command option. 
  416.  
  417. Each subgrouping contains a string constant, that defines the fixed part
  418. of the option name, and the address of a variable.  The variable, type
  419. @code{char *}, is set to the variable part of the given option if the fixed
  420. part matches.  The actual option name is made by appending @samp{-m} to the
  421. specified name. 
  422.  
  423. Here is an example which defines @samp{-mshort-data-@var{number}}.  If the
  424. given option is @samp{-mshort-data-512}, the variable @code{m88k_short_data}
  425. will be set to the string @code{"512"}. 
  426.  
  427. @example
  428. extern char *m88k_short_data;
  429. #define TARGET_OPTIONS @{ @{ "short-data-", &m88k_short_data @} @}
  430. @end example
  431.  
  432. @findex TARGET_VERSION
  433. @item TARGET_VERSION
  434. This macro is a C statement to print on @code{stderr} a string
  435. describing the particular machine description choice.  Every machine
  436. description should define @code{TARGET_VERSION}.  For example:
  437.  
  438. @example
  439. #ifdef MOTOROLA
  440. #define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)");
  441. #else
  442. #define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)");
  443. #endif
  444. @end example
  445.  
  446. @findex OVERRIDE_OPTIONS
  447. @item OVERRIDE_OPTIONS
  448. Sometimes certain combinations of command options do not make sense on
  449. a particular target machine.  You can define a macro
  450. @code{OVERRIDE_OPTIONS} to take account of this.  This macro, if
  451. defined, is executed once just after all the command options have been
  452. parsed.
  453.  
  454. Don't use this macro to turn on various extra optimizations for
  455. @samp{-O}.  That is what @code{OPTIMIZATION_OPTIONS} is for.
  456.  
  457. @findex OPTIMIZATION_OPTIONS
  458. @item OPTIMIZATION_OPTIONS (@var{level})
  459. Some machines may desire to change what optimizations are performed for
  460. various optimization levels.   This macro, if defined, is executed once
  461. just after the optimization level is determined and before the remainder
  462. of the command options have been parsed.  Values set in this macro are
  463. used as the default values for the other command line options.
  464.  
  465. @var{level} is the optimization level specified; 2 if -O2 is specified,
  466. 1 if -O is specified, and 0 if neither is specified.
  467.  
  468. @strong{Do not examine @code{write_symbols} in this macro!}
  469. The debugging options are not supposed to alter the generated code.
  470. @end table
  471.  
  472. @node Storage Layout
  473. @section Storage Layout
  474. @cindex storage layout
  475.  
  476. Note that the definitions of the macros in this table which are sizes or
  477. alignments measured in bits do not need to be constant.  They can be C
  478. expressions that refer to static variables, such as the @code{target_flags}.
  479. @xref{Run-time Target}.
  480.  
  481. @table @code
  482. @findex BITS_BIG_ENDIAN
  483. @item BITS_BIG_ENDIAN
  484. Define this macro to be the value 1 if the most significant bit in a
  485. byte has the lowest number; otherwise define it to be the value zero.
  486. This means that bit-field instructions count from the most significant
  487. bit.  If the machine has no bit-field instructions, this macro is
  488. irrelevant.
  489.  
  490. This macro does not affect the way structure fields are packed into
  491. bytes or words; that is controlled by @code{BYTES_BIG_ENDIAN}.
  492.  
  493. @findex BYTES_BIG_ENDIAN
  494. @item BYTES_BIG_ENDIAN
  495. Define this macro to be 1 if the most significant byte in a word has the
  496. lowest number.
  497.  
  498. @findex WORDS_BIG_ENDIAN
  499. @item WORDS_BIG_ENDIAN
  500. Define this macro to be 1 if, in a multiword object, the most
  501. significant word has the lowest number.  This applies to both memory
  502. locations and registers; GNU CC fundamentally assumes that the order of
  503. words in memory is the same as the order in registers.
  504.  
  505. @findex BITS_PER_UNIT
  506. @item BITS_PER_UNIT
  507. Number of bits in an addressable storage unit (byte); normally 8.
  508.  
  509. @findex BITS_PER_WORD
  510. @item BITS_PER_WORD
  511. Number of bits in a word; normally 32.
  512.  
  513. @findex MAX_BITS_PER_WORD
  514. @item MAX_BITS_PER_WORD
  515. Maximum number of bits in a word.  If this is undefined, the default is
  516. @code{BITS_PER_WORD}.  Otherwise, it is the constant value that is the
  517. largest value that @code{BITS_PER_WORD} can have at run-time.
  518.  
  519. @findex UNITS_PER_WORD
  520. @item UNITS_PER_WORD
  521. Number of storage units in a word; normally 4.
  522.  
  523. @findex POINTER_SIZE
  524. @item POINTER_SIZE
  525. Width of a pointer, in bits.
  526.  
  527. @findex PROMOTE_MODE
  528. @item PROMOTE_MODE (@var{m}, @var{unsignedp}, @var{type})
  529. A macro to update @var{m} and @var{unsignedp} when an object whose type
  530. is @var{type} and which has the specified mode and signedness is to be
  531. stored in a register.  This macro is only called when @var{type} is a
  532. scalar type.
  533.  
  534. On most RISC machines, which only have operations that operate on a full
  535. register, define this macro to set @var{m} to @code{word_mode} if
  536. @var{m} is an integer mode narrower than @code{BITS_PER_WORD}.  In most
  537. cases, only integer modes should be widened because wider-precision
  538. floating-point operations are usually more expensive than their narrower
  539. counterparts.
  540.  
  541. For most machines, the macro definition does not change @var{unsignedp}.
  542. However, some machines, have instructions that preferentially handle
  543. either signed or unsigned quanities of certain modes.  For example, on
  544. the DEC Alpha, 32-bit loads from memory and 32-bit add instructions
  545. sign-extend the result to 64 bits.  On such machines, set
  546. @var{unsignedp} according to which kind of extension is more efficient.
  547.  
  548. Do not define this macro if it would never modify @var{m}.
  549.  
  550. @findex PROMOTE_FUNCTION_ARGS
  551. @item PROMOTE_FUNCTION_ARGS
  552. Define this macro if the promotion described by @code{PROMOTE_MODE}
  553. should also be done for outgoing function arguments.  
  554.  
  555. @findex PROMOTE_FUNCTION_RETURN
  556. @item PROMOTE_FUNCTION_RETURN
  557. Define this macro if the promotion described by @code{PROMOTE_MODE}
  558. should also be done for the return value of functions.
  559.  
  560. If this macro is defined, @code{FUNCTION_VALUE} must perform the same
  561. promotions done by @code{PROMOTE_MODE}.
  562.  
  563. @findex PARM_BOUNDARY
  564. @item PARM_BOUNDARY
  565. Normal alignment required for function parameters on the stack, in
  566. bits.  All stack parameters receive at least this much alignment
  567. regardless of data type.  On most machines, this is the same as the
  568. size of an integer.
  569.  
  570. @findex STACK_BOUNDARY
  571. @item STACK_BOUNDARY
  572. Define this macro if you wish to preserve a certain alignment for
  573. the stack pointer.  The definition is a C expression
  574. for the desired alignment (measured in bits).
  575.  
  576. @cindex @code{PUSH_ROUNDING}, interaction with @code{STACK_BOUNDARY}
  577. If @code{PUSH_ROUNDING} is not defined, the stack will always be aligned
  578. to the specified boundary.  If @code{PUSH_ROUNDING} is defined and specifies a
  579. less strict alignment than @code{STACK_BOUNDARY}, the stack may be
  580. momentarily unaligned while pushing arguments.
  581.  
  582. @findex FUNCTION_BOUNDARY
  583. @item FUNCTION_BOUNDARY
  584. Alignment required for a function entry point, in bits.
  585.  
  586. @findex BIGGEST_ALIGNMENT
  587. @item BIGGEST_ALIGNMENT
  588. Biggest alignment that any data type can require on this machine, in bits.
  589.  
  590. @findex BIGGEST_FIELD_ALIGNMENT
  591. @item BIGGEST_FIELD_ALIGNMENT
  592. Biggest alignment that any structure field can require on this machine,
  593. in bits.  If defined, this overrides @code{BIGGEST_ALIGNMENT} for
  594. structure fields only.
  595.  
  596. @findex MAX_OFILE_ALIGNMENT
  597. @item MAX_OFILE_ALIGNMENT
  598. Biggest alignment supported by the object file format of this machine.
  599. Use this macro to limit the alignment which can be specified using the
  600. @code{__attribute__ ((aligned (@var{n})))} construct.  If not defined,
  601. the default value is @code{BIGGEST_ALIGNMENT}.
  602.  
  603. @findex DATA_ALIGNMENT
  604. @item DATA_ALIGNMENT (@var{type}, @var{basic-align})
  605. If defined, a C expression to compute the alignment for a static
  606. variable.  @var{type} is the data type, and @var{basic-align} is the
  607. alignment that the object would ordinarily have.  The value of this
  608. macro is used instead of that alignment to align the object.
  609.  
  610. If this macro is not defined, then @var{basic-align} is used.
  611.  
  612. @findex strcpy
  613. One use of this macro is to increase alignment of medium-size data to
  614. make it all fit in fewer cache lines.  Another is to cause character
  615. arrays to be word-aligned so that @code{strcpy} calls that copy
  616. constants to character arrays can be done inline.
  617.  
  618. @findex CONSTANT_ALIGNMENT
  619. @item CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})
  620. If defined, a C expression to compute the alignment given to a constant
  621. that is being placed in memory.  @var{constant} is the constant and
  622. @var{basic-align} is the alignment that the object would ordinarily
  623. have.  The value of this macro is used instead of that alignment to
  624. align the object.
  625.  
  626. If this macro is not defined, then @var{basic-align} is used.
  627.  
  628. The typical use of this macro is to increase alignment for string
  629. constants to be word aligned so that @code{strcpy} calls that copy
  630. constants can be done inline.
  631.  
  632. @findex EMPTY_FIELD_BOUNDARY
  633. @item EMPTY_FIELD_BOUNDARY
  634. Alignment in bits to be given to a structure bit field that follows an
  635. empty field such as @code{int : 0;}.
  636.  
  637. Note that @code{PCC_BITFIELD_TYPE_MATTERS} also affects the alignment
  638. that results from an empty field.
  639.  
  640. @findex STRUCTURE_SIZE_BOUNDARY
  641. @item STRUCTURE_SIZE_BOUNDARY
  642. Number of bits which any structure or union's size must be a multiple of.
  643. Each structure or union's size is rounded up to a multiple of this.
  644.  
  645. If you do not define this macro, the default is the same as
  646. @code{BITS_PER_UNIT}.
  647.  
  648. @findex STRICT_ALIGNMENT
  649. @item STRICT_ALIGNMENT
  650. Define this macro to be the value 1 if instructions will fail to work
  651. if given data not on the nominal alignment.  If instructions will merely
  652. go slower in that case, define this macro as 0.
  653.  
  654. @findex PCC_BITFIELD_TYPE_MATTERS
  655. @item PCC_BITFIELD_TYPE_MATTERS
  656. Define this if you wish to imitate the way many other C compilers handle
  657. alignment of bitfields and the structures that contain them.
  658.  
  659. The behavior is that the type written for a bitfield (@code{int},
  660. @code{short}, or other integer type) imposes an alignment for the
  661. entire structure, as if the structure really did contain an ordinary
  662. field of that type.  In addition, the bitfield is placed within the
  663. structure so that it would fit within such a field, not crossing a
  664. boundary for it.
  665.  
  666. Thus, on most machines, a bitfield whose type is written as @code{int}
  667. would not cross a four-byte boundary, and would force four-byte
  668. alignment for the whole structure.  (The alignment used may not be four
  669. bytes; it is controlled by the other alignment parameters.)
  670.  
  671. If the macro is defined, its definition should be a C expression;
  672. a nonzero value for the expression enables this behavior.
  673.  
  674. Note that if this macro is not defined, or its value is zero, some
  675. bitfields may cross more than one alignment boundary.  The compiler can
  676. support such references if there are @samp{insv}, @samp{extv}, and
  677. @samp{extzv} insns that can directly reference memory.
  678.  
  679. The other known way of making bitfields work is to define
  680. @code{STRUCTURE_SIZE_BOUNDARY} as large as @code{BIGGEST_ALIGNMENT}.
  681. Then every structure can be accessed with fullwords.
  682.  
  683. Unless the machine has bitfield instructions or you define
  684. @code{STRUCTURE_SIZE_BOUNDARY} that way, you must define
  685. @code{PCC_BITFIELD_TYPE_MATTERS} to have a nonzero value.
  686.  
  687. If your aim is to make GNU CC use the same conventions for laying out
  688. bitfields as are used by another compiler, here is how to investigate
  689. what the other compiler does.  Compile and run this program:
  690.  
  691. @example
  692. struct foo1
  693. @{
  694.   char x;
  695.   char :0;
  696.   char y;
  697. @};
  698.  
  699. struct foo2
  700. @{
  701.   char x;
  702.   int :0;
  703.   char y;
  704. @};
  705.  
  706. main ()
  707. @{
  708.   printf ("Size of foo1 is %d\n", sizeof (struct foo1));
  709.   printf ("Size of foo2 is %d\n", sizeof (struct foo2));
  710.   exit (0);
  711. @}
  712. @end example
  713.  
  714. If this prints 2 and 5, then the compiler's behavior is what you would
  715. get from @code{PCC_BITFIELD_TYPE_MATTERS}.
  716.  
  717. @findex BITFIELD_NBYTES_LIMITED
  718. @item BITFIELD_NBYTES_LIMITED
  719. Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
  720. aligning a bitfield within the structure.
  721.  
  722. @findex ROUND_TYPE_SIZE
  723. @item ROUND_TYPE_SIZE (@var{struct}, @var{size}, @var{align})
  724. Define this macro as an expression for the overall size of a structure 
  725. (given by @var{struct} as a tree node) when the size computed from the
  726. fields is @var{size} and the alignment is @var{align}.
  727.  
  728. The default is to round @var{size} up to a multiple of @var{align}.
  729.  
  730. @findex ROUND_TYPE_ALIGN
  731. @item ROUND_TYPE_ALIGN (@var{struct}, @var{computed}, @var{specified})
  732. Define this macro as an expression for the alignment of a structure 
  733. (given by @var{struct} as a tree node) if the alignment computed in the
  734. usual way is @var{computed} and the alignment explicitly specified was
  735. @var{specified}.
  736.  
  737. The default is to use @var{specified} if it is larger; otherwise, use
  738. the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT}
  739.  
  740. @findex MAX_FIXED_MODE_SIZE
  741. @item MAX_FIXED_MODE_SIZE
  742. An integer expression for the size in bits of the largest integer
  743. machine mode that should actually be used.  All integer machine modes of
  744. this size or smaller can be used for structures and unions with the
  745. appropriate sizes.  If this macro is undefined, @code{GET_MODE_BITSIZE
  746. (DImode)} is assumed.
  747.  
  748. @findex CHECK_FLOAT_VALUE
  749. @item CHECK_FLOAT_VALUE (@var{mode}, @var{value})
  750. A C statement to validate the value @var{value} (of type
  751. @code{double}) for mode @var{mode}.  This means that you check whether
  752. @var{value} fits within the possible range of values for mode
  753. @var{mode} on this target machine.  The mode @var{mode} is always
  754. @code{SFmode} or @code{DFmode}.
  755.  
  756. @findex error
  757. If @var{value} is not valid, you should call @code{error} to print an
  758. error message and then assign some valid value to @var{value}.
  759. Allowing an invalid value to go through the compiler can produce
  760. incorrect assembler code which may even cause Unix assemblers to
  761. crash.
  762.  
  763. This macro need not be defined if there is no work for it to do.
  764.  
  765. @findex TARGET_FLOAT_FORMAT
  766. @item TARGET_FLOAT_FORMAT
  767. A code distinguishing the floating point format of the target machine.
  768. There are three defined values:
  769.  
  770. @table @code
  771. @findex IEEE_FLOAT_FORMAT
  772. @item IEEE_FLOAT_FORMAT
  773. This code indicates IEEE floating point.  It is the default; there is no
  774. need to define this macro when the format is IEEE.
  775.  
  776. @findex VAX_FLOAT_FORMAT
  777. @item VAX_FLOAT_FORMAT
  778. This code indicates the peculiar format used on the Vax.
  779.  
  780. @findex UNKNOWN_FLOAT_FORMAT
  781. @item UNKNOWN_FLOAT_FORMAT
  782. This code indicates any other format.
  783. @end table
  784.  
  785. The value of this macro is compared with @code{HOST_FLOAT_FORMAT}
  786. (@pxref{Config}) to determine whether the target machine has the same
  787. format as the host machine.  If any other formats are actually in use on
  788. supported machines, new codes should be defined for them.
  789. @end table
  790.  
  791. @node Type Layout
  792. @section Layout of Source Language Data Types
  793.  
  794. These macros define the sizes and other characteristics of the standard
  795. basic data types used in programs being compiled.  Unlike the macros in
  796. the previous section, these apply to specific features of C and related
  797. languages, rather than to fundamental aspects of storage layout.
  798.  
  799. @table @code
  800. @findex INT_TYPE_SIZE
  801. @item INT_TYPE_SIZE
  802. A C expression for the size in bits of the type @code{int} on the
  803. target machine.  If you don't define this, the default is one word.
  804.  
  805. @findex SHORT_TYPE_SIZE
  806. @item SHORT_TYPE_SIZE
  807. A C expression for the size in bits of the type @code{short} on the
  808. target machine.  If you don't define this, the default is half a word.
  809. (If this would be less than one storage unit, it is rounded up to one
  810. unit.)
  811.  
  812. @findex LONG_TYPE_SIZE
  813. @item LONG_TYPE_SIZE
  814. A C expression for the size in bits of the type @code{long} on the
  815. target machine.  If you don't define this, the default is one word.
  816.  
  817. @findex LONG_LONG_TYPE_SIZE
  818. @item LONG_LONG_TYPE_SIZE
  819. A C expression for the size in bits of the type @code{long long} on the
  820. target machine.  If you don't define this, the default is two
  821. words.
  822.  
  823. @findex CHAR_TYPE_SIZE
  824. @item CHAR_TYPE_SIZE
  825. A C expression for the size in bits of the type @code{char} on the
  826. target machine.  If you don't define this, the default is one quarter
  827. of a word.  (If this would be less than one storage unit, it is rounded up
  828. to one unit.)
  829.  
  830. @findex FLOAT_TYPE_SIZE
  831. @item FLOAT_TYPE_SIZE
  832. A C expression for the size in bits of the type @code{float} on the
  833. target machine.  If you don't define this, the default is one word.
  834.  
  835. @findex DOUBLE_TYPE_SIZE
  836. @item DOUBLE_TYPE_SIZE
  837. A C expression for the size in bits of the type @code{double} on the
  838. target machine.  If you don't define this, the default is two
  839. words.
  840.  
  841. @findex LONG_DOUBLE_TYPE_SIZE
  842. @item LONG_DOUBLE_TYPE_SIZE
  843. A C expression for the size in bits of the type @code{long double} on
  844. the target machine.  If you don't define this, the default is two
  845. words.
  846.  
  847. @findex DEFAULT_SIGNED_CHAR
  848. @item DEFAULT_SIGNED_CHAR
  849. An expression whose value is 1 or 0, according to whether the type
  850. @code{char} should be signed or unsigned by default.  The user can
  851. always override this default with the options @samp{-fsigned-char}
  852. and @samp{-funsigned-char}.
  853.  
  854. @findex DEFAULT_SHORT_ENUMS
  855. @item DEFAULT_SHORT_ENUMS
  856. A C expression to determine whether to give an @code{enum} type 
  857. only as many bytes as it takes to represent the range of possible values
  858. of that type.  A nonzero value means to do that; a zero value means all
  859. @code{enum} types should be allocated like @code{int}.
  860.  
  861. If you don't define the macro, the default is 0.
  862.  
  863. @findex SIZE_TYPE
  864. @item SIZE_TYPE
  865. A C expression for a string describing the name of the data type to use
  866. for size values.  The typedef name @code{size_t} is defined using the
  867. contents of the string.
  868.  
  869. The string can contain more than one keyword.  If so, separate them with
  870. spaces, and write first any length keyword, then @code{unsigned} if
  871. appropriate, and finally @code{int}.  The string must exactly match one
  872. of the data type names defined in the function
  873. @code{init_decl_processing} in the file @file{c-decl.c}.  You may not
  874. omit @code{int} or change the order---that would cause the compiler to
  875. crash on startup.
  876.  
  877. If you don't define this macro, the default is @code{"long unsigned
  878. int"}.
  879.  
  880. @findex PTRDIFF_TYPE
  881. @item PTRDIFF_TYPE
  882. A C expression for a string describing the name of the data type to use
  883. for the result of subtracting two pointers.  The typedef name
  884. @code{ptrdiff_t} is defined using the contents of the string.  See
  885. @code{SIZE_TYPE} above for more information.
  886.  
  887. If you don't define this macro, the default is @code{"long int"}.
  888.  
  889. @findex WCHAR_TYPE
  890. @item WCHAR_TYPE
  891. A C expression for a string describing the name of the data type to use
  892. for wide characters.  The typedef name @code{wchar_t} is defined using
  893. the contents of the string.  See @code{SIZE_TYPE} above for more
  894. information.
  895.  
  896. If you don't define this macro, the default is @code{"int"}.
  897.  
  898. @findex WCHAR_TYPE_SIZE
  899. @item WCHAR_TYPE_SIZE
  900. A C expression for the size in bits of the data type for wide
  901. characters.  This is used in @code{cpp}, which cannot make use of
  902. @code{WCHAR_TYPE}.
  903.  
  904. @findex OBJC_INT_SELECTORS
  905. @item OBJC_INT_SELECTORS
  906. Define this macro if the type of Objective C selectors should be
  907. @code{int}.
  908.  
  909. If this macro is not defined, then selectors should have the type
  910. @code{struct objc_selector *}.
  911.  
  912. @findex OBJC_SELECTORS_WITHOUT_LABELS
  913. @item OBJC_SELECTORS_WITHOUT_LABELS
  914. Define this macro if the compiler can group all the selectors together
  915. into a vector and use just one label at the beginning of the vector.
  916. Otherwise, the compiler must give each selector its own assembler
  917. label.
  918.  
  919. On certain machines, it is important to have a separate label for each
  920. selector because this enables the linker to eliminate duplicate selectors.
  921.  
  922. @findex TARGET_BELL
  923. @item TARGET_BELL
  924. A C constant expression for the integer value for escape sequence
  925. @samp{\a}.
  926.  
  927. @findex TARGET_TAB
  928. @findex TARGET_BS
  929. @findex TARGET_NEWLINE
  930. @item TARGET_BS
  931. @itemx TARGET_TAB
  932. @itemx TARGET_NEWLINE
  933. C constant expressions for the integer values for escape sequences
  934. @samp{\b}, @samp{\t} and @samp{\n}.
  935.  
  936. @findex TARGET_VT
  937. @findex TARGET_FF
  938. @findex TARGET_CR
  939. @item TARGET_VT
  940. @itemx TARGET_FF
  941. @itemx TARGET_CR
  942. C constant expressions for the integer values for escape sequences
  943. @samp{\v}, @samp{\f} and @samp{\r}.
  944. @end table
  945.  
  946. @node Registers
  947. @section Register Usage
  948. @cindex register usage
  949.  
  950. This section explains how to describe what registers the target machine
  951. has, and how (in general) they can be used.
  952.  
  953. The description of which registers a specific instruction can use is
  954. done with register classes; see @ref{Register Classes}.  For information
  955. on using registers to access a stack frame, see @ref{Frame Registers}.
  956. For passing values in registers, see @ref{Register Arguments}.
  957. For returning values in registers, see @ref{Scalar Return}.
  958.  
  959. @menu
  960. * Register Basics::        Number and kinds of registers.
  961. * Allocation Order::        Order in which registers are allocated.
  962. * Values in Registers::        What kinds of values each reg can hold.
  963. * Leaf Functions::        Renumbering registers for leaf functions.
  964. * Stack Registers::        Handling a register stack such as 80387.
  965. * Obsolete Register Macros::    Macros formerly used for the 80387.
  966. @end menu
  967.  
  968. @node Register Basics
  969. @subsection Basic Characteristics of Registers
  970.  
  971. @table @code
  972. @findex FIRST_PSEUDO_REGISTER
  973. @item FIRST_PSEUDO_REGISTER
  974. Number of hardware registers known to the compiler.  They receive
  975. numbers 0 through @code{FIRST_PSEUDO_REGISTER-1}; thus, the first
  976. pseudo register's number really is assigned the number
  977. @code{FIRST_PSEUDO_REGISTER}.
  978.  
  979. @item FIXED_REGISTERS
  980. @findex FIXED_REGISTERS
  981. @cindex fixed register
  982. An initializer that says which registers are used for fixed purposes
  983. all throughout the compiled code and are therefore not available for
  984. general allocation.  These would include the stack pointer, the frame
  985. pointer (except on machines where that can be used as a general
  986. register when no frame pointer is needed), the program counter on
  987. machines where that is considered one of the addressable registers,
  988. and any other numbered register with a standard use.
  989.  
  990. This information is expressed as a sequence of numbers, separated by
  991. commas and surrounded by braces.  The @var{n}th number is 1 if
  992. register @var{n} is fixed, 0 otherwise.
  993.  
  994. The table initialized from this macro, and the table initialized by
  995. the following one, may be overridden at run time either automatically,
  996. by the actions of the macro @code{CONDITIONAL_REGISTER_USAGE}, or by
  997. the user with the command options @samp{-ffixed-@var{reg}},
  998. @samp{-fcall-used-@var{reg}} and @samp{-fcall-saved-@var{reg}}.
  999.  
  1000. @findex CALL_USED_REGISTERS
  1001. @item CALL_USED_REGISTERS
  1002. @cindex call-used register
  1003. @cindex call-clobbered register
  1004. @cindex call-saved register
  1005. Like @code{FIXED_REGISTERS} but has 1 for each register that is
  1006. clobbered (in general) by function calls as well as for fixed
  1007. registers.  This macro therefore identifies the registers that are not
  1008. available for general allocation of values that must live across
  1009. function calls.
  1010.  
  1011. If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
  1012. automatically saves it on function entry and restores it on function
  1013. exit, if the register is used within the function.
  1014.  
  1015. @findex CONDITIONAL_REGISTER_USAGE
  1016. @findex fixed_regs
  1017. @findex call_used_regs
  1018. @item CONDITIONAL_REGISTER_USAGE
  1019. Zero or more C statements that may conditionally modify two variables
  1020. @code{fixed_regs} and @code{call_used_regs} (both of type @code{char
  1021. []}) after they have been initialized from the two preceding macros.
  1022.  
  1023. This is necessary in case the fixed or call-clobbered registers depend
  1024. on target flags.
  1025.  
  1026. You need not define this macro if it has no work to do.
  1027.  
  1028. @cindex disabling certain registers
  1029. @cindex controlling register usage 
  1030. If the usage of an entire class of registers depends on the target
  1031. flags, you may indicate this to GCC by using this macro to modify
  1032. @code{fixed_regs} and @code{call_used_regs} to 1 for each of the
  1033. registers in the classes which should not be used by GCC.  Also define
  1034. the macro @code{REG_CLASS_FROM_LETTER} to return @code{NO_REGS} if it
  1035. is called with a letter for a class that shouldn't be used.
  1036.  
  1037. (However, if this class is not included in @code{GENERAL_REGS} and all
  1038. of the insn patterns whose constraints permit this class are
  1039. controlled by target switches, then GCC will automatically avoid using
  1040. these registers when the target switches are opposed to them.)
  1041.  
  1042. @findex NON_SAVING_SETJMP
  1043. @item NON_SAVING_SETJMP
  1044. If this macro is defined and has a nonzero value, it means that
  1045. @code{setjmp} and related functions fail to save the registers, or that
  1046. @code{longjmp} fails to restore them.  To compensate, the compiler
  1047. avoids putting variables in registers in functions that use
  1048. @code{setjmp}.
  1049.  
  1050. @ignore
  1051. @findex PC_REGNUM
  1052. @item PC_REGNUM
  1053. If the program counter has a register number, define this as that
  1054. register number.  Otherwise, do not define it.
  1055. @end ignore
  1056. @end table
  1057.  
  1058. @node Allocation Order
  1059. @subsection Order of Allocation of Registers
  1060. @cindex order of register allocation
  1061. @cindex register allocation order
  1062.  
  1063. @table @code
  1064. @findex REG_ALLOC_ORDER
  1065. @item REG_ALLOC_ORDER
  1066. If defined, an initializer for a vector of integers, containing the
  1067. numbers of hard registers in the order in which GNU CC should prefer
  1068. to use them (from most preferred to least).
  1069.  
  1070. If this macro is not defined, registers are used lowest numbered first
  1071. (all else being equal).
  1072.  
  1073. One use of this macro is on machines where the highest numbered
  1074. registers must always be saved and the save-multiple-registers
  1075. instruction supports only sequences of consecutive registers.  On such
  1076. machines, define @code{REG_ALLOC_ORDER} to be an initializer that lists
  1077. the highest numbered allocatable register first.
  1078.  
  1079. @findex ORDER_REGS_FOR_LOCAL_ALLOC
  1080. @item ORDER_REGS_FOR_LOCAL_ALLOC
  1081. A C statement (sans semicolon) to choose the order in which to allocate
  1082. hard registers for pseudo-registers local to a basic block.
  1083.  
  1084. Store the desired order of registers in the array
  1085. @code{reg_alloc_order}.  Element 0 should be the register to allocate
  1086. first; element 1, the next register; and so on.
  1087.  
  1088. The macro body should not assume anything about the contents of
  1089. @code{reg_alloc_order} before execution of the macro.
  1090.  
  1091. On most machines, it is not necessary to define this macro.
  1092. @end table
  1093.  
  1094. @node Values in Registers
  1095. @subsection How Values Fit in Registers
  1096.  
  1097. This section discusses the macros that describe which kinds of values
  1098. (specifically, which machine modes) each register can hold, and how many
  1099. consecutive registers are needed for a given mode.
  1100.  
  1101. @table @code
  1102. @findex HARD_REGNO_NREGS
  1103. @item HARD_REGNO_NREGS (@var{regno}, @var{mode})
  1104. A C expression for the number of consecutive hard registers, starting
  1105. at register number @var{regno}, required to hold a value of mode
  1106. @var{mode}.
  1107.  
  1108. On a machine where all registers are exactly one word, a suitable
  1109. definition of this macro is
  1110.  
  1111. @example
  1112. #define HARD_REGNO_NREGS(REGNO, MODE)            \
  1113.    ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
  1114.     / UNITS_PER_WORD))
  1115. @end example
  1116.  
  1117. @findex HARD_REGNO_MODE_OK
  1118. @item HARD_REGNO_MODE_OK (@var{regno}, @var{mode})
  1119. A C expression that is nonzero if it is permissible to store a value
  1120. of mode @var{mode} in hard register number @var{regno} (or in several
  1121. registers starting with that one).  For a machine where all registers
  1122. are equivalent, a suitable definition is
  1123.  
  1124. @example
  1125. #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
  1126. @end example
  1127.  
  1128. It is not necessary for this macro to check for the numbers of fixed
  1129. registers, because the allocation mechanism considers them to be always
  1130. occupied.
  1131.  
  1132. @cindex register pairs
  1133. On some machines, double-precision values must be kept in even/odd
  1134. register pairs.  The way to implement that is to define this macro
  1135. to reject odd register numbers for such modes.
  1136.  
  1137. @ignore
  1138. @c I think this is not true now
  1139. GNU CC assumes that it can always move values between registers and
  1140. (suitably addressed) memory locations.  If it is impossible to move a
  1141. value of a certain mode between memory and certain registers, then
  1142. @code{HARD_REGNO_MODE_OK} must not allow this mode in those registers.
  1143. @end ignore
  1144.  
  1145. The minimum requirement for a mode to be OK in a register is that the
  1146. @samp{mov@var{mode}} instruction pattern support moves between the
  1147. register and any other hard register for which the mode is OK; and that
  1148. moving a value into the register and back out not alter it.
  1149.  
  1150. Since the same instruction used to move @code{SImode} will work for all
  1151. narrower integer modes, it is not necessary on any machine for
  1152. @code{HARD_REGNO_MODE_OK} to distinguish between these modes, provided
  1153. you define patterns @samp{movhi}, etc., to take advantage of this.  This
  1154. is useful because of the interaction between @code{HARD_REGNO_MODE_OK}
  1155. and @code{MODES_TIEABLE_P}; it is very desirable for all integer modes
  1156. to be tieable.
  1157.  
  1158. Many machines have special registers for floating point arithmetic.
  1159. Often people assume that floating point machine modes are allowed only
  1160. in floating point registers.  This is not true.  Any registers that
  1161. can hold integers can safely @emph{hold} a floating point machine
  1162. mode, whether or not floating arithmetic can be done on it in those
  1163. registers.  Integer move instructions can be used to move the values.
  1164.  
  1165. On some machines, though, the converse is true: fixed-point machine
  1166. modes may not go in floating registers.  This is true if the floating
  1167. registers normalize any value stored in them, because storing a
  1168. non-floating value there would garble it.  In this case,
  1169. @code{HARD_REGNO_MODE_OK} should reject fixed-point machine modes in
  1170. floating registers.  But if the floating registers do not automatically
  1171. normalize, if you can store any bit pattern in one and retrieve it
  1172. unchanged without a trap, then any machine mode may go in a floating
  1173. register, so you can define this macro to say so.
  1174.  
  1175. On some machines, such as the Sparc and the Mips, we get better code
  1176. by defining @code{HARD_REGNO_MODE_OK} to forbid integers in floating
  1177. registers, even though the hardware is capable of handling them.  This
  1178. is because transferring values between floating registers and general
  1179. registers is so slow that it is better to keep the integer in memory.
  1180.  
  1181. The primary significance of special floating registers is rather that
  1182. they are the registers acceptable in floating point arithmetic
  1183. instructions.  However, this is of no concern to
  1184. @code{HARD_REGNO_MODE_OK}.  You handle it by writing the proper
  1185. constraints for those instructions.
  1186.  
  1187. On some machines, the floating registers are especially slow to access,
  1188. so that it is better to store a value in a stack frame than in such a
  1189. register if floating point arithmetic is not being done.  As long as the
  1190. floating registers are not in class @code{GENERAL_REGS}, they will not
  1191. be used unless some pattern's constraint asks for one.
  1192.  
  1193. @findex MODES_TIEABLE_P
  1194. @item MODES_TIEABLE_P (@var{mode1}, @var{mode2})
  1195. A C expression that is nonzero if it is desirable to choose register
  1196. allocation so as to avoid move instructions between a value of mode
  1197. @var{mode1} and a value of mode @var{mode2}.
  1198.  
  1199. If @code{HARD_REGNO_MODE_OK (@var{r}, @var{mode1})} and
  1200. @code{HARD_REGNO_MODE_OK (@var{r}, @var{mode2})} are ever different
  1201. for any @var{r}, then @code{MODES_TIEABLE_P (@var{mode1},
  1202. @var{mode2})} must be zero.
  1203. @end table
  1204.  
  1205. @node Leaf Functions
  1206. @subsection Handling Leaf Functions
  1207.  
  1208. @cindex leaf functions
  1209. @cindex functions, leaf
  1210. On some machines, a leaf function (i.e., one which makes no calls) can run
  1211. more efficiently if it does not make its own register window.  Often this
  1212. means it is required to receive its arguments in the registers where they
  1213. are passed by the caller, instead of the registers where they would
  1214. normally arrive.
  1215.  
  1216. The special treatment for leaf functions generally applies only when
  1217. other conditions are met; for example, often they may use only those
  1218. registers for its own variables and temporaries.  We use the term ``leaf
  1219. function'' to mean a function that is suitable for this special
  1220. handling, so that functions with no calls are not necessarily ``leaf
  1221. functions''.
  1222.  
  1223. GNU CC assigns register numbers before it knows whether the function is
  1224. suitable for leaf function treatment.  So it needs to renumber the
  1225. registers in order to output a leaf function.  The following macros
  1226. accomplish this.
  1227.  
  1228. @table @code
  1229. @findex LEAF_REGISTERS
  1230. @item LEAF_REGISTERS
  1231. A C initializer for a vector, indexed by hard register number, which
  1232. contains 1 for a register that is allowable in a candidate for leaf
  1233. function treatment.
  1234.  
  1235. If leaf function treatment involves renumbering the registers, then the
  1236. registers marked here should be the ones before renumbering---those that
  1237. GNU CC would ordinarily allocate.  The registers which will actually be
  1238. used in the assembler code, after renumbering, should not be marked with 1
  1239. in this vector.
  1240.  
  1241. Define this macro only if the target machine offers a way to optimize
  1242. the treatment of leaf functions.
  1243.  
  1244. @findex LEAF_REG_REMAP
  1245. @item LEAF_REG_REMAP (@var{regno})
  1246. A C expression whose value is the register number to which @var{regno}
  1247. should be renumbered, when a function is treated as a leaf function.
  1248.  
  1249. If @var{regno} is a register number which should not appear in a leaf
  1250. function before renumbering, then the expression should yield -1, which
  1251. will cause the compiler to abort.
  1252.  
  1253. Define this macro only if the target machine offers a way to optimize the
  1254. treatment of leaf functions, and registers need to be renumbered to do
  1255. this.
  1256.  
  1257. @findex REG_LEAF_ALLOC_ORDER
  1258. @item REG_LEAF_ALLOC_ORDER
  1259. If defined, an initializer for a vector of integers, containing the
  1260. numbers of hard registers in the order in which the GNU CC should prefer
  1261. to use them (from most preferred to least) in a leaf function.  If this
  1262. macro is not defined, REG_ALLOC_ORDER is used for both non-leaf and
  1263. leaf-functions.
  1264. @end table
  1265.  
  1266. @findex leaf_function
  1267. Normally, it is necessary for @code{FUNCTION_PROLOGUE} and
  1268. @code{FUNCTION_EPILOGUE} to treat leaf functions specially.  It can test
  1269. the C variable @code{leaf_function} which is nonzero for leaf functions.
  1270. (The variable @code{leaf_function} is defined only if
  1271. @code{LEAF_REGISTERS} is defined.)
  1272.  
  1273. @node Stack Registers
  1274. @subsection Registers That Form a Stack
  1275.  
  1276. There are special features to handle computers where some of the
  1277. ``registers'' form a stack, as in the 80387 coprocessor for the 80386.
  1278. Stack registers are normally written by pushing onto the stack, and are
  1279. numbered relative to the top of the stack.
  1280.  
  1281. Currently, GNU CC can only handle one group of stack-like registers, and
  1282. they must be consecutively numbered.
  1283.  
  1284. @table @code
  1285. @findex STACK_REGS
  1286. @item STACK_REGS
  1287. Define this if the machine has any stack-like registers.
  1288.  
  1289. @findex FIRST_STACK_REG
  1290. @item FIRST_STACK_REG
  1291. The number of the first stack-like register.  This one is the top
  1292. of the stack.
  1293.  
  1294. @findex LAST_STACK_REG
  1295. @item LAST_STACK_REG
  1296. The number of the last stack-like register.  This one is the bottom of
  1297. the stack.
  1298. @end table
  1299.  
  1300. @node Obsolete Register Macros
  1301. @subsection Obsolete Macros for Controlling Register Usage
  1302.  
  1303. These features do not work very well.  They exist because they used to
  1304. be required to generate correct code for the 80387 coprocessor of the
  1305. 80386.  They are no longer used by that machine description and may be
  1306. removed in a later version of the compiler.  Don't use them!
  1307.  
  1308. @table @code
  1309. @findex OVERLAPPING_REGNO_P 
  1310. @item OVERLAPPING_REGNO_P (@var{regno})
  1311. If defined, this is a C expression whose value is nonzero if hard
  1312. register number @var{regno} is an overlapping register.  This means a
  1313. hard register which overlaps a hard register with a different number.
  1314. (Such overlap is undesirable, but occasionally it allows a machine to
  1315. be supported which otherwise could not be.)  This macro must return
  1316. nonzero for @emph{all} the registers which overlap each other.  GNU CC
  1317. can use an overlapping register only in certain limited ways.  It can
  1318. be used for allocation within a basic block, and may be spilled for
  1319. reloading; that is all.
  1320.  
  1321. If this macro is not defined, it means that none of the hard registers
  1322. overlap each other.  This is the usual situation.
  1323.  
  1324. @findex INSN_CLOBBERS_REGNO_P
  1325. @item INSN_CLOBBERS_REGNO_P (@var{insn}, @var{regno})
  1326. If defined, this is a C expression whose value should be nonzero if
  1327. the insn @var{insn} has the effect of mysteriously clobbering the
  1328. contents of hard register number @var{regno}.  By ``mysterious'' we
  1329. mean that the insn's RTL expression doesn't describe such an effect.
  1330.  
  1331. If this macro is not defined, it means that no insn clobbers registers
  1332. mysteriously.  This is the usual situation; all else being equal,
  1333. it is best for the RTL expression to show all the activity.
  1334.  
  1335. @cindex death notes
  1336. @findex PRESERVE_DEATH_INFO_REGNO_P
  1337. @item PRESERVE_DEATH_INFO_REGNO_P (@var{regno})
  1338. If defined, this is a C expression whose value is nonzero if accurate
  1339. @code{REG_DEAD} notes are needed for hard register number @var{regno}
  1340. at the time of outputting the assembler code.  When this is so, a few
  1341. optimizations that take place after register allocation and could
  1342. invalidate the death notes are not done when this register is
  1343. involved.
  1344.  
  1345. You would arrange to preserve death info for a register when some of the
  1346. code in the machine description which is executed to write the assembler
  1347. code looks at the death notes.  This is necessary only when the actual
  1348. hardware feature which GNU CC thinks of as a register is not actually a
  1349. register of the usual sort.  (It might, for example, be a hardware
  1350. stack.)
  1351.  
  1352. If this macro is not defined, it means that no death notes need to be
  1353. preserved.  This is the usual situation.
  1354. @end table
  1355.  
  1356. @node Register Classes
  1357. @section Register Classes
  1358. @cindex register class definitions
  1359. @cindex class definitions, register
  1360.  
  1361. On many machines, the numbered registers are not all equivalent.
  1362. For example, certain registers may not be allowed for indexed addressing;
  1363. certain registers may not be allowed in some instructions.  These machine
  1364. restrictions are described to the compiler using @dfn{register classes}.
  1365.  
  1366. You define a number of register classes, giving each one a name and saying
  1367. which of the registers belong to it.  Then you can specify register classes
  1368. that are allowed as operands to particular instruction patterns.
  1369.  
  1370. @findex ALL_REGS
  1371. @findex NO_REGS
  1372. In general, each register will belong to several classes.  In fact, one
  1373. class must be named @code{ALL_REGS} and contain all the registers.  Another
  1374. class must be named @code{NO_REGS} and contain no registers.  Often the
  1375. union of two classes will be another class; however, this is not required.
  1376.  
  1377. @findex GENERAL_REGS
  1378. One of the classes must be named @code{GENERAL_REGS}.  There is nothing
  1379. terribly special about the name, but the operand constraint letters
  1380. @samp{r} and @samp{g} specify this class.  If @code{GENERAL_REGS} is
  1381. the same as @code{ALL_REGS}, just define it as a macro which expands
  1382. to @code{ALL_REGS}.
  1383.  
  1384. Order the classes so that if class @var{x} is contained in class @var{y}
  1385. then @var{x} has a lower class number than @var{y}.
  1386.  
  1387. The way classes other than @code{GENERAL_REGS} are specified in operand
  1388. constraints is through machine-dependent operand constraint letters.
  1389. You can define such letters to correspond to various classes, then use
  1390. them in operand constraints.
  1391.  
  1392. You should define a class for the union of two classes whenever some
  1393. instruction allows both classes.  For example, if an instruction allows
  1394. either a floating point (coprocessor) register or a general register for a
  1395. certain operand, you should define a class @code{FLOAT_OR_GENERAL_REGS}
  1396. which includes both of them.  Otherwise you will get suboptimal code.
  1397.  
  1398. You must also specify certain redundant information about the register
  1399. classes: for each class, which classes contain it and which ones are
  1400. contained in it; for each pair of classes, the largest class contained
  1401. in their union.
  1402.  
  1403. When a value occupying several consecutive registers is expected in a
  1404. certain class, all the registers used must belong to that class.
  1405. Therefore, register classes cannot be used to enforce a requirement for
  1406. a register pair to start with an even-numbered register.  The way to
  1407. specify this requirement is with @code{HARD_REGNO_MODE_OK}.
  1408.  
  1409. Register classes used for input-operands of bitwise-and or shift
  1410. instructions have a special requirement: each such class must have, for
  1411. each fixed-point machine mode, a subclass whose registers can transfer that
  1412. mode to or from memory.  For example, on some machines, the operations for
  1413. single-byte values (@code{QImode}) are limited to certain registers.  When
  1414. this is so, each register class that is used in a bitwise-and or shift
  1415. instruction must have a subclass consisting of registers from which
  1416. single-byte values can be loaded or stored.  This is so that
  1417. @code{PREFERRED_RELOAD_CLASS} can always have a possible value to return.
  1418.  
  1419. @table @code
  1420. @findex enum reg_class
  1421. @item enum reg_class
  1422. An enumeral type that must be defined with all the register class names
  1423. as enumeral values.  @code{NO_REGS} must be first.  @code{ALL_REGS}
  1424. must be the last register class, followed by one more enumeral value,
  1425. @code{LIM_REG_CLASSES}, which is not a register class but rather
  1426. tells how many classes there are.
  1427.  
  1428. Each register class has a number, which is the value of casting
  1429. the class name to type @code{int}.  The number serves as an index
  1430. in many of the tables described below.
  1431.  
  1432. @findex N_REG_CLASSES
  1433. @item N_REG_CLASSES
  1434. The number of distinct register classes, defined as follows:
  1435.  
  1436. @example
  1437. #define N_REG_CLASSES (int) LIM_REG_CLASSES
  1438. @end example
  1439.  
  1440. @findex REG_CLASS_NAMES
  1441. @item REG_CLASS_NAMES
  1442. An initializer containing the names of the register classes as C string
  1443. constants.  These names are used in writing some of the debugging dumps.
  1444.  
  1445. @findex REG_CLASS_CONTENTS
  1446. @item REG_CLASS_CONTENTS
  1447. An initializer containing the contents of the register classes, as integers
  1448. which are bit masks.  The @var{n}th integer specifies the contents of class
  1449. @var{n}.  The way the integer @var{mask} is interpreted is that
  1450. register @var{r} is in the class if @code{@var{mask} & (1 << @var{r})} is 1.
  1451.  
  1452. When the machine has more than 32 registers, an integer does not suffice.
  1453. Then the integers are replaced by sub-initializers, braced groupings containing
  1454. several integers.  Each sub-initializer must be suitable as an initializer
  1455. for the type @code{HARD_REG_SET} which is defined in @file{hard-reg-set.h}.
  1456.  
  1457. @findex REGNO_REG_CLASS 
  1458. @item REGNO_REG_CLASS (@var{regno})
  1459. A C expression whose value is a register class containing hard register
  1460. @var{regno}.  In general there is more than one such class; choose a class
  1461. which is @dfn{minimal}, meaning that no smaller class also contains the
  1462. register.
  1463.  
  1464. @findex BASE_REG_CLASS
  1465. @item BASE_REG_CLASS
  1466. A macro whose definition is the name of the class to which a valid
  1467. base register must belong.  A base register is one used in an address
  1468. which is the register value plus a displacement.
  1469.  
  1470. @findex INDEX_REG_CLASS
  1471. @item INDEX_REG_CLASS
  1472. A macro whose definition is the name of the class to which a valid
  1473. index register must belong.  An index register is one used in an
  1474. address where its value is either multiplied by a scale factor or
  1475. added to another register (as well as added to a displacement).
  1476.  
  1477. @findex REG_CLASS_FROM_LETTER
  1478. @item REG_CLASS_FROM_LETTER (@var{char})
  1479. A C expression which defines the machine-dependent operand constraint
  1480. letters for register classes.  If @var{char} is such a letter, the
  1481. value should be the register class corresponding to it.  Otherwise,
  1482. the value should be @code{NO_REGS}.  The register letter @samp{r},
  1483. corresponding to class @code{GENERAL_REGS}, will not be passed
  1484. to this macro; you do not need to handle it.
  1485.  
  1486. @findex REGNO_OK_FOR_BASE_P
  1487. @item REGNO_OK_FOR_BASE_P (@var{num})
  1488. A C expression which is nonzero if register number @var{num} is
  1489. suitable for use as a base register in operand addresses.  It may be
  1490. either a suitable hard register or a pseudo register that has been
  1491. allocated such a hard register.
  1492.  
  1493. @findex REGNO_OK_FOR_INDEX_P
  1494. @item REGNO_OK_FOR_INDEX_P (@var{num})
  1495. A C expression which is nonzero if register number @var{num} is
  1496. suitable for use as an index register in operand addresses.  It may be
  1497. either a suitable hard register or a pseudo register that has been
  1498. allocated such a hard register.
  1499.  
  1500. The difference between an index register and a base register is that
  1501. the index register may be scaled.  If an address involves the sum of
  1502. two registers, neither one of them scaled, then either one may be
  1503. labeled the ``base'' and the other the ``index''; but whichever
  1504. labeling is used must fit the machine's constraints of which registers
  1505. may serve in each capacity.  The compiler will try both labelings,
  1506. looking for one that is valid, and will reload one or both registers
  1507. only if neither labeling works.
  1508.  
  1509. @findex PREFERRED_RELOAD_CLASS
  1510. @item PREFERRED_RELOAD_CLASS (@var{x}, @var{class})
  1511. A C expression that places additional restrictions on the register class
  1512. to use when it is necessary to copy value @var{x} into a register in class
  1513. @var{class}.  The value is a register class; perhaps @var{class}, or perhaps
  1514. another, smaller class.  On many machines, the definition
  1515.  
  1516. @example
  1517. #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
  1518. @end example
  1519.  
  1520. @noindent
  1521. is safe.
  1522.  
  1523. Sometimes returning a more restrictive class makes better code.  For
  1524. example, on the 68000, when @var{x} is an integer constant that is in range
  1525. for a @samp{moveq} instruction, the value of this macro is always
  1526. @code{DATA_REGS} as long as @var{class} includes the data registers.
  1527. Requiring a data register guarantees that a @samp{moveq} will be used.
  1528.  
  1529. If @var{x} is a @code{const_double}, by returning @code{NO_REGS}
  1530. you can force @var{x} into a memory constant.  This is useful on
  1531. certain machines where immediate floating values cannot be loaded into
  1532. certain kinds of registers.
  1533.  
  1534. @findex PREFERRED_OUTPUT_RELOAD_CLASS
  1535. @item PREFERRED_OUTPUT_RELOAD_CLASS (@var{x}, @var{class})
  1536. Like @code{PREFERRED_RELOAD_CLASS}, but for output reloads instead of
  1537. input reloads.  If you don't define this macro, the default is to use
  1538. @var{class}, unchanged.
  1539.  
  1540. @findex LIMIT_RELOAD_CLASS
  1541. @item LIMIT_RELOAD_CLASS (@var{mode}, @var{class})
  1542. A C expression that places additional restrictions on the register class
  1543. to use when it is necessary to be able to hold a value of mode
  1544. @var{mode} in a reload register for which class @var{class} would
  1545. ordinarily be used.
  1546.  
  1547. Unlike @code{PREFERRED_RELOAD_CLASS}, this macro should be used when
  1548. there are certain modes that simply can't go in certain reload classes.
  1549.  
  1550. The value is a register class; perhaps @var{class}, or perhaps another,
  1551. smaller class.
  1552.  
  1553. Don't define this macro unless the target machine has limitations which
  1554. require the macro to do something nontrivial.
  1555.  
  1556. @findex SECONDARY_RELOAD_CLASS
  1557. @findex SECONDARY_INPUT_RELOAD_CLASS
  1558. @findex SECONDARY_OUTPUT_RELOAD_CLASS
  1559. @item SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
  1560. @itemx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
  1561. @itemx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
  1562. Many machines have some registers that cannot be copied directly to or
  1563. from memory or even from other types of registers.  An example is the
  1564. @samp{MQ} register, which on most machines, can only be copied to or
  1565. from general registers, but not memory.  Some machines allow copying all
  1566. registers to and from memory, but require a scratch register for stores
  1567. to some memory locations (e.g., those with symbolic address on the RT,
  1568. and those with certain symbolic address on the Sparc when compiling
  1569. PIC).  In some cases, both an intermediate and a scratch register are
  1570. required.
  1571.  
  1572. You should define these macros to indicate to the reload phase that it may
  1573. need to allocate at least one register for a reload in addition to the
  1574. register to contain the data.  Specifically, if copying @var{x} to a
  1575. register @var{class} in @var{mode} requires an intermediate register,
  1576. you should define @code{SECONDARY_INPUT_RELOAD_CLASS} to return the
  1577. largest register class all of whose registers can be used as
  1578. intermediate registers or scratch registers.
  1579.  
  1580. If copying a register @var{class} in @var{mode} to @var{x} requires an
  1581. intermediate or scratch register, you should define
  1582. @code{SECONDARY_OUTPUT_RELOAD_CLASS} to return the largest register
  1583. class required.  If the requirements for input and output reloads are
  1584. the same, the macro @code{SECONDARY_RELOAD_CLASS} should be used instead
  1585. of defining both macros identically.
  1586.  
  1587. The values returned by these macros are often @code{GENERAL_REGS}.
  1588. Return @code{NO_REGS} if no spare register is needed; i.e., if @var{x}
  1589. can be directly copied to or from a register of @var{class} in
  1590. @var{mode} without requiring a scratch register.  Do not define this
  1591. macro if it would always return @code{NO_REGS}.
  1592.  
  1593. If a scratch register is required (either with or without an
  1594. intermediate register), you should define patterns for
  1595. @samp{reload_in@var{m}} or @samp{reload_out@var{m}}, as required
  1596. (@pxref{Standard Names}.  These patterns, which will normally be
  1597. implemented with a @code{define_expand}, should be similar to the
  1598. @samp{mov@var{m}} patterns, except that operand 2 is the scratch
  1599. register. 
  1600.  
  1601. Define constraints for the reload register and scratch register that
  1602. contain a single register class.  If the original reload register (whose
  1603. class is @var{class}) can meet the constraint given in the pattern, the
  1604. value returned by these macros is used for the class of the scratch
  1605. register.  Otherwise, two additional reload registers are required.
  1606. Their classes are obtained from the constraints in the insn pattern.
  1607.  
  1608. @var{x} might be a pseudo-register or a @code{subreg} of a
  1609. pseudo-register, which could either be in a hard register or in memory.
  1610. Use @code{true_regnum} to find out; it will return -1 if the pseudo is
  1611. in memory and the hard register number if it is in a register.
  1612.  
  1613. These macros should not be used in the case where a particular class of
  1614. registers can only be copied to memory and not to another class of
  1615. registers.  In that case, secondary reload registers are not needed and
  1616. would not be helpful.  Instead, a stack location must be used to perform
  1617. the copy and the @code{mov@var{m}} pattern should use memory as a
  1618. intermediate storage.  This case often occurs between floating-point and
  1619. general registers.
  1620.  
  1621. @findex SECONDARY_MEMORY_NEEDED
  1622. @item SECONDARY_MEMORY_NEEDED (@var{class1}, @var{class2}, @var{m})
  1623. Certain machines have the property that some registers cannot be copied
  1624. to some other registers without using memory.  Define this macro on
  1625. those machines to be a C expression that is non-zero if objects of mode
  1626. @var{m} in registers of @var{class1} can only be copied to registers of
  1627. class @var{class2} by storing a register of @var{class1} into memory
  1628. and loading that memory location into a register of @var{class2}.
  1629.  
  1630. Do not define this macro if its value would always be zero. 
  1631.  
  1632. @findex SMALL_REGISTER_CLASSES
  1633. @item SMALL_REGISTER_CLASSES
  1634. Normally the compiler will avoid choosing spill registers from registers
  1635. that have been explicitly mentioned in the rtl (these registers are
  1636. normally those used to pass parameters and return values).  However,
  1637. some machines have so few registers of certain classes that there would
  1638. not be enough registers to use as spill registers if this were done.
  1639.  
  1640. On those machines, you should define @code{SMALL_REGISTER_CLASSES}.
  1641. When it is defined, the compiler allows registers explicitly used in the
  1642. rtl to be used as spill registers but prevents the compiler from
  1643. extending the lifetime of these registers.
  1644.  
  1645. Defining this macro is always safe, but unnecessarily defining this macro
  1646. will reduce the amount of optimizations that can be performed in some
  1647. cases.  If this macro is not defined but needs to be, the compiler will
  1648. run out of reload registers and print a fatal error message.
  1649.  
  1650. For most machines, this macro should not be defined.
  1651.  
  1652. @findex CLASS_MAX_NREGS
  1653. @item CLASS_MAX_NREGS (@var{class}, @var{mode})
  1654. A C expression for the maximum number of consecutive registers
  1655. of class @var{class} needed to hold a value of mode @var{mode}.
  1656.  
  1657. This is closely related to the macro @code{HARD_REGNO_NREGS}.
  1658. In fact, the value of the macro @code{CLASS_MAX_NREGS (@var{class}, @var{mode})}
  1659. should be the maximum value of @code{HARD_REGNO_NREGS (@var{regno}, @var{mode})}
  1660. for all @var{regno} values in the class @var{class}.
  1661.  
  1662. This macro helps control the handling of multiple-word values
  1663. in the reload pass.
  1664. @end table
  1665.  
  1666. Three other special macros describe which operands fit which constraint
  1667. letters.
  1668.  
  1669. @table @code
  1670. @findex CONST_OK_FOR_LETTER_P
  1671. @item CONST_OK_FOR_LETTER_P (@var{value}, @var{c})
  1672. A C expression that defines the machine-dependent operand constraint letters
  1673. that specify particular ranges of integer values.  If @var{c} is one
  1674. of those letters, the expression should check that @var{value}, an integer,
  1675. is in the appropriate range and return 1 if so, 0 otherwise.  If @var{c} is
  1676. not one of those letters, the value should be 0 regardless of @var{value}.
  1677.  
  1678. @findex CONST_DOUBLE_OK_FOR_LETTER_P
  1679. @item CONST_DOUBLE_OK_FOR_LETTER_P (@var{value}, @var{c})
  1680. A C expression that defines the machine-dependent operand constraint
  1681. letters that specify particular ranges of @code{const_double} values.
  1682.  
  1683. If @var{c} is one of those letters, the expression should check that
  1684. @var{value}, an RTX of code @code{const_double}, is in the appropriate
  1685. range and return 1 if so, 0 otherwise.  If @var{c} is not one of those
  1686. letters, the value should be 0 regardless of @var{value}.
  1687.  
  1688. @code{const_double} is used for all floating-point constants and for
  1689. @code{DImode} fixed-point constants.  A given letter can accept either
  1690. or both kinds of values.  It can use @code{GET_MODE} to distinguish
  1691. between these kinds.
  1692.  
  1693. @findex EXTRA_CONSTRAINT
  1694. @item EXTRA_CONSTRAINT (@var{value}, @var{c})
  1695. A C expression that defines the optional machine-dependent constraint
  1696. letters that can be used to segregate specific types of operands,
  1697. usually memory references, for the target machine.  Normally this macro
  1698. will not be defined.  If it is required for a particular target machine,
  1699. it should return 1 if @var{value} corresponds to the operand type
  1700. represented by the constraint letter @var{c}.  If @var{c} is not defined
  1701. as an extra constraint, the value returned should be 0 regardless of
  1702. @var{value}.
  1703.  
  1704. For example, on the ROMP, load instructions cannot have their output in r0 if
  1705. the memory reference contains a symbolic address.  Constraint letter
  1706. @samp{Q} is defined as representing a memory address that does
  1707. @emph{not} contain a symbolic address.  An alternative is specified with
  1708. a @samp{Q} constraint on the input and @samp{r} on the output.  The next
  1709. alternative specifies @samp{m} on the input and a register class that
  1710. does not include r0 on the output.
  1711. @end table
  1712.  
  1713. @node Stack and Calling
  1714. @section Describing Stack Layout and Calling Conventions
  1715. @cindex calling conventions
  1716.  
  1717. @menu
  1718. * Frame Layout::
  1719. * Frame Registers::
  1720. * Elimination::            
  1721. * Stack Arguments::
  1722. * Register Arguments::
  1723. * Scalar Return::
  1724. * Aggregate Return::
  1725. * Caller Saves::
  1726. * Function Entry::
  1727. * Profiling::
  1728. @end menu
  1729.  
  1730. @node Frame Layout
  1731. @subsection Basic Stack Layout
  1732. @cindex stack frame layout
  1733. @cindex frame layout
  1734.  
  1735. @table @code
  1736. @findex STACK_GROWS_DOWNWARD
  1737. @item STACK_GROWS_DOWNWARD
  1738. Define this macro if pushing a word onto the stack moves the stack
  1739. pointer to a smaller address.
  1740.  
  1741. When we say, ``define this macro if @dots{},'' it means that the
  1742. compiler checks this macro only with @code{#ifdef} so the precise
  1743. definition used does not matter.
  1744.  
  1745. @findex FRAME_GROWS_DOWNWARD
  1746. @item FRAME_GROWS_DOWNWARD
  1747. Define this macro if the addresses of local variable slots are at negative
  1748. offsets from the frame pointer.
  1749.  
  1750. @findex ARGS_GROW_DOWNWARD
  1751. @item ARGS_GROW_DOWNWARD
  1752. Define this macro if successive arguments to a function occupy decreasing
  1753. addresses on the stack.
  1754.  
  1755. @findex STARTING_FRAME_OFFSET
  1756. @item STARTING_FRAME_OFFSET
  1757. Offset from the frame pointer to the first local variable slot to be allocated.
  1758.  
  1759. If @code{FRAME_GROWS_DOWNWARD}, the next slot's offset is found by
  1760. subtracting the length of the first slot from @code{STARTING_FRAME_OFFSET}.
  1761. Otherwise, it is found by adding the length of the first slot to
  1762. the value @code{STARTING_FRAME_OFFSET}.
  1763.  
  1764. @findex STACK_POINTER_OFFSET
  1765. @item STACK_POINTER_OFFSET
  1766. Offset from the stack pointer register to the first location at which
  1767. outgoing arguments are placed.  If not specified, the default value of
  1768. zero is used.  This is the proper value for most machines.
  1769.  
  1770. If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
  1771. the first location at which outgoing arguments are placed.
  1772.  
  1773. @findex FIRST_PARM_OFFSET
  1774. @item FIRST_PARM_OFFSET (@var{fundecl})
  1775. Offset from the argument pointer register to the first argument's
  1776. address.  On some machines it may depend on the data type of the
  1777. function. 
  1778.  
  1779. If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
  1780. the first argument's address.
  1781.  
  1782. @findex STACK_DYNAMIC_OFFSET
  1783. @item STACK_DYNAMIC_OFFSET (@var{fundecl})
  1784. Offset from the stack pointer register to an item dynamically allocated
  1785. on the stack, e.g., by @code{alloca}.
  1786.  
  1787. The default value for this macro is @code{STACK_POINTER_OFFSET} plus the
  1788. length of the outgoing arguments.  The default is correct for most
  1789. machines.  See @file{function.c} for details.
  1790.  
  1791. @findex DYNAMIC_CHAIN_ADDRESS
  1792. @item DYNAMIC_CHAIN_ADDRESS (@var{frameaddr})
  1793. A C expression whose value is RTL representing the address in a stack
  1794. frame where the pointer to the caller's frame is stored.  Assume that
  1795. @var{frameaddr} is an RTL expression for the address of the stack frame
  1796. itself.
  1797.  
  1798. If you don't define this macro, the default is to return the value
  1799. of @var{frameaddr}---that is, the stack frame address is also the
  1800. address of the stack word that points to the previous frame.
  1801. @end table
  1802.  
  1803. @node Frame Registers
  1804. @subsection Registers That Address the Stack Frame 
  1805.  
  1806. @table @code
  1807. @findex STACK_POINTER_REGNUM
  1808. @item STACK_POINTER_REGNUM
  1809. The register number of the stack pointer register, which must also be a
  1810. fixed register according to @code{FIXED_REGISTERS}.  On most machines,
  1811. the hardware determines which register this is.
  1812.  
  1813. @findex FRAME_POINTER_REGNUM
  1814. @item FRAME_POINTER_REGNUM
  1815. The register number of the frame pointer register, which is used to
  1816. access automatic variables in the stack frame.  On some machines, the
  1817. hardware determines which register this is.  On other machines, you can
  1818. choose any register you wish for this purpose.
  1819.  
  1820. @findex ARG_POINTER_REGNUM
  1821. @item ARG_POINTER_REGNUM
  1822. The register number of the arg pointer register, which is used to access
  1823. the function's argument list.  On some machines, this is the same as the
  1824. frame pointer register.  On some machines, the hardware determines which
  1825. register this is.  On other machines, you can choose any register you
  1826. wish for this purpose.  If this is not the same register as the frame
  1827. pointer register, then you must mark it as a fixed register according to
  1828. @code{FIXED_REGISTERS}, or arrange to be able to eliminate it
  1829. (@pxref{Elimination}).
  1830.  
  1831. @findex STATIC_CHAIN_REGNUM
  1832. @findex STATIC_CHAIN_INCOMING_REGNUM
  1833. @item STATIC_CHAIN_REGNUM
  1834. @itemx STATIC_CHAIN_INCOMING_REGNUM
  1835. Register numbers used for passing a function's static chain
  1836. pointer.  If register windows are used, @code{STATIC_CHAIN_INCOMING_REGNUM}
  1837. is the register number as seen by the called function, while
  1838. @code{STATIC_CHAIN_REGNUM} is the register number as seen by the calling
  1839. function.  If these registers are the same,
  1840. @code{STATIC_CHAIN_INCOMING_REGNUM} need not be defined.@refill
  1841.  
  1842. The static chain register need not be a fixed register.
  1843.  
  1844. If the static chain is passed in memory, these macros should not be
  1845. defined; instead, the next two macros should be defined.
  1846.  
  1847. @findex STATIC_CHAIN
  1848. @findex STATIC_CHAIN_INCOMING
  1849. @item STATIC_CHAIN
  1850. @itemx STATIC_CHAIN_INCOMING
  1851. If the static chain is passed in memory, these macros provide rtx giving
  1852. @code{mem} expressions that denote where they are stored.
  1853. @code{STATIC_CHAIN} and @code{STATIC_CHAIN_INCOMING} give the locations
  1854. as seen by the calling and called functions, respectively.  Often the former
  1855. will be at an offset from the stack pointer and the latter at an offset from
  1856. the frame pointer.@refill
  1857.  
  1858. @findex stack_pointer_rtx
  1859. @findex frame_pointer_rtx
  1860. @findex arg_pointer_rtx
  1861. The variables @code{stack_pointer_rtx}, @code{frame_pointer_rtx}, and
  1862. @code{arg_pointer_rtx} will have been initialized prior to the use of these
  1863. macros and should be used to refer to those items.
  1864.  
  1865. If the static chain is passed in a register, the two previous macros should
  1866. be defined instead.
  1867. @end table
  1868.  
  1869. @node Elimination
  1870. @subsection Eliminating Frame Pointer and Arg Pointer
  1871.  
  1872. @table @code
  1873. @findex FRAME_POINTER_REQUIRED
  1874. @item FRAME_POINTER_REQUIRED
  1875. A C expression which is nonzero if a function must have and use a frame
  1876. pointer.  This expression is evaluated  in the reload pass.  If its value is
  1877. nonzero the function will have a frame pointer.
  1878.  
  1879. The expression can in principle examine the current function and decide
  1880. according to the facts, but on most machines the constant 0 or the
  1881. constant 1 suffices.  Use 0 when the machine allows code to be generated
  1882. with no frame pointer, and doing so saves some time or space.  Use 1
  1883. when there is no possible advantage to avoiding a frame pointer.
  1884.  
  1885. In certain cases, the compiler does not know how to produce valid code
  1886. without a frame pointer.  The compiler recognizes those cases and
  1887. automatically gives the function a frame pointer regardless of what
  1888. @code{FRAME_POINTER_REQUIRED} says.  You don't need to worry about
  1889. them.@refill
  1890.  
  1891. In a function that does not require a frame pointer, the frame pointer
  1892. register can be allocated for ordinary usage, unless you mark it as a
  1893. fixed register.  See @code{FIXED_REGISTERS} for more information.
  1894.  
  1895. This macro is ignored and need not be defined if @code{ELIMINABLE_REGS}
  1896. is defined.
  1897.  
  1898. @findex INITIAL_FRAME_POINTER_OFFSET
  1899. @findex get_frame_size
  1900. @item INITIAL_FRAME_POINTER_OFFSET (@var{depth-var})
  1901. A C statement to store in the variable @var{depth-var} the difference
  1902. between the frame pointer and the stack pointer values immediately after
  1903. the function prologue.  The value would be computed from information
  1904. such as the result of @code{get_frame_size ()} and the tables of
  1905. registers @code{regs_ever_live} and @code{call_used_regs}.
  1906.  
  1907. If @code{ELIMINABLE_REGS} is defined, this macro will be not be used and
  1908. need not be defined.  Otherwise, it must be defined even if
  1909. @code{FRAME_POINTER_REQUIRED} is defined to always be true; in that
  1910. case, you may set @var{depth-var} to anything.
  1911.  
  1912. @findex ELIMINABLE_REGS
  1913. @item ELIMINABLE_REGS
  1914. If defined, this macro specifies a table of register pairs used to
  1915. eliminate unneeded registers that point into the stack frame.  If it is not
  1916. defined, the only elimination attempted by the compiler is to replace
  1917. references to the frame pointer with references to the stack pointer.
  1918.  
  1919. The definition of this macro is a list of structure initializations, each
  1920. of which specifies an original and replacement register.
  1921.  
  1922. On some machines, the position of the argument pointer is not known until
  1923. the compilation is completed.  In such a case, a separate hard register
  1924. must be used for the argument pointer.  This register can be eliminated by
  1925. replacing it with either the frame pointer or the argument pointer,
  1926. depending on whether or not the frame pointer has been eliminated.
  1927.  
  1928. In this case, you might specify:
  1929. @example
  1930. #define ELIMINABLE_REGS  \
  1931. @{@{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM@}, \
  1932.  @{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM@}, \
  1933.  @{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM@}@}
  1934. @end example
  1935.  
  1936. Note that the elimination of the argument pointer with the stack pointer is
  1937. specified first since that is the preferred elimination.
  1938.  
  1939. @findex CAN_ELIMINATE
  1940. @item CAN_ELIMINATE (@var{from-reg}, @var{to-reg})
  1941. A C expression that returns non-zero if the compiler is allowed to try
  1942. to replace register number @var{from-reg} with register number
  1943. @var{to-reg}.  This macro need only be defined if @code{ELIMINABLE_REGS}
  1944. is defined, and will usually be the constant 1, since most of the cases
  1945. preventing register elimination are things that the compiler already
  1946. knows about.
  1947.  
  1948. @findex INITIAL_ELIMINATION_OFFSET
  1949. @item INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var})
  1950. This macro is similar to @code{INITIAL_FRAME_POINTER_OFFSET}.  It
  1951. specifies the initial difference between the specified pair of
  1952. registers.  This macro must be defined if @code{ELIMINABLE_REGS} is
  1953. defined.
  1954.  
  1955. @findex LONGJMP_RESTORE_FROM_STACK
  1956. @item LONGJMP_RESTORE_FROM_STACK
  1957. Define this macro if the @code{longjmp} function restores registers from
  1958. the stack frames, rather than from those saved specifically by
  1959. @code{setjmp}.  Certain quantities must not be kept in registers across
  1960. a call to @code{setjmp} on such machines.
  1961. @end table
  1962.  
  1963. @node Stack Arguments
  1964. @subsection Passing Function Arguments on the Stack
  1965. @cindex arguments on stack
  1966. @cindex stack arguments
  1967.  
  1968. The macros in this section control how arguments are passed
  1969. on the stack.  See the following section for other macros that
  1970. control passing certain arguments in registers.
  1971.  
  1972. @table @code
  1973. @findex PROMOTE_PROTOTYPES
  1974. @item PROMOTE_PROTOTYPES
  1975. Define this macro if an argument declared as @code{char} or
  1976. @code{short} in a prototype should actually be passed as an
  1977. @code{int}.  In addition to avoiding errors in certain cases of
  1978. mismatch, it also makes for better code on certain machines.
  1979.  
  1980. @findex PUSH_ROUNDING
  1981. @item PUSH_ROUNDING (@var{npushed})
  1982. A C expression that is the number of bytes actually pushed onto the
  1983. stack when an instruction attempts to push @var{npushed} bytes.
  1984.  
  1985. If the target machine does not have a push instruction, do not define
  1986. this macro.  That directs GNU CC to use an alternate strategy: to
  1987. allocate the entire argument block and then store the arguments into
  1988. it.
  1989.  
  1990. On some machines, the definition
  1991.  
  1992. @example
  1993. #define PUSH_ROUNDING(BYTES) (BYTES)
  1994. @end example
  1995.  
  1996. @noindent
  1997. will suffice.  But on other machines, instructions that appear
  1998. to push one byte actually push two bytes in an attempt to maintain
  1999. alignment.  Then the definition should be
  2000.  
  2001. @example
  2002. #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
  2003. @end example
  2004.  
  2005. @findex ACCUMULATE_OUTGOING_ARGS
  2006. @findex current_function_outgoing_args_size
  2007. @item ACCUMULATE_OUTGOING_ARGS
  2008. If defined, the maximum amount of space required for outgoing arguments
  2009. will be computed and placed into the variable
  2010. @code{current_function_outgoing_args_size}.  No space will be pushed
  2011. onto the stack for each call; instead, the function prologue should
  2012. increase the stack frame size by this amount.
  2013.  
  2014. It is not proper to define both @code{PUSH_ROUNDING} and
  2015. @code{ACCUMULATE_OUTGOING_ARGS}.
  2016.  
  2017. @findex REG_PARM_STACK_SPACE
  2018. @item REG_PARM_STACK_SPACE (@var{fndecl})
  2019. Define this macro if functions should assume that stack space has been
  2020. allocated for arguments even when their values are passed in
  2021. registers.
  2022.  
  2023. The value of this macro is the size, in bytes, of the area reserved for
  2024. arguments passed in registers for the function represented by @var{fndecl}.
  2025.  
  2026. This space can either be allocated by the caller or be a part of the
  2027. machine-dependent stack frame: @code{OUTGOING_REG_PARM_STACK_SPACE}
  2028. says which.
  2029.  
  2030. @findex MAYBE_REG_PARM_STACK_SPACE
  2031. @findex FINAL_REG_PARM_STACK_SPACE
  2032. @item MAYBE_REG_PARM_STACK_SPACE
  2033. @item FINAL_REG_PARM_STACK_SPACE (@var{const_size}, @var{var_size})
  2034. Define these macros in addition to the one above if functions might
  2035. allocate stack space for arguments even when their values are passed
  2036. in registers.  These should be used when the stack space allocated
  2037. for arguments in registers is not a simple constant independent of the
  2038. function declaration.
  2039.  
  2040. The value of the first macro is the size, in bytes, of the area that
  2041. we should initially assume would be reserved for arguments passed in registers.
  2042.  
  2043. The value of the second macro is the actual size, in bytes, of the area
  2044. that will be reserved for arguments passed in registers.  This takes two
  2045. arguments: an integer representing the number of bytes of fixed sized
  2046. arguments on the stack, and a tree representing the number of bytes of
  2047. variable sized arguments on the stack.
  2048.  
  2049. When these macros are defined, @code{REG_PARM_STACK_SPACE} will only be
  2050. called for libcall functions, the current function, or for a function
  2051. being called when it is known that such stack space must be allocated.
  2052. In each case this value can be easily computed.
  2053.  
  2054. When deciding whether a called function needs such stack space, and how
  2055. much space to reserve, GNU CC uses these two macros instead of
  2056. @code{REG_PARM_STACK_SPACE}.
  2057.  
  2058. @findex OUTGOING_REG_PARM_STACK_SPACE
  2059. @item OUTGOING_REG_PARM_STACK_SPACE
  2060. Define this if it is the responsibility of the caller to allocate the area
  2061. reserved for arguments passed in registers.
  2062.  
  2063. If @code{ACCUMULATE_OUTGOING_ARGS} is defined, this macro controls
  2064. whether the space for these arguments counts in the value of
  2065. @code{current_function_outgoing_args_size}.
  2066.  
  2067. @findex STACK_PARMS_IN_REG_PARM_AREA
  2068. @item STACK_PARMS_IN_REG_PARM_AREA
  2069. Define this macro if @code{REG_PARM_STACK_SPACE} is defined but stack
  2070. parameters don't skip the area specified by @code{REG_PARM_STACK_SPACE}.
  2071.  
  2072. Normally, when a parameter is not passed in registers, it is placed on the
  2073. stack beyond the @code{REG_PARM_STACK_SPACE} area.  Defining this macro
  2074. suppresses this behavior and causes the parameter to be passed on the
  2075. stack in its natural location.
  2076.  
  2077. @findex RETURN_POPS_ARGS
  2078. @item RETURN_POPS_ARGS (@var{funtype}, @var{stack-size})
  2079. A C expression that should indicate the number of bytes of its own
  2080. arguments that a function pops on returning, or 0 if the
  2081. function pops no arguments and the caller must therefore pop them all
  2082. after the function returns.
  2083.  
  2084. @var{funtype} is a C variable whose value is a tree node that
  2085. describes the function in question.  Normally it is a node of type
  2086. @code{FUNCTION_TYPE} that describes the data type of the function.
  2087. From this it is possible to obtain the data types of the value and
  2088. arguments (if known).
  2089.  
  2090. When a call to a library function is being considered, @var{funtype}
  2091. will contain an identifier node for the library function.  Thus, if
  2092. you need to distinguish among various library functions, you can do so
  2093. by their names.  Note that ``library function'' in this context means
  2094. a function used to perform arithmetic, whose name is known specially
  2095. in the compiler and was not mentioned in the C code being compiled.
  2096.  
  2097. @var{stack-size} is the number of bytes of arguments passed on the
  2098. stack.  If a variable number of bytes is passed, it is zero, and
  2099. argument popping will always be the responsibility of the calling function.
  2100.  
  2101. On the Vax, all functions always pop their arguments, so the definition
  2102. of this macro is @var{stack-size}.  On the 68000, using the standard
  2103. calling convention, no functions pop their arguments, so the value of
  2104. the macro is always 0 in this case.  But an alternative calling
  2105. convention is available in which functions that take a fixed number of
  2106. arguments pop them but other functions (such as @code{printf}) pop
  2107. nothing (the caller pops all).  When this convention is in use,
  2108. @var{funtype} is examined to determine whether a function takes a fixed
  2109. number of arguments.
  2110. @end table
  2111.  
  2112. @node Register Arguments
  2113. @subsection Passing Arguments in Registers
  2114. @cindex arguments in registers
  2115. @cindex registers arguments
  2116.  
  2117. This section describes the macros which let you control how various
  2118. types of arguments are passed in registers or how they are arranged in
  2119. the stack.
  2120.  
  2121. @table @code
  2122. @findex FUNCTION_ARG
  2123. @item FUNCTION_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
  2124. A C expression that controls whether a function argument is passed
  2125. in a register, and which register.
  2126.  
  2127. The arguments are @var{cum}, which summarizes all the previous
  2128. arguments; @var{mode}, the machine mode of the argument; @var{type},
  2129. the data type of the argument as a tree node or 0 if that is not known
  2130. (which happens for C support library functions); and @var{named},
  2131. which is 1 for an ordinary argument and 0 for nameless arguments that
  2132. correspond to @samp{@dots{}} in the called function's prototype.
  2133.  
  2134. The value of the expression should either be a @code{reg} RTX for the
  2135. hard register in which to pass the argument, or zero to pass the
  2136. argument on the stack.
  2137.  
  2138. For machines like the Vax and 68000, where normally all arguments are
  2139. pushed, zero suffices as a definition.
  2140.  
  2141. @cindex @file{stdarg.h} and register arguments
  2142. The usual way to make the ANSI library @file{stdarg.h} work on a machine
  2143. where some arguments are usually passed in registers, is to cause
  2144. nameless arguments to be passed on the stack instead.  This is done
  2145. by making @code{FUNCTION_ARG} return 0 whenever @var{named} is 0.
  2146.  
  2147. @cindex @code{MUST_PASS_IN_STACK}, and @code{FUNCTION_ARG}
  2148. @cindex @code{REG_PARM_STACK_SPACE}, and @code{FUNCTION_ARG}
  2149. You may use the macro @code{MUST_PASS_IN_STACK (@var{mode}, @var{type})}
  2150. in the definition of this macro to determine if this argument is of a
  2151. type that must be passed in the stack.  If @code{REG_PARM_STACK_SPACE}
  2152. is not defined and @code{FUNCTION_ARG} returns non-zero for such an
  2153. argument, the compiler will abort.  If @code{REG_PARM_STACK_SPACE} is
  2154. defined, the argument will be computed in the stack and then loaded into
  2155. a register.
  2156.  
  2157. @findex FUNCTION_INCOMING_ARG
  2158. @item FUNCTION_INCOMING_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
  2159. Define this macro if the target machine has ``register windows'', so
  2160. that the register in which a function sees an arguments is not
  2161. necessarily the same as the one in which the caller passed the
  2162. argument.
  2163.  
  2164. For such machines, @code{FUNCTION_ARG} computes the register in which
  2165. the caller passes the value, and @code{FUNCTION_INCOMING_ARG} should
  2166. be defined in a similar fashion to tell the function being called
  2167. where the arguments will arrive.
  2168.  
  2169. If @code{FUNCTION_INCOMING_ARG} is not defined, @code{FUNCTION_ARG}
  2170. serves both purposes.@refill
  2171.  
  2172. @findex FUNCTION_ARG_PARTIAL_NREGS
  2173. @item FUNCTION_ARG_PARTIAL_NREGS (@var{cum}, @var{mode}, @var{type}, @var{named})
  2174. A C expression for the number of words, at the beginning of an
  2175. argument, must be put in registers.  The value must be zero for
  2176. arguments that are passed entirely in registers or that are entirely
  2177. pushed on the stack.
  2178.  
  2179. On some machines, certain arguments must be passed partially in
  2180. registers and partially in memory.  On these machines, typically the
  2181. first @var{n} words of arguments are passed in registers, and the rest
  2182. on the stack.  If a multi-word argument (a @code{double} or a
  2183. structure) crosses that boundary, its first few words must be passed
  2184. in registers and the rest must be pushed.  This macro tells the
  2185. compiler when this occurs, and how many of the words should go in
  2186. registers.
  2187.  
  2188. @code{FUNCTION_ARG} for these arguments should return the first
  2189. register to be used by the caller for this argument; likewise
  2190. @code{FUNCTION_INCOMING_ARG}, for the called function.
  2191.  
  2192. @findex FUNCTION_ARG_PASS_BY_REFERENCE
  2193. @item FUNCTION_ARG_PASS_BY_REFERENCE (@var{cum}, @var{mode}, @var{type}, @var{named})
  2194. A C expression that indicates when an argument must be passed by reference.
  2195. If nonzero for an argument, a copy of that argument is made in memory and a
  2196. pointer to the argument is passed instead of the argument itself.
  2197. The pointer is passed in whatever way is appropriate for passing a pointer
  2198. to that type.
  2199.  
  2200. On machines where @code{REG_PARM_STACK_SPACE} is not defined, a suitable
  2201. definition of this macro might be
  2202. @example
  2203. #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED)  \
  2204.   MUST_PASS_IN_STACK (MODE, TYPE)
  2205. @end example
  2206.  
  2207. @findex CUMULATIVE_ARGS
  2208. @item CUMULATIVE_ARGS
  2209. A C type for declaring a variable that is used as the first argument of
  2210. @code{FUNCTION_ARG} and other related values.  For some target machines,
  2211. the type @code{int} suffices and can hold the number of bytes of
  2212. argument so far.
  2213.  
  2214. There is no need to record in @code{CUMULATIVE_ARGS} anything about the
  2215. arguments that have been passed on the stack.  The compiler has other
  2216. variables to keep track of that.  For target machines on which all
  2217. arguments are passed on the stack, there is no need to store anything in
  2218. @code{CUMULATIVE_ARGS}; however, the data structure must exist and
  2219. should not be empty, so use @code{int}.
  2220.  
  2221. @findex INIT_CUMULATIVE_ARGS
  2222. @item INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname})
  2223. A C statement (sans semicolon) for initializing the variable @var{cum}
  2224. for the state at the beginning of the argument list.  The variable has
  2225. type @code{CUMULATIVE_ARGS}.  The value of @var{fntype} is the tree node
  2226. for the data type of the function which will receive the args, or 0
  2227. if the args are to a compiler support library function.
  2228.  
  2229. When processing a call to a compiler support library function,
  2230. @var{libname} identifies which one.  It is a @code{symbol_ref} rtx which
  2231. contains the name of the function, as a string.  @var{libname} is 0 when
  2232. an ordinary C function call is being processed.  Thus, each time this
  2233. macro is called, either @var{libname} or @var{fntype} is nonzero, but
  2234. never both of them at once.
  2235.  
  2236. @findex INIT_CUMULATIVE_INCOMING_ARGS
  2237. @item INIT_CUMULATIVE_INCOMING_ARGS (@var{cum}, @var{fntype}, @var{libname})
  2238. Like @code{INIT_CUMULATIVE_ARGS} but overrides it for the purposes of
  2239. finding the arguments for the function being compiled.  If this macro is
  2240. undefined, @code{INIT_CUMULATIVE_ARGS} is used instead.
  2241.  
  2242. The argument @var{libname} exists for symmetry with
  2243. @code{INIT_CUMULATIVE_ARGS}.  The value passed for @var{libname} is
  2244. always 0, since library routines with special calling conventions are
  2245. never compiled with GNU CC.
  2246.  
  2247. @findex FUNCTION_ARG_ADVANCE
  2248. @item FUNCTION_ARG_ADVANCE (@var{cum}, @var{mode}, @var{type}, @var{named})
  2249. A C statement (sans semicolon) to update the summarizer variable
  2250. @var{cum} to advance past an argument in the argument list.  The
  2251. values @var{mode}, @var{type} and @var{named} describe that argument.
  2252. Once this is done, the variable @var{cum} is suitable for analyzing
  2253. the @emph{following} argument with @code{FUNCTION_ARG}, etc.@refill
  2254.  
  2255. This macro need not do anything if the argument in question was passed
  2256. on the stack.  The compiler knows how to track the amount of stack space
  2257. used for arguments without any special help.
  2258.  
  2259. @findex FUNCTION_ARG_PADDING
  2260. @item FUNCTION_ARG_PADDING (@var{mode}, @var{type})
  2261. If defined, a C expression which determines whether, and in which direction,
  2262. to pad out an argument with extra space.  The value should be of type
  2263. @code{enum direction}: either @code{upward} to pad above the argument,
  2264. @code{downward} to pad below, or @code{none} to inhibit padding.
  2265.  
  2266. This macro does not control the @emph{amount} of padding; that is
  2267. always just enough to reach the next multiple of @code{FUNCTION_ARG_BOUNDARY}.
  2268.  
  2269. This macro has a default definition which is right for most systems.
  2270. For little-endian machines, the default is to pad upward.  For
  2271. big-endian machines, the default is to pad downward for an argument of
  2272. constant size shorter than an @code{int}, and upward otherwise.
  2273.  
  2274. @findex FUNCTION_ARG_BOUNDARY
  2275. @item FUNCTION_ARG_BOUNDARY (@var{mode}, @var{type})
  2276. If defined, a C expression that gives the alignment boundary, in bits,
  2277. of an argument with the specified mode and type.  If it is not defined, 
  2278. @code{PARM_BOUNDARY} is used for all arguments.
  2279.  
  2280. @findex FUNCTION_ARG_REGNO_P
  2281. @item FUNCTION_ARG_REGNO_P (@var{regno})
  2282. A C expression that is nonzero if @var{regno} is the number of a hard
  2283. register in which function arguments are sometimes passed.  This does
  2284. @emph{not} include implicit arguments such as the static chain and
  2285. the structure-value address.  On many machines, no registers can be
  2286. used for this purpose since all function arguments are pushed on the
  2287. stack.
  2288. @end table
  2289.  
  2290. @node Scalar Return
  2291. @subsection How Scalar Function Values Are Returned
  2292. @cindex return values in registers
  2293. @cindex values, returned by functions
  2294. @cindex scalars, returned as values
  2295.  
  2296. This section discusses the macros that control returning scalars as
  2297. values---values that can fit in registers.
  2298.  
  2299. @table @code
  2300. @findex TRADITIONAL_RETURN_FLOAT
  2301. @item TRADITIONAL_RETURN_FLOAT
  2302. Define this macro if @samp{-traditional} should not cause functions 
  2303. declared to return @code{float} to convert the value to @code{double}.
  2304.  
  2305. @findex FUNCTION_VALUE
  2306. @item FUNCTION_VALUE (@var{valtype}, @var{func})
  2307. A C expression to create an RTX representing the place where a
  2308. function returns a value of data type @var{valtype}.  @var{valtype} is
  2309. a tree node representing a data type.  Write @code{TYPE_MODE
  2310. (@var{valtype})} to get the machine mode used to represent that type.
  2311. On many machines, only the mode is relevant.  (Actually, on most
  2312. machines, scalar values are returned in the same place regardless of
  2313. mode).@refill
  2314.  
  2315. If @code{PROMOTE_FUNCTION_RETURN} is defined, you must apply the same
  2316. promotion rules specified in @code{PROMOTE_MODE} if @var{valtype} is a
  2317. scalar type.
  2318.  
  2319. If the precise function being called is known, @var{func} is a tree
  2320. node (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null
  2321. pointer.  This makes it possible to use a different value-returning
  2322. convention for specific functions when all their calls are
  2323. known.@refill
  2324.  
  2325. @code{FUNCTION_VALUE} is not used for return vales with aggregate data
  2326. types, because these are returned in another way.  See
  2327. @code{STRUCT_VALUE_REGNUM} and related macros, below.
  2328.  
  2329. @findex FUNCTION_OUTGOING_VALUE
  2330. @item FUNCTION_OUTGOING_VALUE (@var{valtype}, @var{func})
  2331. Define this macro if the target machine has ``register windows''
  2332. so that the register in which a function returns its value is not
  2333. the same as the one in which the caller sees the value.
  2334.  
  2335. For such machines, @code{FUNCTION_VALUE} computes the register in
  2336. which the caller will see the value, and
  2337. @code{FUNCTION_OUTGOING_VALUE} should be defined in a similar fashion
  2338. to tell the function where to put the value.@refill
  2339.  
  2340. If @code{FUNCTION_OUTGOING_VALUE} is not defined,
  2341. @code{FUNCTION_VALUE} serves both purposes.@refill
  2342.  
  2343. @code{FUNCTION_OUTGOING_VALUE} is not used for return vales with
  2344. aggregate data types, because these are returned in another way.  See
  2345. @code{STRUCT_VALUE_REGNUM} and related macros, below.
  2346.  
  2347. @findex LIBCALL_VALUE
  2348. @item LIBCALL_VALUE (@var{mode})
  2349. A C expression to create an RTX representing the place where a library
  2350. function returns a value of mode @var{mode}.  If the precise function
  2351. being called is known, @var{func} is a tree node
  2352. (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null
  2353. pointer.  This makes it possible to use a different value-returning
  2354. convention for specific functions when all their calls are
  2355. known.@refill
  2356.  
  2357. Note that ``library function'' in this context means a compiler
  2358. support routine, used to perform arithmetic, whose name is known
  2359. specially by the compiler and was not mentioned in the C code being
  2360. compiled.
  2361.  
  2362. The definition of @code{LIBRARY_VALUE} need not be concerned aggregate
  2363. data types, because none of the library functions returns such types.
  2364.  
  2365. @findex FUNCTION_VALUE_REGNO_P
  2366. @item FUNCTION_VALUE_REGNO_P (@var{regno})
  2367. A C expression that is nonzero if @var{regno} is the number of a hard
  2368. register in which the values of called function may come back.
  2369.  
  2370. A register whose use for returning values is limited to serving as the
  2371. second of a pair (for a value of type @code{double}, say) need not be
  2372. recognized by this macro.  So for most machines, this definition
  2373. suffices:
  2374.  
  2375. @example
  2376. #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
  2377. @end example
  2378.  
  2379. If the machine has register windows, so that the caller and the called
  2380. function use different registers for the return value, this macro
  2381. should recognize only the caller's register numbers.
  2382. @end table
  2383.  
  2384. @node Aggregate Return
  2385. @subsection How Large Values Are Returned
  2386. @cindex aggregates as return values
  2387. @cindex large return values
  2388. @cindex returning aggregate values
  2389. @cindex structure value address
  2390.  
  2391. When a function value's mode is @code{BLKmode} (and in some other
  2392. cases), the value is not returned according to @code{FUNCTION_VALUE}
  2393. (@pxref{Scalar Return}).  Instead, the caller passes the address of a
  2394. block of memory in which the value should be stored.  This address
  2395. is called the @dfn{structure value address}.
  2396.  
  2397. This section describes how to control returning structure values in
  2398. memory.
  2399.  
  2400. @table @code
  2401. @findex RETURN_IN_MEMORY
  2402. @item RETURN_IN_MEMORY (@var{type})
  2403. A C expression which can inhibit the returning of certain function
  2404. values in registers, based on the type of value.  A nonzero value says
  2405. to return the function value in memory, just as large structures are
  2406. always returned.  Here @var{type} will be a C expression of type
  2407. @code{tree}, representing the data type of the value.
  2408.  
  2409. Note that values of mode @code{BLKmode} are returned in memory
  2410. regardless of this macro.  Also, the option @samp{-fpcc-struct-return}
  2411. takes effect regardless of this macro.  On most systems, it is
  2412. possible to leave the macro undefined; this causes a default
  2413. definition to be used, whose value is the constant 0.
  2414.  
  2415. @findex STRUCT_VALUE_REGNUM
  2416. @item STRUCT_VALUE_REGNUM
  2417. If the structure value address is passed in a register, then
  2418. @code{STRUCT_VALUE_REGNUM} should be the number of that register.
  2419.  
  2420. @findex STRUCT_VALUE
  2421. @item STRUCT_VALUE
  2422. If the structure value address is not passed in a register, define
  2423. @code{STRUCT_VALUE} as an expression returning an RTX for the place
  2424. where the address is passed.  If it returns 0, the address is passed as
  2425. an ``invisible'' first argument.
  2426.  
  2427. @findex STRUCT_VALUE_INCOMING_REGNUM
  2428. @item STRUCT_VALUE_INCOMING_REGNUM
  2429. On some architectures the place where the structure value address
  2430. is found by the called function is not the same place that the
  2431. caller put it.  This can be due to register windows, or it could
  2432. be because the function prologue moves it to a different place.
  2433.  
  2434. If the incoming location of the structure value address is in a
  2435. register, define this macro as the register number.
  2436.  
  2437. @findex STRUCT_VALUE_INCOMING
  2438. @item STRUCT_VALUE_INCOMING
  2439. If the incoming location is not a register, define
  2440. @code{STRUCT_VALUE_INCOMING} as an expression for an RTX for where the
  2441. called function should find the value.  If it should find the value on
  2442. the stack, define this to create a @code{mem} which refers to the frame
  2443. pointer.  A definition of 0 means that the address is passed as an
  2444. ``invisible'' first argument.
  2445.  
  2446. @findex PCC_STATIC_STRUCT_RETURN
  2447. @item PCC_STATIC_STRUCT_RETURN
  2448. Define this macro if the usual system convention on the target machine
  2449. for returning structures and unions is for the called function to return
  2450. the address of a static variable containing the value.  GNU CC does not
  2451. normally use this convention, even if it is the usual one, but does use
  2452. it if @samp{-fpcc-struct-return} is specified.
  2453.  
  2454. Do not define this if the usual system convention is for the caller to
  2455. pass an address to the subroutine.
  2456. @end table
  2457.  
  2458. @node Caller Saves
  2459. @subsection Caller-Saves Register Allocation
  2460.  
  2461. If you enable it, GNU CC can save registers around function calls.  This
  2462. makes it possible to use call-clobbered registers to hold variables that
  2463. must live across calls.
  2464.  
  2465. @table @code
  2466. @findex DEFAULT_CALLER_SAVES
  2467. @item DEFAULT_CALLER_SAVES
  2468. Define this macro if function calls on the target machine do not preserve
  2469. any registers; in other words, if @code{CALL_USED_REGISTERS} has 1
  2470. for all registers.  This macro enables @samp{-fcaller-saves} by default.
  2471. Eventually that option will be enabled by default on all machines and both
  2472. the option and this macro will be eliminated.
  2473.  
  2474. @findex CALLER_SAVE_PROFITABLE
  2475. @item CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
  2476. A C expression to determine whether it is worthwhile to consider placing
  2477. a pseudo-register in a call-clobbered hard register and saving and
  2478. restoring it around each function call.  The expression should be 1 when
  2479. this is worth doing, and 0 otherwise.
  2480.  
  2481. If you don't define this macro, a default is used which is good on most
  2482. machines: @code{4 * @var{calls} < @var{refs}}.
  2483. @end table
  2484.  
  2485. @node Function Entry
  2486. @subsection Function Entry and Exit
  2487. @cindex function entry and exit
  2488. @cindex prologue
  2489. @cindex epilogue
  2490.  
  2491. This section describes the macros that output function entry
  2492. (@dfn{prologue}) and exit (@dfn{epilogue}) code.
  2493.  
  2494. @table @code
  2495. @findex FUNCTION_PROLOGUE
  2496. @item FUNCTION_PROLOGUE (@var{file}, @var{size})
  2497. A C compound statement that outputs the assembler code for entry to a
  2498. function.  The prologue is responsible for setting up the stack frame,
  2499. initializing the frame pointer register, saving registers that must be
  2500. saved, and allocating @var{size} additional bytes of storage for the
  2501. local variables.  @var{size} is an integer.  @var{file} is a stdio
  2502. stream to which the assembler code should be output.
  2503.  
  2504. The label for the beginning of the function need not be output by this
  2505. macro.  That has already been done when the macro is run.
  2506.  
  2507. @findex regs_ever_live
  2508. To determine which registers to save, the macro can refer to the array
  2509. @code{regs_ever_live}: element @var{r} is nonzero if hard register
  2510. @var{r} is used anywhere within the function.  This implies the function
  2511. prologue should save register @var{r}, provided it is not one of the
  2512. call-used registers.  (@code{FUNCTION_EPILOGUE} must likewise use
  2513. @code{regs_ever_live}.)
  2514.  
  2515. On machines that have ``register windows'', the function entry code does
  2516. not save on the stack the registers that are in the windows, even if
  2517. they are supposed to be preserved by function calls; instead it takes
  2518. appropriate steps to ``push'' the register stack, if any non-call-used
  2519. registers are used in the function.
  2520.  
  2521. @findex frame_pointer_needed
  2522. On machines where functions may or may not have frame-pointers, the
  2523. function entry code must vary accordingly; it must set up the frame
  2524. pointer if one is wanted, and not otherwise.  To determine whether a
  2525. frame pointer is in wanted, the macro can refer to the variable
  2526. @code{frame_pointer_needed}.  The variable's value will be 1 at run
  2527. time in a function that needs a frame pointer.  @xref{Elimination}.
  2528.  
  2529. The function entry code is responsible for allocating any stack space
  2530. required for the function.  This stack space consists of the regions
  2531. listed below.  In most cases, these regions are allocated in the
  2532. order listed, with the last listed region closest to the top of the
  2533. stack (the lowest address if @code{STACK_GROWS_DOWNWARD} is defined, and
  2534. the highest address if it is not defined).  You can use a different order
  2535. for a machine if doing so is more convenient or required for
  2536. compatibility reasons.  Except in cases where required by standard
  2537. or by a debugger, there is no reason why the stack layout used by GCC
  2538. need agree with that used by other compilers for a machine.
  2539.  
  2540. @itemize @bullet
  2541. @item
  2542. @findex current_function_pretend_args_size
  2543. A region of @code{current_function_pretend_args_size} bytes of
  2544. uninitialized space just underneath the first argument arriving on the
  2545. stack.  (This may not be at the very start of the allocated stack region
  2546. if the calling sequence has pushed anything else since pushing the stack
  2547. arguments.  But usually, on such machines, nothing else has been pushed
  2548. yet, because the function prologue itself does all the pushing.)  This
  2549. region is used on machines where an argument may be passed partly in
  2550. registers and partly in memory, and, in some cases to support the
  2551. features in @file{varargs.h} and @file{stdargs.h}.
  2552.  
  2553. @item
  2554. An area of memory used to save certain registers used by the function.
  2555. The size of this area, which may also include space for such things as
  2556. the return address and pointers to previous stack frames, is
  2557. machine-specific and usually depends on which registers have been used
  2558. in the function.  Machines with register windows often do not require
  2559. a save area.
  2560.  
  2561. @item
  2562. A region of at least @var{size} bytes, possibly rounded up to an allocation
  2563. boundary, to contain the local variables of the function.  On some machines,
  2564. this region and the save area may occur in the opposite order, with the
  2565. save area closer to the top of the stack.
  2566.  
  2567. @item
  2568. @cindex @code{ACCUMULATE_OUTGOING_ARGS} and stack frames
  2569. Optionally, in the case that @code{ACCUMULATE_OUTGOING_ARGS} is defined,
  2570. a region of @code{current_function_outgoing_args_size} bytes to be used
  2571. for outgoing argument lists of the function.  @xref{Stack Arguments}.
  2572. @end itemize
  2573.  
  2574. Normally, it is necessary for @code{FUNCTION_PROLOGUE} and
  2575. @code{FUNCTION_EPILOGUE} to treat leaf functions specially.  The C
  2576. variable @code{leaf_function} is nonzero for such a function.
  2577.  
  2578. @findex EXIT_IGNORE_STACK
  2579. @item EXIT_IGNORE_STACK
  2580. Define this macro as a C expression that is nonzero if the return
  2581. instruction or the function epilogue ignores the value of the stack
  2582. pointer; in other words, if it is safe to delete an instruction to
  2583. adjust the stack pointer before a return from the function.
  2584.  
  2585. Note that this macro's value is relevant only for functions for which
  2586. frame pointers are maintained.  It is never safe to delete a final
  2587. stack adjustment in a function that has no frame pointer, and the
  2588. compiler knows this regardless of @code{EXIT_IGNORE_STACK}.
  2589.  
  2590. @findex FUNCTION_EPILOGUE
  2591. @item FUNCTION_EPILOGUE (@var{file}, @var{size})
  2592. A C compound statement that outputs the assembler code for exit from a
  2593. function.  The epilogue is responsible for restoring the saved
  2594. registers and stack pointer to their values when the function was
  2595. called, and returning control to the caller.  This macro takes the
  2596. same arguments as the macro @code{FUNCTION_PROLOGUE}, and the
  2597. registers to restore are determined from @code{regs_ever_live} and
  2598. @code{CALL_USED_REGISTERS} in the same way.
  2599.  
  2600. On some machines, there is a single instruction that does all the work
  2601. of returning from the function.  On these machines, give that
  2602. instruction the name @samp{return} and do not define the macro
  2603. @code{FUNCTION_EPILOGUE} at all.
  2604.  
  2605. Do not define a pattern named @samp{return} if you want the
  2606. @code{FUNCTION_EPILOGUE} to be used.  If you want the target switches
  2607. to control whether return instructions or epilogues are used, define a
  2608. @samp{return} pattern with a validity condition that tests the target
  2609. switches appropriately.  If the @samp{return} pattern's validity
  2610. condition is false, epilogues will be used.
  2611.  
  2612. On machines where functions may or may not have frame-pointers, the
  2613. function exit code must vary accordingly.  Sometimes the code for these
  2614. two cases is completely different.  To determine whether a frame pointer
  2615. is wanted, the macro can refer to the variable
  2616. @code{frame_pointer_needed}.  The variable's value will be 1 at run time
  2617. in a function that needs a frame pointer.
  2618.  
  2619. Normally, it is necessary for @code{FUNCTION_PROLOGUE} and
  2620. @code{FUNCTION_EPILOGUE} to treat leaf functions specially.  The C
  2621. variable @code{leaf_function} is nonzero for such a function.
  2622. @xref{Leaf Functions}.
  2623.  
  2624. On some machines, some functions pop their arguments on exit while
  2625. others leave that for the caller to do.  For example, the 68020 when
  2626. given @samp{-mrtd} pops arguments in functions that take a fixed
  2627. number of arguments.
  2628.  
  2629. @findex current_function_pops_args
  2630. Your definition of the macro @code{RETURN_POPS_ARGS} decides which
  2631. functions pop their own arguments.  @code{FUNCTION_EPILOGUE} needs to
  2632. know what was decided.  The variable @code{current_function_pops_args}
  2633. is the number of bytes of its arguments that a function should pop.
  2634. @xref{Scalar Return}.
  2635.  
  2636. @findex DELAY_SLOTS_FOR_EPILOGUE
  2637. @item DELAY_SLOTS_FOR_EPILOGUE
  2638. Define this macro if the function epilogue contains delay slots to which
  2639. instructions from the rest of the function can be ``moved''.  The
  2640. definition should be a C expression whose value is an integer
  2641. representing the number of delay slots there.
  2642.  
  2643. @findex ELIGIBLE_FOR_EPILOGUE_DELAY
  2644. @item ELIGIBLE_FOR_EPILOGUE_DELAY (@var{insn}, @var{n})
  2645. A C expression that returns 1 if @var{insn} can be placed in delay
  2646. slot number @var{n} of the epilogue.
  2647.  
  2648. The argument @var{n} is an integer which identifies the delay slot now
  2649. being considered (since different slots may have different rules of
  2650. eligibility).  It is never negative and is always less than the number
  2651. of epilogue delay slots (what @code{DELAY_SLOTS_FOR_EPILOGUE} returns).
  2652. If you reject a particular insn for a given delay slot, in principle, it
  2653. may be reconsidered for a subsequent delay slot.  Also, other insns may
  2654. (at least in principle) be considered for the so far unfilled delay
  2655. slot.
  2656.  
  2657. @findex current_function_epilogue_delay_list
  2658. @findex final_scan_insn
  2659. The insns accepted to fill the epilogue delay slots are put in an RTL
  2660. list made with @code{insn_list} objects, stored in the variable
  2661. @code{current_function_epilogue_delay_list}.  The insn for the first
  2662. delay slot comes first in the list.  Your definition of the macro
  2663. @code{FUNCTION_EPILOGUE} should fill the delay slots by outputting the
  2664. insns in this list, usually by calling @code{final_scan_insn}.
  2665.  
  2666. You need not define this macro if you did not define
  2667. @code{DELAY_SLOTS_FOR_EPILOGUE}.
  2668. @end table
  2669.  
  2670. @node Profiling
  2671. @subsection Generating Code for Profiling
  2672. @cindex profiling, code generation
  2673.  
  2674. @table @code
  2675. @findex FUNCTION_PROFILER 
  2676. @item FUNCTION_PROFILER (@var{file}, @var{labelno})
  2677. A C statement or compound statement to output to @var{file} some
  2678. assembler code to call the profiling subroutine @code{mcount}.
  2679. Before calling, the assembler code must load the address of a
  2680. counter variable into a register where @code{mcount} expects to
  2681. find the address.  The name of this variable is @samp{LP} followed
  2682. by the number @var{labelno}, so you would generate the name using
  2683. @samp{LP%d} in a @code{fprintf}.
  2684.  
  2685. @findex mcount
  2686. The details of how the address should be passed to @code{mcount} are
  2687. determined by your operating system environment, not by GNU CC.  To
  2688. figure them out, compile a small program for profiling using the
  2689. system's installed C compiler and look at the assembler code that
  2690. results.
  2691.  
  2692. @findex PROFILE_BEFORE_PROLOGUE
  2693. @item PROFILE_BEFORE_PROLOGUE
  2694. Define this macro if the code for function profiling should come before
  2695. the function prologue.  Normally, the profiling code comes after.
  2696.  
  2697. @findex FUNCTION_BLOCK_PROFILER
  2698. @findex __bb_init_func
  2699. @item FUNCTION_BLOCK_PROFILER (@var{file}, @var{labelno})
  2700. A C statement or compound statement to output to @var{file} some
  2701. assembler code to initialize basic-block profiling for the current
  2702. object module.  This code should call the subroutine
  2703. @code{__bb_init_func} once per object module, passing it as its sole
  2704. argument the address of a block allocated in the object module.
  2705.  
  2706. The name of the block is a local symbol made with this statement:
  2707.  
  2708. @example
  2709. ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 0);
  2710. @end example
  2711.  
  2712. Of course, since you are writing the definition of
  2713. @code{ASM_GENERATE_INTERNAL_LABEL} as well as that of this macro, you
  2714. can take a short cut in the definition of this macro and use the name
  2715. that you know will result.
  2716.  
  2717. The first word of this block is a flag which will be nonzero if the
  2718. object module has already been initialized.  So test this word first,
  2719. and do not call @code{__bb_init_func} if the flag is nonzero.
  2720.  
  2721. @findex BLOCK_PROFILER
  2722. @item BLOCK_PROFILER (@var{file}, @var{blockno})
  2723. A C statement or compound statement to increment the count associated
  2724. with the basic block number @var{blockno}.  Basic blocks are numbered
  2725. separately from zero within each compilation.  The count associated
  2726. with block number @var{blockno} is at index @var{blockno} in a vector
  2727. of words; the name of this array is a local symbol made with this
  2728. statement:
  2729.  
  2730. @example
  2731. ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 2);
  2732. @end example
  2733.  
  2734. Of course, since you are writing the definition of
  2735. @code{ASM_GENERATE_INTERNAL_LABEL} as well as that of this macro, you
  2736. can take a short cut in the definition of this macro and use the name
  2737. that you know will result.
  2738. @end table
  2739.  
  2740. @node Varargs
  2741. @section Implementing the Varargs Macros
  2742. @cindex varargs implementation
  2743.  
  2744. GNU CC comes with an implementation of @file{varargs.h} and
  2745. @file{stdarg.h} that work without change on machines that pass arguments
  2746. on the stack.  Other machines require their own implementations of
  2747. varargs, and the two machine independent header files must have
  2748. conditionals to include it.
  2749.  
  2750. ANSI @file{stdarg.h} differs from traditional @file{varargs.h} mainly in
  2751. the calling convention for @code{va_start}.  The traditional
  2752. implementation takes just one argument, which is the variable in which
  2753. to store the argument pointer.  The ANSI implementation of
  2754. @code{va_start} takes an additional second argument.  The user is
  2755. supposed to write the last named argument of the function here.
  2756.  
  2757. However, @code{va_start} should not use this argument.  The way to find
  2758. the end of the named arguments is with the built-in functions described
  2759. below.
  2760.  
  2761. @table @code
  2762. @findex __builtin_saveregs
  2763. @item __builtin_saveregs ()
  2764. Use this built-in function to save the argument registers in memory so
  2765. that the varargs mechanism can access them.  Both ANSI and traditional
  2766. versions of @code{va_start} must use @code{__builtin_saveregs}, unless
  2767. you use @code{SETUP_INCOMING_VARARGS} (see below) instead.
  2768.  
  2769. On some machines, @code{__builtin_saveregs} is open-coded under the
  2770. control of the macro @code{EXPAND_BUILTIN_SAVEREGS}.  On other machines,
  2771. it calls a routine written in assembler language, found in
  2772. @file{libgcc2.c}.
  2773.  
  2774. Regardless of what code is generated for the call to
  2775. @code{__builtin_saveregs}, it appears at the beginning of the function,
  2776. not where the call to @code{__builtin_saveregs} is written.  This is
  2777. because the registers must be saved before the function starts to use
  2778. them for its own purposes.
  2779.  
  2780. @findex __builtin_args_info
  2781. @item __builtin_args_info (@var{category})
  2782. Use this built-in function to find the first anonymous arguments in
  2783. registers.
  2784.  
  2785. In general, a machine may have several categories of registers used for
  2786. arguments, each for a particular category of data types.  (For example,
  2787. on some machines, floating-point registers are used for floating-point
  2788. arguments while other arguments are passed in the general registers.)
  2789. To make non-varargs functions use the proper calling convention, you
  2790. have defined the @code{CUMULATIVE_ARGS} data type to record how many
  2791. registers in each category have been used so far
  2792.  
  2793. @code{__builtin_args_info} accesses the same data structure of type
  2794. @code{CUMULATIVE_ARGS} after the ordinary argument layout is finished
  2795. with it, with @var{category} specifying which word to access.  Thus, the
  2796. value indicates the first unused register in a given category.
  2797.  
  2798. Normally, you would use @code{__builtin_args_info} in the implementation
  2799. of @code{va_start}, accessing each category just once and storing the
  2800. value in the @code{va_list} object.  This is because @code{va_list} will
  2801. have to update the values, and there is no way to alter the
  2802. values accessed by @code{__builtin_args_info}.
  2803.  
  2804. @findex __builtin_next_arg
  2805. @item __builtin_next_arg ()
  2806. This is the equivalent of @code{__builtin_args_info}, for stack
  2807. arguments.  It returns the address of the first anonymous stack
  2808. argument, as type @code{void *}. If @code{ARGS_GROW_DOWNWARD}, it
  2809. returns the address of the location above the first anonymous stack
  2810. argument. Use it in @code{va_start} to initialize the pointer for
  2811. fetching arguments from the stack. 
  2812.  
  2813. @findex __builtin_classify_type
  2814. @item __builtin_classify_type (@var{object})
  2815. Since each machine has its own conventions for which data types are
  2816. passed in which kind of register, your implementation of @code{va_arg}
  2817. has to embody these conventions.  The easiest way to categorize the
  2818. specified data type is to use @code{__builtin_classify_type} together
  2819. with @code{sizeof} and @code{__alignof__}.
  2820.  
  2821. @code{__builtin_classify_type} ignores the value of @var{object},
  2822. considering only its data type.  It returns an integer describing what
  2823. kind of type that is---integer, floating, pointer, structure, and so on.
  2824.  
  2825. The file @file{typeclass.h} defines an enumeration that you can use to
  2826. interpret the values of @code{__builtin_classify_type}.
  2827. @end table
  2828.  
  2829. These machine description macros help implement varargs: 
  2830.  
  2831. @table @code
  2832. @findex EXPAND_BUILTIN_SAVEREGS
  2833. @item EXPAND_BUILTIN_SAVEREGS (@var{args})
  2834. If defined, is a C expression that produces the machine-specific code
  2835. for a call to @code{__builtin_saveregs}.  This code will be moved to the
  2836. very beginning of the function, before any parameter access are made.
  2837. The return value of this function should be an RTX that contains the
  2838. value to use as the return of @code{__builtin_saveregs}.
  2839.  
  2840. The argument @var{args} is a @code{tree_list} containing the arguments
  2841. that were passed to @code{__builtin_saveregs}.
  2842.  
  2843. If this macro is not defined, the compiler will output an ordinary
  2844. call to the library function @samp{__builtin_saveregs}.
  2845.  
  2846. @findex SETUP_INCOMING_VARARGS
  2847. @item SETUP_INCOMING_VARARGS (@var{args_so_far}, @var{mode}, @var{type}, @var{pretend_args_size}, @var{second_time}) 
  2848. This macro offers an alternative to using @code{__builtin_saveregs} and
  2849. defining the macro @code{EXPAND_BUILTIN_SAVEREGS}.  Use it to store the
  2850. anonymous register arguments into the stack so that all the arguments
  2851. appear to have been passed consecutively on the stack.  Once this is
  2852. done, you can use the standard implementation of varargs that works for
  2853. machines that pass all their arguments on the stack.
  2854.  
  2855. The argument @var{args_so_far} is the @code{CUMULATIVE_ARGS} data
  2856. structure, containing the values that obtain after processing of the
  2857. named arguments.  The arguments @var{mode} and @var{type} describe the
  2858. last named argument---its machine mode and its data type as a tree node.
  2859.  
  2860. The macro implementation should do two things: first, push onto the
  2861. stack all the argument registers @emph{not} used for the named
  2862. arguments, and second, store the size of the data thus pushed into the
  2863. @code{int}-valued variable whose name is supplied as the argument
  2864. @var{pretend_args_size}.  The value that you store here will serve as
  2865. additional offset for setting up the stack frame.
  2866.  
  2867. Because you must generate code to push the anonymous arguments at
  2868. compile time without knowing their data types,
  2869. @code{SETUP_INCOMING_VARARGS} is only useful on machines that have just
  2870. a single category of argument register and use it uniformly for all data
  2871. types.
  2872.  
  2873. If the argument @var{second_time} is nonzero, it means that the
  2874. arguments of the function are being analyzed for the second time.  This
  2875. happens for an inline function, which is not actually compiled until the
  2876. end of the source file.  The macro @code{SETUP_INCOMING_VARARGS} should
  2877. not generate any instructions in this case.
  2878. @end table
  2879.  
  2880. @node Trampolines
  2881. @section Trampolines for Nested Functions
  2882. @cindex trampolines for nested functions
  2883. @cindex nested functions, trampolines for
  2884.  
  2885. A @dfn{trampoline} is a small piece of code that is created at run time
  2886. when the address of a nested function is taken.  It normally resides on
  2887. the stack, in the stack frame of the containing function.  These macros
  2888. tell GNU CC how to generate code to allocate and initialize a
  2889. trampoline.
  2890.  
  2891. The instructions in the trampoline must do two things: load a constant
  2892. address into the static chain register, and jump to the real address of
  2893. the nested function.  On CISC machines such as the m68k, this requires
  2894. two instructions, a move immediate and a jump.  Then the two addresses
  2895. exist in the trampoline as word-long immediate operands.  On RISC
  2896. machines, it is often necessary to load each address into a register in
  2897. two parts.  Then pieces of each address form separate immediate
  2898. operands.
  2899.  
  2900. The code generated to initialize the trampoline must store the variable
  2901. parts---the static chain value and the function address---into the
  2902. immediate operands of the instructions.  On a CISC machine, this is
  2903. simply a matter of copying each address to a memory reference at the
  2904. proper offset from the start of the trampoline.  On a RISC machine, it
  2905. may be necessary to take out pieces of the address and store them
  2906. separately.
  2907.  
  2908. @table @code
  2909. @findex TRAMPOLINE_TEMPLATE
  2910. @item TRAMPOLINE_TEMPLATE (@var{file})
  2911. A C statement to output, on the stream @var{file}, assembler code for a
  2912. block of data that contains the constant parts of a trampoline.  This
  2913. code should not include a label---the label is taken care of
  2914. automatically.
  2915.  
  2916. @findex TRAMPOLINE_SIZE
  2917. @item TRAMPOLINE_SIZE
  2918. A C expression for the size in bytes of the trampoline, as an integer.
  2919.  
  2920. @findex TRAMPOLINE_ALIGNMENT
  2921. @item TRAMPOLINE_ALIGNMENT
  2922. Alignment required for trampolines, in bits.
  2923.  
  2924. If you don't define this macro, the value of @code{BIGGEST_ALIGNMENT}
  2925. is used for aligning trampolines.
  2926.  
  2927. @findex INITIALIZE_TRAMPOLINE
  2928. @item INITIALIZE_TRAMPOLINE (@var{addr}, @var{fnaddr}, @var{static_chain})
  2929. A C statement to initialize the variable parts of a trampoline.
  2930. @var{addr} is an RTX for the address of the trampoline; @var{fnaddr} is
  2931. an RTX for the address of the nested function; @var{static_chain} is an
  2932. RTX for the static chain value that should be passed to the function
  2933. when it is called.
  2934.  
  2935. @findex ALLOCATE_TRAMPOLINE
  2936. @item ALLOCATE_TRAMPOLINE (@var{fp})
  2937. A C expression to allocate run-time space for a trampoline.  The
  2938. expression value should be an RTX representing a memory reference to the
  2939. space for the trampoline.
  2940.  
  2941. @cindex @code{FUNCTION_EPILOGUE} and trampolines
  2942. @cindex @code{FUNCTION_PROLOGUE} and trampolines
  2943. If this macro is not defined, by default the trampoline is allocated as
  2944. a stack slot.  This default is right for most machines.  The exceptions
  2945. are machines where it is impossible to execute instructions in the stack
  2946. area.  On such machines, you may have to implement a separate stack,
  2947. using this macro in conjunction with @code{FUNCTION_PROLOGUE} and
  2948. @code{FUNCTION_EPILOGUE}.
  2949.  
  2950. @var{fp} points to a data structure, a @code{struct function}, which
  2951. describes the compilation status of the immediate containing function of
  2952. the function which the trampoline is for.  Normally (when
  2953. @code{ALLOCATE_TRAMPOLINE} is not defined), the stack slot for the
  2954. trampoline is in the stack frame of this containing function.  Other
  2955. allocation strategies probably must do something analogous with this
  2956. information.
  2957. @end table
  2958.  
  2959. Implementing trampolines is difficult on many machines because they have
  2960. separate instruction and data caches.  Writing into a stack location
  2961. fails to clear the memory in the instruction cache, so when the program
  2962. jumps to that location, it executes the old contents.
  2963.  
  2964. Here are two possible solutions.  One is to clear the relevant parts of
  2965. the instruction cache whenever a trampoline is set up.  The other is to
  2966. make all trampolines identical, by having them jump to a standard
  2967. subroutine.  The former technique makes trampoline execution faster; the
  2968. latter makes initialization faster.
  2969.  
  2970. To clear the instruction cache when a trampoline is initialized, define
  2971. the following macros which describe the shape of the cache.
  2972.  
  2973. @table @code
  2974. @findex INSN_CACHE_SIZE
  2975. @item INSN_CACHE_SIZE
  2976. The total size in bytes of the cache.
  2977.  
  2978. @findex INSN_CACHE_LINE_WIDTH
  2979. @item INSN_CACHE_LINE_WIDTH
  2980. The length in bytes of each cache line.  The cache is divided into cache
  2981. lines which are disjoint slots, each holding a contiguous chunk of data
  2982. fetched from memory.  Each time data is brought into the cache, an
  2983. entire line is read at once.  The data loaded into a cache line is 
  2984. always aligned on a boundary equal to the line size.
  2985.  
  2986. @findex INSN_CACHE_DEPTH
  2987. @item INSN_CACHE_DEPTH
  2988. The number of alternative cache lines that can hold any particular memory
  2989. location.
  2990. @end table
  2991.  
  2992. To use a standard subroutine, define the following macro.  In addition,
  2993. you must make sure that the instructions in a trampoline fill an entire
  2994. cache line with identical instructions, or else ensure that the
  2995. beginning of the trampoline code is always aligned at the same point in
  2996. its cache line.  Look in @file{m68k.h} as a guide.
  2997.  
  2998. @table @code
  2999. @findex TRANSFER_FROM_TRAMPOLINE
  3000. @item TRANSFER_FROM_TRAMPOLINE
  3001. Define this macro if trampolines need a special subroutine to do their
  3002. work.  The macro should expand to a series of @code{asm} statements
  3003. which will be compiled with GNU CC.  They go in a library function named
  3004. @code{__transfer_from_trampoline}.
  3005.  
  3006. If you need to avoid executing the ordinary prologue code of a compiled
  3007. C function when you jump to the subroutine, you can do so by placing a
  3008. special label of your own in the assembler code.  Use one @code{asm}
  3009. statement to generate an assembler label, and another to make the label
  3010. global.  Then trampolines can use that label to jump directly to your
  3011. special assembler code.
  3012. @end table
  3013.  
  3014. @node Library Calls
  3015. @section Implicit Calls to Library Routines
  3016. @cindex library subroutine names
  3017. @cindex @file{libgcc.a}
  3018.  
  3019. @table @code
  3020. @findex MULSI3_LIBCALL
  3021. @item MULSI3_LIBCALL
  3022. A C string constant giving the name of the function to call for
  3023. multiplication of one signed full-word by another.  If you do not
  3024. define this macro, the default name is used, which is @code{__mulsi3},
  3025. a function defined in @file{libgcc.a}.
  3026.  
  3027. @findex DIVSI3_LIBCALL
  3028. @item DIVSI3_LIBCALL
  3029. A C string constant giving the name of the function to call for
  3030. division of one signed full-word by another.  If you do not define
  3031. this macro, the default name is used, which is @code{__divsi3}, a
  3032. function defined in @file{libgcc.a}.
  3033.  
  3034. @findex UDIVSI3_LIBCALL
  3035. @item UDIVSI3_LIBCALL
  3036. A C string constant giving the name of the function to call for
  3037. division of one unsigned full-word by another.  If you do not define
  3038. this macro, the default name is used, which is @code{__udivsi3}, a
  3039. function defined in @file{libgcc.a}.
  3040.  
  3041. @findex MODSI3_LIBCALL
  3042. @item MODSI3_LIBCALL
  3043. A C string constant giving the name of the function to call for the
  3044. remainder in division of one signed full-word by another.  If you do
  3045. not define this macro, the default name is used, which is
  3046. @code{__modsi3}, a function defined in @file{libgcc.a}.
  3047.  
  3048. @findex UMODSI3_LIBCALL
  3049. @item UMODSI3_LIBCALL
  3050. A C string constant giving the name of the function to call for the
  3051. remainder in division of one unsigned full-word by another.  If you do
  3052. not define this macro, the default name is used, which is
  3053. @code{__umodsi3}, a function defined in @file{libgcc.a}.
  3054.  
  3055. @findex MULDI3_LIBCALL
  3056. @item MULDI3_LIBCALL
  3057. A C string constant giving the name of the function to call for
  3058. multiplication of one signed double-word by another.  If you do not
  3059. define this macro, the default name is used, which is @code{__muldi3},
  3060. a function defined in @file{libgcc.a}.
  3061.  
  3062. @findex DIVDI3_LIBCALL
  3063. @item DIVDI3_LIBCALL
  3064. A C string constant giving the name of the function to call for
  3065. division of one signed double-word by another.  If you do not define
  3066. this macro, the default name is used, which is @code{__divdi3}, a
  3067. function defined in @file{libgcc.a}.
  3068.  
  3069. @findex UDIVDI3_LIBCALL
  3070. @item UDIVDI3_LIBCALL
  3071. A C string constant giving the name of the function to call for
  3072. division of one unsigned full-word by another.  If you do not define
  3073. this macro, the default name is used, which is @code{__udivdi3}, a
  3074. function defined in @file{libgcc.a}.
  3075.  
  3076. @findex MODDI3_LIBCALL
  3077. @item MODDI3_LIBCALL
  3078. A C string constant giving the name of the function to call for the
  3079. remainder in division of one signed double-word by another.  If you do
  3080. not define this macro, the default name is used, which is
  3081. @code{__moddi3}, a function defined in @file{libgcc.a}.
  3082.  
  3083. @findex UMODDI3_LIBCALL
  3084. @item UMODDI3_LIBCALL
  3085. A C string constant giving the name of the function to call for the
  3086. remainder in division of one unsigned full-word by another.  If you do
  3087. not define this macro, the default name is used, which is
  3088. @code{__umoddi3}, a function defined in @file{libgcc.a}.
  3089.  
  3090. @findex TARGET_EDOM
  3091. @cindex @code{EDOM}, implicit usage
  3092. @item TARGET_EDOM
  3093. The value of @code{EDOM} on the target machine, as a C integer constant
  3094. expression.  If you don't define this macro, GNU CC does not attempt to
  3095. deposit the value of @code{EDOM} into @code{errno} directly.  Look in
  3096. @file{/usr/include/errno.h} to find the value of @code{EDOM} on your
  3097. system.
  3098.  
  3099. If you do not define @code{TARGET_EDOM}, then compiled code reports
  3100. domain errors by calling the library function and letting it report the
  3101. error.  If mathematical functions on your system use @code{matherr} when
  3102. there is an error, then you should leave @code{TARGET_EDOM} undefined so
  3103. that @code{matherr} is used normally.
  3104.  
  3105. @findex GEN_ERRNO_RTX
  3106. @cindex @code{errno}, implicit usage
  3107. @item GEN_ERRNO_RTX
  3108. Define this macro as a C expression to create an rtl expression that
  3109. refers to the global ``variable'' @code{errno}.  (On certain systems,
  3110. @code{errno} may not actually be a variable.)  If you don't define this
  3111. macro, a reasonable default is used.
  3112.  
  3113. @findex TARGET_MEM_FUNCTIONS
  3114. @cindex @code{bcopy}, implicit usage
  3115. @cindex @code{memcpy}, implicit usage
  3116. @cindex @code{bzero}, implicit usage
  3117. @cindex @code{memset}, implicit usage
  3118. @item TARGET_MEM_FUNCTIONS
  3119. Define this macro if GNU CC should generate calls to the System V
  3120. (and ANSI C) library functions @code{memcpy} and @code{memset}
  3121. rather than the BSD functions @code{bcopy} and @code{bzero}.
  3122.  
  3123. @findex LIBGCC_NEEDS_DOUBLE
  3124. @item LIBGCC_NEEDS_DOUBLE
  3125. Define this macro if only @code{float} arguments cannot be passed to
  3126. library routines (so they must be converted to @code{double}).  This
  3127. macro affects both how library calls are generated and how the library
  3128. routines in @file{libgcc1.c} accept their arguments.  It is useful on
  3129. machines where floating and fixed point arguments are passed
  3130. differently, such as the i860.
  3131.  
  3132. @findex FLOAT_ARG_TYPE
  3133. @item FLOAT_ARG_TYPE
  3134. Define this macro to override the type used by the library routines to
  3135. pick up arguments of type @code{float}.  (By default, they use a union
  3136. of @code{float} and @code{int}.)
  3137.  
  3138. The obvious choice would be @code{float}---but that won't work with
  3139. traditional C compilers that expect all arguments declared as @code{float}
  3140. to arrive as @code{double}.  To avoid this conversion, the library routines
  3141. ask for the value as some other type and then treat it as a @code{float}.
  3142.  
  3143. On some systems, no other type will work for this.  For these systems,
  3144. you must use @code{LIBGCC_NEEDS_DOUBLE} instead, to force conversion of
  3145. the values @code{double} before they are passed.
  3146.  
  3147. @findex FLOATIFY
  3148. @item FLOATIFY (@var{passed-value})
  3149. Define this macro to override the way library routines redesignate a
  3150. @code{float} argument as a @code{float} instead of the type it was
  3151. passed as.  The default is an expression which takes the @code{float}
  3152. field of the union.
  3153.  
  3154. @findex FLOAT_VALUE_TYPE
  3155. @item FLOAT_VALUE_TYPE
  3156. Define this macro to override the type used by the library routines to
  3157. return values that ought to have type @code{float}.  (By default, they
  3158. use @code{int}.)
  3159.  
  3160. The obvious choice would be @code{float}---but that won't work with
  3161. traditional C compilers gratuitously convert values declared as
  3162. @code{float} into @code{double}.
  3163.  
  3164. @findex INTIFY
  3165. @item INTIFY (@var{float-value})
  3166. Define this macro to override the way the value of a
  3167. @code{float}-returning library routine should be packaged in order to
  3168. return it.  These functions are actually declared to return type 
  3169. @code{FLOAT_VALUE_TYPE} (normally @code{int}).
  3170.  
  3171. These values can't be returned as type @code{float} because traditional
  3172. C compilers would gratuitously convert the value to a @code{double}.
  3173.  
  3174. A local variable named @code{intify} is always available when the macro
  3175. @code{INTIFY} is used.  It is a union of a @code{float} field named
  3176. @code{f} and a field named @code{i} whose type is
  3177. @code{FLOAT_VALUE_TYPE} or @code{int}.
  3178.  
  3179. If you don't define this macro, the default definition works by copying
  3180. the value through that union.
  3181.  
  3182. @findex nongcc_SI_type
  3183. @item nongcc_SI_type
  3184. Define this macro as the name of the data type corresponding to
  3185. @code{SImode} in the system's own C compiler.
  3186.  
  3187. You need not define this macro if that type is @code{int}, as it usually
  3188. is.
  3189.  
  3190. @findex perform_@dots{}
  3191. @item perform_@dots{}
  3192. Define these macros to supply explicit C statements to carry out various
  3193. arithmetic operations on types @code{float} and @code{double} in the
  3194. library routines in @file{libgcc1.c}.  See that file for a full list
  3195. of these macros and their arguments.
  3196.  
  3197. On most machines, you don't need to define any of these macros, because
  3198. the C compiler that comes with the system takes care of doing them.
  3199.  
  3200. @findex NEXT_OBJC_RUNTIME
  3201. @item NEXT_OBJC_RUNTIME
  3202. Define this macro to generate code for Objective C message sending using
  3203. the calling convention of the NeXT system.  This calling convention
  3204. involves passing the object, the selector and the method arguments all
  3205. at once to the method-lookup library function.
  3206.  
  3207. The default calling convention passes just the object and the selector
  3208. to the lookup function, which returns a pointer to the method.
  3209. @end table
  3210.  
  3211. @node Addressing Modes
  3212. @section Addressing Modes
  3213. @cindex addressing modes
  3214.  
  3215. @table @code
  3216. @findex HAVE_POST_INCREMENT
  3217. @item HAVE_POST_INCREMENT
  3218. Define this macro if the machine supports post-increment addressing.
  3219.  
  3220. @findex HAVE_PRE_INCREMENT
  3221. @findex HAVE_POST_DECREMENT
  3222. @findex HAVE_PRE_DECREMENT
  3223. @item HAVE_PRE_INCREMENT
  3224. @itemx HAVE_POST_DECREMENT
  3225. @itemx HAVE_PRE_DECREMENT
  3226. Similar for other kinds of addressing.
  3227.  
  3228. @findex CONSTANT_ADDRESS_P
  3229. @item CONSTANT_ADDRESS_P (@var{x})
  3230. A C expression that is 1 if the RTX @var{x} is a constant which
  3231. is a valid address.  On most machines, this can be defined as
  3232. @code{CONSTANT_P (@var{x})}, but a few machines are more restrictive
  3233. in which constant addresses are supported.
  3234.  
  3235. @findex CONSTANT_P
  3236. @code{CONSTANT_P} accepts integer-values expressions whose values are
  3237. not explicitly known, such as @code{symbol_ref}, @code{label_ref}, and
  3238. @code{high} expressions and @code{const} arithmetic expressions, in
  3239. addition to @code{const_int} and @code{const_double} expressions.
  3240.  
  3241. @findex MAX_REGS_PER_ADDRESS
  3242. @item MAX_REGS_PER_ADDRESS
  3243. A number, the maximum number of registers that can appear in a valid
  3244. memory address.  Note that it is up to you to specify a value equal to
  3245. the maximum number that @code{GO_IF_LEGITIMATE_ADDRESS} would ever
  3246. accept.
  3247.  
  3248. @findex GO_IF_LEGITIMATE_ADDRESS
  3249. @item GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})
  3250. A C compound statement with a conditional @code{goto @var{label};}
  3251. executed if @var{x} (an RTX) is a legitimate memory address on the
  3252. target machine for a memory operand of mode @var{mode}.
  3253.  
  3254. It usually pays to define several simpler macros to serve as
  3255. subroutines for this one.  Otherwise it may be too complicated to
  3256. understand.
  3257.  
  3258. This macro must exist in two variants: a strict variant and a
  3259. non-strict one.  The strict variant is used in the reload pass.  It
  3260. must be defined so that any pseudo-register that has not been
  3261. allocated a hard register is considered a memory reference.  In
  3262. contexts where some kind of register is required, a pseudo-register
  3263. with no hard register must be rejected.
  3264.  
  3265. The non-strict variant is used in other passes.  It must be defined to
  3266. accept all pseudo-registers in every context where some kind of
  3267. register is required.
  3268.  
  3269. @findex REG_OK_STRICT
  3270. Compiler source files that want to use the strict variant of this
  3271. macro define the macro @code{REG_OK_STRICT}.  You should use an
  3272. @code{#ifdef REG_OK_STRICT} conditional to define the strict variant
  3273. in that case and the non-strict variant otherwise.
  3274.  
  3275. Typically among the subroutines used to define
  3276. @code{GO_IF_LEGITIMATE_ADDRESS} are subroutines to check for
  3277. acceptable registers for various purposes (one for base registers, one
  3278. for index registers, and so on).  Then only these subroutine macros
  3279. need have two variants; the higher levels of macros may be the same
  3280. whether strict or not.@refill
  3281.  
  3282. Normally, constant addresses which are the sum of a @code{symbol_ref}
  3283. and an integer are stored inside a @code{const} RTX to mark them as
  3284. constant.  Therefore, there is no need to recognize such sums
  3285. specifically as legitimate addresses.  Normally you would simply
  3286. recognize any @code{const} as legitimate.
  3287.  
  3288. Usually @code{PRINT_OPERAND_ADDRESS} is not prepared to handle constant
  3289. sums that are not marked with  @code{const}.  It assumes that a naked
  3290. @code{plus} indicates indexing.  If so, then you @emph{must} reject such
  3291. naked constant sums as illegitimate addresses, so that none of them will
  3292. be given to @code{PRINT_OPERAND_ADDRESS}.
  3293.  
  3294. @cindex @code{ENCODE_SECTION_INFO} and address validation
  3295. On some machines, whether a symbolic address is legitimate depends on
  3296. the section that the address refers to.  On these machines, define the
  3297. macro @code{ENCODE_SECTION_INFO} to store the information into the
  3298. @code{symbol_ref}, and then check for it here.  When you see a
  3299. @code{const}, you will have to look inside it to find the
  3300. @code{symbol_ref} in order to determine the section.  @xref{Assembler
  3301. Format}.
  3302.  
  3303. @findex saveable_obstack
  3304. The best way to modify the name string is by adding text to the
  3305. beginning, with suitable punctuation to prevent any ambiguity.  Allocate
  3306. the new name in @code{saveable_obstack}.  You will have to modify
  3307. @code{ASM_OUTPUT_LABELREF} to remove and decode the added text and
  3308. output the name accordingly, and define @code{STRIP_NAME_ENCODING} to
  3309. access the original name string.
  3310.  
  3311. You can check the information stored here into the @code{symbol_ref} in
  3312. the definitions of @code{GO_IF_LEGITIMATE_ADDRESS} and
  3313. @code{PRINT_OPERAND_ADDRESS}.
  3314.  
  3315. @findex REG_OK_FOR_BASE_P
  3316. @item REG_OK_FOR_BASE_P (@var{x})
  3317. A C expression that is nonzero if @var{x} (assumed to be a @code{reg}
  3318. RTX) is valid for use as a base register.  For hard registers, it
  3319. should always accept those which the hardware permits and reject the
  3320. others.  Whether the macro accepts or rejects pseudo registers must be
  3321. controlled by @code{REG_OK_STRICT} as described above.  This usually
  3322. requires two variant definitions, of which @code{REG_OK_STRICT}
  3323. controls the one actually used.
  3324.  
  3325. @findex REG_OK_FOR_INDEX_P
  3326. @item REG_OK_FOR_INDEX_P (@var{x})
  3327. A C expression that is nonzero if @var{x} (assumed to be a @code{reg}
  3328. RTX) is valid for use as an index register.
  3329.  
  3330. The difference between an index register and a base register is that
  3331. the index register may be scaled.  If an address involves the sum of
  3332. two registers, neither one of them scaled, then either one may be
  3333. labeled the ``base'' and the other the ``index''; but whichever
  3334. labeling is used must fit the machine's constraints of which registers
  3335. may serve in each capacity.  The compiler will try both labelings,
  3336. looking for one that is valid, and will reload one or both registers
  3337. only if neither labeling works.
  3338.  
  3339. @findex LEGITIMIZE_ADDRESS
  3340. @item LEGITIMIZE_ADDRESS (@var{x}, @var{oldx}, @var{mode}, @var{win})
  3341. A C compound statement that attempts to replace @var{x} with a valid
  3342. memory address for an operand of mode @var{mode}.  @var{win} will be a
  3343. C statement label elsewhere in the code; the macro definition may use
  3344.  
  3345. @example
  3346. GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{win});
  3347. @end example
  3348.  
  3349. @noindent
  3350. to avoid further processing if the address has become legitimate.
  3351.  
  3352. @findex break_out_memory_refs
  3353. @var{x} will always be the result of a call to @code{break_out_memory_refs},
  3354. and @var{oldx} will be the operand that was given to that function to produce
  3355. @var{x}.
  3356.  
  3357. The code generated by this macro should not alter the substructure of
  3358. @var{x}.  If it transforms @var{x} into a more legitimate form, it
  3359. should assign @var{x} (which will always be a C variable) a new value.
  3360.  
  3361. It is not necessary for this macro to come up with a legitimate
  3362. address.  The compiler has standard ways of doing so in all cases.  In
  3363. fact, it is safe for this macro to do nothing.  But often a
  3364. machine-dependent strategy can generate better code.
  3365.  
  3366. @findex GO_IF_MODE_DEPENDENT_ADDRESS
  3367. @item GO_IF_MODE_DEPENDENT_ADDRESS (@var{addr}, @var{label})
  3368. A C statement or compound statement with a conditional @code{goto
  3369. @var{label};} executed if memory address @var{x} (an RTX) can have
  3370. different meanings depending on the machine mode of the memory
  3371. reference it is used for or if the address is valid for some modes
  3372. but not others.
  3373.  
  3374. Autoincrement and autodecrement addresses typically have mode-dependent
  3375. effects because the amount of the increment or decrement is the size
  3376. of the operand being addressed.  Some machines have other mode-dependent
  3377. addresses.  Many RISC machines have no mode-dependent addresses.
  3378.  
  3379. You may assume that @var{addr} is a valid address for the machine.
  3380.  
  3381. @findex LEGITIMATE_CONSTANT_P
  3382. @item LEGITIMATE_CONSTANT_P (@var{x})
  3383. A C expression that is nonzero if @var{x} is a legitimate constant for
  3384. an immediate operand on the target machine.  You can assume that
  3385. @var{x} satisfies @code{CONSTANT_P}, so you need not check this.  In fact,
  3386. @samp{1} is a suitable definition for this macro on machines where
  3387. anything @code{CONSTANT_P} is valid.@refill
  3388. @end table
  3389.  
  3390. @node Condition Code
  3391. @section Condition Code Status
  3392. @cindex condition code status
  3393.  
  3394. @findex cc_status
  3395. The file @file{conditions.h} defines a variable @code{cc_status} to
  3396. describe how the condition code was computed (in case the interpretation of
  3397. the condition code depends on the instruction that it was set by).  This
  3398. variable contains the RTL expressions on which the condition code is
  3399. currently based, and several standard flags.
  3400.  
  3401. Sometimes additional machine-specific flags must be defined in the machine
  3402. description header file.  It can also add additional machine-specific
  3403. information by defining @code{CC_STATUS_MDEP}.
  3404.  
  3405. @table @code
  3406. @findex CC_STATUS_MDEP
  3407. @item CC_STATUS_MDEP
  3408. C code for a data type which is used for declaring the @code{mdep}
  3409. component of @code{cc_status}.  It defaults to @code{int}.
  3410.  
  3411. This macro is not used on machines that do not use @code{cc0}.
  3412.  
  3413. @findex CC_STATUS_MDEP_INIT
  3414. @item CC_STATUS_MDEP_INIT
  3415. A C expression to initialize the @code{mdep} field to ``empty''.
  3416. The default definition does nothing, since most machines don't use
  3417. the field anyway.  If you want to use the field, you should probably
  3418. define this macro to initialize it.
  3419.  
  3420. This macro is not used on machines that do not use @code{cc0}.
  3421.  
  3422. @findex NOTICE_UPDATE_CC
  3423. @item NOTICE_UPDATE_CC (@var{exp}, @var{insn})
  3424. A C compound statement to set the components of @code{cc_status}
  3425. appropriately for an insn @var{insn} whose body is @var{exp}.  It is
  3426. this macro's responsibility to recognize insns that set the condition
  3427. code as a byproduct of other activity as well as those that explicitly
  3428. set @code{(cc0)}.
  3429.  
  3430. This macro is not used on machines that do not use @code{cc0}.
  3431.  
  3432. If there are insns that do not set the condition code but do alter
  3433. other machine registers, this macro must check to see whether they
  3434. invalidate the expressions that the condition code is recorded as
  3435. reflecting.  For example, on the 68000, insns that store in address
  3436. registers do not set the condition code, which means that usually
  3437. @code{NOTICE_UPDATE_CC} can leave @code{cc_status} unaltered for such
  3438. insns.  But suppose that the previous insn set the condition code
  3439. based on location @samp{a4@@(102)} and the current insn stores a new
  3440. value in @samp{a4}.  Although the condition code is not changed by
  3441. this, it will no longer be true that it reflects the contents of
  3442. @samp{a4@@(102)}.  Therefore, @code{NOTICE_UPDATE_CC} must alter
  3443. @code{cc_status} in this case to say that nothing is known about the
  3444. condition code value.
  3445.  
  3446. The definition of @code{NOTICE_UPDATE_CC} must be prepared to deal
  3447. with the results of peephole optimization: insns whose patterns are
  3448. @code{parallel} RTXs containing various @code{reg}, @code{mem} or
  3449. constants which are just the operands.  The RTL structure of these
  3450. insns is not sufficient to indicate what the insns actually do.  What
  3451. @code{NOTICE_UPDATE_CC} should do when it sees one is just to run
  3452. @code{CC_STATUS_INIT}.
  3453.  
  3454. A possible definition of @code{NOTICE_UPDATE_CC} is to call a function
  3455. that looks at an attribute (@pxref{Insn Attributes}) named, for example,
  3456. @samp{cc}.  This avoids having detailed information about patterns in
  3457. two places, the @file{md} file and in @code{NOTICE_UPDATE_CC}.
  3458.  
  3459. @findex EXTRA_CC_MODES
  3460. @item EXTRA_CC_MODES
  3461. A list of names to be used for additional modes for condition code
  3462. values in registers (@pxref{Jump Patterns}).  These names are added
  3463. to @code{enum machine_mode} and all have class @code{MODE_CC}.  By
  3464. convention, they should start with @samp{CC} and end with @samp{mode}.
  3465.  
  3466. You should only define this macro if your machine does not use @code{cc0}
  3467. and only if additional modes are required.
  3468.  
  3469. @findex EXTRA_CC_NAMES
  3470. @item EXTRA_CC_NAMES
  3471. A list of C strings giving the names for the modes listed in
  3472. @code{EXTRA_CC_MODES}.  For example, the Sparc defines this macro and
  3473. @code{EXTRA_CC_MODES} as
  3474.  
  3475. @example
  3476. #define EXTRA_CC_MODES CC_NOOVmode, CCFPmode
  3477. #define EXTRA_CC_NAMES "CC_NOOV", "CCFP"
  3478. @end example
  3479.  
  3480. This macro is not required if @code{EXTRA_CC_MODES} is not defined.
  3481.  
  3482. @findex SELECT_CC_MODE
  3483. @item SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
  3484. Returns a mode from class @code{MODE_CC} to be used when comparison
  3485. operation code @var{op} is applied to rtx @var{x} and @var{y}.  For
  3486. example, on the Sparc, @code{SELECT_CC_MODE} is defined as (see
  3487. @pxref{Jump Patterns} for a description of the reason for this
  3488. definition)
  3489.  
  3490. @example
  3491. #define SELECT_CC_MODE(OP,X,Y) \
  3492.   (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT                \
  3493.    ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode)        \
  3494.    : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS || GET_CODE (X) == NEG) \
  3495.       ? CC_NOOVmode : CCmode))
  3496. @end example
  3497.  
  3498. This macro is not required if @code{EXTRA_CC_MODES} is not defined.
  3499. @end table
  3500.  
  3501. @node Costs
  3502. @section Describing Relative Costs of Operations
  3503. @cindex costs of instructions
  3504. @cindex relative costs
  3505. @cindex speed of instructions
  3506.  
  3507. These macros let you describe the relative speed of various operations
  3508. on the target machine.
  3509.  
  3510. @table @code
  3511. @findex CONST_COSTS 
  3512. @item CONST_COSTS (@var{x}, @var{code}, @var{outer_code})
  3513. A part of a C @code{switch} statement that describes the relative costs
  3514. of constant RTL expressions.  It must contain @code{case} labels for
  3515. expression codes @code{const_int}, @code{const}, @code{symbol_ref},
  3516. @code{label_ref} and @code{const_double}.  Each case must ultimately
  3517. reach a @code{return} statement to return the relative cost of the use
  3518. of that kind of constant value in an expression.  The cost may depend on
  3519. the precise value of the constant, which is available for examination in
  3520. @var{x}, and the rtx code of the expression in which it is contained,
  3521. found in @var{outer_code}.
  3522.  
  3523. @var{code} is the expression code---redundant, since it can be
  3524. obtained with @code{GET_CODE (@var{x})}.
  3525.  
  3526. @findex RTX_COSTS 
  3527. @findex COSTS_N_INSNS
  3528. @item RTX_COSTS (@var{x}, @var{code}, @var{outer_code})
  3529. Like @code{CONST_COSTS} but applies to nonconstant RTL expressions.
  3530. This can be used, for example, to indicate how costly a multiply
  3531. instruction is.  In writing this macro, you can use the construct
  3532. @code{COSTS_N_INSNS (@var{n})} to specify a cost equal to @var{n} fast
  3533. instructions.  @var{outer_code} is the code of the expression in which
  3534. @var{x} is contained.
  3535.  
  3536. This macro is optional; do not define it if the default cost assumptions
  3537. are adequate for the target machine.
  3538.  
  3539. @findex ADDRESS_COST
  3540. @item ADDRESS_COST (@var{address})
  3541. An expression giving the cost of an addressing mode that contains
  3542. @var{address}.  If not defined, the cost is computed from
  3543. the @var{address} expression and the @code{CONST_COSTS} values.
  3544.  
  3545. For most CISC machines, the default cost is a good approximation of the
  3546. true cost of the addressing mode.  However, on RISC machines, all
  3547. instructions normally have the same length and execution time.  Hence
  3548. all addresses will have equal costs.
  3549.  
  3550. In cases where more than one form of an address is known, the form with
  3551. the lowest cost will be used.  If multiple forms have the same, lowest,
  3552. cost, the one that is the most complex will be used.
  3553.  
  3554. For example, suppose an address that is equal to the sum of a register
  3555. and a constant is used twice in the same basic block.  When this macro
  3556. is not defined, the address will be computed in a register and memory
  3557. references will be indirect through that register.  On machines where
  3558. the cost of the addressing mode containing the sum is no higher than
  3559. that of a simple indirect reference, this will produce an additional
  3560. instruction and possibly require an additional register.  Proper
  3561. specification of this macro eliminates this overhead for such machines.
  3562.  
  3563. Similar use of this macro is made in strength reduction of loops.
  3564.  
  3565. @var{address} need not be valid as an address.  In such a case, the cost
  3566. is not relevant and can be any value; invalid addresses need not be
  3567. assigned a different cost.
  3568.  
  3569. On machines where an address involving more than one register is as
  3570. cheap as an address computation involving only one register, defining
  3571. @code{ADDRESS_COST} to reflect this can cause two registers to be live
  3572. over a region of code where only one would have been if
  3573. @code{ADDRESS_COST} were not defined in that manner.  This effect should
  3574. be considered in the definition of this macro.  Equivalent costs should
  3575. probably only be given to addresses with different numbers of registers
  3576. on machines with lots of registers.
  3577.  
  3578. This macro will normally either not be defined or be defined as a
  3579. constant.
  3580.  
  3581. @findex REGISTER_MOVE_COST
  3582. @item REGISTER_MOVE_COST (@var{from}, @var{to})
  3583. A C expression for the cost of moving data from a register in class
  3584. @var{from} to one in class @var{to}.  The classes are expressed using
  3585. the enumeration values such as @code{GENERAL_REGS}.  A value of 2 is the
  3586. default; other values are interpreted relative to that.
  3587.  
  3588. It is not required that the cost always equal 2 when @var{from} is the
  3589. same as @var{to}; on some machines it is expensive to move between
  3590. registers if they are not general registers.
  3591.  
  3592. If reload sees an insn consisting of a single @code{set} between two
  3593. hard registers, and if @code{REGISTER_MOVE_COST} applied to their
  3594. classes returns a value of 2, reload does not check to ensure that the
  3595. constraints of the insn are met.  Setting a cost of other than 2 will
  3596. allow reload to verify that the constraints are met.  You should do this
  3597. if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
  3598.  
  3599. @findex MEMORY_MOVE_COST
  3600. @item MEMORY_MOVE_COST (@var{m})
  3601. A C expression for the cost of moving data of mode @var{m} between a
  3602. register and memory.  A value of 2 is the default; this cost is relative
  3603. to those in @code{REGISTER_MOVE_COST}.
  3604.  
  3605. If moving between registers and memory is more expensive than between
  3606. two registers, you should define this macro to express the relative cost.
  3607.  
  3608. @findex BRANCH_COST
  3609. @item BRANCH_COST
  3610. A C expression for the cost of a branch instruction.  A value of 1 is
  3611. the default; other values are interpreted relative to that.
  3612. @end table
  3613.  
  3614. Here are additional macros which do not specify precise relative costs,
  3615. but only that certain actions are more expensive than GNU CC would
  3616. ordinarily expect.
  3617.  
  3618. @table @code
  3619. @findex SLOW_BYTE_ACCESS
  3620. @item SLOW_BYTE_ACCESS
  3621. Define this macro as a C expression which is nonzero if accessing less
  3622. than a word of memory (i.e. a @code{char} or a @code{short}) is no
  3623. faster than accessing a word of memory, i.e., if such access
  3624. require more than one instruction or if there is no difference in cost
  3625. between byte and (aligned) word loads.
  3626.  
  3627. When this macro is not defined, the compiler will access a field by
  3628. finding the smallest containing object; when it is defined, a fullword
  3629. load will be used if alignment permits.  Unless bytes accesses are
  3630. faster than word accesses, using word accesses is preferable since it
  3631. may eliminate subsequent memory access if subsequent accesses occur to
  3632. other fields in the same word of the structure, but to different bytes.
  3633.  
  3634. @findex SLOW_ZERO_EXTEND
  3635. @item SLOW_ZERO_EXTEND
  3636. Define this macro if zero-extension (of a @code{char} or @code{short}
  3637. to an @code{int}) can be done faster if the destination is a register
  3638. that is known to be zero.
  3639.  
  3640. If you define this macro, you must have instruction patterns that
  3641. recognize RTL structures like this:
  3642.  
  3643. @example
  3644. (set (strict_low_part (subreg:QI (reg:SI @dots{}) 0)) @dots{})
  3645. @end example
  3646.  
  3647. @noindent
  3648. and likewise for @code{HImode}.
  3649.  
  3650. @findex SLOW_UNALIGNED_ACCESS
  3651. @item SLOW_UNALIGNED_ACCESS
  3652. Define this macro to be the value 1 if unaligned accesses have a cost
  3653. many times greater than aligned accesses, for example if they are
  3654. emulated in a trap handler.
  3655.  
  3656. When this macro is non-zero, the compiler will act as if
  3657. @code{STRICT_ALIGNMENT} were non-zero when generating code for block
  3658. moves.  This can cause significantly more instructions to be produced.
  3659. Therefore, do not set this macro non-zero if unaligned accesses only add a
  3660. cycle or two to the time for a memory access.
  3661.  
  3662. If the value of this macro is always zero, it need not be defined.
  3663.  
  3664. @findex DONT_REDUCE_ADDR
  3665. @item DONT_REDUCE_ADDR
  3666. Define this macro to inhibit strength reduction of memory addresses.
  3667. (On some machines, such strength reduction seems to do harm rather
  3668. than good.)
  3669.  
  3670. @findex MOVE_RATIO
  3671. @item MOVE_RATIO
  3672. The number of scalar move insns which should be generated instead of a
  3673. string move insn or a library call.  Increasing the value will always
  3674. make code faster, but eventually incurs high cost in increased code size.
  3675.  
  3676. If you don't define this, a reasonable default is used.
  3677.  
  3678. @findex NO_FUNCTION_CSE
  3679. @item NO_FUNCTION_CSE
  3680. Define this macro if it is as good or better to call a constant
  3681. function address than to call an address kept in a register.
  3682.  
  3683. @findex NO_RECURSIVE_FUNCTION_CSE
  3684. @item NO_RECURSIVE_FUNCTION_CSE
  3685. Define this macro if it is as good or better for a function to call
  3686. itself with an explicit address than to call an address kept in a
  3687. register.
  3688.  
  3689. @findex ADJUST_COST
  3690. @item ADJUST_COST (@var{insn}, @var{link}, @var{dep_insn}, @var{cost})
  3691. A C statement (sans semicolon) to update the integer variable @var{cost}
  3692. based on the relationship between @var{insn} that is dependent on
  3693. @var{dep_insn} through the dependence @var{link}.  The default is to
  3694. make no adjustment to @var{cost}.  This can be used for example to
  3695. specify to the scheduler that an output- or anti-dependence does not
  3696. incur the same cost as a data-dependence.
  3697. @end table
  3698.  
  3699. @node Sections
  3700. @section Dividing the Output into Sections (Texts, Data, @dots{})
  3701.  
  3702. An object file is divided into sections containing different types of
  3703. data.  In the most common case, there are three sections: the @dfn{text
  3704. section}, which holds instructions and read-only data; the @dfn{data
  3705. section}, which holds initialized writable data; and the @dfn{bss
  3706. section}, which holds uninitialized data.  Some systems have other kinds
  3707. of sections.
  3708.  
  3709. The compiler must tell the assembler when to switch sections.  These
  3710. macros control what commands to output to tell the assembler this.  You
  3711. can also define additional sections.
  3712.  
  3713. @table @code
  3714. @findex TEXT_SECTION_ASM_OP
  3715. @item TEXT_SECTION_ASM_OP
  3716. A C expression whose value is a string containing the assembler
  3717. operation that should precede instructions and read-only data.  Normally
  3718. @code{".text"} is right.
  3719.  
  3720. @findex DATA_SECTION_ASM_OP
  3721. @item DATA_SECTION_ASM_OP
  3722. A C expression whose value is a string containing the assembler
  3723. operation to identify the following data as writable initialized data.
  3724. Normally @code{".data"} is right.
  3725.  
  3726. @findex SHARED_SECTION_ASM_OP
  3727. @item SHARED_SECTION_ASM_OP
  3728. if defined, a C expression whose value is a string containing the
  3729. assembler operation to identify the following data as shared data.  If
  3730. not defined, @code{DATA_SECTION_ASM_OP} will be used.
  3731.  
  3732. @findex INIT_SECTION_ASM_OP
  3733. @item INIT_SECTION_ASM_OP
  3734. if defined, a C expression whose value is a string containing the
  3735. assembler operation to identify the following data as initialization
  3736. code.  If not defined, GNU CC will assume such a section does not
  3737. exist.
  3738.  
  3739. @findex EXTRA_SECTIONS
  3740. @findex in_text
  3741. @findex in_data
  3742. @item EXTRA_SECTIONS
  3743. A list of names for sections other than the standard two, which are
  3744. @code{in_text} and @code{in_data}.  You need not define this macro
  3745. on a system with no other sections (that GCC needs to use).
  3746.  
  3747. @findex EXTRA_SECTION_FUNCTIONS
  3748. @findex text_section
  3749. @findex data_section
  3750. @item EXTRA_SECTION_FUNCTIONS
  3751. One or more functions to be defined in @file{varasm.c}.  These
  3752. functions should do jobs analogous to those of @code{text_section} and
  3753. @code{data_section}, for your additional sections.  Do not define this
  3754. macro if you do not define @code{EXTRA_SECTIONS}.
  3755.  
  3756. @findex READONLY_DATA_SECTION
  3757. @item READONLY_DATA_SECTION
  3758. On most machines, read-only variables, constants, and jump tables are
  3759. placed in the text section.  If this is not the case on your machine,
  3760. this macro should be defined to be the name of a function (either
  3761. @code{data_section} or a function defined in @code{EXTRA_SECTIONS}) that
  3762. switches to the section to be used for read-only items.
  3763.  
  3764. If these items should be placed in the text section, this macro should
  3765. not be defined.
  3766.  
  3767. @findex SELECT_SECTION
  3768. @item SELECT_SECTION (@var{exp}, @var{reloc})
  3769. A C statement or statements to switch to the appropriate section for
  3770. output of @var{exp}.  You can assume that @var{exp} is either a
  3771. @code{VAR_DECL} node or a constant of some sort.  @var{reloc}
  3772. indicates whether the initial value of @var{exp} requires link-time
  3773. relocations.  Select the section by calling @code{text_section} or one
  3774. of the alternatives for other sections.
  3775.  
  3776. Do not define this macro if you put all read-only variables and
  3777. constants in the read-only data section (usually the text section).
  3778.  
  3779. @findex SELECT_RTX_SECTION
  3780. @item SELECT_RTX_SECTION (@var{mode}, @var{rtx})
  3781. A C statement or statements to switch to the appropriate section for
  3782. output of @var{rtx} in mode @var{mode}.  You can assume that @var{rtx}
  3783. is some kind of constant in RTL.  The argument @var{mode} is redundant
  3784. except in the case of a @code{const_int} rtx.  Select the section by
  3785. calling @code{text_section} or one of the alternatives for other
  3786. sections.
  3787.  
  3788. Do not define this macro if you put all constants in the read-only
  3789. data section.
  3790.  
  3791. @findex JUMP_TABLES_IN_TEXT_SECTION
  3792. @item JUMP_TABLES_IN_TEXT_SECTION
  3793. Define this macro if jump tables (for @code{tablejump} insns) should be
  3794. output in the text section, along with the assembler instructions.
  3795. Otherwise, the readonly data section is used.
  3796.  
  3797. This macro is irrelevant if there is no separate readonly data section.
  3798.  
  3799. @findex ENCODE_SECTION_INFO
  3800. @item ENCODE_SECTION_INFO (@var{decl})
  3801. Define this macro if references to a symbol must be treated differently
  3802. depending on something about the variable or function named by the
  3803. symbol (such as what section it is in).
  3804.  
  3805. The macro definition, if any, is executed immediately after the rtl for
  3806. @var{decl} has been created and stored in @code{DECL_RTL (@var{decl})}.
  3807. The value of the rtl will be a @code{mem} whose address is a
  3808. @code{symbol_ref}.
  3809.  
  3810. @cindex @code{SYMBOL_REF_FLAG}, in @code{ENCODE_SECTION_INFO}
  3811. The usual thing for this macro to do is to record a flag in the
  3812. @code{symbol_ref} (such as @code{SYMBOL_REF_FLAG}) or to store a
  3813. modified name string in the @code{symbol_ref} (if one bit is not enough
  3814. information).
  3815.  
  3816. @findex STRIP_NAME_ENCODING
  3817. @item STRIP_NAME_ENCODING (@var{var}, @var{sym_name})
  3818. Decode @var{sym_name} and store the real name part in @var{var}, sans
  3819. the characters that encode section info.  Define this macro if
  3820. @code{ENCODE_SECTION_INFO} alters the symbol's name string.
  3821. @end table
  3822.  
  3823. @node PIC
  3824. @section Position Independent Code
  3825. @cindex position independent code
  3826. @cindex PIC
  3827.  
  3828. This section describes macros that help implement generation of position
  3829. independent code.  Simply defining these macros is not enough to
  3830. generate valid PIC; you must also add support to the macros
  3831. @code{GO_IF_LEGITIMATE_ADDRESS} and @code{LEGITIMIZE_ADDRESS}, and
  3832. @code{PRINT_OPERAND_ADDRESS} as well.  You must modify the definition of
  3833. @samp{movsi} to do something appropriate when the source operand
  3834. contains a symbolic address.  You may also need to alter the handling of
  3835. switch statements so that they use relative addresses.
  3836.  
  3837. @table @code
  3838. @findex PIC_OFFSET_TABLE_REGNUM
  3839. @item PIC_OFFSET_TABLE_REGNUM
  3840. The register number of the register used to address a table of static
  3841. data addresses in memory.  In some cases this register is defined by a
  3842. processor's ``application binary interface'' (ABI).  When this macro
  3843. is defined, RTL is generated for this register once, as with the stack
  3844. pointer and frame pointer registers.  If this macro is not defined, it
  3845. is up to the machine-dependent files to allocate such a register (if
  3846. necessary).
  3847.  
  3848. @findex FINALIZE_PIC
  3849. @item FINALIZE_PIC
  3850. By generating position-independent code, when two different programs (A
  3851. and B) share a common library (libC.a), the text of the library can be
  3852. shared whether or not the library is linked at the same address for both
  3853. programs.  In some of these environments, position-independent code
  3854. requires not only the use of different addressing modes, but also
  3855. special code to enable the use of these addressing modes.
  3856.  
  3857. The @code{FINALIZE_PIC} macro serves as a hook to emit these special
  3858. codes once the function is being compiled into assembly code, but not
  3859. before.  (It is not done before, because in the case of compiling an
  3860. inline function, it would lead to multiple PIC prologues being
  3861. included in functions which used inline functions and were compiled to
  3862. assembly language.)
  3863.  
  3864. @findex LEGITIMATE_PIC_OPERAND_P
  3865. @item LEGITIMATE_PIC_OPERAND_P (@var{x})
  3866. A C expression that is nonzero if @var{x} is a legitimate immediate
  3867. operand on the target machine when generating position independent code.
  3868. You can assume that @var{x} satisfies @code{CONSTANT_P}, so you need not
  3869. check this.  You can also assume @var{flag_pic} is true, so you need not
  3870. check it either.  You need not define this macro if all constants 
  3871. (including @code{SYMBOL_REF}) can be immediate operands when generating 
  3872. position independent code.
  3873. @end table
  3874.  
  3875. @node Assembler Format
  3876. @section Defining the Output Assembler Language
  3877.  
  3878. This section describes macros whose principal purpose is to describe how
  3879. to write instructions in assembler language--rather than what the
  3880. instructions do.
  3881.  
  3882. @menu
  3883. * File Framework::       Structural information for the assembler file.
  3884. * Data Output::          Output of constants (numbers, strings, addresses).
  3885. * Uninitialized Data::   Output of uninitialized variables.
  3886. * Label Output::         Output and generation of labels.
  3887. * Initialization::       General principles of initialization
  3888.                and termination routines.
  3889. * Macros for Initialization::
  3890.              Specific macros that control the handling of 
  3891.                initialization and termination routines.
  3892. * Instruction Output::   Output of actual instructions.
  3893. * Dispatch Tables::      Output of jump tables.
  3894. * Alignment Output::     Pseudo ops for alignment and skipping data.
  3895. @end menu
  3896.  
  3897. @node File Framework
  3898. @subsection The Overall Framework of an Assembler File 
  3899. @cindex assembler format
  3900. @cindex output of assembler code
  3901.  
  3902. @table @code
  3903. @findex ASM_FILE_START
  3904. @item ASM_FILE_START (@var{stream})
  3905. A C expression which outputs to the stdio stream @var{stream}
  3906. some appropriate text to go at the start of an assembler file.
  3907.  
  3908. Normally this macro is defined to output a line containing
  3909. @samp{#NO_APP}, which is a comment that has no effect on most
  3910. assemblers but tells the GNU assembler that it can save time by not
  3911. checking for certain assembler constructs.
  3912.  
  3913. On systems that use SDB, it is necessary to output certain commands;
  3914. see @file{attasm.h}.
  3915.  
  3916. @findex ASM_FILE_END
  3917. @item ASM_FILE_END (@var{stream})
  3918. A C expression which outputs to the stdio stream @var{stream}
  3919. some appropriate text to go at the end of an assembler file.
  3920.  
  3921. If this macro is not defined, the default is to output nothing
  3922. special at the end of the file.  Most systems don't require any
  3923. definition.
  3924.  
  3925. On systems that use SDB, it is necessary to output certain commands;
  3926. see @file{attasm.h}.
  3927.  
  3928. @findex ASM_IDENTIFY_GCC
  3929. @item ASM_IDENTIFY_GCC (@var{file})
  3930. A C statement to output assembler commands which will identify
  3931. the object file as having been compiled with GNU CC (or another
  3932. GNU compiler).
  3933.  
  3934. If you don't define this macro, the string @samp{gcc_compiled.:}
  3935. is output.  This string is calculated to define a symbol which,
  3936. on BSD systems, will never be defined for any other reason.
  3937. GDB checks for the presence of this symbol when reading the
  3938. symbol table of an executable.
  3939.  
  3940. On non-BSD systems, you must arrange communication with GDB in
  3941. some other fashion.  If GDB is not used on your system, you can
  3942. define this macro with an empty body.
  3943.  
  3944. @findex ASM_COMMENT_START
  3945. @item ASM_COMMENT_START
  3946. A C string constant describing how to begin a comment in the target
  3947. assembler language.  The compiler assumes that the comment will end at
  3948. the end of the line.
  3949.  
  3950. @findex ASM_APP_ON
  3951. @item ASM_APP_ON
  3952. A C string constant for text to be output before each @code{asm}
  3953. statement or group of consecutive ones.  Normally this is
  3954. @code{"#APP"}, which is a comment that has no effect on most
  3955. assemblers but tells the GNU assembler that it must check the lines
  3956. that follow for all valid assembler constructs.
  3957.  
  3958. @findex ASM_APP_OFF
  3959. @item ASM_APP_OFF
  3960. A C string constant for text to be output after each @code{asm}
  3961. statement or group of consecutive ones.  Normally this is
  3962. @code{"#NO_APP"}, which tells the GNU assembler to resume making the
  3963. time-saving assumptions that are valid for ordinary compiler output.
  3964.  
  3965. @findex ASM_OUTPUT_SOURCE_FILENAME
  3966. @item ASM_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
  3967. A C statement to output COFF information or DWARF debugging information
  3968. which indicates that filename @var{name} is the current source file to
  3969. the stdio stream @var{stream}.
  3970.  
  3971. This macro need not be defined if the standard form of output
  3972. for the file format in use is appropriate.
  3973.  
  3974. @findex ASM_OUTPUT_SOURCE_LINE
  3975. @item ASM_OUTPUT_SOURCE_LINE (@var{stream}, @var{line})
  3976. A C statement to output DBX or SDB debugging information before code
  3977. for line number @var{line} of the current source file to the
  3978. stdio stream @var{stream}.
  3979.  
  3980. This macro need not be defined if the standard form of debugging
  3981. information for the debugger in use is appropriate.
  3982.  
  3983. @findex ASM_OUTPUT_IDENT
  3984. @item ASM_OUTPUT_IDENT (@var{stream}, @var{string})
  3985. A C statement to output something to the assembler file to handle a
  3986. @samp{#ident} directive containing the text @var{string}.  If this
  3987. macro is not defined, nothing is output for a @samp{#ident} directive.
  3988.  
  3989. @findex OBJC_PROLOGUE
  3990. @item OBJC_PROLOGUE
  3991. A C statement to output any assembler statements which are required to
  3992. precede any Objective C object definitions or message sending.  The
  3993. statement is executed only when compiling an Objective C program.
  3994. @end table
  3995.  
  3996. @node Data Output
  3997. @subsection Output of Data
  3998.  
  3999. @table @code
  4000. @findex ASM_OUTPUT_LONG_DOUBLE
  4001. @findex ASM_OUTPUT_DOUBLE
  4002. @findex ASM_OUTPUT_FLOAT
  4003. @item ASM_OUTPUT_LONG_DOUBLE (@var{stream}, @var{value})
  4004. @item ASM_OUTPUT_DOUBLE (@var{stream}, @var{value})
  4005. @item ASM_OUTPUT_FLOAT (@var{stream}, @var{value})
  4006. A C statement to output to the stdio stream @var{stream} an assembler
  4007. instruction to assemble a floating-point constant of @code{TFmode},
  4008. @code{DFmode} or @code{SFmode}, respectively, whose value is
  4009. @var{value}.  @var{value} will be a C expression of type
  4010. @code{REAL_VALUE__TYPE}, usually @code{double}.@refill
  4011.  
  4012. @findex ASM_OUTPUT_QUADRUPLE_INT
  4013. @findex ASM_OUTPUT_DOUBLE_INT
  4014. @findex ASM_OUTPUT_INT
  4015. @findex ASM_OUTPUT_SHORT
  4016. @findex ASM_OUTPUT_CHAR
  4017. @findex output_addr_const
  4018. @item ASM_OUTPUT_QUADRUPLE_INT (@var{stream}, @var{exp})
  4019. @item ASM_OUTPUT_DOUBLE_INT (@var{stream}, @var{exp})
  4020. @item ASM_OUTPUT_INT (@var{stream}, @var{exp})
  4021. @itemx ASM_OUTPUT_SHORT (@var{stream}, @var{exp})
  4022. @itemx ASM_OUTPUT_CHAR (@var{stream}, @var{exp})
  4023. A C statement to output to the stdio stream @var{stream} an assembler
  4024. instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
  4025. respectively, whose value is @var{value}.  The argument @var{exp} will
  4026. be an RTL expression which represents a constant value.  Use
  4027. @samp{output_addr_const (@var{stream}, @var{exp})} to output this value
  4028. as an assembler expression.@refill
  4029.  
  4030. For sizes larger than @code{UNITS_PER_WORD}, if the action of a macro
  4031. would be identical to repeatedly calling the macro corresponding to
  4032. a size of @code{UNITS_PER_WORD}, once for each word, you need not define
  4033. the macro.
  4034.  
  4035. @findex ASM_OUTPUT_BYTE
  4036. @item ASM_OUTPUT_BYTE (@var{stream}, @var{value})
  4037. A C statement to output to the stdio stream @var{stream} an assembler
  4038. instruction to assemble a single byte containing the number @var{value}.
  4039.  
  4040. @findex ASM_BYTE_OP
  4041. @item ASM_BYTE_OP
  4042. A C string constant giving the pseudo-op to use for a sequence of
  4043. single-byte constants.  If this macro is not defined, the default is
  4044. @code{"byte"}.
  4045.  
  4046. @findex ASM_OUTPUT_ASCII
  4047. @item ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len})
  4048. A C statement to output to the stdio stream @var{stream} an assembler
  4049. instruction to assemble a string constant containing the @var{len}
  4050. bytes at @var{ptr}.  @var{ptr} will be a C expression of type
  4051. @code{char *} and @var{len} a C expression of type @code{int}.
  4052.  
  4053. If the assembler has a @code{.ascii} pseudo-op as found in the
  4054. Berkeley Unix assembler, do not define the macro
  4055. @code{ASM_OUTPUT_ASCII}.
  4056.  
  4057. @findex ASM_OUTPUT_POOL_PROLOGUE
  4058. @item ASM_OUTPUT_POOL_PROLOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
  4059. A C statement to output assembler commands to define the start of the
  4060. constant pool for a function.  @var{funname} is a string giving
  4061. the name of the function.  Should the return type of the function
  4062. be required, it can be obtained via @var{fundecl}.  @var{size}
  4063. is the size, in bytes, of the constant pool that will be written
  4064. immediately after this call.
  4065.  
  4066. If no constant-pool prefix is required, the usual case, this macro need
  4067. not be defined.
  4068.  
  4069. @findex ASM_OUTPUT_SPECIAL_POOL_ENTRY
  4070. @item ASM_OUTPUT_SPECIAL_POOL_ENTRY (@var{file}, @var{x}, @var{mode}, @var{align}, @var{labelno}, @var{jumpto})
  4071. A C statement (with or without semicolon) to output a constant in the
  4072. constant pool, if it needs special treatment.  (This macro need not do
  4073. anything for RTL expressions that can be output normally.)
  4074.  
  4075. The argument @var{file} is the standard I/O stream to output the
  4076. assembler code on.  @var{x} is the RTL expression for the constant to
  4077. output, and @var{mode} is the machine mode (in case @var{x} is a
  4078. @samp{const_int}).  @var{align} is the required alignment for the value
  4079. @var{x}; you should output an assembler directive to force this much
  4080. alignment.
  4081.  
  4082. The argument @var{labelno} is a number to use in an internal label for
  4083. the address of this pool entry.  The definition of this macro is
  4084. responsible for outputting the label definition at the proper place.
  4085. Here is how to do this:
  4086.  
  4087. @example
  4088. ASM_OUTPUT_INTERNAL_LABEL (@var{file}, "LC", @var{labelno});
  4089. @end example
  4090.  
  4091. When you output a pool entry specially, you should end with a
  4092. @code{goto} to the label @var{jumpto}.  This will prevent the same pool
  4093. entry from being output a second time in the usual manner.
  4094.  
  4095. You need not define this macro if it would do nothing.
  4096.  
  4097. @findex ASM_OPEN_PAREN
  4098. @findex ASM_CLOSE_PAREN
  4099. @item ASM_OPEN_PAREN
  4100. @itemx ASM_CLOSE_PAREN
  4101. These macros are defined as C string constant, describing the syntax
  4102. in the assembler for grouping arithmetic expressions.  The following
  4103. definitions are correct for most assemblers:
  4104.  
  4105. @example
  4106. #define ASM_OPEN_PAREN "("
  4107. #define ASM_CLOSE_PAREN ")"
  4108. @end example
  4109. @end table
  4110.  
  4111. @node Uninitialized Data
  4112. @subsection Output of Uninitialized Variables
  4113.  
  4114. Each of the macros in this section is used to do the whole job of
  4115. outputting a single uninitialized variable.
  4116.  
  4117. @table @code
  4118. @findex ASM_OUTPUT_COMMON
  4119. @item ASM_OUTPUT_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
  4120. A C statement (sans semicolon) to output to the stdio stream
  4121. @var{stream} the assembler definition of a common-label named
  4122. @var{name} whose size is @var{size} bytes.  The variable @var{rounded}
  4123. is the size rounded up to whatever alignment the caller wants.
  4124.  
  4125. Use the expression @code{assemble_name (@var{stream}, @var{name})} to
  4126. output the name itself; before and after that, output the additional
  4127. assembler syntax for defining the name, and a newline.
  4128.  
  4129. This macro controls how the assembler definitions of uninitialized
  4130. global variables are output.
  4131.  
  4132. @findex ASM_OUTPUT_ALIGNED_COMMON
  4133. @item ASM_OUTPUT_ALIGNED_COMMON (@var{stream}, @var{name}, @var{size}, @var{alignment})
  4134. Like @code{ASM_OUTPUT_COMMON} except takes the required alignment as a
  4135. separate, explicit argument.  If you define this macro, it is used in
  4136. place of @code{ASM_OUTPUT_COMMON}, and gives you more flexibility in
  4137. handling the required alignment of the variable.
  4138.  
  4139. @findex ASM_OUTPUT_SHARED_COMMON
  4140. @item ASM_OUTPUT_SHARED_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
  4141. If defined, it is similar to @code{ASM_OUTPUT_COMMON}, except that it
  4142. is used when @var{name} is shared.  If not defined, @code{ASM_OUTPUT_COMMON}
  4143. will be used.
  4144.  
  4145. @findex ASM_OUTPUT_LOCAL
  4146. @item ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
  4147. A C statement (sans semicolon) to output to the stdio stream
  4148. @var{stream} the assembler definition of a local-common-label named
  4149. @var{name} whose size is @var{size} bytes.  The variable @var{rounded}
  4150. is the size rounded up to whatever alignment the caller wants.
  4151.  
  4152. Use the expression @code{assemble_name (@var{stream}, @var{name})} to
  4153. output the name itself; before and after that, output the additional
  4154. assembler syntax for defining the name, and a newline.
  4155.  
  4156. This macro controls how the assembler definitions of uninitialized
  4157. static variables are output.
  4158.  
  4159. @findex ASM_OUTPUT_ALIGNED_LOCAL
  4160. @item ASM_OUTPUT_ALIGNED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{alignment})
  4161. Like @code{ASM_OUTPUT_LOCAL} except takes the required alignment as a
  4162. separate, explicit argument.  If you define this macro, it is used in
  4163. place of @code{ASM_OUTPUT_LOCAL}, and gives you more flexibility in
  4164. handling the required alignment of the variable.
  4165.  
  4166. @findex ASM_OUTPUT_SHARED_LOCAL
  4167. @item ASM_OUTPUT_SHARED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
  4168. If defined, it is similar to @code{ASM_OUTPUT_LOCAL}, except that it
  4169. is used when @var{name} is shared.  If not defined, @code{ASM_OUTPUT_LOCAL}
  4170. will be used.
  4171. @end table
  4172.  
  4173. @node Label Output
  4174. @subsection Output and Generation of Labels
  4175.  
  4176. @table @code
  4177. @findex ASM_OUTPUT_LABEL
  4178. @findex assemble_name
  4179. @item ASM_OUTPUT_LABEL (@var{stream}, @var{name})
  4180. A C statement (sans semicolon) to output to the stdio stream
  4181. @var{stream} the assembler definition of a label named @var{name}.
  4182. Use the expression @code{assemble_name (@var{stream}, @var{name})} to
  4183. output the name itself; before and after that, output the additional
  4184. assembler syntax for defining the name, and a newline.
  4185.  
  4186. @findex ASM_DECLARE_FUNCTION_NAME
  4187. @item ASM_DECLARE_FUNCTION_NAME (@var{stream}, @var{name}, @var{decl})
  4188. A C statement (sans semicolon) to output to the stdio stream
  4189. @var{stream} any text necessary for declaring the name @var{name} of a
  4190. function which is being defined.  This macro is responsible for
  4191. outputting the label definition (perhaps using
  4192. @code{ASM_OUTPUT_LABEL}).  The argument @var{decl} is the
  4193. @code{FUNCTION_DECL} tree node representing the function.
  4194.  
  4195. If this macro is not defined, then the function name is defined in the
  4196. usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
  4197.  
  4198. @findex ASM_DECLARE_FUNCTION_SIZE
  4199. @item ASM_DECLARE_FUNCTION_SIZE (@var{stream}, @var{name}, @var{decl})
  4200. A C statement (sans semicolon) to output to the stdio stream
  4201. @var{stream} any text necessary for declaring the size of a function
  4202. which is being defined.  The argument @var{name} is the name of the
  4203. function.  The argument @var{decl} is the @code{FUNCTION_DECL} tree node
  4204. representing the function.
  4205.  
  4206. If this macro is not defined, then the function size is not defined.
  4207.  
  4208. @findex ASM_DECLARE_OBJECT_NAME
  4209. @item ASM_DECLARE_OBJECT_NAME (@var{stream}, @var{name}, @var{decl})
  4210. A C statement (sans semicolon) to output to the stdio stream
  4211. @var{stream} any text necessary for declaring the name @var{name} of an
  4212. initialized variable which is being defined.  This macro must output the
  4213. label definition (perhaps using @code{ASM_OUTPUT_LABEL}).  The argument
  4214. @var{decl} is the @code{VAR_DECL} tree node representing the variable.
  4215.  
  4216. If this macro is not defined, then the variable name is defined in the
  4217. usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
  4218.  
  4219. @findex ASM_GLOBALIZE_LABEL
  4220. @item ASM_GLOBALIZE_LABEL (@var{stream}, @var{name})
  4221. A C statement (sans semicolon) to output to the stdio stream
  4222. @var{stream} some commands that will make the label @var{name} global;
  4223. that is, available for reference from other files.  Use the expression
  4224. @code{assemble_name (@var{stream}, @var{name})} to output the name
  4225. itself; before and after that, output the additional assembler syntax
  4226. for making that name global, and a newline.
  4227.  
  4228. @findex ASM_OUTPUT_EXTERNAL
  4229. @item ASM_OUTPUT_EXTERNAL (@var{stream}, @var{decl}, @var{name})
  4230. A C statement (sans semicolon) to output to the stdio stream
  4231. @var{stream} any text necessary for declaring the name of an external
  4232. symbol named @var{name} which is referenced in this compilation but
  4233. not defined.  The value of @var{decl} is the tree node for the
  4234. declaration.
  4235.  
  4236. This macro need not be defined if it does not need to output anything.
  4237. The GNU assembler and most Unix assemblers don't require anything.
  4238.  
  4239. @findex ASM_OUTPUT_EXTERNAL_LIBCALL
  4240. @item ASM_OUTPUT_EXTERNAL_LIBCALL (@var{stream}, @var{symref})
  4241. A C statement (sans semicolon) to output on @var{stream} an assembler
  4242. pseudo-op to declare a library function name external.  The name of the
  4243. library function is given by @var{symref}, which has type @code{rtx} and
  4244. is a @code{symbol_ref}.
  4245.  
  4246. This macro need not be defined if it does not need to output anything.
  4247. The GNU assembler and most Unix assemblers don't require anything.
  4248.  
  4249. @findex ASM_OUTPUT_LABELREF
  4250. @item ASM_OUTPUT_LABELREF (@var{stream}, @var{name})
  4251. A C statement (sans semicolon) to output to the stdio stream
  4252. @var{stream} a reference in assembler syntax to a label named
  4253. @var{name}.  This should add @samp{_} to the front of the name, if that
  4254. is customary on your operating system, as it is in most Berkeley Unix
  4255. systems.  This macro is used in @code{assemble_name}.
  4256.  
  4257. @findex ASM_OUTPUT_LABELREF_AS_INT
  4258. @item ASM_OUTPUT_LABELREF_AS_INT (@var{file}, @var{label})
  4259. Define this macro for systems that use the program @code{collect2}.
  4260. The definition should be a C statement to output a word containing
  4261. a reference to the label @var{label}.
  4262.  
  4263. @findex ASM_OUTPUT_INTERNAL_LABEL
  4264. @item ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{prefix}, @var{num})
  4265. A C statement to output to the stdio stream @var{stream} a label whose
  4266. name is made from the string @var{prefix} and the number @var{num}.
  4267.  
  4268. It is absolutely essential that these labels be distinct from the labels
  4269. used for user-level functions and variables.  Otherwise, certain programs
  4270. will have name conflicts with internal labels.
  4271.  
  4272. It is desirable to exclude internal labels from the symbol table of the
  4273. object file.  Most assemblers have a naming convention for labels that
  4274. should be excluded; on many systems, the letter @samp{L} at the
  4275. beginning of a label has this effect.  You should find out what
  4276. convention your system uses, and follow it.
  4277.  
  4278. The usual definition of this macro is as follows:
  4279.  
  4280. @example
  4281. fprintf (@var{stream}, "L%s%d:\n", @var{prefix}, @var{num})
  4282. @end example
  4283.  
  4284. @findex ASM_GENERATE_INTERNAL_LABEL
  4285. @item ASM_GENERATE_INTERNAL_LABEL (@var{string}, @var{prefix}, @var{num})
  4286. A C statement to store into the string @var{string} a label whose name
  4287. is made from the string @var{prefix} and the number @var{num}.
  4288.  
  4289. This string, when output subsequently by @code{assemble_name},
  4290. should produce the same output that @code{ASM_OUTPUT_INTERNAL_LABEL}
  4291. would produce with the same @var{prefix} and @var{num}.
  4292.  
  4293. If the string begins with @samp{*}, then @code{assemble_name} will
  4294. output the rest of the string unchanged.  It is often convenient for
  4295. @code{ASM_GENERATE_INTERNAL_LABEL} to use @samp{*} in this way.  If the
  4296. string doesn't start with @samp{*}, then @code{ASM_OUTPUT_LABELREF} gets
  4297. to output the string, and may change it.  (Of course,
  4298. @code{ASM_OUTPUT_LABELREF} is also part of your machine description, so
  4299. you should know what it does on your machine.)
  4300.  
  4301. @findex ASM_FORMAT_PRIVATE_NAME
  4302. @item ASM_FORMAT_PRIVATE_NAME (@var{outvar}, @var{name}, @var{number})
  4303. A C expression to assign to @var{outvar} (which is a variable of type
  4304. @code{char *}) a newly allocated string made from the string
  4305. @var{name} and the number @var{number}, with some suitable punctuation
  4306. added.  Use @code{alloca} to get space for the string.
  4307.  
  4308. This string will be used as the argument to @code{ASM_OUTPUT_LABELREF}
  4309. to produce an assembler label for an internal static variable whose
  4310. name is @var{name}.  Therefore, the string must be such as to result
  4311. in valid assembler code.  The argument @var{number} is different each
  4312. time this macro is executed; it prevents conflicts between
  4313. similarly-named internal static variables in different scopes.
  4314.  
  4315. Ideally this string should not be a valid C identifier, to prevent any
  4316. conflict with the user's own symbols.  Most assemblers allow periods
  4317. or percent signs in assembler symbols; putting at least one of these
  4318. between the name and the number will suffice.
  4319.  
  4320. @findex OBJC_GEN_METHOD_LABEL
  4321. @item OBJC_GEN_METHOD_LABEL (@var{buf}, @var{is_inst}, @var{class_name}, @var{cat_name}, @var{sel_name})
  4322. Define this macro to override the default assembler names used for
  4323. Objective C methods.
  4324.  
  4325. The default name is a unique method number followed by the name of the
  4326. class (e.g.@: @samp{_1_Foo}).  For methods in categories, the name of
  4327. the category is also included in the assembler name (e.g.@:
  4328. @samp{_1_Foo_Bar}).
  4329.  
  4330. These names are safe on most systems, but make debugging difficult since
  4331. the method's selector is not present in the name.  Therefore, particular
  4332. systems define other ways of computing names.
  4333.  
  4334. @var{buf} is an expression of type @code{char *} which gives you a
  4335. buffer in which to store the name; its length is as long as
  4336. @var{class_name}, @var{cat_name} and @var{sel_name} put together, plus
  4337. 50 characters extra.
  4338.  
  4339. The argument @var{is_inst} specifies whether the method is an instance
  4340. method or a class method; @var{class_name} is the name of the class;
  4341. @var{cat_name} is the name of the category (or NULL if the method is not
  4342. in a category); and @var{sel_name} is the name of the selector.
  4343.  
  4344. On systems where the assembler can handle quoted names, you can use this
  4345. macro to provide more human-readable names.
  4346. @end table
  4347.  
  4348. @node Initialization
  4349. @subsection How Initialization Functions Are Handled
  4350. @cindex initialization routines
  4351. @cindex termination routines
  4352. @cindex constructors, output of
  4353. @cindex destructors, output of
  4354.  
  4355. The compiled code for certain languages includes @dfn{constructors}
  4356. (also called @dfn{initialization routines})---functions to initialize
  4357. data in the program when the program is started.  These functions need
  4358. to be called before the program is ``started''---that is to say, before
  4359. @code{main} is called.
  4360.  
  4361. Compiling some languages generates @dfn{destructors} (also called
  4362. @dfn{termination routines}) that should be called when the program
  4363. terminates.
  4364.  
  4365. To make the initialization and termination functions work, the compiler
  4366. must output something in the assembler code to cause those functions to
  4367. be called at the appropriate time.  When you port the compiler to a new
  4368. system, you need to specify how to do this.
  4369.  
  4370. There are two major ways that GCC currently supports the execution of
  4371. initialization and termination functions.  Each way has two variants.
  4372. Much of the structure is common to all four variations.
  4373.  
  4374. @findex __CTOR_LIST__
  4375. @findex __DTOR_LIST__
  4376. The linker must build two lists of these functions---a list of
  4377. initialization functions, called @code{__CTOR_LIST__}, and a list of
  4378. termination functions, called @code{__DTOR_LIST__}.
  4379.  
  4380. Each list always begins with an ignored function pointer (which may hold
  4381. 0, @minus{}1, or a count of the function pointers after it, depending on
  4382. the environment).  This is followed by a series of zero or more function
  4383. pointers to constructors (or destructors), followed by a function
  4384. pointer containing zero.
  4385.  
  4386. Depending on the operating system and its executable file format, either
  4387. @file{crtstuff.c} or @file{libgcc2.c} traverses these lists at startup
  4388. time and exit time.  Constructors are called in forward order of the
  4389. list; destructors in reverse order.
  4390.  
  4391. The best way to handle static constructors works only for object file
  4392. formats which provide arbitrarily-named sections.  A section is set
  4393. aside for a list of constructors, and another for a list of destructors.
  4394. Traditionally these are called @samp{.ctors} and @samp{.dtors}.  Each
  4395. object file that defines an initialization function also puts a word in
  4396. the constructor section to point to that function.  The linker
  4397. accumulates all these words into one contiguous @samp{.ctors} section.
  4398. Termination functions are handled similarly.
  4399.  
  4400. To use this method, you need appropriate definitions of the macros
  4401. @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR}.  Usually
  4402. you can get them by including @file{svr4.h}.
  4403.  
  4404. When arbitrary sections are available, there are two variants, depending
  4405. upon how the code in @file{crtstuff.c} is called.  On systems that
  4406. support an @dfn{init} section which is executed at program startup,
  4407. parts of @file{crtstuff.c} are compiled into that section.  The
  4408. program is linked by the @code{gcc} driver like this:
  4409.  
  4410. @example
  4411. ld -o @var{output_file} crtbegin.o @dots{} crtend.o -lgcc
  4412. @end example
  4413.  
  4414. The head of a function (@code{__do_global_ctors}) appears in the init
  4415. section of @file{crtbegin.o}; the remainder of the function appears in
  4416. the init section of @file{crtend.o}.  The linker will pull these two
  4417. parts of the section together, making a whole function.  If any of the
  4418. user's object files linked into the middle of it contribute code, then that
  4419. code will be executed as part of the body of @code{__do_global_ctors}.
  4420.  
  4421. To use this variant, you must define the @code{INIT_SECTION_ASM_OP}
  4422. macro properly.
  4423.  
  4424. If no init section is available, do not define
  4425. @code{INIT_SECTION_ASM_OP}.  Then @code{__do_global_ctors} is built into
  4426. the text section like all other functions, and resides in
  4427. @file{libgcc.a}.  When GCC compiles any function called @code{main}, it
  4428. inserts a procedure call to @code{__main} as the first executable code
  4429. after the function prologue.  The @code{__main} function, also defined
  4430. in @file{libgcc2.c}, simply calls @file{__do_global_ctors}.
  4431.  
  4432. In file formats that don't support arbitrary sections, there are again
  4433. two variants.  In the simplest variant, the GNU linker (GNU @code{ld})
  4434. and an `a.out' format must be used.  In this case,
  4435. @code{ASM_OUTPUT_CONSTRUCTOR} is defined to produce a @code{.stabs}
  4436. entry of type @samp{N_SETT}, referencing the name @code{__CTOR_LIST__},
  4437. and with the address of the void function containing the initialization
  4438. code as its value.  The GNU linker recognizes this as a request to add
  4439. the value to a ``set''; the values are accumulated, and are eventually
  4440. placed in the executable as a vector in the format described above, with
  4441. a leading (ignored) count and a trailing zero element.
  4442. @code{ASM_OUTPUT_DESTRUCTOR} is handled similarly.  Since no init
  4443. section is available, the absence of @code{INIT_SECTION_ASM_OP} causes
  4444. the compilation of @code{main} to call @code{__main} as above, starting
  4445. the initialization process.
  4446.  
  4447. The last variant uses neither arbitrary sections nor the GNU linker.
  4448. This is preferable when you want to do dynamic linking and when using
  4449. file formats which the GNU linker does not support, such as `ECOFF'.  In
  4450. this case, @code{ASM_OUTPUT_CONSTRUCTOR} does not produce an
  4451. @code{N_SETT} symbol; initialization and termination functions are
  4452. recognized simply by their names.  This requires an extra program in the
  4453. linkage step, called @code{collect2}.  This program pretends to be the
  4454. linker, for use with GNU CC; it does its job by running the ordinary
  4455. linker, but also arranges to include the vectors of initialization and
  4456. termination functions.  These functions are called via @code{__main} as
  4457. described above.
  4458.  
  4459. Choosing among these configuration options has been simplified by a set
  4460. of operating-system-dependent files in the @file{config} subdirectory.
  4461. These files define all of the relevant parameters.  Usually it is
  4462. sufficient to include one into your specific machine-dependent
  4463. configuration file.  These files are:
  4464.  
  4465. @table @file
  4466. @item aoutos.h
  4467. For operating systems using the `a.out' format.
  4468.  
  4469. @item next.h
  4470. For operating systems using the `MachO' format.
  4471.  
  4472. @item svr3.h
  4473. For System V Release 3 and similar systems using `COFF' format.
  4474.  
  4475. @item svr4.h
  4476. For System V Release 4 and similar systems using `ELF' format.
  4477.  
  4478. @item vms.h
  4479. For the VMS operating system.
  4480. @end table
  4481.  
  4482. @ifinfo
  4483. The following section describes the specific macros that control and
  4484. customize the handling of initialization and termination functions.
  4485. @end ifinfo
  4486.  
  4487. @node Macros for Initialization
  4488. @subsection Macros Controlling Initialization Routines
  4489.  
  4490. Here are the macros that control how the compiler handles initialization
  4491. and termination functions:
  4492.  
  4493. @table @code
  4494. @findex INIT_SECTION_ASM_OP
  4495. @item INIT_SECTION_ASM_OP
  4496. If defined, a C string constant for the assembler operation to identify
  4497. the following data as initialization code.  If not defined, GNU CC will
  4498. assume such a section does not exist.  When you are using special
  4499. sections for initialization and termination functions, this macro also
  4500. controls how @file{crtstuff.c} and @file{libgcc2.c} arrange to run the
  4501. initialization functions.
  4502.  
  4503. @item ASM_OUTPUT_CONSTRUCTOR (@var{stream}, @var{name})
  4504. @findex ASM_OUTPUT_CONSTRUCTOR
  4505. Define this macro as a C statement to output on the stream @var{stream}
  4506. the assembler code to arrange to call the function named @var{name} at
  4507. initialization time.
  4508.  
  4509. Assume that @var{name} is the name of a C function generated
  4510. automatically by the compiler.  This function takes no arguments.  Use
  4511. the function @code{assemble_name} to output the name @var{name}; this
  4512. performs any system-specific syntactic transformations such as adding an
  4513. underscore.
  4514.  
  4515. If you don't define this macro, nothing special is output to arrange to
  4516. call the function.  This is correct when the function will be called in
  4517. some other manner---for example, by means of the @code{collect2} program,
  4518. which looks through the symbol table to find these functions by their
  4519. names.  If you want to use @code{collect2}, then you need to arrange for
  4520. it to be built and installed and used on your system.
  4521.  
  4522. @item ASM_OUTPUT_DESTRUCTOR (@var{stream}, @var{name})
  4523. @findex ASM_OUTPUT_DESTRUCTOR
  4524. This is like @code{ASM_OUTPUT_CONSTRUCTOR} but used for termination
  4525. functions rather than initialization functions.
  4526. @end table
  4527.  
  4528. If your system uses @code{collect2} as the means of processing
  4529. constructors, then that program normally uses @code{nm} to scan an
  4530. object file for constructor functions to be called.  On certain kinds of
  4531. systems, you can define these macros to make @code{collect2} work faster
  4532. (and, in some cases, make it work at all):
  4533.  
  4534. @table @code
  4535. @findex OBJECT_FORMAT_COFF
  4536. @item OBJECT_FORMAT_COFF
  4537. Define this macro if the system uses COFF (Common Object File Format)
  4538. object files, so that @code{collect2} can assume this format and scan
  4539. object files directly for dynamic constructor/destructor functions.
  4540.  
  4541. @findex OBJECT_FORMAT_ROSE
  4542. @item OBJECT_FORMAT_ROSE
  4543. Define this macro if the system uses ROSE format object files, so that
  4544. @code{collect2} can assume this format and scan object files directly
  4545. for dynamic constructor/destructor functions.
  4546. @end table
  4547.  
  4548. These macros are effective only in a native compiler; @code{collect2} as
  4549. part of a cross compiler always uses @code{nm}.
  4550.  
  4551. @table @code
  4552. @findex REAL_NM_FILE_NAME
  4553. @item REAL_NM_FILE_NAME
  4554. Define this macro as a C string constant containing the file name to use
  4555. to execute @code{nm}.  The default is to search the path normally for
  4556. @code{nm}.
  4557. @end table
  4558.  
  4559. @node Instruction Output
  4560. @subsection Output of Assembler Instructions
  4561.  
  4562. @table @code
  4563. @findex REGISTER_NAMES
  4564. @item REGISTER_NAMES
  4565. A C initializer containing the assembler's names for the machine
  4566. registers, each one as a C string constant.  This is what translates
  4567. register numbers in the compiler into assembler language.
  4568.  
  4569. @findex ADDITIONAL_REGISTER_NAMES
  4570. @item ADDITIONAL_REGISTER_NAMES
  4571. If defined, a C initializer for an array of structures containing a name
  4572. and a register number.  This macro defines additional names for hard
  4573. registers, thus allowing the @code{asm} option in declarations to refer
  4574. to registers using alternate names.
  4575.  
  4576. @findex ASM_OUTPUT_OPCODE
  4577. @item ASM_OUTPUT_OPCODE (@var{stream}, @var{ptr})
  4578. Define this macro if you are using an unusual assembler that
  4579. requires different names for the machine instructions.
  4580.  
  4581. The definition is a C statement or statements which output an
  4582. assembler instruction opcode to the stdio stream @var{stream}.  The
  4583. macro-operand @var{ptr} is a variable of type @code{char *} which
  4584. points to the opcode name in its ``internal'' form---the form that is
  4585. written in the machine description.  The definition should output the
  4586. opcode name to @var{stream}, performing any translation you desire, and
  4587. increment the variable @var{ptr} to point at the end of the opcode
  4588. so that it will not be output twice.
  4589.  
  4590. In fact, your macro definition may process less than the entire opcode
  4591. name, or more than the opcode name; but if you want to process text
  4592. that includes @samp{%}-sequences to substitute operands, you must take
  4593. care of the substitution yourself.  Just be sure to increment
  4594. @var{ptr} over whatever text should not be output normally.
  4595.  
  4596. @findex recog_operand
  4597. If you need to look at the operand values, they can be found as the
  4598. elements of @code{recog_operand}.
  4599.  
  4600. If the macro definition does nothing, the instruction is output
  4601. in the usual way.
  4602.  
  4603. @findex FINAL_PRESCAN_INSN
  4604. @item FINAL_PRESCAN_INSN (@var{insn}, @var{opvec}, @var{noperands})
  4605. If defined, a C statement to be executed just prior to the output of
  4606. assembler code for @var{insn}, to modify the extracted operands so
  4607. they will be output differently.
  4608.  
  4609. Here the argument @var{opvec} is the vector containing the operands
  4610. extracted from @var{insn}, and @var{noperands} is the number of
  4611. elements of the vector which contain meaningful data for this insn.
  4612. The contents of this vector are what will be used to convert the insn
  4613. template into assembler code, so you can change the assembler output
  4614. by changing the contents of the vector.
  4615.  
  4616. This macro is useful when various assembler syntaxes share a single
  4617. file of instruction patterns; by defining this macro differently, you
  4618. can cause a large class of instructions to be output differently (such
  4619. as with rearranged operands).  Naturally, variations in assembler
  4620. syntax affecting individual insn patterns ought to be handled by
  4621. writing conditional output routines in those patterns.
  4622.  
  4623. If this macro is not defined, it is equivalent to a null statement.
  4624.  
  4625. @findex PRINT_OPERAND
  4626. @item PRINT_OPERAND (@var{stream}, @var{x}, @var{code})
  4627. A C compound statement to output to stdio stream @var{stream} the
  4628. assembler syntax for an instruction operand @var{x}.  @var{x} is an
  4629. RTL expression.
  4630.  
  4631. @var{code} is a value that can be used to specify one of several ways
  4632. of printing the operand.  It is used when identical operands must be
  4633. printed differently depending on the context.  @var{code} comes from
  4634. the @samp{%} specification that was used to request printing of the
  4635. operand.  If the specification was just @samp{%@var{digit}} then
  4636. @var{code} is 0; if the specification was @samp{%@var{ltr}
  4637. @var{digit}} then @var{code} is the ASCII code for @var{ltr}.
  4638.  
  4639. @findex reg_names
  4640. If @var{x} is a register, this macro should print the register's name.
  4641. The names can be found in an array @code{reg_names} whose type is
  4642. @code{char *[]}.  @code{reg_names} is initialized from
  4643. @code{REGISTER_NAMES}.
  4644.  
  4645. When the machine description has a specification @samp{%@var{punct}}
  4646. (a @samp{%} followed by a punctuation character), this macro is called
  4647. with a null pointer for @var{x} and the punctuation character for
  4648. @var{code}.
  4649.  
  4650. @findex PRINT_OPERAND_PUNCT_VALID_P
  4651. @item PRINT_OPERAND_PUNCT_VALID_P (@var{code})
  4652. A C expression which evaluates to true if @var{code} is a valid
  4653. punctuation character for use in the @code{PRINT_OPERAND} macro.  If
  4654. @code{PRINT_OPERAND_PUNCT_VALID_P} is not defined, it means that no
  4655. punctuation characters (except for the standard one, @samp{%}) are used
  4656. in this way.
  4657.  
  4658. @findex PRINT_OPERAND_ADDRESS
  4659. @item PRINT_OPERAND_ADDRESS (@var{stream}, @var{x})
  4660. A C compound statement to output to stdio stream @var{stream} the
  4661. assembler syntax for an instruction operand that is a memory reference
  4662. whose address is @var{x}.  @var{x} is an RTL expression.
  4663.  
  4664. @cindex @code{ENCODE_SECTION_INFO} usage
  4665. On some machines, the syntax for a symbolic address depends on the
  4666. section that the address refers to.  On these machines, define the macro
  4667. @code{ENCODE_SECTION_INFO} to store the information into the
  4668. @code{symbol_ref}, and then check for it here.  @xref{Assembler Format}.
  4669.  
  4670. @findex DBR_OUTPUT_SEQEND
  4671. @findex dbr_sequence_length
  4672. @item DBR_OUTPUT_SEQEND(@var{file})
  4673. A C statement, to be executed after all slot-filler instructions have
  4674. been output.  If necessary, call @code{dbr_sequence_length} to
  4675. determine the number of slots filled in a sequence (zero if not
  4676. currently outputting a sequence), to decide how many no-ops to output,
  4677. or whatever.
  4678.  
  4679. Don't define this macro if it has nothing to do, but it is helpful in
  4680. reading assembly output if the extent of the delay sequence is made
  4681. explicit (e.g. with white space).
  4682.  
  4683. @findex final_sequence
  4684. Note that output routines for instructions with delay slots must be
  4685. prepared to deal with not being output as part of a sequence (i.e.
  4686. when the scheduling pass is not run, or when no slot fillers could be
  4687. found.)  The variable @code{final_sequence} is null when not
  4688. processing a sequence, otherwise it contains the @code{sequence} rtx
  4689. being output.
  4690.  
  4691. @findex REGISTER_PREFIX
  4692. @findex LOCAL_LABEL_PREFIX
  4693. @findex USER_LABEL_PREFIX
  4694. @findex IMMEDIATE_PREFIX
  4695. @findex asm_fprintf
  4696. @item REGISTER_PREFIX
  4697. @itemx LOCAL_LABEL_PREFIX
  4698. @itemx USER_LABEL_PREFIX
  4699. @itemx IMMEDIATE_PREFIX
  4700. If defined, C string expressions to be used for the @samp{%R}, @samp{%L},
  4701. @samp{%U}, and @samp{%I} options of @code{asm_fprintf} (see
  4702. @file{final.c}).  These are useful when a single @file{md} file must
  4703. support multiple assembler formats.  In that case, the various @file{tm.h}
  4704. files can define these macros differently.
  4705.  
  4706. @findex ASM_OUTPUT_REG_PUSH
  4707. @item ASM_OUTPUT_REG_PUSH (@var{stream}, @var{regno})
  4708. A C expression to output to @var{stream} some assembler code
  4709. which will push hard register number @var{regno} onto the stack.
  4710. The code need not be optimal, since this macro is used only when
  4711. profiling.
  4712.  
  4713. @findex ASM_OUTPUT_REG_POP
  4714. @item ASM_OUTPUT_REG_POP (@var{stream}, @var{regno})
  4715. A C expression to output to @var{stream} some assembler code
  4716. which will pop hard register number @var{regno} off of the stack.
  4717. The code need not be optimal, since this macro is used only when
  4718. profiling.
  4719. @end table
  4720.  
  4721. @node Dispatch Tables
  4722. @subsection Output of Dispatch Tables
  4723.  
  4724. @table @code
  4725. @cindex dispatch table
  4726. @findex ASM_OUTPUT_ADDR_DIFF_ELT
  4727. @item ASM_OUTPUT_ADDR_DIFF_ELT (@var{stream}, @var{value}, @var{rel})
  4728. This macro should be provided on machines where the addresses
  4729. in a dispatch table are relative to the table's own address.
  4730.  
  4731. The definition should be a C statement to output to the stdio stream
  4732. @var{stream} an assembler pseudo-instruction to generate a difference
  4733. between two labels.  @var{value} and @var{rel} are the numbers of two
  4734. internal labels.  The definitions of these labels are output using
  4735. @code{ASM_OUTPUT_INTERNAL_LABEL}, and they must be printed in the same
  4736. way here.  For example,
  4737.  
  4738. @example
  4739. fprintf (@var{stream}, "\t.word L%d-L%d\n",
  4740.          @var{value}, @var{rel})
  4741. @end example
  4742.  
  4743. @findex ASM_OUTPUT_ADDR_VEC_ELT
  4744. @item ASM_OUTPUT_ADDR_VEC_ELT (@var{stream}, @var{value})
  4745. This macro should be provided on machines where the addresses
  4746. in a dispatch table are absolute.
  4747.  
  4748. The definition should be a C statement to output to the stdio stream
  4749. @var{stream} an assembler pseudo-instruction to generate a reference to
  4750. a label.  @var{value} is the number of an internal label whose
  4751. definition is output using @code{ASM_OUTPUT_INTERNAL_LABEL}.
  4752. For example,
  4753.  
  4754. @example
  4755. fprintf (@var{stream}, "\t.word L%d\n", @var{value})
  4756. @end example
  4757.  
  4758. @findex ASM_OUTPUT_CASE_LABEL
  4759. @item ASM_OUTPUT_CASE_LABEL (@var{stream}, @var{prefix}, @var{num}, @var{table})
  4760. Define this if the label before a jump-table needs to be output
  4761. specially.  The first three arguments are the same as for
  4762. @code{ASM_OUTPUT_INTERNAL_LABEL}; the fourth argument is the
  4763. jump-table which follows (a @code{jump_insn} containing an
  4764. @code{addr_vec} or @code{addr_diff_vec}).
  4765.  
  4766. This feature is used on system V to output a @code{swbeg} statement
  4767. for the table.
  4768.  
  4769. If this macro is not defined, these labels are output with
  4770. @code{ASM_OUTPUT_INTERNAL_LABEL}.
  4771.  
  4772. @findex ASM_OUTPUT_CASE_END
  4773. @item ASM_OUTPUT_CASE_END (@var{stream}, @var{num}, @var{table})
  4774. Define this if something special must be output at the end of a
  4775. jump-table.  The definition should be a C statement to be executed
  4776. after the assembler code for the table is written.  It should write
  4777. the appropriate code to stdio stream @var{stream}.  The argument
  4778. @var{table} is the jump-table insn, and @var{num} is the label-number
  4779. of the preceding label.
  4780.  
  4781. If this macro is not defined, nothing special is output at the end of
  4782. the jump-table.
  4783. @end table
  4784.  
  4785. @node Alignment Output
  4786. @subsection Assembler Commands for Alignment
  4787.  
  4788. @table @code
  4789. @findex ASM_OUTPUT_ALIGN_CODE
  4790. @item ASM_OUTPUT_ALIGN_CODE (@var{file})
  4791. A C expression to output text to align the location counter in the way
  4792. that is desirable at a point in the code that is reached only by
  4793. jumping.
  4794.  
  4795. This macro need not be defined if you don't want any special alignment
  4796. to be done at such a time.  Most machine descriptions do not currently
  4797. define the macro.
  4798.  
  4799. @findex ASM_OUTPUT_LOOP_ALIGN
  4800. @item ASM_OUTPUT_LOOP_ALIGN (@var{file})
  4801. A C expression to output text to align the location counter in the way
  4802. that is desirable at the beginning of a loop.
  4803.  
  4804. This macro need not be defined if you don't want any special alignment
  4805. to be done at such a time.  Most machine descriptions do not currently
  4806. define the macro.
  4807.  
  4808. @findex ASM_OUTPUT_SKIP
  4809. @item ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes})
  4810. A C statement to output to the stdio stream @var{stream} an assembler
  4811. instruction to advance the location counter by @var{nbytes} bytes.
  4812. Those bytes should be zero when loaded.  @var{nbytes} will be a C
  4813. expression of type @code{int}.
  4814.  
  4815. @findex ASM_NO_SKIP_IN_TEXT
  4816. @item ASM_NO_SKIP_IN_TEXT
  4817. Define this macro if @code{ASM_OUTPUT_SKIP} should not be used in the
  4818. text section because it fails put zeros in the bytes that are skipped.
  4819. This is true on many Unix systems, where the pseudo--op to skip bytes
  4820. produces no-op instructions rather than zeros when used in the text
  4821. section.
  4822.  
  4823. @findex ASM_OUTPUT_ALIGN
  4824. @item ASM_OUTPUT_ALIGN (@var{stream}, @var{power})
  4825. A C statement to output to the stdio stream @var{stream} an assembler
  4826. command to advance the location counter to a multiple of 2 to the
  4827. @var{power} bytes.  @var{power} will be a C expression of type @code{int}.
  4828. @end table
  4829.  
  4830. @node Debugging Info
  4831. @section Controlling Debugging Information Format
  4832.  
  4833. @menu
  4834. * All Debuggers::      Macros that affect all debugging formats uniformly.
  4835. * DBX Options::        Macros enabling specific options in DBX format.
  4836. * DBX Hooks::          Hook macros for varying DBX format.
  4837. * File Names and DBX:: Macros controlling output of file names in DBX format.
  4838. * SDB and DWARF::      Macros for SDB (COFF) and DWARF formats.
  4839. @end menu
  4840.  
  4841. @node All Debuggers
  4842. @subsection Macros Affecting All Debugging Formats
  4843.  
  4844. @table @code
  4845. @findex DBX_REGISTER_NUMBER
  4846. @item DBX_REGISTER_NUMBER (@var{regno})
  4847. A C expression that returns the DBX register number for the compiler
  4848. register number @var{regno}.  In simple cases, the value of this
  4849. expression may be @var{regno} itself.  But sometimes there are some
  4850. registers that the compiler knows about and DBX does not, or vice
  4851. versa.  In such cases, some register may need to have one number in
  4852. the compiler and another for DBX.
  4853.  
  4854. If two registers have consecutive numbers inside GNU CC, and they can be
  4855. used as a pair to hold a multiword value, then they @emph{must} have
  4856. consecutive numbers after renumbering with @code{DBX_REGISTER_NUMBER}.
  4857. Otherwise, debuggers will be unable to access such a pair, because they
  4858. expect register pairs to be consecutive in their own numbering scheme.
  4859.  
  4860. If you find yourself defining @code{DBX_REGISTER_NUMBER} in way that
  4861. does not preserve register pairs, then what you must do instead is
  4862. redefine the actual register numbering scheme.
  4863.  
  4864. @findex DEBUGGER_AUTO_OFFSET
  4865. @item DEBUGGER_AUTO_OFFSET (@var{x})
  4866. A C expression that returns the integer offset value for an automatic
  4867. variable having address @var{x} (an RTL expression).  The default
  4868. computation assumes that @var{x} is based on the frame-pointer and
  4869. gives the offset from the frame-pointer.  This is required for targets
  4870. that produce debugging output for DBX or COFF-style debugging output
  4871. for SDB and allow the frame-pointer to be eliminated when the
  4872. @samp{-g} options is used.
  4873.  
  4874. @findex DEBUGGER_ARG_OFFSET
  4875. @item DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
  4876. A C expression that returns the integer offset value for an argument
  4877. having address @var{x} (an RTL expression).  The nominal offset is
  4878. @var{offset}.
  4879. @end table
  4880.  
  4881. @node DBX Options
  4882. @subsection Specific Options for DBX Output
  4883.  
  4884. @table @code
  4885. @findex DBX_DEBUGGING_INFO
  4886. @item DBX_DEBUGGING_INFO
  4887. Define this macro if GNU CC should produce debugging output for DBX
  4888. in response to the @samp{-g} option.
  4889.  
  4890. @findex XCOFF_DEBUGGING_INFO
  4891. @item XCOFF_DEBUGGING_INFO
  4892. Define this macro if GNU CC should produce XCOFF format debugging output
  4893. in response to the @samp{-g} option.  This is a variant of DBX format.
  4894.  
  4895. @findex DEFAULT_GDB_EXTENSIONS
  4896. @item DEFAULT_GDB_EXTENSIONS
  4897. Define this macro to control whether GNU CC should by default generate
  4898. GDB's extended version of DBX debugging information (assuming DBX-format
  4899. debugging information is enabled at all).  If you don't define the
  4900. macro, the default is 1: always generate the extended information
  4901. if there is any occasion to.
  4902.  
  4903. @findex DEBUG_SYMS_TEXT
  4904. @item DEBUG_SYMS_TEXT
  4905. Define this macro if all @code{.stabs} commands should be output while
  4906. in the text section.
  4907.  
  4908. @findex ASM_STABS_OP
  4909. @item ASM_STABS_OP
  4910. A C string constant naming the assembler pseudo op to use instead of
  4911. @code{.stabs} to define an ordinary debugging symbol.  If you don't
  4912. define this macro, @code{.stabs} is used.  This macro applies only to
  4913. DBX debugging information format.
  4914.  
  4915. @findex ASM_STABD_OP
  4916. @item ASM_STABD_OP
  4917. A C string constant naming the assembler pseudo op to use instead of
  4918. @code{.stabd} to define a debugging symbol whose value is the current
  4919. location.  If you don't define this macro, @code{.stabd} is used.
  4920. This macro applies only to DBX debugging information format.
  4921.  
  4922. @findex ASM_STABN_OP
  4923. @item ASM_STABN_OP
  4924. A C string constant naming the assembler pseudo op to use instead of
  4925. @code{.stabn} to define a debugging symbol with no name.  If you don't
  4926. define this macro, @code{.stabn} is used.  This macro applies only to
  4927. DBX debugging information format.
  4928.  
  4929. @findex DBX_NO_XREFS
  4930. @item DBX_NO_XREFS
  4931. Define this macro if DBX on your system does not support the construct
  4932. @samp{xs@var{tagname}}.  On some systems, this construct is used to
  4933. describe a forward reference to a structure named @var{tagname}.
  4934. On other systems, this construct is not supported at all.
  4935.  
  4936. @findex DBX_CONTIN_LENGTH
  4937. @item DBX_CONTIN_LENGTH
  4938. A symbol name in DBX-format debugging information is normally
  4939. continued (split into two separate @code{.stabs} directives) when it
  4940. exceeds a certain length (by default, 80 characters).  On some
  4941. operating systems, DBX requires this splitting; on others, splitting
  4942. must not be done.  You can inhibit splitting by defining this macro
  4943. with the value zero.  You can override the default splitting-length by
  4944. defining this macro as an expression for the length you desire.
  4945.  
  4946. @findex DBX_CONTIN_CHAR
  4947. @item DBX_CONTIN_CHAR
  4948. Normally continuation is indicated by adding a @samp{\} character to
  4949. the end of a @code{.stabs} string when a continuation follows.  To use
  4950. a different character instead, define this macro as a character
  4951. constant for the character you want to use.  Do not define this macro
  4952. if backslash is correct for your system.
  4953.  
  4954. @findex DBX_STATIC_STAB_DATA_SECTION
  4955. @item DBX_STATIC_STAB_DATA_SECTION
  4956. Define this macro if it is necessary to go to the data section before
  4957. outputting the @samp{.stabs} pseudo-op for a non-global static
  4958. variable.
  4959.  
  4960. @findex DBX_TYPE_DECL_STABS_CODE
  4961. @item DBX_TYPE_DECL_STABS_CODE
  4962. The value to use in the ``code'' field of the @code{.stabs} directive
  4963. for a typedef.  The default is @code{N_LSYM}.
  4964.  
  4965. @findex DBX_STATIC_CONST_VAR_CODE
  4966. @item DBX_STATIC_CONST_VAR_CODE
  4967. The value to use in the ``code'' field of the @code{.stabs} directive
  4968. for a static variable located in the text section.  DBX format does not
  4969. provide any ``right'' way to do this.  The default is @code{N_FUN}.
  4970.  
  4971. @findex DBX_REGPARM_STABS_CODE
  4972. @item DBX_REGPARM_STABS_CODE
  4973. The value to use in the ``code'' field of the @code{.stabs} directive
  4974. for a parameter passed in registers.  DBX format does not provide any
  4975. ``right'' way to do this.  The default is @code{N_RSYM}.
  4976.  
  4977. @findex DBX_REGPARM_STABS_LETTER
  4978. @item DBX_REGPARM_STABS_LETTER
  4979. The letter to use in DBX symbol data to identify a symbol as a parameter
  4980. passed in registers.  DBX format does not customarily provide any way to
  4981. do this.  The default is @code{'P'}.
  4982.  
  4983. @findex DBX_MEMPARM_STABS_LETTER
  4984. @item DBX_MEMPARM_STABS_LETTER
  4985. The letter to use in DBX symbol data to identify a symbol as a stack
  4986. parameter.  The default is @code{'p'}.
  4987.  
  4988. @findex DBX_FUNCTION_FIRST
  4989. @item DBX_FUNCTION_FIRST
  4990. Define this macro if the DBX information for a function and its
  4991. arguments should precede the assembler code for the function.  Normally,
  4992. in DBX format, the debugging information entirely follows the assembler
  4993. code.
  4994.  
  4995. @findex DBX_LBRAC_FIRST
  4996. @item DBX_LBRAC_FIRST
  4997. Define this macro if the @code{N_LBRAC} symbol for a block should
  4998. precede the debugging information for variables and functions defined in
  4999. that block.  Normally, in DBX format, the @code{N_LBRAC} symbol comes
  5000. first.
  5001. @end table
  5002.  
  5003. @node DBX Hooks
  5004. @subsection Open-Ended Hooks for DBX Format
  5005.  
  5006. @table @code
  5007. @findex DBX_OUTPUT_LBRAC
  5008. @item DBX_OUTPUT_LBRAC (@var{stream}, @var{name})
  5009. Define this macro to say how to output to @var{stream} the debugging
  5010. information for the start of a scope level for variable names.  The
  5011. argument @var{name} is the name of an assembler symbol (for use with
  5012. @code{assemble_name}) whose value is the address where the scope begins.
  5013.  
  5014. @findex DBX_OUTPUT_RBRAC
  5015. @item DBX_OUTPUT_RBRAC (@var{stream}, @var{name})
  5016. Like @code{DBX_OUTPUT_LBRAC}, but for the end of a scope level.
  5017.  
  5018. @findex DBX_OUTPUT_ENUM
  5019. @item DBX_OUTPUT_ENUM (@var{stream}, @var{type})
  5020. Define this macro if the target machine requires special handling to
  5021. output an enumeration type.  The definition should be a C statement
  5022. (sans semicolon) to output the appropriate information to @var{stream}
  5023. for the type @var{type}.
  5024.  
  5025. @findex DBX_OUTPUT_FUNCTION_END
  5026. @item DBX_OUTPUT_FUNCTION_END (@var{stream}, @var{function})
  5027. Define this macro if the target machine requires special output at the
  5028. end of the debugging information for a function.  The definition should
  5029. be a C statement (sans semicolon) to output the appropriate information
  5030. to @var{stream}.  @var{function} is the @code{FUNCTION_DECL} node for
  5031. the function.
  5032.  
  5033. @findex DBX_OUTPUT_STANDARD_TYPES
  5034. @item DBX_OUTPUT_STANDARD_TYPES (@var{syms})
  5035. Define this macro if you need to control the order of output of the
  5036. standard data types at the beginning of compilation.  The argument
  5037. @var{syms} is a @code{tree} which is a chain of all the predefined
  5038. global symbols, including names of data types.
  5039.  
  5040. Normally, DBX output starts with definitions of the types for integers
  5041. and characters, followed by all the other predefined types of the
  5042. particular language in no particular order.
  5043.  
  5044. On some machines, it is necessary to output different particular types
  5045. first.  To do this, define @code{DBX_OUTPUT_STANDARD_TYPES} to output
  5046. those symbols in the necessary order.  Any predefined types that you
  5047. don't explicitly output will be output afterward in no particular order.
  5048.  
  5049. Be careful not to define this macro so that it works only for C.  There
  5050. are no global variables to access most of the built-in types, because
  5051. another language may have another set of types.  The way to output a
  5052. particular type is to look through @var{syms} to see if you can find it.
  5053. Here is an example:
  5054.  
  5055. @example
  5056. @{
  5057.   tree decl;
  5058.   for (decl = syms; decl; decl = TREE_CHAIN (decl))
  5059.     if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "long int"))
  5060.       dbxout_symbol (decl);
  5061.   @dots{}
  5062. @}
  5063. @end example
  5064.  
  5065. @noindent
  5066. This does nothing if the expected type does not exist.
  5067.  
  5068. See the function @code{init_decl_processing} in source file
  5069. @file{c-decl.c} to find the names to use for all the built-in C types.
  5070.  
  5071. Here is another way of finding a particular type:
  5072.  
  5073. @example
  5074. @{
  5075.   tree decl;
  5076.   for (decl = syms; decl; decl = TREE_CHAIN (decl))
  5077.     if (TREE_CODE (decl) == TYPE_DECL
  5078.         && TREE_CODE (TREE_TYPE (decl)) == INTEGER_CST
  5079.         && TYPE_PRECISION (TREE_TYPE (decl)) == 16
  5080.         && TYPE_UNSIGNED (TREE_TYPE (decl)))
  5081.       /* @r{This must be @code{unsigned short}.}  */
  5082.       dbxout_symbol (decl);
  5083.   @dots{}
  5084. @}
  5085. @end example
  5086. @end table
  5087.  
  5088. @node File Names and DBX
  5089. @subsection File Names in DBX Format
  5090.  
  5091. @table @code
  5092. @findex DBX_WORKING_DIRECTORY
  5093. @item DBX_WORKING_DIRECTORY
  5094. Define this if DBX wants to have the current directory recorded in each
  5095. object file.
  5096.  
  5097. Note that the working directory is always recorded if GDB extensions are
  5098. enabled.
  5099.  
  5100. @findex DBX_OUTPUT_MAIN_SOURCE_FILENAME
  5101. @item DBX_OUTPUT_MAIN_SOURCE_FILENAME (@var{stream}, @var{name})
  5102. A C statement to output DBX debugging information to the stdio stream
  5103. @var{stream} which indicates that file @var{name} is the main source
  5104. file---the file specified as the input file for compilation.
  5105. This macro is called only once, at the beginning of compilation.
  5106.  
  5107. This macro need not be defined if the standard form of output
  5108. for DBX debugging information is appropriate.
  5109.  
  5110. @findex DBX_OUTPUT_MAIN_SOURCE_DIRECTORY
  5111. @item DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (@var{stream}, @var{name})
  5112. A C statement to output DBX debugging information to the stdio stream
  5113. @var{stream} which indicates that the current directory during
  5114. compilation is named @var{name}.
  5115.  
  5116. This macro need not be defined if the standard form of output
  5117. for DBX debugging information is appropriate.
  5118.  
  5119. @findex DBX_OUTPUT_MAIN_SOURCE_FILE_END
  5120. @item DBX_OUTPUT_MAIN_SOURCE_FILE_END (@var{stream}, @var{name})
  5121. A C statement to output DBX debugging information at the end of
  5122. compilation of the main source file @var{name}.
  5123.  
  5124. If you don't define this macro, nothing special is output at the end
  5125. of compilation, which is correct for most machines.
  5126.  
  5127. @findex DBX_OUTPUT_SOURCE_FILENAME
  5128. @item DBX_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
  5129. A C statement to output DBX debugging information to the stdio stream
  5130. @var{stream} which indicates that file @var{name} is the current source
  5131. file.  This output is generated each time input shifts to a different
  5132. source file as a result of @samp{#include}, the end of an included file,
  5133. or a @samp{#line} command.
  5134.  
  5135. This macro need not be defined if the standard form of output
  5136. for DBX debugging information is appropriate.
  5137. @end table
  5138.  
  5139. @node SDB and DWARF
  5140. @subsection Macros for SDB and DWARF Output
  5141.  
  5142. @table @code
  5143. @findex SDB_DEBUGGING_INFO
  5144. @item SDB_DEBUGGING_INFO
  5145. Define this macro if GNU CC should produce COFF-style debugging output
  5146. for SDB in response to the @samp{-g} option.
  5147.  
  5148. @findex DWARF_DEBUGGING_INFO
  5149. @item DWARF_DEBUGGING_INFO
  5150. Define this macro if GNU CC should produce dwarf format debugging output 
  5151. in response to the @samp{-g} option.
  5152.  
  5153. @findex PUT_SDB_@dots{}
  5154. @item PUT_SDB_@dots{}
  5155. Define these macros to override the assembler syntax for the special
  5156. SDB assembler directives.  See @file{sdbout.c} for a list of these
  5157. macros and their arguments.  If the standard syntax is used, you need
  5158. not define them yourself.
  5159.  
  5160. @findex SDB_DELIM
  5161. @item SDB_DELIM
  5162. Some assemblers do not support a semicolon as a delimiter, even between
  5163. SDB assembler directives.  In that case, define this macro to be the
  5164. delimiter to use (usually @samp{\n}).  It is not necessary to define
  5165. a new set of @code{PUT_SDB_@var{op}} macros if this is the only change
  5166. required.
  5167.  
  5168. @findex SDB_GENERATE_FAKE
  5169. @item SDB_GENERATE_FAKE
  5170. Define this macro to override the usual method of constructing a dummy
  5171. name for anonymous structure and union types.  See @file{sdbout.c} for
  5172. more information.
  5173.  
  5174. @findex SDB_ALLOW_UNKNOWN_REFERENCES
  5175. @item SDB_ALLOW_UNKNOWN_REFERENCES
  5176. Define this macro to allow references to unknown structure,
  5177. union, or enumeration tags to be emitted.  Standard COFF does not
  5178. allow handling of unknown references, MIPS ECOFF has support for
  5179. it.
  5180.  
  5181. @findex SDB_ALLOW_FORWARD_REFERENCES
  5182. @item SDB_ALLOW_FORWARD_REFERENCES
  5183. Define this macro to allow references to structure, union, or
  5184. enumeration tags that have not yet been seen to be handled.  Some
  5185. assemblers choke if forward tags are used, while some require it.
  5186. @end table
  5187.  
  5188. @node Cross-compilation
  5189. @section Cross Compilation and Floating Point Format
  5190. @cindex cross compilation and floating point 
  5191. @cindex floating point format and cross compilation
  5192.  
  5193. While all modern machines use 2's complement representation for integers,
  5194. there are a variety of representations for floating point numbers.  This
  5195. means that in a cross-compiler the representation of floating point numbers
  5196. in the compiled program may be different from that used in the machine
  5197. doing the compilation.
  5198.  
  5199. @findex atof
  5200. Because different representation systems may offer different amounts of
  5201. range and precision, the cross compiler cannot safely use the host
  5202. machine's floating point arithmetic.  Therefore, floating point constants
  5203. must be represented in the target machine's format.  This means that the
  5204. cross compiler cannot use @code{atof} to parse a floating point constant;
  5205. it must have its own special routine to use instead.  Also, constant
  5206. folding must emulate the target machine's arithmetic (or must not be done
  5207. at all).
  5208.  
  5209. The macros in the following table should be defined only if you are cross
  5210. compiling between different floating point formats.
  5211.  
  5212. Otherwise, don't define them. Then default definitions will be set up which
  5213. use @code{double} as the data type, @code{==} to test for equality, etc.
  5214.  
  5215. You don't need to worry about how many times you use an operand of any
  5216. of these macros.  The compiler never uses operands which have side effects.
  5217.  
  5218. @table @code
  5219. @findex REAL_VALUE_TYPE
  5220. @item REAL_VALUE_TYPE
  5221. A macro for the C data type to be used to hold a floating point value
  5222. in the target machine's format.  Typically this would be a
  5223. @code{struct} containing an array of @code{int}.
  5224.  
  5225. @findex REAL_VALUES_EQUAL
  5226. @item REAL_VALUES_EQUAL (@var{x}, @var{y})
  5227. A macro for a C expression which compares for equality the two values,
  5228. @var{x} and @var{y}, both of type @code{REAL_VALUE_TYPE}.
  5229.  
  5230. @findex REAL_VALUES_LESS
  5231. @item REAL_VALUES_LESS (@var{x}, @var{y})
  5232. A macro for a C expression which tests whether @var{x} is less than
  5233. @var{y}, both values being of type @code{REAL_VALUE_TYPE} and
  5234. interpreted as floating point numbers in the target machine's
  5235. representation.
  5236.  
  5237. @findex REAL_VALUE_LDEXP
  5238. @findex ldexp
  5239. @item REAL_VALUE_LDEXP (@var{x}, @var{scale})
  5240. A macro for a C expression which performs the standard library
  5241. function @code{ldexp}, but using the target machine's floating point
  5242. representation.  Both @var{x} and the value of the expression have
  5243. type @code{REAL_VALUE_TYPE}.  The second argument, @var{scale}, is an
  5244. integer.
  5245.  
  5246. @findex REAL_VALUE_FIX
  5247. @item REAL_VALUE_FIX (@var{x})
  5248. A macro whose definition is a C expression to convert the target-machine
  5249. floating point value @var{x} to a signed integer.  @var{x} has type
  5250. @code{REAL_VALUE_TYPE}.
  5251.  
  5252. @findex REAL_VALUE_UNSIGNED_FIX
  5253. @item REAL_VALUE_UNSIGNED_FIX (@var{x})
  5254. A macro whose definition is a C expression to convert the target-machine
  5255. floating point value @var{x} to an unsigned integer.  @var{x} has type
  5256. @code{REAL_VALUE_TYPE}.
  5257.  
  5258. @findex REAL_VALUE_FIX_TRUNCATE
  5259. @item REAL_VALUE_FIX_TRUNCATE (@var{x})
  5260. A macro whose definition is a C expression to convert the target-machine
  5261. floating point value @var{x} to a signed integer, rounding toward 0.
  5262. @var{x} has type @code{REAL_VALUE_TYPE}.
  5263.  
  5264. @findex REAL_VALUE_UNSIGNED_FIX_TRUNCATE
  5265. @item REAL_VALUE_UNSIGNED_FIX_TRUNCATE (@var{x})
  5266. A macro whose definition is a C expression to convert the target-machine
  5267. floating point value @var{x} to an unsigned integer, rounding toward 0.
  5268. @var{x} has type @code{REAL_VALUE_TYPE}.
  5269.  
  5270. @findex REAL_VALUE_ATOF
  5271. @item REAL_VALUE_ATOF (@var{string})
  5272. A macro for a C expression which converts @var{string}, an expression
  5273. of type @code{char *}, into a floating point number in the target
  5274. machine's representation.  The value has type @code{REAL_VALUE_TYPE}.
  5275.  
  5276. @findex REAL_INFINITY
  5277. @item REAL_INFINITY
  5278. Define this macro if infinity is a possible floating point value, and
  5279. therefore division by 0 is legitimate.
  5280.  
  5281. @findex REAL_VALUE_ISINF
  5282. @findex isinf
  5283. @item REAL_VALUE_ISINF (@var{x})
  5284. A macro for a C expression which determines whether @var{x}, a floating
  5285. point value, is infinity.  The value has type @code{int}.
  5286. By default, this is defined to call @code{isinf}.
  5287.  
  5288. @findex REAL_VALUE_ISNAN
  5289. @findex isnan
  5290. @item REAL_VALUE_ISNAN (@var{x})
  5291. A macro for a C expression which determines whether @var{x}, a floating
  5292. point value, is a ``nan'' (not-a-number).  The value has type
  5293. @code{int}.  By default, this is defined to call @code{isnan}.
  5294. @end table
  5295.  
  5296. @cindex constant folding and floating point
  5297. Define the following additional macros if you want to make floating
  5298. point constant folding work while cross compiling.  If you don't
  5299. define them, cross compilation is still possible, but constant folding
  5300. will not happen for floating point values.
  5301.  
  5302. @table @code
  5303. @findex REAL_ARITHMETIC
  5304. @item REAL_ARITHMETIC (@var{output}, @var{code}, @var{x}, @var{y})
  5305. A macro for a C statement which calculates an arithmetic operation of
  5306. the two floating point values @var{x} and @var{y}, both of type
  5307. @code{REAL_VALUE_TYPE} in the target machine's representation, to
  5308. produce a result of the same type and representation which is stored
  5309. in @var{output} (which will be a variable).
  5310.  
  5311. The operation to be performed is specified by @var{code}, a tree code
  5312. which will always be one of the following: @code{PLUS_EXPR},
  5313. @code{MINUS_EXPR}, @code{MULT_EXPR}, @code{RDIV_EXPR},
  5314. @code{MAX_EXPR}, @code{MIN_EXPR}.@refill
  5315.  
  5316. @cindex overflow while constant folding
  5317. The expansion of this macro is responsible for checking for overflow.
  5318. If overflow happens, the macro expansion should execute the statement
  5319. @code{return 0;}, which indicates the inability to perform the
  5320. arithmetic operation requested.
  5321.  
  5322. @findex REAL_VALUE_NEGATE
  5323. @item REAL_VALUE_NEGATE (@var{x})
  5324. A macro for a C expression which returns the negative of the floating
  5325. point value @var{x}.  Both @var{x} and the value of the expression
  5326. have type @code{REAL_VALUE_TYPE} and are in the target machine's
  5327. floating point representation.
  5328.  
  5329. There is no way for this macro to report overflow, since overflow
  5330. can't happen in the negation operation.
  5331.  
  5332. @findex REAL_VALUE_TRUNCATE
  5333. @item REAL_VALUE_TRUNCATE (@var{mode}, @var{x})
  5334. A macro for a C expression which converts the floating point value
  5335. @var{x} to mode @var{mode}.
  5336.  
  5337. Both @var{x} and the value of the expression have type
  5338. @code{REAL_VALUE_TYPE} and are in the target machine's floating point
  5339. representation.  However, the value should have an appropriate bit
  5340. pattern to be output properly as a floating constant whose precision
  5341. accords with mode @var{mode}.
  5342.  
  5343. There is no way for this macro to report overflow.
  5344.  
  5345. @findex REAL_VALUE_TO_INT
  5346. @item REAL_VALUE_TO_INT (@var{low}, @var{high}, @var{x})
  5347. A macro for a C expression which converts a floating point value
  5348. @var{x} into a double-precision integer which is then stored into
  5349. @var{low} and @var{high}, two variables of type @var{int}.
  5350.  
  5351. @item REAL_VALUE_FROM_INT (@var{x}, @var{low}, @var{high})
  5352. @findex REAL_VALUE_FROM_INT
  5353. A macro for a C expression which converts a double-precision integer
  5354. found in @var{low} and @var{high}, two variables of type @var{int},
  5355. into a floating point value which is then stored into @var{x}.
  5356. @end table
  5357.  
  5358. @node Misc
  5359. @section Miscellaneous Parameters
  5360. @cindex parameters, miscellaneous
  5361.  
  5362. @table @code
  5363. @item PREDICATE_CODES
  5364. @findex PREDICATE_CODES
  5365. Optionally define this if you have added predicates to
  5366. @file{@var{machine}.c}.  This macro is called within an initializer of an
  5367. array of structures.  The first field in the structure is the name of a
  5368. predicate and the second field is an array of rtl codes.  For each
  5369. predicate, list all rtl codes that can be in expressions matched by the
  5370. predicate.  The list should have a trailing comma.  Here is an example
  5371. of two entries in the list for a typical RISC machine:
  5372.  
  5373. @example
  5374. #define PREDICATE_CODES \
  5375.   @{"gen_reg_rtx_operand", @{SUBREG, REG@}@},  \
  5376.   @{"reg_or_short_cint_operand", @{SUBREG, REG, CONST_INT@}@},
  5377. @end example
  5378.  
  5379. Defining this macro does not affect the generated code (however,
  5380. incorrect definitions that omit an rtl code that may be matched by the
  5381. predicate can cause the compiler to malfunction).  Instead, it allows
  5382. the table built by @file{genrecog} to be more compact and efficient,
  5383. thus speeding up the compiler.  The most important predicates to include
  5384. in the list specified by this macro are thoses used in the most insn
  5385. patterns.
  5386.  
  5387. @findex CASE_VECTOR_MODE
  5388. @item CASE_VECTOR_MODE
  5389. An alias for a machine mode name.  This is the machine mode that
  5390. elements of a jump-table should have.
  5391.  
  5392. @findex CASE_VECTOR_PC_RELATIVE
  5393. @item CASE_VECTOR_PC_RELATIVE
  5394. Define this macro if jump-tables should contain relative addresses.
  5395.  
  5396. @findex CASE_DROPS_THROUGH
  5397. @item CASE_DROPS_THROUGH
  5398. Define this if control falls through a @code{case} insn when the index
  5399. value is out of range.  This means the specified default-label is
  5400. actually ignored by the @code{case} insn proper.
  5401.  
  5402. @findex CASE_VALUES_THRESHOLD
  5403. @item CASE_VALUES_THRESHOLD
  5404. Define this to be the smallest number of different values for which it
  5405. is best to use a jump-table instead of a tree of conditional branches.
  5406. The default is four for machines with a @code{casesi} instruction and
  5407. five otherwise.  This is best for most machines.
  5408.  
  5409. @findex BYTE_LOADS_ZERO_EXTEND
  5410. @item BYTE_LOADS_ZERO_EXTEND
  5411. Define this macro if an instruction to load a value narrower than a
  5412. word from memory into a register also zero-extends the value to the whole 
  5413. register.
  5414.  
  5415. @findex BYTE_LOADS_SIGN_EXTEND
  5416. @item BYTE_LOADS_SIGN_EXTEND
  5417. Define this macro if an instruction to load a value narrower than a
  5418. word from memory into a register also sign-extends the value to the whole 
  5419. register.
  5420.  
  5421. @findex IMPLICIT_FIX_EXPR
  5422. @item IMPLICIT_FIX_EXPR
  5423. An alias for a tree code that should be used by default for conversion
  5424. of floating point values to fixed point.  Normally,
  5425. @code{FIX_ROUND_EXPR} is used.@refill
  5426.  
  5427. @findex FIXUNS_TRUNC_LIKE_FIX_TRUNC
  5428. @item FIXUNS_TRUNC_LIKE_FIX_TRUNC
  5429. Define this macro if the same instructions that convert a floating
  5430. point number to a signed fixed point number also convert validly to an
  5431. unsigned one.
  5432.  
  5433. @findex EASY_DIV_EXPR
  5434. @item EASY_DIV_EXPR
  5435. An alias for a tree code that is the easiest kind of division to
  5436. compile code for in the general case.  It may be
  5437. @code{TRUNC_DIV_EXPR}, @code{FLOOR_DIV_EXPR}, @code{CEIL_DIV_EXPR} or
  5438. @code{ROUND_DIV_EXPR}.  These four division operators differ in how
  5439. they round the result to an integer.  @code{EASY_DIV_EXPR} is used
  5440. when it is permissible to use any of those kinds of division and the
  5441. choice should be made on the basis of efficiency.@refill
  5442.  
  5443. @findex MOVE_MAX
  5444. @item MOVE_MAX
  5445. The maximum number of bytes that a single instruction can move quickly
  5446. from memory to memory.
  5447.  
  5448. @findex SHIFT_COUNT_TRUNCATED
  5449. @item SHIFT_COUNT_TRUNCATED
  5450. Defining this macro causes the compiler to omit a sign-extend,
  5451. zero-extend, or bitwise `and' instruction that truncates the count of a
  5452. shift operation to a width equal to the number of bits needed to
  5453. represent the size of the object being shifted.  On machines that have
  5454. instructions that act on bitfields at variable positions, which may
  5455. include `bit test' instructions, defining @code{SHIFT_COUNT_TRUNCATED}
  5456. also enables deletion of truncations of the values that serve as
  5457. arguments to bitfield instructions.
  5458.  
  5459. If both types of instructions truncate the count (for shifts) and
  5460. position (for bitfield operations), or if no variable-position bitfield
  5461. instructions exist, you should define this macro.
  5462.  
  5463. However, on some machines, such as the 80386 and the 680x0, truncation
  5464. only applies to shift operations and not the (real or pretended)
  5465. bitfield operations.  Do not define @code{SHIFT_COUNT_TRUNCATED} on such
  5466. machines.  Instead, add patterns to the @file{md} file that include the
  5467. implied truncation of the shift instructions.
  5468.  
  5469. @findex TRULY_NOOP_TRUNCATION
  5470. @item TRULY_NOOP_TRUNCATION (@var{outprec}, @var{inprec})
  5471. A C expression which is nonzero if on this machine it is safe to
  5472. ``convert'' an integer of @var{inprec} bits to one of @var{outprec}
  5473. bits (where @var{outprec} is smaller than @var{inprec}) by merely
  5474. operating on it as if it had only @var{outprec} bits.
  5475.  
  5476. On many machines, this expression can be 1.
  5477.  
  5478. It is reported that suboptimal code can result when
  5479. @code{TRULY_NOOP_TRUNCATION} returns 1 for a pair of sizes for modes for
  5480. which @code{MODES_TIEABLE_P} is 0.  If this is the case, making
  5481. @code{TRULY_NOOP_TRUNCATION} return 0 in such cases may improve things.
  5482.  
  5483. @findex STORE_FLAG_VALUE
  5484. @item STORE_FLAG_VALUE
  5485. A C expression describing the value returned by a comparison operator
  5486. with an integral mode and stored by a store-flag instruction
  5487. (@samp{s@var{cond}}) when the condition is true.  This description must
  5488. apply to @emph{all} the @samp{s@var{cond}} patterns and all the
  5489. comparison operators whose results have a @code{MODE_INT} mode.
  5490.  
  5491. A value of 1 or -1 means that the instruction implementing the
  5492. comparison operator returns exactly 1 or -1 when the comparison is true
  5493. and 0 when the comparison is false.  Otherwise, the value indicates
  5494. which bits of the result are guaranteed to be 1 when the comparison is
  5495. true.  This value is interpreted in the mode of the comparison
  5496. operation, which is given by the mode of the first operand in the
  5497. @samp{s@var{cond}} pattern.  Either the low bit or the sign bit of
  5498. @code{STORE_FLAG_VALUE} be on.  Presently, only those bits are used by
  5499. the compiler.
  5500.  
  5501. If @code{STORE_FLAG_VALUE} is neither 1 or -1, the compiler will
  5502. generate code that depends only on the specified bits.  It can also
  5503. replace comparison operators with equivalent operations if they cause
  5504. the required bits to be set, even if the remaining bits are undefined.
  5505. For example, on a machine whose comparison operators return an
  5506. @code{SImode} value and where @code{STORE_FLAG_VALUE} is defined as
  5507. @samp{0x80000000}, saying that just the sign bit is relevant, the
  5508. expression
  5509.  
  5510. @example
  5511. (ne:SI (and:SI @var{x} (const_int @var{power-of-2})) (const_int 0))
  5512. @end example
  5513.  
  5514. @noindent
  5515. can be converted to
  5516.  
  5517. @example
  5518. (ashift:SI @var{x} (const_int @var{n}))
  5519. @end example
  5520.  
  5521. @noindent
  5522. where @var{n} is the appropriate shift count to move the bit being
  5523. tested into the sign bit.
  5524.  
  5525. There is no way to describe a machine that always sets the low-order bit
  5526. for a true value, but does not guarantee the value of any other bits,
  5527. but we do not know of any machine that has such an instruction.  If you
  5528. are trying to port GNU CC to such a machine, include an instruction to
  5529. perform a logical-and of the result with 1 in the pattern for the
  5530. comparison operators and let us know (@pxref{Bug Reporting}).
  5531.  
  5532. Often, a machine will have multiple instructions that obtain a value
  5533. from a comparison (or the condition codes).  Here are rules to guide the
  5534. choice of value for @code{STORE_FLAG_VALUE}, and hence the instructions
  5535. to be used:
  5536.  
  5537. @itemize @bullet
  5538. @item
  5539. Use the shortest sequence that yields a valid definition for
  5540. @code{STORE_FLAG_VALUE}.  It is more efficient for the compiler to
  5541. ``normalize'' the value (convert it to, e.g., 1 or 0) than for the
  5542. comparison operators to do so because there may be opportunities to
  5543. combine the normalization with other operations.
  5544.  
  5545. @item
  5546. For equal-length sequences, use a value of 1 or -1, with -1 being
  5547. slightly preferred on machines with expensive jumps and 1 preferred on
  5548. other machines.
  5549.  
  5550. @item
  5551. As a second choice, choose a value of @samp{0x80000001} if instructions
  5552. exist that set both the sign and low-order bits but do not define the
  5553. others.
  5554.  
  5555. @item
  5556. Otherwise, use a value of @samp{0x80000000}.
  5557. @end itemize
  5558.  
  5559. You need not define @code{STORE_FLAG_VALUE} if the machine has no store-flag
  5560. instructions.
  5561.  
  5562. @findex FLOAT_STORE_FLAG_VALUE
  5563. @item FLOAT_STORE_FLAG_VALUE
  5564. A C expression that gives a non-zero floating point value that is
  5565. returned when comparison operators with floating-point results are true.
  5566. Define this macro on machine that have comparison operations that return
  5567. floating-point values.  If there are no such operations, do not define
  5568. this macro.
  5569.  
  5570. @findex Pmode
  5571. @item Pmode
  5572. An alias for the machine mode for pointers.  Normally the definition
  5573. can be
  5574.  
  5575. @example
  5576. #define Pmode SImode
  5577. @end example
  5578.  
  5579. @findex FUNCTION_MODE
  5580. @item FUNCTION_MODE
  5581. An alias for the machine mode used for memory references to functions
  5582. being called, in @code{call} RTL expressions.  On most machines this
  5583. should be @code{QImode}.
  5584.  
  5585. @findex INTEGRATE_THRESHOLD
  5586. @item INTEGRATE_THRESHOLD (@var{decl})
  5587. A C expression for the maximum number of instructions above which the
  5588. function @var{decl} should not be inlined.  @var{decl} is a
  5589. @code{FUNCTION_DECL} node.
  5590.  
  5591. The default definition of this macro is 64 plus 8 times the number of
  5592. arguments that the function accepts.  Some people think a larger
  5593. threshold should be used on RISC machines.
  5594.  
  5595. @findex SCCS_DIRECTIVE
  5596. @item SCCS_DIRECTIVE
  5597. Define this if the preprocessor should ignore @code{#sccs} directives
  5598. and print no error message.
  5599.  
  5600. @findex HANDLE_PRAGMA
  5601. @findex #pragma
  5602. @findex pragma
  5603. @item HANDLE_PRAGMA (@var{stream})
  5604. Define this macro if you want to implement any pragmas.  If defined, it
  5605. should be a C statement to be executed when @code{#pragma} is seen.  The
  5606. argument @var{stream} is the stdio input stream from which the source
  5607. text can be read.
  5608.  
  5609. It is generally a bad idea to implement new uses of @code{#pragma}.  The
  5610. only reason to define this macro is for compatibility with other
  5611. compilers that do support @code{#pragma} for the sake of any user
  5612. programs which already use it.
  5613.  
  5614. @findex DOLLARS_IN_IDENTIFIERS
  5615. @item DOLLARS_IN_IDENTIFIERS
  5616. Define this macro to control use of the character @samp{$} in identifier
  5617. names.  The value should be 0, 1, or 2.  0 means @samp{$} is not allowed
  5618. by default; 1 means it is allowed by default if @samp{-traditional} is
  5619. used; 2 means it is allowed by default provided @samp{-ansi} is not used.
  5620. 1 is the default; there is no need to define this macro in that case.
  5621.  
  5622. @findex NO_DOLLAR_IN_LABEL
  5623. @item NO_DOLLAR_IN_LABEL
  5624. Define this macro if the assembler does not accept the character
  5625. @samp{$} in label names.  By default constructors and destructors in
  5626. G++ have @samp{$} in the identifiers.  If this macro is defined,
  5627. @samp{.} is used instead.
  5628.  
  5629. @findex DEFAULT_MAIN_RETURN
  5630. @item DEFAULT_MAIN_RETURN
  5631. Define this macro if the target system expects every program's @code{main}
  5632. function to return a standard ``success'' value by default (if no other
  5633. value is explicitly returned).
  5634.  
  5635. The definition should be a C statement (sans semicolon) to generate the
  5636. appropriate rtl instructions.  It is used only when compiling the end of
  5637. @code{main}.
  5638.  
  5639. @item HAVE_ATEXIT
  5640. @findex HAVE_ATEXIT
  5641. Define this if the target system supports the function
  5642. @code{atexit} from the ANSI C standard.  If this is not defined,
  5643. and @code{INIT_SECTION_ASM_OP} is not defined, a default
  5644. @code{exit} function will be provided to support C++.
  5645.  
  5646. @item EXIT_BODY
  5647. @findex EXIT_BODY
  5648. Define this if your @code{exit} function needs to do something
  5649. besides calling an external function @code{_cleanup} before
  5650. terminating with @code{_exit}.  The @code{EXIT_BODY} macro is
  5651. only needed if netiher @code{HAVE_ATEXIT} nor
  5652. @code{INIT_SECTION_ASM_OP} are defined.
  5653. @end table
  5654. @end ifset
  5655.