internals-2 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349
  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: Comparisons, Prev: Arithmetic, Up: RTL, Next: Bit Fields
  20. Comparison Operations
  21. =====================
  22. Comparison operators test a relation on two operands and are considered to
  23. represent the value 1 if the relation holds, or zero if it does not. The
  24. mode of the comparison is determined by the operands; they must both be
  25. valid for a common machine mode. A comparison with both operands constant
  26. would be invalid as the machine mode could not be deduced from it, but such
  27. a comparison should never exist in rtl due to constant folding.
  28. Inequality comparisons come in two flavors, signed and unsigned. Thus,
  29. there are distinct expression codes `GT' and `GTU' for signed and
  30. unsigned greater-than. These can produce different results for the same
  31. pair of integer values: for example, 1 is signed greater-than -1 but not
  32. unsigned greater-than, because -1 when regarded as unsigned is actually
  33. 0xffffffff which is greater than 1.
  34. The signed comparisons are also used for floating point values. Floating
  35. point comparisons are distinguished by the machine modes of the operands.
  36. The comparison operators may be used to compare the condition codes
  37. `(cc0)' against zero, as in `(eq (cc0) (const_int 0))'.
  38. Such a construct actually refers to the result of the preceding
  39. instruction in which the condition codes were set. The above
  40. example stands for 1 if the condition codes were set to say
  41. "zero" or "equal", 0 otherwise. Although the same comparison
  42. operators are used for this as may be used in other contexts
  43. on actual data, no confusion can result since the machine description
  44. would never allow both kinds of uses in the same context.
  45. `(eq X Y)'
  46. 1 if the values represented by X and Y are equal,
  47. otherwise 0.
  48. `(ne X Y)'
  49. 1 if the values represented by X and Y are not equal,
  50. otherwise 0.
  51. `(gt X Y)'
  52. 1 if the X is greater than Y. If they are fixed-point,
  53. the comparison is done in a signed sense.
  54. `(gtu X Y)'
  55. Like `gt' but does unsigned comparison, on fixed-point numbers only.
  56. `(lt X Y)'
  57. `(ltu X Y)'
  58. Like `gt' and `gtu' but test for "less than".
  59. `(ge X Y)'
  60. `(geu X Y)'
  61. Like `gt' and `gtu' but test for "greater than or equal".
  62. `(le X Y)'
  63. `(leu X Y)'
  64. Like `gt' and `gtu' but test for "less than or equal".
  65. `(if_then_else COND THEN ELSE)'
  66. This is not a comparison operation but is listed here because it is
  67. always used in conjunction with a comparison operation. To be
  68. precise, COND is a comparison expression. This expression
  69. represents a choice, according to COND, between the value
  70. represented by THEN and the one represented by ELSE.
  71. On most machines, `if_then_else' expressions are valid only
  72. to express conditional jumps.
  73. 
  74. File: internals Node: Bit Fields, Prev: Comparisons, Up: RTL, Next: Conversions
  75. Bit-fields
  76. ==========
  77. Special expression codes exist to represent bit-field instructions.
  78. These types of expressions are lvalues in rtl; they may appear
  79. on the left side of a assignment, indicating insertion of a value
  80. into the specified bit field.
  81. `(sign_extract:SI LOC SIZE POS)'
  82. This represents a reference to a sign-extended bit-field contained or
  83. starting in LOC (a memory or register reference). The bit field
  84. is SIZE bits wide and starts at bit POS. The compilation
  85. switch `BITS_BIG_ENDIAN' says which end of the memory unit
  86. POS counts from.
  87. Which machine modes are valid for LOC depends on the machine,
  88. but typically LOC should be a single byte when in memory
  89. or a full word in a register.
  90. `(zero_extract:SI LOC POS SIZE)'
  91. Like `sign_extract' but refers to an unsigned or zero-extended
  92. bit field. The same sequence of bits are extracted, but they
  93. are filled to an entire word with zeros instead of by sign-extension.
  94. 
  95. File: internals Node: Conversions, Prev: Bit Fields, Up: RTL, Next: RTL Declarations
  96. Conversions
  97. ===========
  98. All conversions between machine modes must be represented by
  99. explicit conversion operations. For example, an expression
  100. which the sum of a byte and a full word cannot be written as
  101. `(plus:SI (reg:QI 34) (reg:SI 80))' because the `plus'
  102. operation requires two operands of the same machine mode.
  103. Therefore, the byte-sized operand is enclosed in a conversion
  104. operation, as in
  105. (plus:SI (sign_extend:SI (reg:QI 34)) (reg:SI 80))
  106. The conversion operation is not a mere placeholder, because there
  107. may be more than one way of converting from a given starting mode
  108. to the desired final mode. The conversion operation code says how
  109. to do it.
  110. `(sign_extend:M X)'
  111. Represents the result of sign-extending the value X
  112. to machine mode M. M must be a fixed-point mode
  113. and X a fixed-point value of a mode narrower than M.
  114. `(zero_extend:M X)'
  115. Represents the result of zero-extending the value X
  116. to machine mode M. M must be a fixed-point mode
  117. and X a fixed-point value of a mode narrower than M.
  118. `(float_extend:M X)'
  119. Represents the result of extending the value X
  120. to machine mode M. M must be a floating point mode
  121. and X a floating point value of a mode narrower than M.
  122. `(truncate:M X)'
  123. Represents the result of truncating the value X
  124. to machine mode M. M must be a fixed-point mode
  125. and X a fixed-point value of a mode wider than M.
  126. `(float_truncate:M X)'
  127. Represents the result of truncating the value X
  128. to machine mode M. M must be a floating point mode
  129. and X a floating point value of a mode wider than M.
  130. `(float:M X)'
  131. Represents the result of converting fixed point value X
  132. to floating point mode M.
  133. `(fix:M X)'
  134. Represents the result of converting floating point value X
  135. to fixed point mode M. How rounding is done is not specified.
  136. 
  137. File: internals Node: RTL Declarations, Prev: Conversions, Up: RTL, Next: Side Effects
  138. Declarations
  139. ============
  140. Declaration expression codes do not represent arithmetic operations
  141. but rather state assertions about their operands.
  142. `(volatile:M X)'
  143. Represents the same value X does, but makes the assertion
  144. that it should be treated as a volatile value. This forbids
  145. coalescing multiple accesses or deleting them even if it would
  146. appear to have no effect on the program. X must be a `mem'
  147. expression with mode M.
  148. The first thing the reload pass does to an insn is to remove all
  149. `volatile' expressions from it; each one is replaced by its
  150. operand.
  151. Recognizers will never recognize anything with `volatile' in it.
  152. This automatically prevents some optimizations on such things
  153. (such as instruction combination). After the reload pass removes
  154. all volatility information, the insns can be recognized.
  155. Cse removes `volatile' from destinations of `set''s, because
  156. no optimizations reorder such `set's. This is not required for
  157. correct code and is done to permit some optimization on the value to
  158. be stored.
  159. `(unchanging:M X)'
  160. Represents the same value X does, but makes the assertion
  161. that its value is effectively constant during the execution
  162. of the current function. This permits references to X
  163. to be moved freely within the function. X must be a `reg'
  164. expression with mode M.
  165. `(strict_low_part (subreg:M (reg:N R) 0))'
  166. This expression code is used in only one context: operand 0 of a
  167. `set' expression. In addition, the operand of this expression
  168. must be a `subreg' expression.
  169. The presence of `strict_low_part' says that the part of the
  170. register which is meaningful in mode N but is not part of
  171. mode M is not to be altered. Normally, an assignment to such
  172. a subreg is allowed to have undefined effects on the rest of the
  173. register when M is less than a word.
  174. 
  175. File: internals Node: Side Effects, Prev: RTL Declarations, Up: RTL, Next: Incdec
  176. Side Effect Expressions
  177. =======================
  178. The expression codes described so far represent values, not actions.
  179. But machine instructions never produce values; they are meaningful
  180. only for their side effects on the state of the machine. Special
  181. expression codes are used to represent side effects.
  182. The body of an instruction is always one of these side effect codes;
  183. the codes described above, which represent values, appear only as
  184. the operands of these.
  185. `(set LVAL X)'
  186. Represents the action of storing the value of X into the place
  187. represented by LVAL. LVAL must be an expression
  188. representing a place that can be stored in: `reg' (or
  189. `subreg' or `strict_low_part'), `mem', `pc' or
  190. `cc0'.
  191. If LVAL is a `reg', `subreg' or `mem', it has a
  192. machine mode; then X must be valid for that mode.
  193. If LVAL is a `reg' whose machine mode is less than the full
  194. width of the register, then it means that the part of the register
  195. specified by the machine mode is given the specified value and the
  196. rest of the register receives an undefined value. Likewise, if
  197. LVAL is a `subreg' whose machine mode is narrower than
  198. `SImode', the rest of the register can be changed in an undefined way.
  199. If LVAL is a `strict_low_part' of a `subreg', then the
  200. part of the register specified by the machine mode of the
  201. `subreg' is given the value X and the rest of the register
  202. is not changed.
  203. If LVAL is `(cc0)', it has no machine mode, and X may
  204. have any mode. This represents a "test" or "compare" instruction.
  205. If LVAL is `(pc)', we have a jump instruction, and the
  206. possibilities for X are very limited. It may be a
  207. `label_ref' expression (unconditional jump). It may be an
  208. `if_then_else' (conditional jump), in which case either the
  209. second or the third operand must be `(pc)' (for the case which
  210. does not jump) and the other of the two must be a `label_ref'
  211. (for the case which does jump). X may also be a `mem' or
  212. `(plus:SI (pc) Y)', where Y may be a `reg' or a
  213. `mem'; these unusual patterns are used to represent jumps through
  214. branch tables.
  215. `(return)'
  216. Represents a return from the current function, on machines where
  217. this can be done with one instruction, such as Vaxen. On machines
  218. where a multi-instruction "epilogue" must be executed in order
  219. to return from the function, returning is done by jumping to a
  220. label which precedes the epilogue, and the `return' expression
  221. code is never used.
  222. `(call FUNCTION NARGS)'
  223. Represents a function call. FUNCTION is a `mem' expression
  224. whose address is the address of the function to be called. NARGS
  225. is an expression representing the number of words of argument.
  226. Each machine has a standard machine mode which FUNCTION must
  227. have. The machine descripion defines macro `FUNCTION_MODE' to
  228. expand into the requisite mode name. The purpose of this mode is to
  229. specify what kind of addressing is allowed, on machines where the
  230. allowed kinds of addressing depend on the machine mode being
  231. addressed.
  232. `(clobber X)'
  233. Represents the storing or possible storing of an unpredictable,
  234. undescribed value into X, which must be a `reg' or
  235. `mem' expression.
  236. One place this is used is in string instructions that store standard
  237. values into particular hard registers. It may not be worth the
  238. trouble to describe the values that are stored, but it is essential
  239. to inform the compiler that the registers will be altered, lest it
  240. attempt to keep data in them across the string instruction.
  241. X may also be null---a null C pointer, no expression at all.
  242. Such a `(clobber (null))' expression means that all memory
  243. locations must be presumed clobbered.
  244. Note that the machine description classifies certain hard registers as
  245. "call-clobbered". All function call instructions are assumed by
  246. default to clobber these registers, so there is no need to use
  247. `clobber' expressions to indicate this fact. Also, each function
  248. call is assumed to have the potential to alter any memory location.
  249. `(use X)'
  250. Represents the use of the value of X. It indicates that
  251. the value in X at this point in the program is needed,
  252. even though it may not be apparent whythis is so. Therefore, the
  253. compiler will not attempt to delete instructions whose only
  254. effect is to store a value in X. X must be a `reg'
  255. expression.
  256. `(parallel [X0 X1 ...])'
  257. Represents several side effects performed in parallel. The square
  258. brackets stand for a vector; the operand of `parallel' is a
  259. vector of expressions. X0, X1 and so on are individual
  260. side effects---expressions of code `set', `call',
  261. `return', `clobber' or `use'.
  262. "In parallel" means that first all the values used in
  263. the individual side-effects are computed, and second all the actual
  264. side-effects are performed. For example,
  265. (parallel [(set (reg:SI 1) (mem:SI (reg:SI 1)))
  266. (set (mem:SI (reg:SI 1)) (reg:SI 1))])
  267. says unambiguously that the values of hard register 1 and the memory
  268. location addressed by it are interchanged. In both places where
  269. `(reg:SI 1)' appears as a memory address it refers to the value
  270. in register 1 before the execution of the instruction.
  271. Three expression codes appear in place of a side effect, as the body
  272. of an insn, though strictly speaking they do not describe side effects
  273. as such:
  274. `(asm_input S)'
  275. Represents literal assembler code as described by the string S.
  276. `(addr_vec:M [LR0 LR1 ...])'
  277. Represents a table of jump addresses. LR0 etc. are
  278. `label_ref' expressions. The mode M specifies how much
  279. space is given to each address; normally M would be
  280. `Pmode'.
  281. `(addr_diff_vec:M BASE [LR0 LR1 ...])'
  282. Represents a table of jump addresses expressed as offsets from
  283. BASE. LR0 etc. are `label_ref' expressions and so is
  284. BASE. The mode M specifies how much space is given to
  285. each address-difference.
  286. 
  287. File: internals Node: Incdec, Prev: Side Effects, Up: RTL, Next: Insns
  288. Embedded Side-Effects on Addresses
  289. ==================================
  290. Four special side-effect expression codes appear as memory addresses.
  291. `(pre_dec:M X)'
  292. Represents the side effect of decrementing X by a standard
  293. amount and represents also the value that X has after being
  294. decremented. X must be a `reg' or `mem', but most
  295. machines allow only a `reg'. M must be the machine mode
  296. for pointers on the machine in use. The amount X is decrement
  297. by is the length in bytes of the machine mode of the containing memory
  298. reference of which this expression serves as the address. Here is an
  299. example of its use:
  300. (mem:DF (pre_dec:SI (reg:SI 39)))
  301. This says to decrement pseudo register 39 by the length of a `DFmode'
  302. value and use the result to address a `DFmode' value.
  303. `(pre_inc:M X)'
  304. Similar, but specifies incrementing X instead of decrementing it.
  305. `(post_dec:M X)'
  306. Represents the same side effect as `pre_decrement' but a different
  307. value. The value represented here is the value X has before
  308. being decremented.
  309. `(post_inc:M X)'
  310. Similar, but specifies incrementing X instead of decrementing it.
  311. These embedded side effect expressions must be used with care. Instruction
  312. patterns may not use them. Until the `flow' pass of the compiler,
  313. they may occur only to represent pushes onto the stack. The `flow'
  314. pass finds cases where registers are incremented or decremented in one
  315. instruction and used as an address shortly before or after; these cases are
  316. then transformed to use pre- or post-increment or -decrement.
  317. Explicit popping of the stack could be represented with these embedded
  318. side effect operators, but that would not be safe; the instruction
  319. combination pass could move the popping past pushes, thus changing
  320. the meaning of the code.
  321. An instruction that can be represented with an embedded side effect
  322. could also be represented using `parallel' containing an additional
  323. `set' to describe how the address register is altered. This is not
  324. done because machines that allow these operations at all typically
  325. allow them wherever a memory address is called for. Describing them as
  326. additional parallel stores would require doubling the number of entries
  327. in the machine description.
  328. 
  329. File: internals Node: Insns, Prev: Incdec, Up: RTL, Next: Sharing
  330. Insns
  331. =====
  332. The RTL representation of the code for a function is a doubly-linked
  333. chain of objects called "insns". Insns are expressions with
  334. special codes that are used for no other purpose. Some insns are
  335. actual instructions; others represent dispatch tables for `switch'
  336. statements; others represent labels to jump to or various sorts of
  337. declaratory information.
  338. In addition to its own specific data, each insn must have a unique id number
  339. that distinguishes it from all other insns in the current function, and
  340. chain pointers to the preceding and following insns. These three fields
  341. occupy the same position in every insn, independent of the expression code
  342. of the insn. They could be accessed with `XEXP' and `XINT',
  343. but instead three special macros are always used:
  344. `INSN_UID (I)'
  345. Accesses the unique id of insn I.
  346. `PREV_INSN (I)'
  347. Accesses the chain pointer to the insn preceding I.
  348. If I is the first insn, this is a null pointer.
  349. `NEXT_INSN (I)'
  350. Accesses the chain pointer to the insn following I.
  351. If I is the last insn, this is a null pointer.
  352. The `NEXT_INSN' and `PREV_INSN' pointers must always
  353. correspond: if I is not the first insn,
  354. NEXT_INSN (PREV_INSN (INSN)) == INSN
  355. is always true.
  356. Every insn has one of the following six expression codes:
  357. `insn'
  358. The expression code `insn' is used for instructions that do not jump
  359. and do not do function calls. Insns with code `insn' have four
  360. additional fields beyond the three mandatory ones listed above.
  361. These four are described in a table below.
  362. `jump_insn'
  363. The expression code `jump_insn' is used for instructions that may jump
  364. (or, more generally, may contain `label_ref' expressions).
  365. `jump_insn' insns have the same extra fields as `insn' insns,
  366. accessed in the same way.
  367. `call_insn'
  368. The expression code `call_insn' is used for instructions that may do
  369. function calls. It is important to distinguish these instructions because
  370. they imply that certain registers and memory locations may be altered
  371. unpredictably.
  372. `call_insn' insns have the same extra fields as `insn' insns,
  373. accessed in the same way.
  374. `code_label'
  375. A `code_label' insn represents a label that a jump insn can jump to.
  376. It contains one special field of data in addition to the three standard ones.
  377. It is used to hold the "label number", a number that identifies this
  378. label uniquely among all the labels in the compilation (not just in the
  379. current function). Ultimately, the label is represented in the assembler
  380. output as an assembler label `LN' where N is the label number.
  381. `barrier'
  382. Barriers are placed in the instruction stream after unconditional
  383. jump instructions to indicate that the jumps are unconditional.
  384. They contain no information beyond the three standard fields.
  385. `note'
  386. `note' insns are used to represent additional debugging and
  387. declaratory information. They contain two nonstandard fields, an
  388. integer which is accessed with the macro `NOTE_LINE_NUMBER' and a
  389. string accessed with `NOTE_SOURCE_FILE'.
  390. If `NOTE_LINE_NUMBER' is positive, the note represents the
  391. position of a source line and `NOTE_SOURCE_FILE' is the source file name
  392. that the line came from. These notes control generation of line
  393. number data in the assembler output.
  394. Otherwise, `NOTE_LINE_NUMBER' is not really a line number but a
  395. code with one of the following values (and `NOTE_SOURCE_FILE'
  396. must contain a null pointer):
  397. `NOTE_INSN_DELETED'
  398. Such a note is completely ignorable. Some passes of the compiler
  399. delete insns by altering them into notes of this kind.
  400. `NOTE_INSN_BLOCK_BEG'
  401. `NOTE_INSN_BLOCK_END'
  402. These types of notes indicate the position of the beginning and end
  403. of a level of scoping of variable names. They control the output
  404. of debugging information.
  405. `NOTE_INSN_LOOP_BEG'
  406. `NOTE_INSN_LOOP_END'
  407. These types of notes indicate the position of the beginning and end
  408. of a `while' or `for' loop. They enable the loop optimizer
  409. to find loops quickly.
  410. Here is a table of the extra fields of `insn', `jump_insn'
  411. and `call_insn' insns:
  412. `PATTERN (I)'
  413. An expression for the side effect performed by this insn.
  414. `REG_NOTES (I)'
  415. A list (chain of `expr_list' expressions) giving information
  416. about the usage of registers in this insn. This list is set up by the
  417. `flow' pass; it is a null pointer until then.
  418. `LOG_LINKS (I)'
  419. A list (chain of `insn_list' expressions) of previous "related"
  420. insns: insns which store into registers values that are used for the
  421. first time in this insn. (An additional constraint is that neither a
  422. jump nor a label may come between the related insns). This list is
  423. set up by the `flow' pass; it is a null pointer until then.
  424. `INSN_CODE (I)'
  425. An integer that says which pattern in the machine description matches
  426. this insn, or -1 if the matching has not yet been attempted.
  427. Such matching is never attempted and this field is not used on an insn
  428. whose pattern consists of a single `use', `clobber',
  429. `asm', `addr_vec' or `addr_diff_vec' expression.
  430. The `LOG_LINKS' field of an insn is a chain of `insn_list'
  431. expressions. Each of these has two operands: the first is an insn,
  432. and the second is another `insn_list' expression (the next one in
  433. the chain). The last `insn_list' in the chain has a null pointer
  434. as second operand. The significant thing about the chain is which
  435. insns apepar in it (as first operands of `insn_list'
  436. expressions). Their order is not significant.
  437. The `REG_NOTES' field of an insn is a similar chain but of
  438. `expr_list' expressions instead of `insn_list'. The first
  439. operand is a `reg' rtx. Its presence in the list can have three
  440. possible meanings, distinguished by a value that is stored in the
  441. machine-mode field of the `expr_list' because that is a
  442. conveniently available space, but that is not really a machine mode.
  443. These values belong to the C type `enum reg_note' and there are
  444. three of them:
  445. `REG_DEAD'
  446. The `reg' listed dies in this insn; that is to say, altering
  447. the value immediately after this insn would not affect the future
  448. behavior of the program.
  449. `REG_INC'
  450. The `reg' listed is incremented (or decremented; at this level
  451. there is no distinction) by an embedded side effect inside this insn.
  452. `REG_CONST'
  453. The `reg' listed has a value that could safely be replaced
  454. everywhere by the value that this insn copies into it. ("Safety"
  455. here refers to the data flow of the program; such replacement may
  456. require reloading into registers for some of the insns in which
  457. the `reg' is replaced.)
  458. `REG_WAS_0'
  459. The `reg' listed contained zero before this insn. You can rely
  460. on this note if it is present; its absence implies nothing.
  461. (The only difference between the expression codes `insn_list' and
  462. `expr_list' is that the first operand of an `insn_list' is
  463. assumed to be an insn and is printed in debugging dumps as the insn's
  464. unique id; the first operand of an `expr_list' is printed in the
  465. ordinary way as an expression.)
  466. 
  467. File: internals Node: Sharing, Prev: Insns, Up: RTL
  468. Structure Sharing Assumptions
  469. =============================
  470. The compiler assumes that certain kinds of RTL expressions are unique;
  471. there do not exist two distinct objects representing the same value.
  472. In other cases, it makes an opposite assumption: that no RTL expression
  473. object of a certain kind appears in more than one place in the
  474. containing structure.
  475. These assumptions refer to a single function; except for the RTL
  476. objects that describe global variables and external functions,
  477. no RTL objects are common to two functions.
  478. * Each pseudo-register has only a single `reg' object to represent it,
  479. and therefore only a single machine mode.
  480. * For any symbolic label, there is only one `symbol_ref' object
  481. referring to it.
  482. * There is only one `const_int' expression with value zero,
  483. and only one with value one.
  484. * There is only one `pc' expression.
  485. * There is only one `cc0' expression.
  486. * There is only one `const_double' expression with mode
  487. `SFmode' and value zero, and only one with mode `DFmode' and
  488. value zero.
  489. * No `label_ref' appears in more than one place in the RTL structure;
  490. in other words, it is safe to do a tree-walk of all the insns in the function
  491. and assume that each time a `label_ref' is seen it is distinct from all
  492. other `label_refs' seen.
  493. * Aside from the cases listed above, the only kind of expression
  494. object that may appear in more than one place is the `mem'
  495. object that describes a stack slot or a static variable.
  496. 
  497. File: internals Node: Machine Desc, Prev: RTL, Up: Top, Next: Machine Macros
  498. Machine Descriptions
  499. ********************
  500. A machine description has two parts: a file of instruction patterns
  501. (`.md' file) and a C header file of macro definitions.
  502. The `.md' file for a target machine contains a pattern for each
  503. instruction that the target machine supports (or at least each instruction
  504. that is worth telling the compiler about). It may also contain comments.
  505. A semicolon causes the rest of the line to be a comment, unless the semicolon
  506. is inside a quoted string.
  507. See the next chapter for information on the C header file.
  508. * Menu:
  509. * Patterns:: How to write instruction patterns.
  510. * Example:: Example of an instruction pattern.
  511. * Constraints:: When not all operands are general operands.
  512. * Standard Names:: Names mark patterns to use for code generation.
  513. * Dependent Patterns:: Having one pattern may make you need another.
  514. 
  515. File: internals Node: Patterns, Prev: Machine Desc, Up: Machine Desc, Next: Example
  516. Instruction Patterns
  517. ====================
  518. Each instruction pattern contains an incomplete RTL expression, with pieces
  519. to be filled in later, operand constraints that restrict how the pieces can
  520. be filled in, and an output pattern or C code to generate the assembler
  521. output, all wrapped up in a `define_insn' expression.
  522. Sometimes an insn can match more than one instruction pattern. Then the
  523. pattern that appears first in the machine description is the one used.
  524. Therefore, more specific patterns should usually go first in the
  525. description.
  526. The `define_insn' expression contains four operands:
  527. 1. An optional name. The presence of a name indicate that this instruction
  528. pattern can perform a certain standard job for the RTL-generation
  529. pass of the compiler. This pass knows certain names and will use
  530. the instruction patterns with those names, if the names are defined
  531. in the machine description.
  532. The absence of a name is indicated by writing an empty string
  533. where the name should go. Nameless instruction patterns are never
  534. used for generating RTL code, but they may permit several simpler insns
  535. to be combined later on.
  536. Names that are not thus known and used in RTL-generation have no
  537. effect; they are equivalent to no name at all.
  538. 2. The recognition template. This is a vector of incomplete RTL
  539. expressions which show what the instruction should look like. It is
  540. incomplete because it may contain `match_operand' and
  541. `match_dup' expressions that stand for operands of the
  542. instruction.
  543. If the vector has only one element, that element is what the
  544. instruction should look like. If the vector has multiple elements,
  545. then the instruction looks like a `parallel' expression
  546. containing that many elements as described.
  547. 3. A condition. This is a string which contains a C expression that is
  548. the final test to decide whether an insn body matches this pattern.
  549. For a named pattern, the condition (if present) may not depend on
  550. the data in the insn being matched, but only the target-machine-type
  551. flags. The compiler needs to test these conditions during
  552. initialization in order to learn exactly which named instructions are
  553. available in a particular run.
  554. For nameless patterns, the condition is applied only when matching an
  555. individual insn, and only after the insn has matched the pattern's
  556. recognition template. The insn's operands may be found in the vector
  557. `operands'.
  558. 4. A string that says how to output matching insns as assembler code. In
  559. the simpler case, the string is an output template, much like a
  560. `printf' control string. `%' in the string specifies where
  561. to insert the operands of the instruction; the `%' is followed by
  562. a single-digit operand number.
  563. `%cDIGIT' can be used to subtitute an operand that is a
  564. constant value without the syntax that normally indicates an immediate
  565. operand.
  566. `%aDIGIT' can be used to substitute an operand as if it
  567. were a memory reference, with the actual operand treated as the address.
  568. This may be useful when outputting a "load address" instruction,
  569. because often the assembler syntax for such an instruction requires
  570. you to write the operand as if it were a memory reference.
  571. The template may generate multiple assembler instructions.
  572. Write the text for the instructions, with `\;' between them.
  573. If the output control string starts with a `*', then it is not an
  574. output template but rather a piece of C program that should compute a
  575. template. It should execute a `return' statement to return the
  576. template-string you want. Most such templates use C string literals,
  577. which require doublequote characters to delimit them. To include
  578. these doublequote characters in the string, prefix each one with
  579. `\'.
  580. The operands may be found in the array `operands', whose C
  581. data type is `rtx []'.
  582. It is possible to output an assembler instruction and then go on to
  583. output or compute more of them, using the subroutine
  584. `output_asm_insn'. This receives two arguments: a
  585. template-string and a vector of operands. The vector may be
  586. `operands', or it may be another array of `rtx' that you
  587. declare locally and initialize yourself.
  588. The recognition template is used also, for named patterns, for
  589. constructing insns. Construction involves substituting specified
  590. operands into a copy of the template. Matching involves determining
  591. the values that serve as the operands in the insn being matched. Both
  592. of these activities are controlled by two special expression types
  593. that direct matching and substitution of the operands.
  594. `(match_operand:M N TESTFN CONSTRAINT)'
  595. This expression is a placeholder for operand number N of
  596. the insn. When constructing an insn, operand number N
  597. will be substituted at this point. When matching an insn, whatever
  598. appears at this position in the insn will be taken as operand
  599. number N; but it must satisfy TESTFN or this instruction
  600. pattern will not match at all.
  601. Operand numbers must be chosen consecutively counting from zero in
  602. each instruction pattern. There may be only one `match_operand'
  603. expression in the pattern for each expression number, and they must
  604. appear in order of increasing expression number.
  605. TESTFN is a string that is the name of a C function that accepts
  606. two arguments, a machine mode and an expression. During matching,
  607. the function will be called with M as the mode argument
  608. and the putative operand as the other argument. If it returns zero,
  609. this instruction pattern fails to match. TESTFN may be
  610. an empty string; then it means no test is to be done on the operand.
  611. Most often, TESTFN is `"general_operand"'. It checks
  612. that the putative operand is either a constant, a register or a
  613. memory reference, and that it is valid for mode M.
  614. CONSTRAINT is explained later.
  615. `(match_dup N)'
  616. This expression is also a placeholder for operand number N.
  617. It is used when the operand needs to appear more than once in the
  618. insn.
  619. In construction, `match_dup' behaves exactly like
  620. MATCH_OPERAND: the operand is substituted into the insn being
  621. constructed. But in matching, `match_dup' behaves differently.
  622. It assumes that operand number N has already been determined by
  623. a `match_operand' apparing earlier in the recognition template,
  624. and it matches only an identical-looking expression.
  625. `(address (match_operand:M N "address_operand" ""))'
  626. This complex of expressions is a placeholder for an operand number
  627. N in a "load address" instruction: an operand which specifies
  628. a memory location in the usual way, but for which the actual operand
  629. value used is the address of the location, not the contents of the
  630. location.
  631. `address' expressions never appear in RTL code, only in machine
  632. descriptions. And they are used only in machine descriptions that do
  633. not use the operand constraint feature. When operand constraints are
  634. in use, the letter `p' in the constraint serves this purpose.
  635. M is the machine mode of the *memory location being
  636. addressed*, not the machine mode of the address itself. That mode is
  637. always the same on a given target machine (it is `Pmode', which
  638. normally is `SImode'), so there is no point in mentioning it;
  639. thus, no machine mode is written in the `address' expression. If
  640. some day support is added for machines in which addresses of different
  641. kinds of objects appear differently or are used differently (such as
  642. the PDP-10), different formats would perhaps need different machine
  643. modes and these modes might be written in the `address'
  644. expression.
  645. 
  646. File: internals Node: Example, Prev: Patterns, Up: Machine Desc, Next: Constraints
  647. Example of `define_insn'
  648. ========================
  649. Here is an actual example of an instruction pattern, for the 68000/68020.
  650. (define_insn "tstsi"
  651. [(set (cc0)
  652. (match_operand:SI 0 "general_operand" "rm"))]
  653. ""
  654. "*
  655. { if (TARGET_68020 || ! ADDRESS_REG_P (operands[0]))
  656. return \"tstl %0\";
  657. return \"cmpl #0,%0\"; }")
  658. This is an instruction that sets the condition codes based on the value of
  659. a general operand. It has no condition, so any insn whose RTL description
  660. has the form shown may be handled according to this pattern. The name
  661. `tstsi' means "test a `SImode' value" and tells the RTL generation
  662. pass that, when it is necessary to test such a value, an insn to do so
  663. can be constructed using this pattern.
  664. The output control string is a piece of C code which chooses which
  665. output template to return based on the kind of operand and the specific
  666. type of CPU for which code is being generated.
  667. `"rm"' is an operand constraint. Its meaning is explained below.
  668. 
  669. File: internals Node: Constraints, Prev: Example, Up: Machine Desc, Next: Standard Names
  670. Operand Constraints
  671. ===================
  672. Each `match_operand' in an instruction pattern can specify a
  673. constraint for the type of operands allowed. Constraints can say whether
  674. an operand may be in a register, and which kinds of register; whether the
  675. operand can be a memory reference, and which kinds of address; whether the
  676. operand may be an immediate constant, and which possible values it may
  677. have. Constraints can also require two operands to match.
  678. * Menu:
  679. * Simple Constraints:: Basic use of constraints.
  680. * Multi-alternative:: When an insn has two alternative constraint-patterns.
  681. * Class Preferences:: Constraints guide which hard register to put things in.
  682. * Modifiers:: More precise control over effects of constraints.
  683. * No Constraints:: Describing a clean machine without constraints.
  684. 
  685. File: internals Node: Simple Constraints, Prev: Constraints, Up: Constraints, Next: Multi-Alternative
  686. Simple Constraints
  687. ------------------
  688. The simplest kind of constraint is a string full of letters, each of
  689. which describes one kind of operand that is permitted. Here are
  690. the letters that are allowed:
  691. `m'
  692. A memory operand is allowed, with any kind of address that the machine
  693. supports in general.
  694. `o'
  695. A memory operand is allowed, but only if the address is "offsetable".
  696. This means that adding a small integer (actually, the width in bytes of the
  697. operand, as determined by its machine mode) may be added to the address
  698. and the result is also a valid memory address. For example, an address
  699. which is constant is offsetable; so is an address that is the sum of
  700. a register and a constant (as long as a slightly larger constant is also
  701. within the range of address-offsets supported by the machine); but an
  702. autoincrement or autodecrement address is not offsetable. More complicated
  703. indirect/indexed addresses may or may not be offsetable depending on the
  704. other addressing modes that the machine supports.
  705. `<'
  706. A memory operand with autodecrement addressing (either predecrement or
  707. postdecrement) is allowed.
  708. `>'
  709. A memory operand with autoincrement addressing (either preincrement or
  710. postincrement) is allowed.
  711. `r'
  712. A register operand is allowed provided that it is in a general register.
  713. `d'
  714. `a'
  715. `f'
  716. `...'
  717. Other letters can be defined in machine-dependent fashion to stand for
  718. particular classes of registers. `d', `a' and `f' are
  719. defined on the 68000/68020 to stand for data, address and floating point
  720. registers.
  721. `i'
  722. An immediate integer operand (one with constant value) is allowed.
  723. `I'
  724. `J'
  725. `K'
  726. `...'
  727. Other letters in the range `I' through `M' may be defined in a
  728. machine-dependent fashion to permit immediate integer operands with
  729. explicit integer values in specified ranges. For example, on the 68000,
  730. `I' is defined to stand for the range of values 1 to 8. This is the
  731. range permitted as a shift count in the shift instructions.
  732. `F'
  733. An immediate floating operand (expression code `const_double') is
  734. allowed.
  735. `G'
  736. `H'
  737. `G' and `H' may be defined in a machine-dependent fashion to
  738. permit immediate floating operands in particular ranges of values.
  739. `s'
  740. An immediate integer operand whose value is not an explicit integer is
  741. allowed. This might appear strange; if an insn allows a constant operand
  742. with a value not known at compile time, it certainly must allow any known
  743. value. So why use `s' instead of `i'? Sometimes it allows
  744. better code to be generated. For example, on the 68000 in a fullword
  745. instruction it is possible to use an immediate operand; but if the
  746. immediate value is between -32 and 31, better code results from loading the
  747. value into a register and using the register. This is because the load
  748. into the register can be done with a `moveq' instruction. We arrange
  749. for this to happen by defining the letter `K' to mean "any integer
  750. outside the range -32 to 31", and then specifying `Ks' in the operand
  751. constraints.
  752. `g'
  753. Any register, memory or immediate integer operand is allowed, except for
  754. registers that are not general registers.
  755. `N, a digit'
  756. An operand identical to operand number N is allowed.
  757. If a digit is used together with letters, the digit should come last.
  758. `p'
  759. An operand that is a valid memory address is allowed. This is
  760. for "load address" and "push address" instructions.
  761. If `p' is used in the constraint, the test-function in the
  762. `match_operand' must be `address_operand'.
  763. In order to have valid assembler code, each operand must satisfy
  764. its constraint. But a failure to do so does not prevent the pattern
  765. from applying to an insn. Instead, it directs the compiler to modify
  766. the code such that the constraint will be satisfied. Usually this is
  767. done by copying an operand into a register.
  768. Contrast, therefore, the two instruction patterns that follow:
  769. (define_insn ""
  770. [(set (match_operand:SI 0 "general_operand" "r")
  771. (plus:SI (match_dup 0)
  772. (match_operand:SI 1 "general_operand" "r")))]
  773. ""
  774. "...")
  775. which has two operands, one of which must appear in two places, and
  776. (define_insn ""
  777. [(set (match_operand:SI 0 "general_operand" "r")
  778. (plus:SI (match_operand:SI 1 "general_operand" "0")
  779. (match_operand:SI 2 "general_operand" "r")))]
  780. ""
  781. "...")
  782. which has three operands, two of which are required by a constraint to be
  783. identical. If we are considering an insn of the form
  784. (insn N PREV NEXT
  785. (set (reg:SI 3)
  786. (plus:SI (reg:SI 6) (reg:SI 109)))
  787. ...)
  788. the first pattern would not apply at all, because this insn does not
  789. contain two identical subexpressions in the right place. The pattern would
  790. say, "That does not look like an add instruction; try other patterns."
  791. The second pattern would say, "Yes, that's an add instruction, but there
  792. is something wrong with it." It would direct the reload pass of the
  793. compiler to generate additional insns to make the constraint true. The
  794. results might look like this:
  795. (insn N2 PREV N
  796. (set (reg:SI 3) (reg:SI 6))
  797. ...)
  798. (insn N N2 NEXT
  799. (set (reg:SI 3)
  800. (plus:SI (reg:SI 3) (reg:SI 109)))
  801. ...)
  802. Because insns that don't fit the constraints are fixed up by loading
  803. operands into registers, every instruction pattern's constraints must
  804. permit the case where all the operands are in registers. It need not
  805. permit all classes of registers; the compiler knows how to copy registers
  806. into other registers of the proper class in order to make an instruction
  807. valid. But if no registers are permitted, the compiler will be stymied: it
  808. does not know how to save a register in memory in order to make an
  809. instruction valid. Instruction patterns that reject registers can be
  810. made valid by attaching a condition-expression that refuses to match
  811. an insn at all if the crucial operand is a register.
  812. 
  813. File: internals Node: Multi-Alternative, Prev: Simple Constraints, Up: Constraints, Next: Class Preferences
  814. Multiple Alternative Constraints
  815. --------------------------------
  816. Sometimes a single instruction has multiple alternative sets of possible
  817. operands. For example, on the 68000, a logical-or instruction can combine
  818. register or an immediate value into memory, or it can combine any kind of
  819. operand into a register; but it cannot combine one memory location into
  820. another.
  821. These constraints are represented as multiple alternatives. An alternative
  822. can be described by a series of letters for each operand. The overall
  823. constraint for an operand is made from the letters for this operand
  824. from the first alternative, a comma, the letters for this operand from
  825. the second alternative, a comma, and so on until the last alternative.
  826. Here is how it is done for fullword logical-or on the 68000:
  827. (define_insn "iorsi3"
  828. [(set (match_operand:SI 0 "general_operand" "=%m,d")
  829. (ior:SI (match_operand:SI 1 "general_operand" "0,0")
  830. (match_operand:SI 2 "general_operand" "dKs,dmKs")))]
  831. ...)
  832. The first alternative has `m' (memory) for operand 0, `0' for
  833. operand 1 (meaning it must match operand 0), and `dKs' for operand 2.
  834. The second alternative has `d' (data register) for operand 0, `0'
  835. for operand 1, and `dmKs' for operand 2. The `=' and `%' in
  836. the constraint for operand 0 are not part of any alternative; their meaning
  837. is explained in the next section.
  838. If all the operands fit any one alternative, the instruction is valid.
  839. Otherwise, for each alternative, the compiler counts how many instructions
  840. must be added to copy the operands so that that alternative applies.
  841. The alternative requiring the least copying is chosen. If two alternatives
  842. need the same amount of copying, the one that comes first is chosen.
  843. These choices can be altered with the `?' and `!' characters:
  844. `?'
  845. Disparage slightly the alternative that the `?' appears in,
  846. as a choice when no alternative applies exactly. The compiler regards
  847. this alternative as one unit more costly for each `?' that appears
  848. in it.
  849. `!'
  850. Disparage severely the alternative that the `!' appears in.
  851. When operands must be copied into registers, the compiler will
  852. never choose this alternative as the one to strive for.
  853. 
  854. File: internals Node: Class Preferences, Prev: Multi-Alternative, Up: Constraints, Next: Modifiers
  855. Register Class Preferences
  856. --------------------------
  857. The operand constraints have another function: they enable the compiler
  858. to decide which kind of hardware register a pseudo register is best
  859. allocated to. The compiler examines the constraints that apply to the
  860. insns that use the pseudo register, looking for the machine-dependent
  861. letters such as `d' and `a' that specify classes of registers.
  862. The pseudo register is put in whichever class gets the most "votes".
  863. The constraint letters `g' and `r' also vote: they vote in
  864. favor of a general register. The machine description says which registers
  865. are considered general.
  866. Of course, on some machines all registers are equivalent, and no register
  867. classes are defined. Then none of this complexity is relevant.
  868. 
  869. File: internals Node: Modifiers, Prev: Class Preferences, Up: Constraints, Next: No Constraints
  870. Constraint Modifier Characters
  871. ------------------------------
  872. `='
  873. Means that this operand is written by the instruction, but its previous
  874. value is not used.
  875. `+'
  876. Means that this operand is both read and written by the instruction.
  877. When the compiler fixes up the operands to satisfy the constraints,
  878. it needs to know which operands are inputs to the instruction and
  879. which are outputs from it. `=' identifies an output; `+'
  880. identifies an operand that is both input and output; all other operands
  881. are assumed to be input only.
  882. `%'
  883. Declares the instruction to be commutative for operands 1 and 2.
  884. This means that the compiler may interchange operands 1 and 2
  885. if that will make the operands fit their constraints.
  886. `#'
  887. Says that all following characters, up to the next comma, are to be ignored
  888. as a constraint. They are significant only for choosing register preferences.
  889. `*'
  890. Says that the following character should be ignored when choosing
  891. register preferences. `*' has no effect on the meaning of
  892. the constraint as a constraint.
  893. 
  894. File: internals Node: No Constraints, Prev: Modifiers, Up: Constraints
  895. Not Using Constraints
  896. ---------------------
  897. Some machines are so clean that operand constraints are not required. For
  898. example, on the Vax, an operand valid in one context is valid in any other
  899. context. On such a machine, every operand constraint would be `"g"',
  900. excepting only operands of "load address" instructions which are
  901. written as if they referred to a memory location's contents but actual
  902. refer to its address. They would have constraint `"p"'.
  903. For such machines, instead of writing `"g"' and `"p"' for all
  904. the constraints, you can choose to write a description with empty constraints.
  905. Then you write `""' for the constraint in every `match_operand'.
  906. Address operands are identified by writing an `address' expression
  907. around the `match_operand', not by their constraints.
  908. When the machine description has just empty constraints, certain parts
  909. of compilation are skipped, making the compiler faster.
  910. 
  911. File: internals Node: Standard Names, Prev: Constraints, Up: Machine Desc, Next: Dependent Patterns
  912. Standard Insn Names
  913. ===================
  914. Here is a table of the instruction names that are meaningful in the RTL
  915. generation pass of the compiler. Giving one of these names to an
  916. instruction pattern tells the RTL generation pass that it can use the
  917. pattern in to accomplish a certain task.
  918. `movM'
  919. Here M is a two-letter machine mode name, in lower case. This
  920. instruction pattern moves data with that machine mode from operand 1 to
  921. operand 0. For example, `movsi' moves full-word data.
  922. If operand 0 is a `subreg' with mode M of a register whose
  923. natural mode is wider than M, the effect of this instruction is
  924. to store the specified value in the part of the register that corresponds
  925. to mode M. The effect on the rest of the register is undefined.
  926. `movstrictM'
  927. Like `movM' except that if operand 0 is a `subreg'
  928. with mode M of a register whose natural mode is wider,
  929. the `movstrictM' instruction is guaranteed not to alter
  930. any of the register except the part which belongs to mode M.
  931. `addM3'
  932. Add operand 2 and operand 1, storing the result in operand 0. All operands
  933. must have mode M. This can be used even on two-address machines, by
  934. means of constraints requiring operands 1 and 0 to be the same location.
  935. `subM3'
  936. `mulM3'
  937. `umulM3'
  938. `divM3'
  939. `udivM3'
  940. `modM3'
  941. `umodM3'
  942. `andM3'
  943. `iorM3'
  944. `xorM3'
  945. Similar, for other arithmetic operations.
  946. `andcbM3'
  947. Bitwise logical-and operand 1 with the complement of operand 2
  948. and store the result in operand 0.
  949. `mulhisi3'
  950. Multiply operands 1 and 2, which have mode `HImode', and store
  951. a `SImode' product in operand 0.
  952. `mulqihi3'
  953. `mulsidi3'
  954. Similar widening-multiplication instructions of other widths.
  955. `umulqihi3'
  956. `umulhisi3'
  957. `umulsidi3'
  958. Similar widening-multiplication instructions that do unsigned
  959. multiplication.
  960. `divmodM4'
  961. Signed division that produces both a quotient and a remainder.
  962. Operand 1 is divided by operand 2 to produce a quotient stored
  963. in operand 0 and a remainder stored in operand 3.
  964. `udivmodM4'
  965. Similar, but does unsigned division.
  966. `divmodMN4'
  967. Like `divmodM4' except that only the dividend has mode
  968. M; the divisor, quotient and remainder have mode N.
  969. For example, the Vax has a `divmoddisi4' instruction
  970. (but it is omitted from the machine description, because it
  971. is so slow that it is faster to compute remainders by the
  972. circumlocution that the compiler will use if this instruction is
  973. not available).
  974. `ashlM3'
  975. Arithmetic-shift operand 1 left by a number of bits specified by
  976. operand 2, and store the result in operand 0. Operand 2 has
  977. mode `SImode', not mode M.
  978. `ashrM3'
  979. `lshlM3'
  980. `lshrM3'
  981. `rotlM3'
  982. `rotrM3'
  983. Other shift and rotate instructions.
  984. `negM2'
  985. Negate operand 1 and store the result in operand 0.
  986. `absM2'
  987. Store the absolute value of operand 1 into operand 0.
  988. `sqrtM2'
  989. Store the square root of operand 1 into operand 0.
  990. `one_cmplM2'
  991. Store the bitwise-complement of operand 1 into operand 0.
  992. `cmpM'
  993. Compare operand 0 and operand 1, and set the condition codes.
  994. `tstM'
  995. Compare operand 0 against zero, and set the condition codes.
  996. `movstrM'
  997. Block move instruction. The addresses of the destination and source
  998. strings are the first two operands, and both are in mode `Pmode'.
  999. The number of bytes to move is the third operand, in mode M.
  1000. `cmpstrM'
  1001. Block compare instruction, with operands like `movstrM'
  1002. except that the two memory blocks are compared byte by byte
  1003. in lexicographic order. The effect of the instruction is to set
  1004. the condition codes.
  1005. `floatMN2'
  1006. Convert operand 1 (valid for floating point mode M) to fixed
  1007. point mode N and store in operand 0 (which has mode N).
  1008. `fixMN2'
  1009. Convert operand 1 (valid for fixed point mode M) to floating
  1010. point mode N and store in operand 0 (which has mode N).
  1011. `truncMN'
  1012. Truncate operand 1 (valid for mode M) to mode N and
  1013. store in operand 0 (which has mode N). Both modes must be fixed
  1014. point or both floating point.
  1015. `extendMN'
  1016. Sign-extend operand 1 (valid for mode M) to mode N and
  1017. store in operand 0 (which has mode N). Both modes must be fixed
  1018. point or both floating point.
  1019. `zero_extendMN'
  1020. Zero-extend operand 1 (valid for mode M) to mode N and
  1021. store in operand 0 (which has mode N). Both modes must be fixed
  1022. point.
  1023. `extv'
  1024. Extract a bit-field from operand 1 (a register or memory operand),
  1025. where operand 2 specifies the width in bits and operand 3 the starting
  1026. bit, and store it in operand 0. Operand 0 must have `Simode'.
  1027. Operand 1 may have mode `QImode' or `SImode'; often
  1028. `SImode' is allowed only for registers. Operands 2 and 3 must be
  1029. valid for `SImode'.
  1030. The RTL generation pass generates this instruction only with constants
  1031. for operands 2 and 3.
  1032. The bit-field value is sign-extended to a full word integer
  1033. before it is stored in operand 0.
  1034. `extzv'
  1035. Like `extv' except that the bit-field value is zero-extended.
  1036. `insv'
  1037. Store operand 3 (which must be valid for `SImode') into a
  1038. bit-field in operand 0, where operand 1 specifies the width in bits
  1039. and operand 2 the starting bit. Operand 0 may have mode `QImode'
  1040. or `SImode'; often `SImode' is allowed only for registers.
  1041. Operands 1 and 2 must be valid for `SImode'.
  1042. The RTL generation pass generates this instruction only with constants
  1043. for operands 1 and 2.
  1044. `sCONDM'
  1045. Store zero or -1 in the operand (with mode M) according to the
  1046. condition codes. Value stored is -1 iff the condition COND is
  1047. true. COND is the name of a comparison operation rtx code, such
  1048. as `eq', `lt' or `leu'.
  1049. `bCOND'
  1050. Conditional branch instruction. Operand 0 is a `label_ref'
  1051. that refers to the label to jump to. Jump if the condition codes
  1052. meet condition COND.
  1053. `call'
  1054. Subroutine call instruction. Operand 1 is the number of arguments
  1055. and operand 0 is the function to call. Operand 1 should be a `mem'
  1056. rtx whose address is the address of the function.
  1057. `return'
  1058. Subroutine return instruction. This instruction pattern name should be
  1059. defined only if a single instruction can do all the work of returning
  1060. from a function.
  1061. `tablejump'
  1062. `caseM'
  1063.