internals-3 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  1. Info file internals, produced by texinfo-format-buffer -*-Text-*-
  2. from file internals.texinfo
  3. This file documents the internals of the GNU compiler.
  4. Copyright (C) 1987 Richard M. Stallman.
  5. Permission is granted to make and distribute verbatim copies of
  6. this manual provided the copyright notice and this permission notice
  7. are preserved on all copies.
  8. Permission is granted to copy and distribute modified versions of this
  9. manual under the conditions for verbatim copying, provided also that the
  10. section entitled "GNU CC General Public License" is included exactly as
  11. in the original, and provided that the entire resulting derived work is
  12. distributed under the terms of a permission notice identical to this one.
  13. Permission is granted to copy and distribute translations of this manual
  14. into another language, under the above conditions for modified versions,
  15. except that the section entitled "GNU CC General Public License" may be
  16. included in a translation approved by the author instead of in the original
  17. English.
  18. 
  19. File: internals Node: Dependent Patterns, Prev: Standard Names, Up: Machine Desc
  20. Patterns Require Other Patterns
  21. ===============================
  22. Every machine description must have a named pattern for each of the
  23. conditional branch names `bCOND'. The recognition template
  24. must always have the form
  25. (set (pc)
  26. (if_then_else (COND (cc0) (const_int 0))
  27. (label_ref (match_operand 0 "" ""))
  28. (pc)))
  29. In addition, every machine description must have an anonymous pattern
  30. for each of the possible reverse-conditional branches. These patterns
  31. look like
  32. (set (pc)
  33. (if_then_else (COND (cc0) (const_int 0))
  34. (pc)
  35. (label_ref (match_operand 0 "" ""))))
  36. They are necessary because jump optimization can turn direct-conditional
  37. branches into reverse-conditional branches.
  38. The compiler does more with RTL than just create it from patterns
  39. and recognize the patterns: it can perform arithmetic expression codes
  40. when constant values for their operands can be determined. As a result,
  41. sometimes having one pattern can require other patterns. For example, the
  42. Vax has no `and' instruction, but it has `and not' instructions. Here
  43. is the definition of one of them:
  44. (define_insn "andcbsi2"
  45. [(set (match_operand:SI 0 "general_operand" "")
  46. (and:SI (match_dup 0)
  47. (not:SI (match_operand:SI
  48. 1 "general_operand" ""))))]
  49. ""
  50. "bicl2 %1,%0")
  51. If operand 1 is an explicit integer constant, an instruction constructed
  52. using that pattern can end up looking like
  53. (set (reg:SI 41)
  54. (and:SI (reg:SI 41)
  55. (const_int 0xffff7fff)))
  56. (where the integer constant is the one's complement of what
  57. appeared in the original instruction).
  58. To avoid a fatal error, the compiler must have a pattern that recognizes
  59. such an instruction. Here is what is used:
  60. (define_insn ""
  61. [(set (match_operand:SI 0 "general_operand" "")
  62. (and:SI (match_dup 0)
  63. (match_operand:SI 1 "general_operand" "")))]
  64. "GET_CODE (operands[1]) == CONST_INT"
  65. "*
  66. { operands[1]
  67. = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[1]));
  68. return \"bicl2 %1,%0\";
  69. }")
  70. Whereas a pattern to match a general `and' instruction is impossible to
  71. support on the Vax, this pattern is possible because it matches only a
  72. constant second argument: a special case that can be output as an `and not'
  73. instruction.
  74. 
  75. File: internals Node: Machine Macros, Prev: Machine Desc, Up: Top
  76. Machine Description Macros
  77. **************************
  78. The other half of the machine description is a C header file conventionally
  79. given the name `tm-MACHINE.h'. The file `tm.h' should be a
  80. link to it. The header file `config.h' includes `tm.h' and most
  81. compiler source files include `config.h'.
  82. * Menu:
  83. * Run-time Target:: Defining -m switches like -m68000 and -m68020.
  84. * Storage Layout:: Defining sizes and alignments of data types.
  85. * Registers:: Naming and describing the hardware registers.
  86. * Register Classes:: Defining the classes of hardware registers.
  87. * Stack Layout:: Defining which way the stack grows and by how much.
  88. * Addressing Modes:: Defining addressing modes valid for memory operands.
  89. * Condition Code:: Defining how insns update the condition code.
  90. * Assembler Format:: Defining how to write insns and pseudo-ops to output.
  91. * Misc:: Everything else.
  92. 
  93. File: internals Node: Run-time Target, Prev: Machine Macros, Up: Machine Macros, Next: Storage Layout
  94. Run-time Target Specification
  95. =============================
  96. `CPP_PREDEFINES'
  97. Define this to be a string constant containing `-D' switches
  98. to define the predefined macros that identify this machine and system.
  99. For example, on the Sun, one can use the value
  100. "-Dmc68000 -Dsun"
  101. `extern int target_flags;'
  102. This declaration should be present.
  103. `TARGET_...'
  104. This series of macros is to allow compiler command arguments to
  105. enable or disable the use of optional features of the target machine.
  106. For example, one machine description serves both the 68000 and
  107. the 68020; a command argument tells the compiler whether it should
  108. use 68020-only instructions or not. This command argument works
  109. by means of a macro `TARGET_68020' that tests a bit in
  110. `target_flags'.
  111. Define a macro `TARGET_FEATURENAME' for each such option.
  112. Its definition should test a bit in `target_flags'; for example:
  113. #define TARGET_68020 (target_flags & 1)
  114. One place where these macros are used is in the condition-expressions
  115. of instruction patterns. Note how `TARGET_68020' appears
  116. frequently in the 68000 machine description file, `m68000.md'.
  117. Another place they are used is in the definitions of the other
  118. macros in the `tm-MACHINE.h' file.
  119. `TARGET_SWITCHES'
  120. This macro defines names of command switches to set and clear
  121. bits in `target_flags'. Its definition is an initializer
  122. with a subgrouping for each command switches.
  123. Each subgrouping contains a string constant, that defines the switch
  124. name, and a number, which contains the bits to set in
  125. `target_flags'. A negative number says to clear bits instead;
  126. the negative of the number is which bits to clear. The actual switch
  127. name is made by appending `-m' to the specified name.
  128. One of the subgroupings should have a null string. The number in
  129. this grouping is the default value for `target_flags'. Any
  130. target switches act starting with that value.
  131. Here is an example which defines `-m68000' and `-m68020'
  132. with opposite meanings, and picks the latter as the default:
  133. #define TARGET_SWITCHES \
  134. { { "68020", 1}, \
  135. { "68000", -1}, \
  136. { "", 1}}
  137. 
  138. File: internals Node: Storage Layout, Prev: Run-time Target, Up: Machine Macros, Next: Registers
  139. Storage Layout
  140. ==============
  141. `BITS_BIG_ENDIAN'
  142. Define this macro if the most significant bit in a byte has the lowest
  143. number. This means that bit-field instructions count from the most
  144. significant bit. If the machine has no bit-field instructions, this
  145. macro is irrelevant.
  146. `BYTES_BIG_ENDIAN'
  147. Define this macro if the most significant byte in a word has the
  148. lowest number.
  149. `WORDS_BIG_ENDIAN'
  150. Define this macro if, in a multiword object, the most signficant
  151. word has the lowest number.
  152. `BITS_PER_UNIT'
  153. Number of bits in an addressable storage unit (byte); normally 8.
  154. `BITS_PER_WORD'
  155. Number of bits in a word; normally 32.
  156. `UNITS_PER_WORD'
  157. Number of storage units in a word; normally 4.
  158. `POINTER_SIZE'
  159. Width of a pointer, in bits.
  160. `PARM_BOUNDARY'
  161. Alignment required for pointers, in bits.
  162. `FUNCTION_BOUNDARY'
  163. Alignment required for a function entry point, in bits.
  164. `BIGGEST_ALIGNMENT'
  165. Biggest alignment that anything can require on this machine, in bits.
  166. `STRICT_ALIGNMENT'
  167. Define this if instructions will fail to work if given data not
  168. on the nominal alignment. If instructions will merely go slower
  169. in that case, do not define this macro.
  170. 
  171. File: internals Node: Registers, Prev: Storage Layout, Up: Machine Macros, Next: Register Classes
  172. Register Usage
  173. ==============
  174. `FIRST_PSEUDO_REGISTER'
  175. Number of hardware registers known to the compiler. They receive
  176. numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
  177. pseudo register's number really is assigned the number7
  178. `FIRST_PSEUDO_REGISTER'.
  179. `FIXED_REGISTERS'
  180. An initializer that says which registers are used for fixed purposes
  181. all throughout the compiled code and are therefore not available for
  182. general allocation. These would inclue the stack pointer, the frame
  183. pointer, the program counter on machines where that is considered one
  184. of the addressable registers, and any other numbered register with a
  185. standard use.
  186. This information is expressed as a sequence of numbers, separated by
  187. commas and surrounded by braces. The Nth number is 1 if
  188. register N is fixed, 0 otherwise
  189. `CALL_USED_REGISTERS'
  190. Like `FIXED_REGISTERS' but has 1 for each register that is
  191. clobbered (in general) by function calls as well as for fixed
  192. registers. This macro therefore identifies the registers that are not
  193. available for general allocation of values that must live across
  194. function calls.
  195. If a registers has 0 in `CALL_USED_REGISTERS', the compiler
  196. automatically saves it on function entry and restores it on function
  197. exit, if the register is used within the function.
  198. `HARD_REGNO_REGS (REGNO, MODE)'
  199. A C expression for the number of consecutive hard registers, starting
  200. at register number REGNO, required to hold a value of mode
  201. MODE.
  202. On a machine where all registers are exactly one word, a suitable
  203. definition of this macro is
  204. #define HARD_REGNO_NREGS(REGNO, MODE) \
  205. ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
  206. / UNITS_PER_WORD))
  207. `HARD_REGNO_MODE_OK (REGNO, MODE)'
  208. A C expression that is nonzero if it is permissible to store a value
  209. of mode MODE in hard register number REGNO (or in several
  210. registers starting with that one). For a machine where all registers
  211. are equivalent, a suitable definition is
  212. #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
  213. It is not necessary for this macro to check for fixed register numbers
  214. because the allocation mechanism considers them to be always occupied.
  215. `MODES_TIEABLE_P (MODE1, MODE2)'
  216. A C expression that is nonzero if it is desirable to choose register
  217. allocation so as to avoid move instructions between a value of mode
  218. MODE1 and a value of mode MODE2.
  219. If `HARD_REGNO_MODE_OK (R, MODE1)' and
  220. `HARD_REGNO_MODE_OK (R, MODE2)' are ever different
  221. for any R, then `MODES_TIEABLE_P (MODE1,
  222. MODE2)' must be zero.
  223. `PC_REGNUM'
  224. If the program counter has a register number, define this as that
  225. register number. Otherwise, do not define it.
  226. `STACK_POINTER_REGNUM'
  227. The register number of the stack pointer register, which must also be
  228. a fixed register according to `FIXED_REGISTERS'. On many
  229. machines, the hardware determines which register this is.
  230. `FRAME_POINTER_REGNUM'
  231. The register number of the frame pointer register, which is used to
  232. access automatic variables in the stack frame. It must also described
  233. in `FIXED_REGISTERS' as a fixed register. On some machines, the
  234. hardware determines which register this is. On other machines, you
  235. can choose any register you wish for this purpose.
  236. `ARG_POINTER_REGNUM'
  237. The register number of the arg pointer register, which is used to
  238. access the function's argument list. On some machines, this is the
  239. same as the frame pointer register. On some machines, the hardware
  240. determines which register this is. On other machines, you can choose
  241. any register you wish for this purpose. It must in any case be a
  242. fixed register according to `FIXED_REGISTERS'.
  243. `STATIC_CHAIN_REGNUM'
  244. The register number used for passing a function's static chain
  245. pointer. This is needed for languages such as Pascal and Algol where
  246. functions defined within other functions can access the local
  247. variables of the outer functions; it is not currently used because C
  248. does not provide this feature.
  249. The static chain register need not be a fixed register.
  250. `FUNCTION_VALUE_REGNUM'
  251. The register number used for returning values from a function. This
  252. must be one of the call-used registers (since function calls alter
  253. it!) but should not be a fixed register. When the value being
  254. returned has a multi-word machine mode, multiple consecutive registers
  255. starting with the specified one are used.
  256. `STRUCT_VALUE_REGNUM'
  257. When a function's value's mode is `BLKmode', the value is not returned
  258. in the register `FUNCTION_VALUE_REGNUM'. Instead, the caller passes
  259. the address of a block of memory in which the value should be stored.
  260. `STRUCT_VALUE_REGNUM' is the register in which this address is passed.
  261. 
  262. File: internals Node: Register Classes, Prev: Registers, Up: Machine Macros, Next: Stack Layout
  263. Register Classes
  264. ================
  265. On many machines, the numbered registers are not all equivalent.
  266. For example, certain registers may not be allowed for indexed addressing;
  267. certain registers may not be allowed in some instructions. These machine
  268. restrictions are described to the compiler using "register classes".
  269. You define a number of register classes, giving each one a name and saying
  270. which of the registers belong to it. Then you can specify register classes
  271. that are allowed as operands to particular instruction patterns.
  272. In general, each register will belong to several classes. In fact, one
  273. class must be named `ALL_REGS' and contain all the registers. Another
  274. class must be named `NO_REGS' and contain no registers. Often the
  275. union of two classes will be another class; however, this is not required.
  276. One of the classes must be named `GENERAL_REGS'. There is nothing
  277. terribly special about the name, but the operand constraint letters
  278. `r' and `g' specify this class. If `GENERAL_REGS' is
  279. the same as `ALL_REGS', just define it as a macro which expands
  280. to `ALL_REGS'.
  281. The way classes other than `GENERAL_REGS' are specified in operand
  282. constraints is through machine-dependent operand constraint letters.
  283. You can define such letters to correspond to various classes, then use
  284. them in operand constraints.
  285. You must also specify certain redundant information about the register
  286. classes: for each class, which classes contain it and which ones are
  287. contained in it; for each pair of classes, the largest class contained
  288. in their union.
  289. `enum reg_class'
  290. An enumeral type that must be defined with all the register class names
  291. as enumeral values. `NO_REGS' must be first. `ALL_REGS'
  292. must be the last register class, followed by one more enumeral value,
  293. `LIM_REG_CLASSES', which is not a register class but rather
  294. tells how many classes there are.
  295. Each register class has a number, which is the value of casting
  296. the class name to type `int'. The number serves as an index
  297. in many of the tables described below.
  298. `REG_CLASS_NAMES'
  299. An initializer containing the names of the register classes as C string
  300. constants. These names are used in writing some of the debugging dumps.
  301. `REG_CLASS_CONTENTS'
  302. An initializer containing the contents of the register classes, as integers
  303. which are bit masks. The Nth integer specifies the contents of class
  304. N. The way the integer MASK is interpreted is that
  305. register R is in the class if `MASK & (1 << R)' is 1.
  306. When the machine has more than 32 registers, an integer does not suffice.
  307. Then the integers are replaced by sub-initializers, braced groupings containing
  308. several integers. Each sub-initializer must be suitable as an initializer
  309. for the type `HARD_REG_SET' which is defined in `hard-reg-set.h'.
  310. `REGNO_REG_CLASS (REGNO)'
  311. A C expression whose value is a register class containing hard register
  312. REGNO. In general there is more that one such class; choose a class
  313. which is "minimal", meaning that no smaller class also contains the
  314. register.
  315. `REG_CLASS_SUPERCLASSES'
  316. A two-level initializer that says, for each class, which classes contain
  317. it. The Nth element of the initializer is a sub-initializer for
  318. class N; it contains the names of the othe classes that contain class
  319. N (but not the name of class N itself), followed by
  320. `LIM_REG_CLASSES' to mark the end of the element.
  321. `REG_CLASS_SUBCLASSES'
  322. Similar to `REG_CLASS_SUPERCLASSES', except that element N lists
  323. the classes *contained in* class N, followed once again by
  324. `LIM_REG_CLASSES' to mark the end of the element.
  325. `REG_CLASS_SUBUNION'
  326. An two-level initializer for a two-dimensional array. The element
  327. (M, N) of this array must be a class that is "close to"
  328. being the union of classes M and N. If there is a class
  329. that is exactly that union, use it; otherwise, choose some smaller
  330. class, preferably as large as possible but certainly not containing
  331. any register that is neither in class M nor in class N.
  332. `INDEX_REG_CLASS'
  333. A macro whose definition is the name of the class to which a valid index
  334. register must belong.
  335. `REG_CLASS_FROM_LETTER (CHAR)'
  336. A C expression which defines the machine-dependent operand constraint
  337. letters for register classes. If CHAR is such a letter, the value
  338. should be the register class corresponding to it. Otherwise, the value
  339. should be `NO_REGS'.
  340. `REGNO_OK_FOR_CLASS_P (REGNO, CLASS)'
  341. A C expression which is nonzero if register number REGNO is a hard
  342. register belonging to class CLASS. The expression is always zero if
  343. REGNO is a pseudo register.
  344. `REG_OK_FOR_CLASS_P (REG, CLASS)'
  345. A C expression which is nonzero if REG (an rtx assumed to have
  346. code `reg') belongs to class CLASS.
  347. What about pseudo registers? There are two alternatives, and the machine
  348. description header file must be able to do either one on command. If the
  349. macro `REG_OK_STRICT' is defined, this macro should be defined to
  350. reject all pseudo registers (return 0 for them). Otherwise, this macro
  351. should be defined to accept all pseudo registers (return 1 for them).
  352. Some source files of the compiler define `REG_OK_STRICT' before
  353. including the machine description header file, while others do not,
  354. according to the needs of that part of the compiler.
  355. `PREFERRED_RELOAD_CLASS (X, CLASS)'
  356. A C expression that places additional restrictions on the register class
  357. to use when it is necessary to copy value X into a register in class
  358. CLASS. The value is a register class; perhaps CLASS, or perhaps
  359. another, smaller class. CLASS is always safe as a value. In fact,
  360. the definition
  361. #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
  362. is always safe. However, sometimes returning a more restrictive class
  363. makes better code. For example, on the 68000, when X is an
  364. integer constant that is in range for a `moveq' instruction,
  365. the value of this macro is always `DATA_REGS' as long as
  366. CLASS includes the data registers. Requiring a data register
  367. guarantees that a `moveq' will be used.
  368. Two other special macros
  369. `CONST_OK_FOR_LETTER_P (VALUE, C)'
  370. A C expression that defines the machine-dependent operand constraint letters
  371. that specify particular ranges of integer values. If C is one
  372. of those letters, the expression should check that VALUE, an integer,
  373. is in the appropriate range and return 1 if so, 0 otherwise. If C is
  374. not one of those letters, the value should be 0 regardless of VALUE.
  375. `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
  376. A C expression that defines the machine-dependent operand constraint
  377. letters that specify particular ranges of floating values. If C is
  378. one of those letters, the expression should check that VALUE, an rtx
  379. of code `const_double', is in the appropriate range and return 1 if
  380. so, 0 otherwise. If C is not one of those letters, the value should
  381. be 0 regardless of VALUE.
  382. 
  383. File: internals Node: Stack Layout, Prev: Register Classes, Up: Machine Macros, Next: Addressing Modes
  384. Describing Stack Layout
  385. =======================
  386. `STACK_GROWS_DOWNWARD'
  387. Define this macro if pushing a word onto the stack moves the stack
  388. pointer to a smaller address. The definition is irrelevant because the
  389. compiler checks this macro with `#ifdef'.
  390. `FRAME_GROWS_DOWNWARD'
  391. Define this macro if the addresses of local variable slots are at negative
  392. offsets from the frame pointer.
  393. `STARTING_FRAME_OFFSET'
  394. Offset from the frame pointer to the first local variable slot to be allocated.
  395. If `FRAME_GROWS_DOWNWARD', the next slot's offset is found by
  396. subtracting the length of the first slot from `STARTING_FRAME_OFFSET'.
  397. Otherwise, it is found by adding the length of the first slot to
  398. the value `STARTING_FRAME_OFFSET'.
  399. `PUSH_ROUNDING (NPUSHED)'
  400. A C expression that is the number of bytes actually pushed onto the
  401. stack when an instruction attempts to push NPUSHED bytes.
  402. On some machines, the definition
  403. #define PUSH_ROUNDING(BYTES) (BYTES)
  404. will suffice. But on other machines, instructions that appear
  405. to push one byte actually push two bytes in an attempt to maintain
  406. alignment. Then the definition should be
  407. #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
  408. `FIRST_PARM_OFFSET'
  409. Offset from the argument pointer register to the first argument's address.
  410. `RETURN_POPS_ARGS'
  411. Define this macro if returning from a function automatically pops the
  412. function's arguments. Do not define it if the caller must pop them.
  413. `FUNCTION_PROLOGUE (FILE, SIZE)'
  414. A C compound statement that outputs the assembler code for entry to a
  415. function. The prologue is responsible for setting up the stack frame,
  416. initializing the frame pointer register, saving registers that must be
  417. saved, and allocating SIZE additional bytes of storage for the local
  418. variables. SIZE is an integer. FILE is a stdio stream to
  419. which the assembler code should be output.
  420. The label for the beginning of the function need not be output by this
  421. macro. That has already been done when the macro is run.
  422. To determine which registers to save, the macro can refer to the array
  423. `regs_ever_live': element R is nonzero if hard register R
  424. is used anywhere within the function. This implies the function prologue
  425. should save register R, but not if it is one of the call-used
  426. registers.
  427. `FUNCTION_EPILOGUE (FILE, SIZE)'
  428. A C compound statement that outputs the assembler code for exit from a
  429. function. The epilogue is responsible for restoring the saved
  430. registers and stack pointer to their values when the function was
  431. called, and returning control to the caller. This macro takes the
  432. same arguments as the macro `FUNCTION_PROLOGUE', and the
  433. registers to restore are determined from `regs_ever_live' and
  434. `CALL_USED_REGISTERS' in the same way.
  435. On some machines, there is a single instruction that does all the work of
  436. returning from the function. On these machines, give that instruction the
  437. name `return' and do not define the macro `FUNCTION_EPILOGUE' at
  438. all.
  439. 
  440. File: internals Node: Addressing Modes, Prev: Stack Layout, Up: Machine Macros, Next: Misc
  441. Addressing Modes
  442. ================
  443. `HAVE_POST_INCREMENT'
  444. Define this macro if the machine supports post-increment addressing.
  445. `HAVE_PRE_INCREMENT'
  446. `HAVE_POST_DECREMENT'
  447. `HAVE_PRE_DECREMENT'
  448. Similar for other kinds of addressing.
  449. `CONSTANT_ADDRESS_P (X)'
  450. A C expression that is 1 if the rtx X is a constant whose value
  451. is an integer. This includes integers whose values are not explicitly
  452. known, such as `symbol_ref' and `label_ref' expressions
  453. and `const' arithmetic expressions.
  454. `MAX_REGS_PER_ADDRESS'
  455. A number, the maximum number of registers that can appear in a valid
  456. memory address.
  457. `GO_IF_LEGITIMATE_ADDRESS (MODE, X, LABEL)'
  458. A C compound statement with a conditional `goto LABEL;'
  459. executed if X (an rtx) is a legitimate memory address on
  460. the target machine for a memory operand of mode MODE.
  461. It usually pays to define several simpler macros to serve as
  462. subroutines for this one. Otherwise it may be too complicated
  463. to understand.
  464. `LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN)'
  465. A C compound statement that attempts to replace X with a valid
  466. memory address for an operand of mode MODE. WIN will be
  467. a C statement label elsewhere in the code; the macro definition
  468. may use
  469. GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
  470. to avoid further processing if the address has become legitimate.
  471. X will always be the result of a call to `break_out_memory_refs',
  472. and OLDX will be the operand that was given to that function to produce
  473. X.
  474. The code generated by this macro should not alter the substructure of X.
  475. If it transforms X into a more legitimate form, it should assign X
  476. (which will always be a C variable) a new value.
  477. It is not necessary for this macro to come up with a legitimate address.
  478. The compiler has standard ways of doing so in all cases. In fact, it is
  479. safe for this macro to do nothing. But often a machine-dependent strategy
  480. can generate better code.
  481. 
  482. File: internals Node: Misc, Prev: Addressing Modes, Up: Machine Macros, Next: Condition Code
  483. Miscellaneous Parameters
  484. ========================
  485. `CASE_VECTOR_MODE'
  486. An alias for a machine mode name. This is the machine mode that elements
  487. of a jump-table should have.
  488. `CASE_VECTOR_PC_RELATIVE'
  489. Define this macro if jump-tables should contain relative addresses.
  490. `IMPLICIT_FIX_EXPR'
  491. An alias for a tree code that should be used by default for conversion
  492. of floating point values to fixed point. Normally, `FIX_ROUND_EXPR'
  493. is used.
  494. `EASY_DIV_EXPR'
  495. An alias for a tree code that is the easiest kind of division to compile
  496. code for in the general case. It may be `TRUNC_DIV_EXPR',
  497. `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'.
  498. These differ in how they round the result to an integer.
  499. `EASY_DIV_EXPR' is used when it is permissible to use any of those
  500. kinds of division and the choice should be made on the basis of efficiency.
  501. `MOVE_MAX'
  502. The maximum number of bytes that a single instruction can move quickly
  503. from memory to memory.
  504. `SLOW_ZERO_EXTEND'
  505. Define this macro if zero-extension (of chars or shorts to integers)
  506. can be done faster if the destination is a register that is known to be zero.
  507. `SHIFT_COUNT_TRUNCATED'
  508. Define this macro if shift instructions ignore all but the lowest few
  509. bits of the shift count. It implies that a sign-extend or zero-extend
  510. instruction for the shift count can be omitted.
  511. `TRULY_NOOP_TRUNCATON (OUTPREC, INPREC)'
  512. A C expression which is nonzero if on this machine it is safe to
  513. "convert" an integer of INPREC bits to one of OUTPREC bits
  514. (where OUTPREC is smaller than INPREC) by merely operating
  515. on it as if it had only INPREC bits.
  516. On many machines, this expression can be 1.
  517. `Pmode'
  518. An alias for the machine mode for pointers. Normally the definition can be
  519. #define Pmode SImode
  520. `FUNCTION_MODE'
  521. An alias for the machine mode used for memory references to functions being
  522. called, in `call' RTL expressions. On most machines this should be
  523. `QImode'.
  524. `CONST_COST (X, CODE)'
  525. A part of a C `switch' statement that describes the relative costs of
  526. constant RTL expressions. It must contain `case' labels for
  527. expression codes `const_int', `const', `symbol_ref',
  528. `label_ref' and `const_double'. Each case must ultimately reach
  529. a `return' statement to return the relative cost of the use of that
  530. kind of constant value in an expression. The cost may depend on the
  531. precise value of the constant, which is available for examination in
  532. X.
  533. CODE is the expression code---redundant, since it can be obtained with
  534. `GET_CODE (X)'.
  535. 
  536. File: internals Node: Condition Code, Prev: Misc, Up: Machine Macros, Next: Assembler Format
  537. Condition Code Information
  538. ==========================
  539. The file `conditions.h' defines a variable `cc_status' to
  540. describe how the condition code was computed (in case the interpretation of
  541. the condition code depends on the instruction that it was set by). This
  542. variable contains the RTL expressions on which the condition code is
  543. currently based, and several standard flags.
  544. Sometimes additional machine-specific flags must be defined in the machine
  545. description header file. It can also add additional machine-specific
  546. information by defining `CC_STATUS_MDEP'.
  547. `CC_STATUS_MDEP'
  548. A type, with which the `mdep' component of `cc_status' should
  549. be declared. It defaults to `int'.
  550. `CC_STATUS_MDEP_INIT'
  551. A C expression for the initial value of the `mdep' field.
  552. It defaults to 0.
  553. `NOTICE_UPDATE_CC (EXP)'
  554. A C compound statement to set the components of `cc_status'
  555. appropriately for an insn whose body is EXP. It is this
  556. macro's responsibility to recognize insns that set the condition code
  557. as a byproduct of other activity as well as those that explicitly
  558. set `(cc0)'.
  559. If there are insn that do not set the condition code but do alter other
  560. machine registers, this macro must check to see whether they invalidate the
  561. expressions that the condition code is recorded as reflecting. For
  562. example, on the 68000, insns that store in address registers do not set the
  563. condition code, which means that usually `NOTICE_UPDATE_CC' can leave
  564. `cc_status' unaltered for such insns. But suppose that the previous
  565. insn set the condition code based on location `a4@(102)' and the
  566. current insn stores a new value in `a4'. Although the condition code
  567. is not changed by this, it will no longer be true that it reflects the
  568. contents of `a4@(102)'. Therefore, `NOTICE_UPDATE_CC' must alter
  569. `cc_status' in this case to say that nothing is known about the
  570. condition code value.
  571. 
  572. File: internals Node: Assembler Format, Prev: Condition Code, Up: Machine Macros
  573. Output of Assembler Code
  574. ========================
  575. `TEXT_SECTION_ASM_OP'
  576. A C string constant for the assembler operation that should precede
  577. instructions and read-only data. Normally `".text"' is right.
  578. `DATA_SECTION_ASM_OP'
  579. A C string constant for the assembler operation to identify the following
  580. data as writable initialized data. Normally `".data"' is right.
  581. `REGISTER_NAMES'
  582. A C initializer containing the assembler's names for the machine registers,
  583. each one as a C string constant. This is what translates register numbers
  584. in the compiler into assembler language.
  585. `DBX_REGISTER_NUMBER (REGNO)'
  586. A C expression that returns the DBX register number for the compiler register
  587. number REGNO. In simple cases, the value of this expression may be
  588. REGNO itself. But sometimes there are some registers that the compiler
  589. knows about and DBX does not, or vice versa. In such cases, some register
  590. may need to have one number in the compiler and another for DBX.
  591. `ASM_OUTPUT_DOUBLE (FILE, VALUE)'
  592. A C statement to output to the stdio stream FILE an assembler
  593. instruction to assemble a `double' constant whose value is
  594. VALUE. VALUE will be a C expression of type `double'.
  595. `ASM_OUTPUT_FLOAT (FILE, VALUE)'
  596. A C statement to output to the stdio stream FILE an assembler
  597. instruction to assemble a `float' constant whose value is VALUE.
  598. VALUE will be a C expression of type `float'.
  599. `ASM_OUTPUT_SKIP (FILE, NBYTES)'
  600. A C statement to output to the stdio stream FILE an assembler
  601. instruction to advance the location counter by NBYTES bytes.
  602. NBYTES will be a C expression of type `int'.
  603. `ASM_OUTPUT_ALIGN (FILE, POWER)'
  604. A C statement to output to the stdio stream FILE an assembler
  605. instruction to advance the location counter to a multiple of 2 to the
  606. POWER bytes. POWER will be a C expression of type `int'.
  607. `ASM_INT_OP'
  608. A C string constant for the assembler operation that assembles constants of
  609. C type `int'. A space must follow the operation name. Normally
  610. `".long "'.
  611. `ASM_SHORT_OP'
  612. `ASM_CHAR_OP'
  613. Likewise, for C types `short' and `char'. Normally `".word "'
  614. and `".byte "'.
  615. `TARGET_BELL'
  616. A C constant expression for the integer value for escape sequence `\a'.
  617. `TARGET_BS'
  618. `TARGET_TAB'
  619. `TARGET_NEWLINE'
  620. C constant expressions for the integer values for escape sequences
  621. `\b', `\t' and `\n'.
  622. `TARGET_VT'
  623. `TARGET_FF'
  624. `TARGET_CR'
  625. C constant expressions for the integer values for escape sequences
  626. `\v', `\f' and `\r'.
  627. `PRINT_OPERAND (FILE, X)'
  628. A C compound statement to output to stdio stream FILE
  629. the assembler syntax for an instruction operand X.
  630. X is an RTL expression.
  631. If X is a register, this macro should print the register's name. The
  632. names can be found in an array `reg_names' whose type is `char
  633. *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
  634. `PRINT_OPERAND_ADDRESS (FILE, X)'
  635. A C compound statement to output to stdio stream FILE the assembler
  636. syntax for an instruction operand that is a memory reference whose address
  637. is X. X is an RTL expression.
  638.