rtl.def 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371
  1. /* This file contains the definitions and documentation for the
  2. Register Transfer Expressions (rtx's) that make up the
  3. Register Transfer Language (rtl) used in the Back End of the GNU compiler.
  4. Copyright (C) 1987-2019 Free Software Foundation, Inc.
  5. This file is part of GCC.
  6. GCC is free software; you can redistribute it and/or modify it under
  7. the terms of the GNU General Public License as published by the Free
  8. Software Foundation; either version 3, or (at your option) any later
  9. version.
  10. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with GCC; see the file COPYING3. If not see
  16. <http://www.gnu.org/licenses/>. */
  17. /* Expression definitions and descriptions for all targets are in this file.
  18. Some will not be used for some targets.
  19. The fields in the cpp macro call "DEF_RTL_EXPR()"
  20. are used to create declarations in the C source of the compiler.
  21. The fields are:
  22. 1. The internal name of the rtx used in the C source.
  23. It is a tag in the enumeration "enum rtx_code" defined in "rtl.h".
  24. By convention these are in UPPER_CASE.
  25. 2. The name of the rtx in the external ASCII format read by
  26. read_rtx(), and printed by print_rtx().
  27. These names are stored in rtx_name[].
  28. By convention these are the internal (field 1) names in lower_case.
  29. 3. The print format, and type of each rtx->u.fld[] (field) in this rtx.
  30. These formats are stored in rtx_format[].
  31. The meaning of the formats is documented in front of this array in rtl.c
  32. 4. The class of the rtx. These are stored in rtx_class and are accessed
  33. via the GET_RTX_CLASS macro. They are defined as follows:
  34. RTX_CONST_OBJ
  35. an rtx code that can be used to represent a constant object
  36. (e.g, CONST_INT)
  37. RTX_OBJ
  38. an rtx code that can be used to represent an object (e.g, REG, MEM)
  39. RTX_COMPARE
  40. an rtx code for a comparison (e.g, LT, GT)
  41. RTX_COMM_COMPARE
  42. an rtx code for a commutative comparison (e.g, EQ, NE, ORDERED)
  43. RTX_UNARY
  44. an rtx code for a unary arithmetic expression (e.g, NEG, NOT)
  45. RTX_COMM_ARITH
  46. an rtx code for a commutative binary operation (e.g,, PLUS, MULT)
  47. RTX_TERNARY
  48. an rtx code for a non-bitfield three input operation (IF_THEN_ELSE)
  49. RTX_BIN_ARITH
  50. an rtx code for a non-commutative binary operation (e.g., MINUS, DIV)
  51. RTX_BITFIELD_OPS
  52. an rtx code for a bit-field operation (ZERO_EXTRACT, SIGN_EXTRACT)
  53. RTX_INSN
  54. an rtx code for a machine insn (INSN, JUMP_INSN, CALL_INSN) or
  55. data that will be output as assembly pseudo-ops (DEBUG_INSN)
  56. RTX_MATCH
  57. an rtx code for something that matches in insns (e.g, MATCH_DUP)
  58. RTX_AUTOINC
  59. an rtx code for autoincrement addressing modes (e.g. POST_DEC)
  60. RTX_EXTRA
  61. everything else
  62. All of the expressions that appear only in machine descriptions,
  63. not in RTL used by the compiler itself, are at the end of the file. */
  64. /* Unknown, or no such operation; the enumeration constant should have
  65. value zero. */
  66. DEF_RTL_EXPR(UNKNOWN, "UnKnown", "*", RTX_EXTRA)
  67. /* Used in the cselib routines to describe a value. Objects of this
  68. kind are only allocated in cselib.c, in an alloc pool instead of in
  69. GC memory. The only operand of a VALUE is a cselib_val.
  70. var-tracking requires this to have a distinct integral value from
  71. DECL codes in trees. */
  72. DEF_RTL_EXPR(VALUE, "value", "0", RTX_OBJ)
  73. /* The RTL generated for a DEBUG_EXPR_DECL. It links back to the
  74. DEBUG_EXPR_DECL in the first operand. */
  75. DEF_RTL_EXPR(DEBUG_EXPR, "debug_expr", "0", RTX_OBJ)
  76. /* ---------------------------------------------------------------------
  77. Expressions used in constructing lists.
  78. --------------------------------------------------------------------- */
  79. /* A linked list of expressions. */
  80. DEF_RTL_EXPR(EXPR_LIST, "expr_list", "ee", RTX_EXTRA)
  81. /* A linked list of instructions.
  82. The insns are represented in print by their uids. */
  83. DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", RTX_EXTRA)
  84. /* A linked list of integers. */
  85. DEF_RTL_EXPR(INT_LIST, "int_list", "ie", RTX_EXTRA)
  86. /* SEQUENCE is used in late passes of the compiler to group insns for
  87. one reason or another.
  88. For example, after delay slot filling, branch instructions with filled
  89. delay slots are represented as a SEQUENCE of length 1 + n_delay_slots,
  90. with the branch instruction in XEXPVEC(seq, 0, 0) and the instructions
  91. occupying the delay slots in the remaining XEXPVEC slots.
  92. Another place where a SEQUENCE may appear, is in REG_FRAME_RELATED_EXPR
  93. notes, to express complex operations that are not obvious from the insn
  94. to which the REG_FRAME_RELATED_EXPR note is attached. In this usage of
  95. SEQUENCE, the sequence vector slots do not hold real instructions but
  96. only pseudo-instructions that can be translated to DWARF CFA expressions.
  97. Some back ends also use SEQUENCE to group insns in bundles.
  98. Much of the compiler infrastructure is not prepared to handle SEQUENCE
  99. objects. Only passes after pass_free_cfg are expected to handle them. */
  100. DEF_RTL_EXPR(SEQUENCE, "sequence", "E", RTX_EXTRA)
  101. /* Represents a non-global base address. This is only used in alias.c. */
  102. DEF_RTL_EXPR(ADDRESS, "address", "i", RTX_EXTRA)
  103. /* ----------------------------------------------------------------------
  104. Expression types used for things in the instruction chain.
  105. All formats must start with "uu" to handle the chain.
  106. Each insn expression holds an rtl instruction and its semantics
  107. during back-end processing.
  108. See macros in "rtl.h" for the meaning of each rtx->u.fld[].
  109. ---------------------------------------------------------------------- */
  110. /* An annotation for variable assignment tracking. */
  111. DEF_RTL_EXPR(DEBUG_INSN, "debug_insn", "uuBeiie", RTX_INSN)
  112. /* An instruction that cannot jump. */
  113. DEF_RTL_EXPR(INSN, "insn", "uuBeiie", RTX_INSN)
  114. /* An instruction that can possibly jump.
  115. Fields ( rtx->u.fld[] ) have exact same meaning as INSN's. */
  116. DEF_RTL_EXPR(JUMP_INSN, "jump_insn", "uuBeiie0", RTX_INSN)
  117. /* An instruction that can possibly call a subroutine
  118. but which will not change which instruction comes next
  119. in the current function.
  120. Field ( rtx->u.fld[8] ) is CALL_INSN_FUNCTION_USAGE.
  121. All other fields ( rtx->u.fld[] ) have exact same meaning as INSN's. */
  122. DEF_RTL_EXPR(CALL_INSN, "call_insn", "uuBeiiee", RTX_INSN)
  123. /* Placeholder for tablejump JUMP_INSNs. The pattern of this kind
  124. of rtx is always either an ADDR_VEC or an ADDR_DIFF_VEC. These
  125. placeholders do not appear as real instructions inside a basic
  126. block, but are considered active_insn_p instructions for historical
  127. reasons, when jump table data was represented with JUMP_INSNs. */
  128. DEF_RTL_EXPR(JUMP_TABLE_DATA, "jump_table_data", "uuBe0000", RTX_INSN)
  129. /* A marker that indicates that control will not flow through. */
  130. DEF_RTL_EXPR(BARRIER, "barrier", "uu00000", RTX_EXTRA)
  131. /* Holds a label that is followed by instructions.
  132. Operand:
  133. 3: is used in jump.c for the use-count of the label.
  134. 4: is used in the sh backend.
  135. 5: is a number that is unique in the entire compilation.
  136. 6: is the user-given name of the label, if any. */
  137. DEF_RTL_EXPR(CODE_LABEL, "code_label", "uuB00is", RTX_EXTRA)
  138. /* Say where in the code a source line starts, for symbol table's sake.
  139. Operand:
  140. 3: note-specific data
  141. 4: enum insn_note
  142. 5: unique number if insn_note == note_insn_deleted_label. */
  143. DEF_RTL_EXPR(NOTE, "note", "uuB0ni", RTX_EXTRA)
  144. /* ----------------------------------------------------------------------
  145. Top level constituents of INSN, JUMP_INSN and CALL_INSN.
  146. ---------------------------------------------------------------------- */
  147. /* Conditionally execute code.
  148. Operand 0 is the condition that if true, the code is executed.
  149. Operand 1 is the code to be executed (typically a SET).
  150. Semantics are that there are no side effects if the condition
  151. is false. This pattern is created automatically by the if_convert
  152. pass run after reload or by target-specific splitters. */
  153. DEF_RTL_EXPR(COND_EXEC, "cond_exec", "ee", RTX_EXTRA)
  154. /* Several operations to be done in parallel (perhaps under COND_EXEC). */
  155. DEF_RTL_EXPR(PARALLEL, "parallel", "E", RTX_EXTRA)
  156. /* A string that is passed through to the assembler as input.
  157. One can obviously pass comments through by using the
  158. assembler comment syntax.
  159. These occur in an insn all by themselves as the PATTERN.
  160. They also appear inside an ASM_OPERANDS
  161. as a convenient way to hold a string. */
  162. DEF_RTL_EXPR(ASM_INPUT, "asm_input", "si", RTX_EXTRA)
  163. /* An assembler instruction with operands.
  164. 1st operand is the instruction template.
  165. 2nd operand is the constraint for the output.
  166. 3rd operand is the number of the output this expression refers to.
  167. When an insn stores more than one value, a separate ASM_OPERANDS
  168. is made for each output; this integer distinguishes them.
  169. 4th is a vector of values of input operands.
  170. 5th is a vector of modes and constraints for the input operands.
  171. Each element is an ASM_INPUT containing a constraint string
  172. and whose mode indicates the mode of the input operand.
  173. 6th is a vector of labels that may be branched to by the asm.
  174. 7th is the source line number. */
  175. DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands", "ssiEEEi", RTX_EXTRA)
  176. /* A machine-specific operation.
  177. 1st operand is a vector of operands being used by the operation so that
  178. any needed reloads can be done.
  179. 2nd operand is a unique value saying which of a number of machine-specific
  180. operations is to be performed.
  181. (Note that the vector must be the first operand because of the way that
  182. genrecog.c record positions within an insn.)
  183. UNSPEC can occur all by itself in a PATTERN, as a component of a PARALLEL,
  184. or inside an expression.
  185. UNSPEC by itself or as a component of a PARALLEL
  186. is currently considered not deletable.
  187. FIXME: Replace all uses of UNSPEC that appears by itself or as a component
  188. of a PARALLEL with USE.
  189. */
  190. DEF_RTL_EXPR(UNSPEC, "unspec", "Ei", RTX_EXTRA)
  191. /* Similar, but a volatile operation and one which may trap. */
  192. DEF_RTL_EXPR(UNSPEC_VOLATILE, "unspec_volatile", "Ei", RTX_EXTRA)
  193. /* ----------------------------------------------------------------------
  194. Table jump addresses.
  195. ---------------------------------------------------------------------- */
  196. /* Vector of addresses, stored as full words.
  197. Each element is a LABEL_REF to a CODE_LABEL whose address we want. */
  198. DEF_RTL_EXPR(ADDR_VEC, "addr_vec", "E", RTX_EXTRA)
  199. /* Vector of address differences X0 - BASE, X1 - BASE, ...
  200. First operand is BASE; the vector contains the X's.
  201. The machine mode of this rtx says how much space to leave
  202. for each difference and is adjusted by branch shortening if
  203. CASE_VECTOR_SHORTEN_MODE is defined.
  204. The third and fourth operands store the target labels with the
  205. minimum and maximum addresses respectively.
  206. The fifth operand stores flags for use by branch shortening.
  207. Set at the start of shorten_branches:
  208. min_align: the minimum alignment for any of the target labels.
  209. base_after_vec: true iff BASE is after the ADDR_DIFF_VEC.
  210. min_after_vec: true iff minimum addr target label is after the ADDR_DIFF_VEC.
  211. max_after_vec: true iff maximum addr target label is after the ADDR_DIFF_VEC.
  212. min_after_base: true iff minimum address target label is after BASE.
  213. max_after_base: true iff maximum address target label is after BASE.
  214. Set by the actual branch shortening process:
  215. offset_unsigned: true iff offsets have to be treated as unsigned.
  216. scale: scaling that is necessary to make offsets fit into the mode.
  217. The third, fourth and fifth operands are only valid when
  218. CASE_VECTOR_SHORTEN_MODE is defined, and only in an optimizing
  219. compilation. */
  220. DEF_RTL_EXPR(ADDR_DIFF_VEC, "addr_diff_vec", "eEee0", RTX_EXTRA)
  221. /* Memory prefetch, with attributes supported on some targets.
  222. Operand 1 is the address of the memory to fetch.
  223. Operand 2 is 1 for a write access, 0 otherwise.
  224. Operand 3 is the level of temporal locality; 0 means there is no
  225. temporal locality and 1, 2, and 3 are for increasing levels of temporal
  226. locality.
  227. The attributes specified by operands 2 and 3 are ignored for targets
  228. whose prefetch instructions do not support them. */
  229. DEF_RTL_EXPR(PREFETCH, "prefetch", "eee", RTX_EXTRA)
  230. /* ----------------------------------------------------------------------
  231. At the top level of an instruction (perhaps under PARALLEL).
  232. ---------------------------------------------------------------------- */
  233. /* Assignment.
  234. Operand 1 is the location (REG, MEM, PC, CC0 or whatever) assigned to.
  235. Operand 2 is the value stored there.
  236. ALL assignment must use SET.
  237. Instructions that do multiple assignments must use multiple SET,
  238. under PARALLEL. */
  239. DEF_RTL_EXPR(SET, "set", "ee", RTX_EXTRA)
  240. /* Indicate something is used in a way that we don't want to explain.
  241. For example, subroutine calls will use the register
  242. in which the static chain is passed.
  243. USE cannot appear as an operand of other rtx except for PARALLEL.
  244. USE is not deletable, as it indicates that the operand
  245. is used in some unknown way. */
  246. DEF_RTL_EXPR(USE, "use", "e", RTX_EXTRA)
  247. /* Indicate something is clobbered in a way that we don't want to explain.
  248. For example, subroutine calls will clobber some physical registers
  249. (the ones that are by convention not saved).
  250. CLOBBER cannot appear as an operand of other rtx except for PARALLEL.
  251. CLOBBER of a hard register appearing by itself (not within PARALLEL)
  252. is considered undeletable before reload. */
  253. DEF_RTL_EXPR(CLOBBER, "clobber", "e", RTX_EXTRA)
  254. /* Indicate that the upper parts of something are clobbered in a way that we
  255. don't want to explain. The MODE references the lower bits that will be
  256. preserved. Anything above that size will be clobbered.
  257. CLOBBER_HIGH only occurs as the operand of a PARALLEL rtx. It cannot appear
  258. in other contexts, and unlike CLOBBER, it cannot appear on its own.
  259. CLOBBER_HIGH can only be used with fixed register rtxes. */
  260. DEF_RTL_EXPR(CLOBBER_HIGH, "clobber_high", "e", RTX_EXTRA)
  261. /* Call a subroutine.
  262. Operand 1 is the address to call.
  263. Operand 2 is the number of arguments. */
  264. DEF_RTL_EXPR(CALL, "call", "ee", RTX_EXTRA)
  265. /* Return from a subroutine. */
  266. DEF_RTL_EXPR(RETURN, "return", "", RTX_EXTRA)
  267. /* Like RETURN, but truly represents only a function return, while
  268. RETURN may represent an insn that also performs other functions
  269. of the function epilogue. Like RETURN, this may also occur in
  270. conditional jumps. */
  271. DEF_RTL_EXPR(SIMPLE_RETURN, "simple_return", "", RTX_EXTRA)
  272. /* Special for EH return from subroutine. */
  273. DEF_RTL_EXPR(EH_RETURN, "eh_return", "", RTX_EXTRA)
  274. /* Conditional trap.
  275. Operand 1 is the condition.
  276. Operand 2 is the trap code.
  277. For an unconditional trap, make the condition (const_int 1). */
  278. DEF_RTL_EXPR(TRAP_IF, "trap_if", "ee", RTX_EXTRA)
  279. /* ----------------------------------------------------------------------
  280. Primitive values for use in expressions.
  281. ---------------------------------------------------------------------- */
  282. /* numeric integer constant */
  283. DEF_RTL_EXPR(CONST_INT, "const_int", "w", RTX_CONST_OBJ)
  284. /* numeric integer constant */
  285. DEF_RTL_EXPR(CONST_WIDE_INT, "const_wide_int", "", RTX_CONST_OBJ)
  286. /* An rtx representation of a poly_wide_int. */
  287. DEF_RTL_EXPR(CONST_POLY_INT, "const_poly_int", "", RTX_CONST_OBJ)
  288. /* fixed-point constant */
  289. DEF_RTL_EXPR(CONST_FIXED, "const_fixed", "www", RTX_CONST_OBJ)
  290. /* numeric floating point or integer constant. If the mode is
  291. VOIDmode it is an int otherwise it has a floating point mode and a
  292. floating point value. Operands hold the value. They are all 'w'
  293. and there may be from 2 to 6; see real.h. */
  294. DEF_RTL_EXPR(CONST_DOUBLE, "const_double", CONST_DOUBLE_FORMAT, RTX_CONST_OBJ)
  295. /* Describes a vector constant. */
  296. DEF_RTL_EXPR(CONST_VECTOR, "const_vector", "E", RTX_CONST_OBJ)
  297. /* String constant. Used for attributes in machine descriptions and
  298. for special cases in DWARF2 debug output. NOT used for source-
  299. language string constants. */
  300. DEF_RTL_EXPR(CONST_STRING, "const_string", "s", RTX_OBJ)
  301. /* This is used to encapsulate an expression whose value is constant
  302. (such as the sum of a SYMBOL_REF and a CONST_INT) so that it will be
  303. recognized as a constant operand rather than by arithmetic instructions. */
  304. DEF_RTL_EXPR(CONST, "const", "e", RTX_CONST_OBJ)
  305. /* program counter. Ordinary jumps are represented
  306. by a SET whose first operand is (PC). */
  307. DEF_RTL_EXPR(PC, "pc", "", RTX_OBJ)
  308. /* A register. The "operand" is the register number, accessed with
  309. the REGNO macro. If this number is less than FIRST_PSEUDO_REGISTER
  310. than a hardware register is being referred to. The second operand
  311. points to a reg_attrs structure.
  312. This rtx needs to have as many (or more) fields as a MEM, since we
  313. can change REG rtx's into MEMs during reload. */
  314. DEF_RTL_EXPR(REG, "reg", "r", RTX_OBJ)
  315. /* A scratch register. This represents a register used only within a
  316. single insn. It will be replaced by a REG during register allocation
  317. or reload unless the constraint indicates that the register won't be
  318. needed, in which case it can remain a SCRATCH. */
  319. DEF_RTL_EXPR(SCRATCH, "scratch", "", RTX_OBJ)
  320. /* A reference to a part of another value. The first operand is the
  321. complete value and the second is the byte offset of the selected part. */
  322. DEF_RTL_EXPR(SUBREG, "subreg", "ep", RTX_EXTRA)
  323. /* This one-argument rtx is used for move instructions
  324. that are guaranteed to alter only the low part of a destination.
  325. Thus, (SET (SUBREG:HI (REG...)) (MEM:HI ...))
  326. has an unspecified effect on the high part of REG,
  327. but (SET (STRICT_LOW_PART (SUBREG:HI (REG...))) (MEM:HI ...))
  328. is guaranteed to alter only the bits of REG that are in HImode.
  329. The actual instruction used is probably the same in both cases,
  330. but the register constraints may be tighter when STRICT_LOW_PART
  331. is in use. */
  332. DEF_RTL_EXPR(STRICT_LOW_PART, "strict_low_part", "e", RTX_EXTRA)
  333. /* (CONCAT a b) represents the virtual concatenation of a and b
  334. to make a value that has as many bits as a and b put together.
  335. This is used for complex values. Normally it appears only
  336. in DECL_RTLs and during RTL generation, but not in the insn chain. */
  337. DEF_RTL_EXPR(CONCAT, "concat", "ee", RTX_OBJ)
  338. /* (CONCATN [a1 a2 ... an]) represents the virtual concatenation of
  339. all An to make a value. This is an extension of CONCAT to larger
  340. number of components. Like CONCAT, it should not appear in the
  341. insn chain. Every element of the CONCATN is the same size. */
  342. DEF_RTL_EXPR(CONCATN, "concatn", "E", RTX_OBJ)
  343. /* A memory location; operand is the address. The second operand is the
  344. alias set to which this MEM belongs. We use `0' instead of `w' for this
  345. field so that the field need not be specified in machine descriptions. */
  346. DEF_RTL_EXPR(MEM, "mem", "e0", RTX_OBJ)
  347. /* Reference to an assembler label in the code for this function.
  348. The operand is a CODE_LABEL found in the insn chain. */
  349. DEF_RTL_EXPR(LABEL_REF, "label_ref", "u", RTX_CONST_OBJ)
  350. /* Reference to a named label:
  351. Operand 0: label name
  352. Operand 1: tree from which this symbol is derived, or null.
  353. This is either a DECL node, or some kind of constant. */
  354. DEF_RTL_EXPR(SYMBOL_REF, "symbol_ref", "s0", RTX_CONST_OBJ)
  355. /* The condition code register is represented, in our imagination,
  356. as a register holding a value that can be compared to zero.
  357. In fact, the machine has already compared them and recorded the
  358. results; but instructions that look at the condition code
  359. pretend to be looking at the entire value and comparing it. */
  360. DEF_RTL_EXPR(CC0, "cc0", "", RTX_OBJ)
  361. /* ----------------------------------------------------------------------
  362. Expressions for operators in an rtl pattern
  363. ---------------------------------------------------------------------- */
  364. /* if_then_else. This is used in representing ordinary
  365. conditional jump instructions.
  366. Operand:
  367. 0: condition
  368. 1: then expr
  369. 2: else expr */
  370. DEF_RTL_EXPR(IF_THEN_ELSE, "if_then_else", "eee", RTX_TERNARY)
  371. /* Comparison, produces a condition code result. */
  372. DEF_RTL_EXPR(COMPARE, "compare", "ee", RTX_BIN_ARITH)
  373. /* plus */
  374. DEF_RTL_EXPR(PLUS, "plus", "ee", RTX_COMM_ARITH)
  375. /* Operand 0 minus operand 1. */
  376. DEF_RTL_EXPR(MINUS, "minus", "ee", RTX_BIN_ARITH)
  377. /* Minus operand 0. */
  378. DEF_RTL_EXPR(NEG, "neg", "e", RTX_UNARY)
  379. DEF_RTL_EXPR(MULT, "mult", "ee", RTX_COMM_ARITH)
  380. /* Multiplication with signed saturation */
  381. DEF_RTL_EXPR(SS_MULT, "ss_mult", "ee", RTX_COMM_ARITH)
  382. /* Multiplication with unsigned saturation */
  383. DEF_RTL_EXPR(US_MULT, "us_mult", "ee", RTX_COMM_ARITH)
  384. /* Operand 0 divided by operand 1. */
  385. DEF_RTL_EXPR(DIV, "div", "ee", RTX_BIN_ARITH)
  386. /* Division with signed saturation */
  387. DEF_RTL_EXPR(SS_DIV, "ss_div", "ee", RTX_BIN_ARITH)
  388. /* Division with unsigned saturation */
  389. DEF_RTL_EXPR(US_DIV, "us_div", "ee", RTX_BIN_ARITH)
  390. /* Remainder of operand 0 divided by operand 1. */
  391. DEF_RTL_EXPR(MOD, "mod", "ee", RTX_BIN_ARITH)
  392. /* Unsigned divide and remainder. */
  393. DEF_RTL_EXPR(UDIV, "udiv", "ee", RTX_BIN_ARITH)
  394. DEF_RTL_EXPR(UMOD, "umod", "ee", RTX_BIN_ARITH)
  395. /* Bitwise operations. */
  396. DEF_RTL_EXPR(AND, "and", "ee", RTX_COMM_ARITH)
  397. DEF_RTL_EXPR(IOR, "ior", "ee", RTX_COMM_ARITH)
  398. DEF_RTL_EXPR(XOR, "xor", "ee", RTX_COMM_ARITH)
  399. DEF_RTL_EXPR(NOT, "not", "e", RTX_UNARY)
  400. /* Operand:
  401. 0: value to be shifted.
  402. 1: number of bits. */
  403. DEF_RTL_EXPR(ASHIFT, "ashift", "ee", RTX_BIN_ARITH) /* shift left */
  404. DEF_RTL_EXPR(ROTATE, "rotate", "ee", RTX_BIN_ARITH) /* rotate left */
  405. DEF_RTL_EXPR(ASHIFTRT, "ashiftrt", "ee", RTX_BIN_ARITH) /* arithmetic shift right */
  406. DEF_RTL_EXPR(LSHIFTRT, "lshiftrt", "ee", RTX_BIN_ARITH) /* logical shift right */
  407. DEF_RTL_EXPR(ROTATERT, "rotatert", "ee", RTX_BIN_ARITH) /* rotate right */
  408. /* Minimum and maximum values of two operands. We need both signed and
  409. unsigned forms. (We cannot use MIN for SMIN because it conflicts
  410. with a macro of the same name.) The signed variants should be used
  411. with floating point. Further, if both operands are zeros, or if either
  412. operand is NaN, then it is unspecified which of the two operands is
  413. returned as the result. */
  414. DEF_RTL_EXPR(SMIN, "smin", "ee", RTX_COMM_ARITH)
  415. DEF_RTL_EXPR(SMAX, "smax", "ee", RTX_COMM_ARITH)
  416. DEF_RTL_EXPR(UMIN, "umin", "ee", RTX_COMM_ARITH)
  417. DEF_RTL_EXPR(UMAX, "umax", "ee", RTX_COMM_ARITH)
  418. /* These unary operations are used to represent incrementation
  419. and decrementation as they occur in memory addresses.
  420. The amount of increment or decrement are not represented
  421. because they can be understood from the machine-mode of the
  422. containing MEM. These operations exist in only two cases:
  423. 1. pushes onto the stack.
  424. 2. created automatically by the auto-inc-dec pass. */
  425. DEF_RTL_EXPR(PRE_DEC, "pre_dec", "e", RTX_AUTOINC)
  426. DEF_RTL_EXPR(PRE_INC, "pre_inc", "e", RTX_AUTOINC)
  427. DEF_RTL_EXPR(POST_DEC, "post_dec", "e", RTX_AUTOINC)
  428. DEF_RTL_EXPR(POST_INC, "post_inc", "e", RTX_AUTOINC)
  429. /* These binary operations are used to represent generic address
  430. side-effects in memory addresses, except for simple incrementation
  431. or decrementation which use the above operations. They are
  432. created automatically by the life_analysis pass in flow.c.
  433. The first operand is a REG which is used as the address.
  434. The second operand is an expression that is assigned to the
  435. register, either before (PRE_MODIFY) or after (POST_MODIFY)
  436. evaluating the address.
  437. Currently, the compiler can only handle second operands of the
  438. form (plus (reg) (reg)) and (plus (reg) (const_int)), where
  439. the first operand of the PLUS has to be the same register as
  440. the first operand of the *_MODIFY. */
  441. DEF_RTL_EXPR(PRE_MODIFY, "pre_modify", "ee", RTX_AUTOINC)
  442. DEF_RTL_EXPR(POST_MODIFY, "post_modify", "ee", RTX_AUTOINC)
  443. /* Comparison operations. The ordered comparisons exist in two
  444. flavors, signed and unsigned. */
  445. DEF_RTL_EXPR(NE, "ne", "ee", RTX_COMM_COMPARE)
  446. DEF_RTL_EXPR(EQ, "eq", "ee", RTX_COMM_COMPARE)
  447. DEF_RTL_EXPR(GE, "ge", "ee", RTX_COMPARE)
  448. DEF_RTL_EXPR(GT, "gt", "ee", RTX_COMPARE)
  449. DEF_RTL_EXPR(LE, "le", "ee", RTX_COMPARE)
  450. DEF_RTL_EXPR(LT, "lt", "ee", RTX_COMPARE)
  451. DEF_RTL_EXPR(GEU, "geu", "ee", RTX_COMPARE)
  452. DEF_RTL_EXPR(GTU, "gtu", "ee", RTX_COMPARE)
  453. DEF_RTL_EXPR(LEU, "leu", "ee", RTX_COMPARE)
  454. DEF_RTL_EXPR(LTU, "ltu", "ee", RTX_COMPARE)
  455. /* Additional floating point unordered comparison flavors. */
  456. DEF_RTL_EXPR(UNORDERED, "unordered", "ee", RTX_COMM_COMPARE)
  457. DEF_RTL_EXPR(ORDERED, "ordered", "ee", RTX_COMM_COMPARE)
  458. /* These are equivalent to unordered or ... */
  459. DEF_RTL_EXPR(UNEQ, "uneq", "ee", RTX_COMM_COMPARE)
  460. DEF_RTL_EXPR(UNGE, "unge", "ee", RTX_COMPARE)
  461. DEF_RTL_EXPR(UNGT, "ungt", "ee", RTX_COMPARE)
  462. DEF_RTL_EXPR(UNLE, "unle", "ee", RTX_COMPARE)
  463. DEF_RTL_EXPR(UNLT, "unlt", "ee", RTX_COMPARE)
  464. /* This is an ordered NE, ie !UNEQ, ie false for NaN. */
  465. DEF_RTL_EXPR(LTGT, "ltgt", "ee", RTX_COMM_COMPARE)
  466. /* Represents the result of sign-extending the sole operand.
  467. The machine modes of the operand and of the SIGN_EXTEND expression
  468. determine how much sign-extension is going on. */
  469. DEF_RTL_EXPR(SIGN_EXTEND, "sign_extend", "e", RTX_UNARY)
  470. /* Similar for zero-extension (such as unsigned short to int). */
  471. DEF_RTL_EXPR(ZERO_EXTEND, "zero_extend", "e", RTX_UNARY)
  472. /* Similar but here the operand has a wider mode. */
  473. DEF_RTL_EXPR(TRUNCATE, "truncate", "e", RTX_UNARY)
  474. /* Similar for extending floating-point values (such as SFmode to DFmode). */
  475. DEF_RTL_EXPR(FLOAT_EXTEND, "float_extend", "e", RTX_UNARY)
  476. DEF_RTL_EXPR(FLOAT_TRUNCATE, "float_truncate", "e", RTX_UNARY)
  477. /* Conversion of fixed point operand to floating point value. */
  478. DEF_RTL_EXPR(FLOAT, "float", "e", RTX_UNARY)
  479. /* With fixed-point machine mode:
  480. Conversion of floating point operand to fixed point value.
  481. Value is defined only when the operand's value is an integer.
  482. With floating-point machine mode (and operand with same mode):
  483. Operand is rounded toward zero to produce an integer value
  484. represented in floating point. */
  485. DEF_RTL_EXPR(FIX, "fix", "e", RTX_UNARY)
  486. /* Conversion of unsigned fixed point operand to floating point value. */
  487. DEF_RTL_EXPR(UNSIGNED_FLOAT, "unsigned_float", "e", RTX_UNARY)
  488. /* With fixed-point machine mode:
  489. Conversion of floating point operand to *unsigned* fixed point value.
  490. Value is defined only when the operand's value is an integer. */
  491. DEF_RTL_EXPR(UNSIGNED_FIX, "unsigned_fix", "e", RTX_UNARY)
  492. /* Conversions involving fractional fixed-point types without saturation,
  493. including:
  494. fractional to fractional (of different precision),
  495. signed integer to fractional,
  496. fractional to signed integer,
  497. floating point to fractional,
  498. fractional to floating point.
  499. NOTE: fractional can be either signed or unsigned for conversions. */
  500. DEF_RTL_EXPR(FRACT_CONVERT, "fract_convert", "e", RTX_UNARY)
  501. /* Conversions involving fractional fixed-point types and unsigned integer
  502. without saturation, including:
  503. unsigned integer to fractional,
  504. fractional to unsigned integer.
  505. NOTE: fractional can be either signed or unsigned for conversions. */
  506. DEF_RTL_EXPR(UNSIGNED_FRACT_CONVERT, "unsigned_fract_convert", "e", RTX_UNARY)
  507. /* Conversions involving fractional fixed-point types with saturation,
  508. including:
  509. fractional to fractional (of different precision),
  510. signed integer to fractional,
  511. floating point to fractional.
  512. NOTE: fractional can be either signed or unsigned for conversions. */
  513. DEF_RTL_EXPR(SAT_FRACT, "sat_fract", "e", RTX_UNARY)
  514. /* Conversions involving fractional fixed-point types and unsigned integer
  515. with saturation, including:
  516. unsigned integer to fractional.
  517. NOTE: fractional can be either signed or unsigned for conversions. */
  518. DEF_RTL_EXPR(UNSIGNED_SAT_FRACT, "unsigned_sat_fract", "e", RTX_UNARY)
  519. /* Absolute value */
  520. DEF_RTL_EXPR(ABS, "abs", "e", RTX_UNARY)
  521. /* Square root */
  522. DEF_RTL_EXPR(SQRT, "sqrt", "e", RTX_UNARY)
  523. /* Swap bytes. */
  524. DEF_RTL_EXPR(BSWAP, "bswap", "e", RTX_UNARY)
  525. /* Find first bit that is set.
  526. Value is 1 + number of trailing zeros in the arg.,
  527. or 0 if arg is 0. */
  528. DEF_RTL_EXPR(FFS, "ffs", "e", RTX_UNARY)
  529. /* Count number of leading redundant sign bits (number of leading
  530. sign bits minus one). */
  531. DEF_RTL_EXPR(CLRSB, "clrsb", "e", RTX_UNARY)
  532. /* Count leading zeros. */
  533. DEF_RTL_EXPR(CLZ, "clz", "e", RTX_UNARY)
  534. /* Count trailing zeros. */
  535. DEF_RTL_EXPR(CTZ, "ctz", "e", RTX_UNARY)
  536. /* Population count (number of 1 bits). */
  537. DEF_RTL_EXPR(POPCOUNT, "popcount", "e", RTX_UNARY)
  538. /* Population parity (number of 1 bits modulo 2). */
  539. DEF_RTL_EXPR(PARITY, "parity", "e", RTX_UNARY)
  540. /* Reference to a signed bit-field of specified size and position.
  541. Operand 0 is the memory unit (usually SImode or QImode) which
  542. contains the field's first bit. Operand 1 is the width, in bits.
  543. Operand 2 is the number of bits in the memory unit before the
  544. first bit of this field.
  545. If BITS_BIG_ENDIAN is defined, the first bit is the msb and
  546. operand 2 counts from the msb of the memory unit.
  547. Otherwise, the first bit is the lsb and operand 2 counts from
  548. the lsb of the memory unit.
  549. This kind of expression cannot appear as an lvalue in RTL. */
  550. DEF_RTL_EXPR(SIGN_EXTRACT, "sign_extract", "eee", RTX_BITFIELD_OPS)
  551. /* Similar for unsigned bit-field.
  552. But note! This kind of expression _can_ appear as an lvalue. */
  553. DEF_RTL_EXPR(ZERO_EXTRACT, "zero_extract", "eee", RTX_BITFIELD_OPS)
  554. /* For RISC machines. These save memory when splitting insns. */
  555. /* HIGH are the high-order bits of a constant expression. */
  556. DEF_RTL_EXPR(HIGH, "high", "e", RTX_CONST_OBJ)
  557. /* LO_SUM is the sum of a register and the low-order bits
  558. of a constant expression. */
  559. DEF_RTL_EXPR(LO_SUM, "lo_sum", "ee", RTX_OBJ)
  560. /* Describes a merge operation between two vector values.
  561. Operands 0 and 1 are the vectors to be merged, operand 2 is a bitmask
  562. that specifies where the parts of the result are taken from. Set bits
  563. indicate operand 0, clear bits indicate operand 1. The parts are defined
  564. by the mode of the vectors. */
  565. DEF_RTL_EXPR(VEC_MERGE, "vec_merge", "eee", RTX_TERNARY)
  566. /* Describes an operation that selects parts of a vector.
  567. Operands 0 is the source vector, operand 1 is a PARALLEL that contains
  568. a CONST_INT for each of the subparts of the result vector, giving the
  569. number of the source subpart that should be stored into it. */
  570. DEF_RTL_EXPR(VEC_SELECT, "vec_select", "ee", RTX_BIN_ARITH)
  571. /* Describes a vector concat operation. Operands 0 and 1 are the source
  572. vectors, the result is a vector that is as long as operands 0 and 1
  573. combined and is the concatenation of the two source vectors. */
  574. DEF_RTL_EXPR(VEC_CONCAT, "vec_concat", "ee", RTX_BIN_ARITH)
  575. /* Describes an operation that converts a small vector into a larger one by
  576. duplicating the input values. The output vector mode must have the same
  577. submodes as the input vector mode, and the number of output parts must be
  578. an integer multiple of the number of input parts. */
  579. DEF_RTL_EXPR(VEC_DUPLICATE, "vec_duplicate", "e", RTX_UNARY)
  580. /* Creation of a vector in which element I has the value BASE + I * STEP,
  581. where BASE is the first operand and STEP is the second. The result
  582. must have a vector integer mode. */
  583. DEF_RTL_EXPR(VEC_SERIES, "vec_series", "ee", RTX_BIN_ARITH)
  584. /* Addition with signed saturation */
  585. DEF_RTL_EXPR(SS_PLUS, "ss_plus", "ee", RTX_COMM_ARITH)
  586. /* Addition with unsigned saturation */
  587. DEF_RTL_EXPR(US_PLUS, "us_plus", "ee", RTX_COMM_ARITH)
  588. /* Operand 0 minus operand 1, with signed saturation. */
  589. DEF_RTL_EXPR(SS_MINUS, "ss_minus", "ee", RTX_BIN_ARITH)
  590. /* Negation with signed saturation. */
  591. DEF_RTL_EXPR(SS_NEG, "ss_neg", "e", RTX_UNARY)
  592. /* Negation with unsigned saturation. */
  593. DEF_RTL_EXPR(US_NEG, "us_neg", "e", RTX_UNARY)
  594. /* Absolute value with signed saturation. */
  595. DEF_RTL_EXPR(SS_ABS, "ss_abs", "e", RTX_UNARY)
  596. /* Shift left with signed saturation. */
  597. DEF_RTL_EXPR(SS_ASHIFT, "ss_ashift", "ee", RTX_BIN_ARITH)
  598. /* Shift left with unsigned saturation. */
  599. DEF_RTL_EXPR(US_ASHIFT, "us_ashift", "ee", RTX_BIN_ARITH)
  600. /* Operand 0 minus operand 1, with unsigned saturation. */
  601. DEF_RTL_EXPR(US_MINUS, "us_minus", "ee", RTX_BIN_ARITH)
  602. /* Signed saturating truncate. */
  603. DEF_RTL_EXPR(SS_TRUNCATE, "ss_truncate", "e", RTX_UNARY)
  604. /* Unsigned saturating truncate. */
  605. DEF_RTL_EXPR(US_TRUNCATE, "us_truncate", "e", RTX_UNARY)
  606. /* Floating point multiply/add combined instruction. */
  607. DEF_RTL_EXPR(FMA, "fma", "eee", RTX_TERNARY)
  608. /* Information about the variable and its location. */
  609. DEF_RTL_EXPR(VAR_LOCATION, "var_location", "te", RTX_EXTRA)
  610. /* Used in VAR_LOCATION for a pointer to a decl that is no longer
  611. addressable. */
  612. DEF_RTL_EXPR(DEBUG_IMPLICIT_PTR, "debug_implicit_ptr", "t", RTX_OBJ)
  613. /* Represents value that argument had on function entry. The
  614. single argument is the DECL_INCOMING_RTL of the corresponding
  615. parameter. */
  616. DEF_RTL_EXPR(ENTRY_VALUE, "entry_value", "0", RTX_OBJ)
  617. /* Used in VAR_LOCATION for a reference to a parameter that has
  618. been optimized away completely. */
  619. DEF_RTL_EXPR(DEBUG_PARAMETER_REF, "debug_parameter_ref", "t", RTX_OBJ)
  620. /* Used in marker DEBUG_INSNs to avoid being recognized as an insn. */
  621. DEF_RTL_EXPR(DEBUG_MARKER, "debug_marker", "", RTX_EXTRA)
  622. /* All expressions from this point forward appear only in machine
  623. descriptions. */
  624. #ifdef GENERATOR_FILE
  625. /* Pattern-matching operators: */
  626. /* Use the function named by the second arg (the string)
  627. as a predicate; if matched, store the structure that was matched
  628. in the operand table at index specified by the first arg (the integer).
  629. If the second arg is the null string, the structure is just stored.
  630. A third string argument indicates to the register allocator restrictions
  631. on where the operand can be allocated.
  632. If the target needs no restriction on any instruction this field should
  633. be the null string.
  634. The string is prepended by:
  635. '=' to indicate the operand is only written to.
  636. '+' to indicate the operand is both read and written to.
  637. Each character in the string represents an allocable class for an operand.
  638. 'g' indicates the operand can be any valid class.
  639. 'i' indicates the operand can be immediate (in the instruction) data.
  640. 'r' indicates the operand can be in a register.
  641. 'm' indicates the operand can be in memory.
  642. 'o' a subset of the 'm' class. Those memory addressing modes that
  643. can be offset at compile time (have a constant added to them).
  644. Other characters indicate target dependent operand classes and
  645. are described in each target's machine description.
  646. For instructions with more than one operand, sets of classes can be
  647. separated by a comma to indicate the appropriate multi-operand constraints.
  648. There must be a 1 to 1 correspondence between these sets of classes in
  649. all operands for an instruction.
  650. */
  651. DEF_RTL_EXPR(MATCH_OPERAND, "match_operand", "iss", RTX_MATCH)
  652. /* Match a SCRATCH or a register. When used to generate rtl, a
  653. SCRATCH is generated. As for MATCH_OPERAND, the mode specifies
  654. the desired mode and the first argument is the operand number.
  655. The second argument is the constraint. */
  656. DEF_RTL_EXPR(MATCH_SCRATCH, "match_scratch", "is", RTX_MATCH)
  657. /* Apply a predicate, AND match recursively the operands of the rtx.
  658. Operand 0 is the operand-number, as in match_operand.
  659. Operand 1 is a predicate to apply (as a string, a function name).
  660. Operand 2 is a vector of expressions, each of which must match
  661. one subexpression of the rtx this construct is matching. */
  662. DEF_RTL_EXPR(MATCH_OPERATOR, "match_operator", "isE", RTX_MATCH)
  663. /* Match a PARALLEL of arbitrary length. The predicate is applied
  664. to the PARALLEL and the initial expressions in the PARALLEL are matched.
  665. Operand 0 is the operand-number, as in match_operand.
  666. Operand 1 is a predicate to apply to the PARALLEL.
  667. Operand 2 is a vector of expressions, each of which must match the
  668. corresponding element in the PARALLEL. */
  669. DEF_RTL_EXPR(MATCH_PARALLEL, "match_parallel", "isE", RTX_MATCH)
  670. /* Match only something equal to what is stored in the operand table
  671. at the index specified by the argument. Use with MATCH_OPERAND. */
  672. DEF_RTL_EXPR(MATCH_DUP, "match_dup", "i", RTX_MATCH)
  673. /* Match only something equal to what is stored in the operand table
  674. at the index specified by the argument. Use with MATCH_OPERATOR. */
  675. DEF_RTL_EXPR(MATCH_OP_DUP, "match_op_dup", "iE", RTX_MATCH)
  676. /* Match only something equal to what is stored in the operand table
  677. at the index specified by the argument. Use with MATCH_PARALLEL. */
  678. DEF_RTL_EXPR(MATCH_PAR_DUP, "match_par_dup", "iE", RTX_MATCH)
  679. /* Appears only in define_predicate/define_special_predicate
  680. expressions. Evaluates true only if the operand has an RTX code
  681. from the set given by the argument (a comma-separated list). If the
  682. second argument is present and nonempty, it is a sequence of digits
  683. and/or letters which indicates the subexpression to test, using the
  684. same syntax as genextract/genrecog's location strings: 0-9 for
  685. XEXP (op, n), a-z for XVECEXP (op, 0, n); each character applies to
  686. the result of the one before it. */
  687. DEF_RTL_EXPR(MATCH_CODE, "match_code", "ss", RTX_MATCH)
  688. /* Used to inject a C conditional expression into an .md file. It can
  689. appear in a predicate definition or an attribute expression. */
  690. DEF_RTL_EXPR(MATCH_TEST, "match_test", "s", RTX_MATCH)
  691. /* Insn (and related) definitions. */
  692. /* Definition of the pattern for one kind of instruction.
  693. Operand:
  694. 0: names this instruction.
  695. If the name is the null string, the instruction is in the
  696. machine description just to be recognized, and will never be emitted by
  697. the tree to rtl expander.
  698. 1: is the pattern.
  699. 2: is a string which is a C expression
  700. giving an additional condition for recognizing this pattern.
  701. A null string means no extra condition.
  702. 3: is the action to execute if this pattern is matched.
  703. If this assembler code template starts with a * then it is a fragment of
  704. C code to run to decide on a template to use. Otherwise, it is the
  705. template to use.
  706. 4: optionally, a vector of attributes for this insn.
  707. */
  708. DEF_RTL_EXPR(DEFINE_INSN, "define_insn", "sEsTV", RTX_EXTRA)
  709. /* Definition of a peephole optimization.
  710. 1st operand: vector of insn patterns to match
  711. 2nd operand: C expression that must be true
  712. 3rd operand: template or C code to produce assembler output.
  713. 4: optionally, a vector of attributes for this insn.
  714. This form is deprecated; use define_peephole2 instead. */
  715. DEF_RTL_EXPR(DEFINE_PEEPHOLE, "define_peephole", "EsTV", RTX_EXTRA)
  716. /* Definition of a split operation.
  717. 1st operand: insn pattern to match
  718. 2nd operand: C expression that must be true
  719. 3rd operand: vector of insn patterns to place into a SEQUENCE
  720. 4th operand: optionally, some C code to execute before generating the
  721. insns. This might, for example, create some RTX's and store them in
  722. elements of `recog_data.operand' for use by the vector of
  723. insn-patterns.
  724. (`operands' is an alias here for `recog_data.operand'). */
  725. DEF_RTL_EXPR(DEFINE_SPLIT, "define_split", "EsES", RTX_EXTRA)
  726. /* Definition of an insn and associated split.
  727. This is the concatenation, with a few modifications, of a define_insn
  728. and a define_split which share the same pattern.
  729. Operand:
  730. 0: names this instruction.
  731. If the name is the null string, the instruction is in the
  732. machine description just to be recognized, and will never be emitted by
  733. the tree to rtl expander.
  734. 1: is the pattern.
  735. 2: is a string which is a C expression
  736. giving an additional condition for recognizing this pattern.
  737. A null string means no extra condition.
  738. 3: is the action to execute if this pattern is matched.
  739. If this assembler code template starts with a * then it is a fragment of
  740. C code to run to decide on a template to use. Otherwise, it is the
  741. template to use.
  742. 4: C expression that must be true for split. This may start with "&&"
  743. in which case the split condition is the logical and of the insn
  744. condition and what follows the "&&" of this operand.
  745. 5: vector of insn patterns to place into a SEQUENCE
  746. 6: optionally, some C code to execute before generating the
  747. insns. This might, for example, create some RTX's and store them in
  748. elements of `recog_data.operand' for use by the vector of
  749. insn-patterns.
  750. (`operands' is an alias here for `recog_data.operand').
  751. 7: optionally, a vector of attributes for this insn. */
  752. DEF_RTL_EXPR(DEFINE_INSN_AND_SPLIT, "define_insn_and_split", "sEsTsESV", RTX_EXTRA)
  753. /* Definition of an RTL peephole operation.
  754. Follows the same arguments as define_split. */
  755. DEF_RTL_EXPR(DEFINE_PEEPHOLE2, "define_peephole2", "EsES", RTX_EXTRA)
  756. /* Define how to generate multiple insns for a standard insn name.
  757. 1st operand: the insn name.
  758. 2nd operand: vector of insn-patterns.
  759. Use match_operand to substitute an element of `recog_data.operand'.
  760. 3rd operand: C expression that must be true for this to be available.
  761. This may not test any operands.
  762. 4th operand: Extra C code to execute before generating the insns.
  763. This might, for example, create some RTX's and store them in
  764. elements of `recog_data.operand' for use by the vector of
  765. insn-patterns.
  766. (`operands' is an alias here for `recog_data.operand').
  767. 5th: optionally, a vector of attributes for this expand. */
  768. DEF_RTL_EXPR(DEFINE_EXPAND, "define_expand", "sEssV", RTX_EXTRA)
  769. /* Define a requirement for delay slots.
  770. 1st operand: Condition involving insn attributes that, if true,
  771. indicates that the insn requires the number of delay slots
  772. shown.
  773. 2nd operand: Vector whose length is the three times the number of delay
  774. slots required.
  775. Each entry gives three conditions, each involving attributes.
  776. The first must be true for an insn to occupy that delay slot
  777. location. The second is true for all insns that can be
  778. annulled if the branch is true and the third is true for all
  779. insns that can be annulled if the branch is false.
  780. Multiple DEFINE_DELAYs may be present. They indicate differing
  781. requirements for delay slots. */
  782. DEF_RTL_EXPR(DEFINE_DELAY, "define_delay", "eE", RTX_EXTRA)
  783. /* Define attribute computation for `asm' instructions. */
  784. DEF_RTL_EXPR(DEFINE_ASM_ATTRIBUTES, "define_asm_attributes", "V", RTX_EXTRA)
  785. /* Definition of a conditional execution meta operation. Automatically
  786. generates new instances of DEFINE_INSN, selected by having attribute
  787. "predicable" true. The new pattern will contain a COND_EXEC and the
  788. predicate at top-level.
  789. Operand:
  790. 0: The predicate pattern. The top-level form should match a
  791. relational operator. Operands should have only one alternative.
  792. 1: A C expression giving an additional condition for recognizing
  793. the generated pattern.
  794. 2: A template or C code to produce assembler output.
  795. 3: A vector of attributes to append to the resulting cond_exec insn. */
  796. DEF_RTL_EXPR(DEFINE_COND_EXEC, "define_cond_exec", "EssV", RTX_EXTRA)
  797. /* Definition of an operand predicate. The difference between
  798. DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE is that genrecog will
  799. not warn about a match_operand with no mode if it has a predicate
  800. defined with DEFINE_SPECIAL_PREDICATE.
  801. Operand:
  802. 0: The name of the predicate.
  803. 1: A boolean expression which computes whether or not the predicate
  804. matches. This expression can use IOR, AND, NOT, MATCH_OPERAND,
  805. MATCH_CODE, and MATCH_TEST. It must be specific enough that genrecog
  806. can calculate the set of RTX codes that can possibly match.
  807. 2: A C function body which must return true for the predicate to match.
  808. Optional. Use this when the test is too complicated to fit into a
  809. match_test expression. */
  810. DEF_RTL_EXPR(DEFINE_PREDICATE, "define_predicate", "ses", RTX_EXTRA)
  811. DEF_RTL_EXPR(DEFINE_SPECIAL_PREDICATE, "define_special_predicate", "ses", RTX_EXTRA)
  812. /* Definition of a register operand constraint. This simply maps the
  813. constraint string to a register class.
  814. Operand:
  815. 0: The name of the constraint (often, but not always, a single letter).
  816. 1: A C expression which evaluates to the appropriate register class for
  817. this constraint. If this is not just a constant, it should look only
  818. at -m switches and the like.
  819. 2: A docstring for this constraint, in Texinfo syntax; not currently
  820. used, in future will be incorporated into the manual's list of
  821. machine-specific operand constraints. */
  822. DEF_RTL_EXPR(DEFINE_REGISTER_CONSTRAINT, "define_register_constraint", "sss", RTX_EXTRA)
  823. /* Definition of a non-register operand constraint. These look at the
  824. operand and decide whether it fits the constraint.
  825. DEFINE_CONSTRAINT gets no special treatment if it fails to match.
  826. It is appropriate for constant-only constraints, and most others.
  827. DEFINE_MEMORY_CONSTRAINT tells reload that this constraint can be made
  828. to match, if it doesn't already, by converting the operand to the form
  829. (mem (reg X)) where X is a base register. It is suitable for constraints
  830. that describe a subset of all memory references.
  831. DEFINE_ADDRESS_CONSTRAINT tells reload that this constraint can be made
  832. to match, if it doesn't already, by converting the operand to the form
  833. (reg X) where X is a base register. It is suitable for constraints that
  834. describe a subset of all address references.
  835. When in doubt, use plain DEFINE_CONSTRAINT.
  836. Operand:
  837. 0: The name of the constraint (often, but not always, a single letter).
  838. 1: A docstring for this constraint, in Texinfo syntax; not currently
  839. used, in future will be incorporated into the manual's list of
  840. machine-specific operand constraints.
  841. 2: A boolean expression which computes whether or not the constraint
  842. matches. It should follow the same rules as a define_predicate
  843. expression, including the bit about specifying the set of RTX codes
  844. that could possibly match. MATCH_TEST subexpressions may make use of
  845. these variables:
  846. `op' - the RTL object defining the operand.
  847. `mode' - the mode of `op'.
  848. `ival' - INTVAL(op), if op is a CONST_INT.
  849. `hval' - CONST_DOUBLE_HIGH(op), if op is an integer CONST_DOUBLE.
  850. `lval' - CONST_DOUBLE_LOW(op), if op is an integer CONST_DOUBLE.
  851. `rval' - CONST_DOUBLE_REAL_VALUE(op), if op is a floating-point
  852. CONST_DOUBLE.
  853. Do not use ival/hval/lval/rval if op is not the appropriate kind of
  854. RTL object. */
  855. DEF_RTL_EXPR(DEFINE_CONSTRAINT, "define_constraint", "sse", RTX_EXTRA)
  856. DEF_RTL_EXPR(DEFINE_MEMORY_CONSTRAINT, "define_memory_constraint", "sse", RTX_EXTRA)
  857. DEF_RTL_EXPR(DEFINE_SPECIAL_MEMORY_CONSTRAINT, "define_special_memory_constraint", "sse", RTX_EXTRA)
  858. DEF_RTL_EXPR(DEFINE_ADDRESS_CONSTRAINT, "define_address_constraint", "sse", RTX_EXTRA)
  859. /* Constructions for CPU pipeline description described by NDFAs. */
  860. /* (define_cpu_unit string [string]) describes cpu functional
  861. units (separated by comma).
  862. 1st operand: Names of cpu functional units.
  863. 2nd operand: Name of automaton (see comments for DEFINE_AUTOMATON).
  864. All define_reservations, define_cpu_units, and
  865. define_query_cpu_units should have unique names which may not be
  866. "nothing". */
  867. DEF_RTL_EXPR(DEFINE_CPU_UNIT, "define_cpu_unit", "sS", RTX_EXTRA)
  868. /* (define_query_cpu_unit string [string]) describes cpu functional
  869. units analogously to define_cpu_unit. The reservation of such
  870. units can be queried for automaton state. */
  871. DEF_RTL_EXPR(DEFINE_QUERY_CPU_UNIT, "define_query_cpu_unit", "sS", RTX_EXTRA)
  872. /* (exclusion_set string string) means that each CPU functional unit
  873. in the first string cannot be reserved simultaneously with any
  874. unit whose name is in the second string and vise versa. CPU units
  875. in the string are separated by commas. For example, it is useful
  876. for description CPU with fully pipelined floating point functional
  877. unit which can execute simultaneously only single floating point
  878. insns or only double floating point insns. All CPU functional
  879. units in a set should belong to the same automaton. */
  880. DEF_RTL_EXPR(EXCLUSION_SET, "exclusion_set", "ss", RTX_EXTRA)
  881. /* (presence_set string string) means that each CPU functional unit in
  882. the first string cannot be reserved unless at least one of pattern
  883. of units whose names are in the second string is reserved. This is
  884. an asymmetric relation. CPU units or unit patterns in the strings
  885. are separated by commas. Pattern is one unit name or unit names
  886. separated by white-spaces.
  887. For example, it is useful for description that slot1 is reserved
  888. after slot0 reservation for a VLIW processor. We could describe it
  889. by the following construction
  890. (presence_set "slot1" "slot0")
  891. Or slot1 is reserved only after slot0 and unit b0 reservation. In
  892. this case we could write
  893. (presence_set "slot1" "slot0 b0")
  894. All CPU functional units in a set should belong to the same
  895. automaton. */
  896. DEF_RTL_EXPR(PRESENCE_SET, "presence_set", "ss", RTX_EXTRA)
  897. /* (final_presence_set string string) is analogous to `presence_set'.
  898. The difference between them is when checking is done. When an
  899. instruction is issued in given automaton state reflecting all
  900. current and planned unit reservations, the automaton state is
  901. changed. The first state is a source state, the second one is a
  902. result state. Checking for `presence_set' is done on the source
  903. state reservation, checking for `final_presence_set' is done on the
  904. result reservation. This construction is useful to describe a
  905. reservation which is actually two subsequent reservations. For
  906. example, if we use
  907. (presence_set "slot1" "slot0")
  908. the following insn will be never issued (because slot1 requires
  909. slot0 which is absent in the source state).
  910. (define_reservation "insn_and_nop" "slot0 + slot1")
  911. but it can be issued if we use analogous `final_presence_set'. */
  912. DEF_RTL_EXPR(FINAL_PRESENCE_SET, "final_presence_set", "ss", RTX_EXTRA)
  913. /* (absence_set string string) means that each CPU functional unit in
  914. the first string can be reserved only if each pattern of units
  915. whose names are in the second string is not reserved. This is an
  916. asymmetric relation (actually exclusion set is analogous to this
  917. one but it is symmetric). CPU units or unit patterns in the string
  918. are separated by commas. Pattern is one unit name or unit names
  919. separated by white-spaces.
  920. For example, it is useful for description that slot0 cannot be
  921. reserved after slot1 or slot2 reservation for a VLIW processor. We
  922. could describe it by the following construction
  923. (absence_set "slot2" "slot0, slot1")
  924. Or slot2 cannot be reserved if slot0 and unit b0 are reserved or
  925. slot1 and unit b1 are reserved . In this case we could write
  926. (absence_set "slot2" "slot0 b0, slot1 b1")
  927. All CPU functional units in a set should to belong the same
  928. automaton. */
  929. DEF_RTL_EXPR(ABSENCE_SET, "absence_set", "ss", RTX_EXTRA)
  930. /* (final_absence_set string string) is analogous to `absence_set' but
  931. checking is done on the result (state) reservation. See comments
  932. for `final_presence_set'. */
  933. DEF_RTL_EXPR(FINAL_ABSENCE_SET, "final_absence_set", "ss", RTX_EXTRA)
  934. /* (define_bypass number out_insn_names in_insn_names) names bypass
  935. with given latency (the first number) from insns given by the first
  936. string (see define_insn_reservation) into insns given by the second
  937. string. Insn names in the strings are separated by commas. The
  938. third operand is optional name of function which is additional
  939. guard for the bypass. The function will get the two insns as
  940. parameters. If the function returns zero the bypass will be
  941. ignored for this case. Additional guard is necessary to recognize
  942. complicated bypasses, e.g. when consumer is load address. If there
  943. are more one bypass with the same output and input insns, the
  944. chosen bypass is the first bypass with a guard in description whose
  945. guard function returns nonzero. If there is no such bypass, then
  946. bypass without the guard function is chosen. */
  947. DEF_RTL_EXPR(DEFINE_BYPASS, "define_bypass", "issS", RTX_EXTRA)
  948. /* (define_automaton string) describes names of automata generated and
  949. used for pipeline hazards recognition. The names are separated by
  950. comma. Actually it is possibly to generate the single automaton
  951. but unfortunately it can be very large. If we use more one
  952. automata, the summary size of the automata usually is less than the
  953. single one. The automaton name is used in define_cpu_unit and
  954. define_query_cpu_unit. All automata should have unique names. */
  955. DEF_RTL_EXPR(DEFINE_AUTOMATON, "define_automaton", "s", RTX_EXTRA)
  956. /* (automata_option string) describes option for generation of
  957. automata. Currently there are the following options:
  958. o "no-minimization" which makes no minimization of automata. This
  959. is only worth to do when we are debugging the description and
  960. need to look more accurately at reservations of states.
  961. o "time" which means printing additional time statistics about
  962. generation of automata.
  963. o "v" which means generation of file describing the result
  964. automata. The file has suffix `.dfa' and can be used for the
  965. description verification and debugging.
  966. o "w" which means generation of warning instead of error for
  967. non-critical errors.
  968. o "ndfa" which makes nondeterministic finite state automata.
  969. o "progress" which means output of a progress bar showing how many
  970. states were generated so far for automaton being processed. */
  971. DEF_RTL_EXPR(AUTOMATA_OPTION, "automata_option", "s", RTX_EXTRA)
  972. /* (define_reservation string string) names reservation (the first
  973. string) of cpu functional units (the 2nd string). Sometimes unit
  974. reservations for different insns contain common parts. In such
  975. case, you can describe common part and use its name (the 1st
  976. parameter) in regular expression in define_insn_reservation. All
  977. define_reservations, define_cpu_units, and define_query_cpu_units
  978. should have unique names which may not be "nothing". */
  979. DEF_RTL_EXPR(DEFINE_RESERVATION, "define_reservation", "ss", RTX_EXTRA)
  980. /* (define_insn_reservation name default_latency condition regexpr)
  981. describes reservation of cpu functional units (the 3nd operand) for
  982. instruction which is selected by the condition (the 2nd parameter).
  983. The first parameter is used for output of debugging information.
  984. The reservations are described by a regular expression according
  985. the following syntax:
  986. regexp = regexp "," oneof
  987. | oneof
  988. oneof = oneof "|" allof
  989. | allof
  990. allof = allof "+" repeat
  991. | repeat
  992. repeat = element "*" number
  993. | element
  994. element = cpu_function_unit_name
  995. | reservation_name
  996. | result_name
  997. | "nothing"
  998. | "(" regexp ")"
  999. 1. "," is used for describing start of the next cycle in
  1000. reservation.
  1001. 2. "|" is used for describing the reservation described by the
  1002. first regular expression *or* the reservation described by the
  1003. second regular expression *or* etc.
  1004. 3. "+" is used for describing the reservation described by the
  1005. first regular expression *and* the reservation described by the
  1006. second regular expression *and* etc.
  1007. 4. "*" is used for convenience and simply means sequence in
  1008. which the regular expression are repeated NUMBER times with
  1009. cycle advancing (see ",").
  1010. 5. cpu functional unit name which means its reservation.
  1011. 6. reservation name -- see define_reservation.
  1012. 7. string "nothing" means no units reservation. */
  1013. DEF_RTL_EXPR(DEFINE_INSN_RESERVATION, "define_insn_reservation", "sies", RTX_EXTRA)
  1014. /* Expressions used for insn attributes. */
  1015. /* Definition of an insn attribute.
  1016. 1st operand: name of the attribute
  1017. 2nd operand: comma-separated list of possible attribute values
  1018. 3rd operand: expression for the default value of the attribute. */
  1019. DEF_RTL_EXPR(DEFINE_ATTR, "define_attr", "sse", RTX_EXTRA)
  1020. /* Definition of an insn attribute that uses an existing enumerated type.
  1021. 1st operand: name of the attribute
  1022. 2nd operand: the name of the enumerated type
  1023. 3rd operand: expression for the default value of the attribute. */
  1024. DEF_RTL_EXPR(DEFINE_ENUM_ATTR, "define_enum_attr", "sse", RTX_EXTRA)
  1025. /* Marker for the name of an attribute. */
  1026. DEF_RTL_EXPR(ATTR, "attr", "s", RTX_EXTRA)
  1027. /* For use in the last (optional) operand of DEFINE_INSN or DEFINE_PEEPHOLE and
  1028. in DEFINE_ASM_INSN to specify an attribute to assign to insns matching that
  1029. pattern.
  1030. (set_attr "name" "value") is equivalent to
  1031. (set (attr "name") (const_string "value")) */
  1032. DEF_RTL_EXPR(SET_ATTR, "set_attr", "ss", RTX_EXTRA)
  1033. /* In the last operand of DEFINE_INSN and DEFINE_PEEPHOLE, this can be used to
  1034. specify that attribute values are to be assigned according to the
  1035. alternative matched.
  1036. The following three expressions are equivalent:
  1037. (set (attr "att") (cond [(eq_attrq "alternative" "1") (const_string "a1")
  1038. (eq_attrq "alternative" "2") (const_string "a2")]
  1039. (const_string "a3")))
  1040. (set_attr_alternative "att" [(const_string "a1") (const_string "a2")
  1041. (const_string "a3")])
  1042. (set_attr "att" "a1,a2,a3")
  1043. */
  1044. DEF_RTL_EXPR(SET_ATTR_ALTERNATIVE, "set_attr_alternative", "sE", RTX_EXTRA)
  1045. /* A conditional expression true if the value of the specified attribute of
  1046. the current insn equals the specified value. The first operand is the
  1047. attribute name and the second is the comparison value. */
  1048. DEF_RTL_EXPR(EQ_ATTR, "eq_attr", "ss", RTX_EXTRA)
  1049. /* A special case of the above representing a set of alternatives. The first
  1050. operand is bitmap of the set, the second one is the default value. */
  1051. DEF_RTL_EXPR(EQ_ATTR_ALT, "eq_attr_alt", "ww", RTX_EXTRA)
  1052. /* A conditional expression which is true if the specified flag is
  1053. true for the insn being scheduled in reorg.
  1054. genattr.c defines the following flags which can be tested by
  1055. (attr_flag "foo") expressions in eligible_for_delay: forward, backward. */
  1056. DEF_RTL_EXPR (ATTR_FLAG, "attr_flag", "s", RTX_EXTRA)
  1057. /* General conditional. The first operand is a vector composed of pairs of
  1058. expressions. The first element of each pair is evaluated, in turn.
  1059. The value of the conditional is the second expression of the first pair
  1060. whose first expression evaluates nonzero. If none of the expressions is
  1061. true, the second operand will be used as the value of the conditional. */
  1062. DEF_RTL_EXPR(COND, "cond", "Ee", RTX_EXTRA)
  1063. /* Definition of a pattern substitution meta operation on a DEFINE_EXPAND
  1064. or a DEFINE_INSN. Automatically generates new instances of DEFINE_INSNs
  1065. that match the substitution pattern.
  1066. Operand:
  1067. 0: The name of the substitition template.
  1068. 1: Input template to match to see if a substitution is applicable.
  1069. 2: A C expression giving an additional condition for the generated
  1070. new define_expand or define_insn.
  1071. 3: Output tempalate to generate via substitution.
  1072. Within a DEFINE_SUBST template, the meaning of some RTL expressions is
  1073. different from their usual interpretation: a MATCH_OPERAND matches any
  1074. expression tree with matching machine mode or with VOIDmode. Likewise,
  1075. MATCH_OP_DUP and MATCH_DUP match more liberally in a DEFINE_SUBST than
  1076. in other RTL expressions. MATCH_OPERATOR matches all common operators
  1077. but also UNSPEC, UNSPEC_VOLATILE, and MATCH_OPERATORS from the input
  1078. DEFINE_EXPAND or DEFINE_INSN. */
  1079. DEF_RTL_EXPR(DEFINE_SUBST, "define_subst", "sEsE", RTX_EXTRA)
  1080. /* Substitution attribute to apply a DEFINE_SUBST to a pattern.
  1081. Operand:
  1082. 0: The name of the subst-attribute.
  1083. 1: The name of the DEFINE_SUBST to be applied for this attribute.
  1084. 2: String to substitute for the subst-attribute name in the pattern
  1085. name, for the case that the DEFINE_SUBST is not applied (i.e. the
  1086. unmodified version of the pattern).
  1087. 3: String to substitute for the subst-attribute name in the pattern
  1088. name, for the case that the DEFINE_SUBST is applied to the patten.
  1089. The use of DEFINE_SUBST and DEFINE_SUBST_ATTR is explained in the
  1090. GCC internals manual, under "RTL Templates Transformations". */
  1091. DEF_RTL_EXPR(DEFINE_SUBST_ATTR, "define_subst_attr", "ssss", RTX_EXTRA)
  1092. #endif /* GENERATOR_FILE */
  1093. /*
  1094. Local variables:
  1095. mode:c
  1096. End:
  1097. */