rtl.def 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349
  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-2015 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 "iuu" to handle the chain.
  106. Each insn expression holds an rtl instruction and its semantics
  107. during back-end processing.
  108. See macros's 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 can not 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 can not 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. /* Call a subroutine.
  255. Operand 1 is the address to call.
  256. Operand 2 is the number of arguments. */
  257. DEF_RTL_EXPR(CALL, "call", "ee", RTX_EXTRA)
  258. /* Return from a subroutine. */
  259. DEF_RTL_EXPR(RETURN, "return", "", RTX_EXTRA)
  260. /* Like RETURN, but truly represents only a function return, while
  261. RETURN may represent an insn that also performs other functions
  262. of the function epilogue. Like RETURN, this may also occur in
  263. conditional jumps. */
  264. DEF_RTL_EXPR(SIMPLE_RETURN, "simple_return", "", RTX_EXTRA)
  265. /* Special for EH return from subroutine. */
  266. DEF_RTL_EXPR(EH_RETURN, "eh_return", "", RTX_EXTRA)
  267. /* Conditional trap.
  268. Operand 1 is the condition.
  269. Operand 2 is the trap code.
  270. For an unconditional trap, make the condition (const_int 1). */
  271. DEF_RTL_EXPR(TRAP_IF, "trap_if", "ee", RTX_EXTRA)
  272. /* ----------------------------------------------------------------------
  273. Primitive values for use in expressions.
  274. ---------------------------------------------------------------------- */
  275. /* numeric integer constant */
  276. DEF_RTL_EXPR(CONST_INT, "const_int", "w", RTX_CONST_OBJ)
  277. /* numeric integer constant */
  278. DEF_RTL_EXPR(CONST_WIDE_INT, "const_wide_int", "", RTX_CONST_OBJ)
  279. /* fixed-point constant */
  280. DEF_RTL_EXPR(CONST_FIXED, "const_fixed", "www", RTX_CONST_OBJ)
  281. /* numeric floating point or integer constant. If the mode is
  282. VOIDmode it is an int otherwise it has a floating point mode and a
  283. floating point value. Operands hold the value. They are all 'w'
  284. and there may be from 2 to 6; see real.h. */
  285. DEF_RTL_EXPR(CONST_DOUBLE, "const_double", CONST_DOUBLE_FORMAT, RTX_CONST_OBJ)
  286. /* Describes a vector constant. */
  287. DEF_RTL_EXPR(CONST_VECTOR, "const_vector", "E", RTX_CONST_OBJ)
  288. /* String constant. Used for attributes in machine descriptions and
  289. for special cases in DWARF2 debug output. NOT used for source-
  290. language string constants. */
  291. DEF_RTL_EXPR(CONST_STRING, "const_string", "s", RTX_OBJ)
  292. /* This is used to encapsulate an expression whose value is constant
  293. (such as the sum of a SYMBOL_REF and a CONST_INT) so that it will be
  294. recognized as a constant operand rather than by arithmetic instructions. */
  295. DEF_RTL_EXPR(CONST, "const", "e", RTX_CONST_OBJ)
  296. /* program counter. Ordinary jumps are represented
  297. by a SET whose first operand is (PC). */
  298. DEF_RTL_EXPR(PC, "pc", "", RTX_OBJ)
  299. /* A register. The "operand" is the register number, accessed with
  300. the REGNO macro. If this number is less than FIRST_PSEUDO_REGISTER
  301. than a hardware register is being referred to. The second operand
  302. points to a reg_attrs structure.
  303. This rtx needs to have as many (or more) fields as a MEM, since we
  304. can change REG rtx's into MEMs during reload. */
  305. DEF_RTL_EXPR(REG, "reg", "i0", RTX_OBJ)
  306. /* A scratch register. This represents a register used only within a
  307. single insn. It will be replaced by a REG during register allocation
  308. or reload unless the constraint indicates that the register won't be
  309. needed, in which case it can remain a SCRATCH. */
  310. DEF_RTL_EXPR(SCRATCH, "scratch", "", RTX_OBJ)
  311. /* A reference to a part of another value. The first operand is the
  312. complete value and the second is the byte offset of the selected part. */
  313. DEF_RTL_EXPR(SUBREG, "subreg", "ei", RTX_EXTRA)
  314. /* This one-argument rtx is used for move instructions
  315. that are guaranteed to alter only the low part of a destination.
  316. Thus, (SET (SUBREG:HI (REG...)) (MEM:HI ...))
  317. has an unspecified effect on the high part of REG,
  318. but (SET (STRICT_LOW_PART (SUBREG:HI (REG...))) (MEM:HI ...))
  319. is guaranteed to alter only the bits of REG that are in HImode.
  320. The actual instruction used is probably the same in both cases,
  321. but the register constraints may be tighter when STRICT_LOW_PART
  322. is in use. */
  323. DEF_RTL_EXPR(STRICT_LOW_PART, "strict_low_part", "e", RTX_EXTRA)
  324. /* (CONCAT a b) represents the virtual concatenation of a and b
  325. to make a value that has as many bits as a and b put together.
  326. This is used for complex values. Normally it appears only
  327. in DECL_RTLs and during RTL generation, but not in the insn chain. */
  328. DEF_RTL_EXPR(CONCAT, "concat", "ee", RTX_OBJ)
  329. /* (CONCATN [a1 a2 ... an]) represents the virtual concatenation of
  330. all An to make a value. This is an extension of CONCAT to larger
  331. number of components. Like CONCAT, it should not appear in the
  332. insn chain. Every element of the CONCATN is the same size. */
  333. DEF_RTL_EXPR(CONCATN, "concatn", "E", RTX_OBJ)
  334. /* A memory location; operand is the address. The second operand is the
  335. alias set to which this MEM belongs. We use `0' instead of `w' for this
  336. field so that the field need not be specified in machine descriptions. */
  337. DEF_RTL_EXPR(MEM, "mem", "e0", RTX_OBJ)
  338. /* Reference to an assembler label in the code for this function.
  339. The operand is a CODE_LABEL found in the insn chain. */
  340. DEF_RTL_EXPR(LABEL_REF, "label_ref", "u", RTX_CONST_OBJ)
  341. /* Reference to a named label:
  342. Operand 0: label name
  343. Operand 1: tree from which this symbol is derived, or null.
  344. This is either a DECL node, or some kind of constant. */
  345. DEF_RTL_EXPR(SYMBOL_REF, "symbol_ref", "s0", RTX_CONST_OBJ)
  346. /* The condition code register is represented, in our imagination,
  347. as a register holding a value that can be compared to zero.
  348. In fact, the machine has already compared them and recorded the
  349. results; but instructions that look at the condition code
  350. pretend to be looking at the entire value and comparing it. */
  351. DEF_RTL_EXPR(CC0, "cc0", "", RTX_OBJ)
  352. /* ----------------------------------------------------------------------
  353. Expressions for operators in an rtl pattern
  354. ---------------------------------------------------------------------- */
  355. /* if_then_else. This is used in representing ordinary
  356. conditional jump instructions.
  357. Operand:
  358. 0: condition
  359. 1: then expr
  360. 2: else expr */
  361. DEF_RTL_EXPR(IF_THEN_ELSE, "if_then_else", "eee", RTX_TERNARY)
  362. /* Comparison, produces a condition code result. */
  363. DEF_RTL_EXPR(COMPARE, "compare", "ee", RTX_BIN_ARITH)
  364. /* plus */
  365. DEF_RTL_EXPR(PLUS, "plus", "ee", RTX_COMM_ARITH)
  366. /* Operand 0 minus operand 1. */
  367. DEF_RTL_EXPR(MINUS, "minus", "ee", RTX_BIN_ARITH)
  368. /* Minus operand 0. */
  369. DEF_RTL_EXPR(NEG, "neg", "e", RTX_UNARY)
  370. DEF_RTL_EXPR(MULT, "mult", "ee", RTX_COMM_ARITH)
  371. /* Multiplication with signed saturation */
  372. DEF_RTL_EXPR(SS_MULT, "ss_mult", "ee", RTX_COMM_ARITH)
  373. /* Multiplication with unsigned saturation */
  374. DEF_RTL_EXPR(US_MULT, "us_mult", "ee", RTX_COMM_ARITH)
  375. /* Operand 0 divided by operand 1. */
  376. DEF_RTL_EXPR(DIV, "div", "ee", RTX_BIN_ARITH)
  377. /* Division with signed saturation */
  378. DEF_RTL_EXPR(SS_DIV, "ss_div", "ee", RTX_BIN_ARITH)
  379. /* Division with unsigned saturation */
  380. DEF_RTL_EXPR(US_DIV, "us_div", "ee", RTX_BIN_ARITH)
  381. /* Remainder of operand 0 divided by operand 1. */
  382. DEF_RTL_EXPR(MOD, "mod", "ee", RTX_BIN_ARITH)
  383. /* Unsigned divide and remainder. */
  384. DEF_RTL_EXPR(UDIV, "udiv", "ee", RTX_BIN_ARITH)
  385. DEF_RTL_EXPR(UMOD, "umod", "ee", RTX_BIN_ARITH)
  386. /* Bitwise operations. */
  387. DEF_RTL_EXPR(AND, "and", "ee", RTX_COMM_ARITH)
  388. DEF_RTL_EXPR(IOR, "ior", "ee", RTX_COMM_ARITH)
  389. DEF_RTL_EXPR(XOR, "xor", "ee", RTX_COMM_ARITH)
  390. DEF_RTL_EXPR(NOT, "not", "e", RTX_UNARY)
  391. /* Operand:
  392. 0: value to be shifted.
  393. 1: number of bits. */
  394. DEF_RTL_EXPR(ASHIFT, "ashift", "ee", RTX_BIN_ARITH) /* shift left */
  395. DEF_RTL_EXPR(ROTATE, "rotate", "ee", RTX_BIN_ARITH) /* rotate left */
  396. DEF_RTL_EXPR(ASHIFTRT, "ashiftrt", "ee", RTX_BIN_ARITH) /* arithmetic shift right */
  397. DEF_RTL_EXPR(LSHIFTRT, "lshiftrt", "ee", RTX_BIN_ARITH) /* logical shift right */
  398. DEF_RTL_EXPR(ROTATERT, "rotatert", "ee", RTX_BIN_ARITH) /* rotate right */
  399. /* Minimum and maximum values of two operands. We need both signed and
  400. unsigned forms. (We cannot use MIN for SMIN because it conflicts
  401. with a macro of the same name.) The signed variants should be used
  402. with floating point. Further, if both operands are zeros, or if either
  403. operand is NaN, then it is unspecified which of the two operands is
  404. returned as the result. */
  405. DEF_RTL_EXPR(SMIN, "smin", "ee", RTX_COMM_ARITH)
  406. DEF_RTL_EXPR(SMAX, "smax", "ee", RTX_COMM_ARITH)
  407. DEF_RTL_EXPR(UMIN, "umin", "ee", RTX_COMM_ARITH)
  408. DEF_RTL_EXPR(UMAX, "umax", "ee", RTX_COMM_ARITH)
  409. /* These unary operations are used to represent incrementation
  410. and decrementation as they occur in memory addresses.
  411. The amount of increment or decrement are not represented
  412. because they can be understood from the machine-mode of the
  413. containing MEM. These operations exist in only two cases:
  414. 1. pushes onto the stack.
  415. 2. created automatically by the auto-inc-dec pass. */
  416. DEF_RTL_EXPR(PRE_DEC, "pre_dec", "e", RTX_AUTOINC)
  417. DEF_RTL_EXPR(PRE_INC, "pre_inc", "e", RTX_AUTOINC)
  418. DEF_RTL_EXPR(POST_DEC, "post_dec", "e", RTX_AUTOINC)
  419. DEF_RTL_EXPR(POST_INC, "post_inc", "e", RTX_AUTOINC)
  420. /* These binary operations are used to represent generic address
  421. side-effects in memory addresses, except for simple incrementation
  422. or decrementation which use the above operations. They are
  423. created automatically by the life_analysis pass in flow.c.
  424. The first operand is a REG which is used as the address.
  425. The second operand is an expression that is assigned to the
  426. register, either before (PRE_MODIFY) or after (POST_MODIFY)
  427. evaluating the address.
  428. Currently, the compiler can only handle second operands of the
  429. form (plus (reg) (reg)) and (plus (reg) (const_int)), where
  430. the first operand of the PLUS has to be the same register as
  431. the first operand of the *_MODIFY. */
  432. DEF_RTL_EXPR(PRE_MODIFY, "pre_modify", "ee", RTX_AUTOINC)
  433. DEF_RTL_EXPR(POST_MODIFY, "post_modify", "ee", RTX_AUTOINC)
  434. /* Comparison operations. The ordered comparisons exist in two
  435. flavors, signed and unsigned. */
  436. DEF_RTL_EXPR(NE, "ne", "ee", RTX_COMM_COMPARE)
  437. DEF_RTL_EXPR(EQ, "eq", "ee", RTX_COMM_COMPARE)
  438. DEF_RTL_EXPR(GE, "ge", "ee", RTX_COMPARE)
  439. DEF_RTL_EXPR(GT, "gt", "ee", RTX_COMPARE)
  440. DEF_RTL_EXPR(LE, "le", "ee", RTX_COMPARE)
  441. DEF_RTL_EXPR(LT, "lt", "ee", RTX_COMPARE)
  442. DEF_RTL_EXPR(GEU, "geu", "ee", RTX_COMPARE)
  443. DEF_RTL_EXPR(GTU, "gtu", "ee", RTX_COMPARE)
  444. DEF_RTL_EXPR(LEU, "leu", "ee", RTX_COMPARE)
  445. DEF_RTL_EXPR(LTU, "ltu", "ee", RTX_COMPARE)
  446. /* Additional floating point unordered comparison flavors. */
  447. DEF_RTL_EXPR(UNORDERED, "unordered", "ee", RTX_COMM_COMPARE)
  448. DEF_RTL_EXPR(ORDERED, "ordered", "ee", RTX_COMM_COMPARE)
  449. /* These are equivalent to unordered or ... */
  450. DEF_RTL_EXPR(UNEQ, "uneq", "ee", RTX_COMM_COMPARE)
  451. DEF_RTL_EXPR(UNGE, "unge", "ee", RTX_COMPARE)
  452. DEF_RTL_EXPR(UNGT, "ungt", "ee", RTX_COMPARE)
  453. DEF_RTL_EXPR(UNLE, "unle", "ee", RTX_COMPARE)
  454. DEF_RTL_EXPR(UNLT, "unlt", "ee", RTX_COMPARE)
  455. /* This is an ordered NE, ie !UNEQ, ie false for NaN. */
  456. DEF_RTL_EXPR(LTGT, "ltgt", "ee", RTX_COMM_COMPARE)
  457. /* Represents the result of sign-extending the sole operand.
  458. The machine modes of the operand and of the SIGN_EXTEND expression
  459. determine how much sign-extension is going on. */
  460. DEF_RTL_EXPR(SIGN_EXTEND, "sign_extend", "e", RTX_UNARY)
  461. /* Similar for zero-extension (such as unsigned short to int). */
  462. DEF_RTL_EXPR(ZERO_EXTEND, "zero_extend", "e", RTX_UNARY)
  463. /* Similar but here the operand has a wider mode. */
  464. DEF_RTL_EXPR(TRUNCATE, "truncate", "e", RTX_UNARY)
  465. /* Similar for extending floating-point values (such as SFmode to DFmode). */
  466. DEF_RTL_EXPR(FLOAT_EXTEND, "float_extend", "e", RTX_UNARY)
  467. DEF_RTL_EXPR(FLOAT_TRUNCATE, "float_truncate", "e", RTX_UNARY)
  468. /* Conversion of fixed point operand to floating point value. */
  469. DEF_RTL_EXPR(FLOAT, "float", "e", RTX_UNARY)
  470. /* With fixed-point machine mode:
  471. Conversion of floating point operand to fixed point value.
  472. Value is defined only when the operand's value is an integer.
  473. With floating-point machine mode (and operand with same mode):
  474. Operand is rounded toward zero to produce an integer value
  475. represented in floating point. */
  476. DEF_RTL_EXPR(FIX, "fix", "e", RTX_UNARY)
  477. /* Conversion of unsigned fixed point operand to floating point value. */
  478. DEF_RTL_EXPR(UNSIGNED_FLOAT, "unsigned_float", "e", RTX_UNARY)
  479. /* With fixed-point machine mode:
  480. Conversion of floating point operand to *unsigned* fixed point value.
  481. Value is defined only when the operand's value is an integer. */
  482. DEF_RTL_EXPR(UNSIGNED_FIX, "unsigned_fix", "e", RTX_UNARY)
  483. /* Conversions involving fractional fixed-point types without saturation,
  484. including:
  485. fractional to fractional (of different precision),
  486. signed integer to fractional,
  487. fractional to signed integer,
  488. floating point to fractional,
  489. fractional to floating point.
  490. NOTE: fractional can be either signed or unsigned for conversions. */
  491. DEF_RTL_EXPR(FRACT_CONVERT, "fract_convert", "e", RTX_UNARY)
  492. /* Conversions involving fractional fixed-point types and unsigned integer
  493. without saturation, including:
  494. unsigned integer to fractional,
  495. fractional to unsigned integer.
  496. NOTE: fractional can be either signed or unsigned for conversions. */
  497. DEF_RTL_EXPR(UNSIGNED_FRACT_CONVERT, "unsigned_fract_convert", "e", RTX_UNARY)
  498. /* Conversions involving fractional fixed-point types with saturation,
  499. including:
  500. fractional to fractional (of different precision),
  501. signed integer to fractional,
  502. floating point to fractional.
  503. NOTE: fractional can be either signed or unsigned for conversions. */
  504. DEF_RTL_EXPR(SAT_FRACT, "sat_fract", "e", RTX_UNARY)
  505. /* Conversions involving fractional fixed-point types and unsigned integer
  506. with saturation, including:
  507. unsigned integer to fractional.
  508. NOTE: fractional can be either signed or unsigned for conversions. */
  509. DEF_RTL_EXPR(UNSIGNED_SAT_FRACT, "unsigned_sat_fract", "e", RTX_UNARY)
  510. /* Absolute value */
  511. DEF_RTL_EXPR(ABS, "abs", "e", RTX_UNARY)
  512. /* Square root */
  513. DEF_RTL_EXPR(SQRT, "sqrt", "e", RTX_UNARY)
  514. /* Swap bytes. */
  515. DEF_RTL_EXPR(BSWAP, "bswap", "e", RTX_UNARY)
  516. /* Find first bit that is set.
  517. Value is 1 + number of trailing zeros in the arg.,
  518. or 0 if arg is 0. */
  519. DEF_RTL_EXPR(FFS, "ffs", "e", RTX_UNARY)
  520. /* Count number of leading redundant sign bits (number of leading
  521. sign bits minus one). */
  522. DEF_RTL_EXPR(CLRSB, "clrsb", "e", RTX_UNARY)
  523. /* Count leading zeros. */
  524. DEF_RTL_EXPR(CLZ, "clz", "e", RTX_UNARY)
  525. /* Count trailing zeros. */
  526. DEF_RTL_EXPR(CTZ, "ctz", "e", RTX_UNARY)
  527. /* Population count (number of 1 bits). */
  528. DEF_RTL_EXPR(POPCOUNT, "popcount", "e", RTX_UNARY)
  529. /* Population parity (number of 1 bits modulo 2). */
  530. DEF_RTL_EXPR(PARITY, "parity", "e", RTX_UNARY)
  531. /* Reference to a signed bit-field of specified size and position.
  532. Operand 0 is the memory unit (usually SImode or QImode) which
  533. contains the field's first bit. Operand 1 is the width, in bits.
  534. Operand 2 is the number of bits in the memory unit before the
  535. first bit of this field.
  536. If BITS_BIG_ENDIAN is defined, the first bit is the msb and
  537. operand 2 counts from the msb of the memory unit.
  538. Otherwise, the first bit is the lsb and operand 2 counts from
  539. the lsb of the memory unit.
  540. This kind of expression can not appear as an lvalue in RTL. */
  541. DEF_RTL_EXPR(SIGN_EXTRACT, "sign_extract", "eee", RTX_BITFIELD_OPS)
  542. /* Similar for unsigned bit-field.
  543. But note! This kind of expression _can_ appear as an lvalue. */
  544. DEF_RTL_EXPR(ZERO_EXTRACT, "zero_extract", "eee", RTX_BITFIELD_OPS)
  545. /* For RISC machines. These save memory when splitting insns. */
  546. /* HIGH are the high-order bits of a constant expression. */
  547. DEF_RTL_EXPR(HIGH, "high", "e", RTX_CONST_OBJ)
  548. /* LO_SUM is the sum of a register and the low-order bits
  549. of a constant expression. */
  550. DEF_RTL_EXPR(LO_SUM, "lo_sum", "ee", RTX_OBJ)
  551. /* Describes a merge operation between two vector values.
  552. Operands 0 and 1 are the vectors to be merged, operand 2 is a bitmask
  553. that specifies where the parts of the result are taken from. Set bits
  554. indicate operand 0, clear bits indicate operand 1. The parts are defined
  555. by the mode of the vectors. */
  556. DEF_RTL_EXPR(VEC_MERGE, "vec_merge", "eee", RTX_TERNARY)
  557. /* Describes an operation that selects parts of a vector.
  558. Operands 0 is the source vector, operand 1 is a PARALLEL that contains
  559. a CONST_INT for each of the subparts of the result vector, giving the
  560. number of the source subpart that should be stored into it. */
  561. DEF_RTL_EXPR(VEC_SELECT, "vec_select", "ee", RTX_BIN_ARITH)
  562. /* Describes a vector concat operation. Operands 0 and 1 are the source
  563. vectors, the result is a vector that is as long as operands 0 and 1
  564. combined and is the concatenation of the two source vectors. */
  565. DEF_RTL_EXPR(VEC_CONCAT, "vec_concat", "ee", RTX_BIN_ARITH)
  566. /* Describes an operation that converts a small vector into a larger one by
  567. duplicating the input values. The output vector mode must have the same
  568. submodes as the input vector mode, and the number of output parts must be
  569. an integer multiple of the number of input parts. */
  570. DEF_RTL_EXPR(VEC_DUPLICATE, "vec_duplicate", "e", RTX_UNARY)
  571. /* Addition with signed saturation */
  572. DEF_RTL_EXPR(SS_PLUS, "ss_plus", "ee", RTX_COMM_ARITH)
  573. /* Addition with unsigned saturation */
  574. DEF_RTL_EXPR(US_PLUS, "us_plus", "ee", RTX_COMM_ARITH)
  575. /* Operand 0 minus operand 1, with signed saturation. */
  576. DEF_RTL_EXPR(SS_MINUS, "ss_minus", "ee", RTX_BIN_ARITH)
  577. /* Negation with signed saturation. */
  578. DEF_RTL_EXPR(SS_NEG, "ss_neg", "e", RTX_UNARY)
  579. /* Negation with unsigned saturation. */
  580. DEF_RTL_EXPR(US_NEG, "us_neg", "e", RTX_UNARY)
  581. /* Absolute value with signed saturation. */
  582. DEF_RTL_EXPR(SS_ABS, "ss_abs", "e", RTX_UNARY)
  583. /* Shift left with signed saturation. */
  584. DEF_RTL_EXPR(SS_ASHIFT, "ss_ashift", "ee", RTX_BIN_ARITH)
  585. /* Shift left with unsigned saturation. */
  586. DEF_RTL_EXPR(US_ASHIFT, "us_ashift", "ee", RTX_BIN_ARITH)
  587. /* Operand 0 minus operand 1, with unsigned saturation. */
  588. DEF_RTL_EXPR(US_MINUS, "us_minus", "ee", RTX_BIN_ARITH)
  589. /* Signed saturating truncate. */
  590. DEF_RTL_EXPR(SS_TRUNCATE, "ss_truncate", "e", RTX_UNARY)
  591. /* Unsigned saturating truncate. */
  592. DEF_RTL_EXPR(US_TRUNCATE, "us_truncate", "e", RTX_UNARY)
  593. /* Floating point multiply/add combined instruction. */
  594. DEF_RTL_EXPR(FMA, "fma", "eee", RTX_TERNARY)
  595. /* Information about the variable and its location. */
  596. DEF_RTL_EXPR(VAR_LOCATION, "var_location", "te", RTX_EXTRA)
  597. /* Used in VAR_LOCATION for a pointer to a decl that is no longer
  598. addressable. */
  599. DEF_RTL_EXPR(DEBUG_IMPLICIT_PTR, "debug_implicit_ptr", "t", RTX_OBJ)
  600. /* Represents value that argument had on function entry. The
  601. single argument is the DECL_INCOMING_RTL of the corresponding
  602. parameter. */
  603. DEF_RTL_EXPR(ENTRY_VALUE, "entry_value", "0", RTX_OBJ)
  604. /* Used in VAR_LOCATION for a reference to a parameter that has
  605. been optimized away completely. */
  606. DEF_RTL_EXPR(DEBUG_PARAMETER_REF, "debug_parameter_ref", "t", RTX_OBJ)
  607. /* All expressions from this point forward appear only in machine
  608. descriptions. */
  609. #ifdef GENERATOR_FILE
  610. /* Pattern-matching operators: */
  611. /* Use the function named by the second arg (the string)
  612. as a predicate; if matched, store the structure that was matched
  613. in the operand table at index specified by the first arg (the integer).
  614. If the second arg is the null string, the structure is just stored.
  615. A third string argument indicates to the register allocator restrictions
  616. on where the operand can be allocated.
  617. If the target needs no restriction on any instruction this field should
  618. be the null string.
  619. The string is prepended by:
  620. '=' to indicate the operand is only written to.
  621. '+' to indicate the operand is both read and written to.
  622. Each character in the string represents an allocable class for an operand.
  623. 'g' indicates the operand can be any valid class.
  624. 'i' indicates the operand can be immediate (in the instruction) data.
  625. 'r' indicates the operand can be in a register.
  626. 'm' indicates the operand can be in memory.
  627. 'o' a subset of the 'm' class. Those memory addressing modes that
  628. can be offset at compile time (have a constant added to them).
  629. Other characters indicate target dependent operand classes and
  630. are described in each target's machine description.
  631. For instructions with more than one operand, sets of classes can be
  632. separated by a comma to indicate the appropriate multi-operand constraints.
  633. There must be a 1 to 1 correspondence between these sets of classes in
  634. all operands for an instruction.
  635. */
  636. DEF_RTL_EXPR(MATCH_OPERAND, "match_operand", "iss", RTX_MATCH)
  637. /* Match a SCRATCH or a register. When used to generate rtl, a
  638. SCRATCH is generated. As for MATCH_OPERAND, the mode specifies
  639. the desired mode and the first argument is the operand number.
  640. The second argument is the constraint. */
  641. DEF_RTL_EXPR(MATCH_SCRATCH, "match_scratch", "is", RTX_MATCH)
  642. /* Apply a predicate, AND match recursively the operands of the rtx.
  643. Operand 0 is the operand-number, as in match_operand.
  644. Operand 1 is a predicate to apply (as a string, a function name).
  645. Operand 2 is a vector of expressions, each of which must match
  646. one subexpression of the rtx this construct is matching. */
  647. DEF_RTL_EXPR(MATCH_OPERATOR, "match_operator", "isE", RTX_MATCH)
  648. /* Match a PARALLEL of arbitrary length. The predicate is applied
  649. to the PARALLEL and the initial expressions in the PARALLEL are matched.
  650. Operand 0 is the operand-number, as in match_operand.
  651. Operand 1 is a predicate to apply to the PARALLEL.
  652. Operand 2 is a vector of expressions, each of which must match the
  653. corresponding element in the PARALLEL. */
  654. DEF_RTL_EXPR(MATCH_PARALLEL, "match_parallel", "isE", RTX_MATCH)
  655. /* Match only something equal to what is stored in the operand table
  656. at the index specified by the argument. Use with MATCH_OPERAND. */
  657. DEF_RTL_EXPR(MATCH_DUP, "match_dup", "i", RTX_MATCH)
  658. /* Match only something equal to what is stored in the operand table
  659. at the index specified by the argument. Use with MATCH_OPERATOR. */
  660. DEF_RTL_EXPR(MATCH_OP_DUP, "match_op_dup", "iE", RTX_MATCH)
  661. /* Match only something equal to what is stored in the operand table
  662. at the index specified by the argument. Use with MATCH_PARALLEL. */
  663. DEF_RTL_EXPR(MATCH_PAR_DUP, "match_par_dup", "iE", RTX_MATCH)
  664. /* Appears only in define_predicate/define_special_predicate
  665. expressions. Evaluates true only if the operand has an RTX code
  666. from the set given by the argument (a comma-separated list). If the
  667. second argument is present and nonempty, it is a sequence of digits
  668. and/or letters which indicates the subexpression to test, using the
  669. same syntax as genextract/genrecog's location strings: 0-9 for
  670. XEXP (op, n), a-z for XVECEXP (op, 0, n); each character applies to
  671. the result of the one before it. */
  672. DEF_RTL_EXPR(MATCH_CODE, "match_code", "ss", RTX_MATCH)
  673. /* Used to inject a C conditional expression into an .md file. It can
  674. appear in a predicate definition or an attribute expression. */
  675. DEF_RTL_EXPR(MATCH_TEST, "match_test", "s", RTX_MATCH)
  676. /* Insn (and related) definitions. */
  677. /* Definition of the pattern for one kind of instruction.
  678. Operand:
  679. 0: names this instruction.
  680. If the name is the null string, the instruction is in the
  681. machine description just to be recognized, and will never be emitted by
  682. the tree to rtl expander.
  683. 1: is the pattern.
  684. 2: is a string which is a C expression
  685. giving an additional condition for recognizing this pattern.
  686. A null string means no extra condition.
  687. 3: is the action to execute if this pattern is matched.
  688. If this assembler code template starts with a * then it is a fragment of
  689. C code to run to decide on a template to use. Otherwise, it is the
  690. template to use.
  691. 4: optionally, a vector of attributes for this insn.
  692. */
  693. DEF_RTL_EXPR(DEFINE_INSN, "define_insn", "sEsTV", RTX_EXTRA)
  694. /* Definition of a peephole optimization.
  695. 1st operand: vector of insn patterns to match
  696. 2nd operand: C expression that must be true
  697. 3rd operand: template or C code to produce assembler output.
  698. 4: optionally, a vector of attributes for this insn.
  699. This form is deprecated; use define_peephole2 instead. */
  700. DEF_RTL_EXPR(DEFINE_PEEPHOLE, "define_peephole", "EsTV", RTX_EXTRA)
  701. /* Definition of a split operation.
  702. 1st operand: insn pattern to match
  703. 2nd operand: C expression that must be true
  704. 3rd operand: vector of insn patterns to place into a SEQUENCE
  705. 4th operand: optionally, some C code to execute before generating the
  706. insns. This might, for example, create some RTX's and store them in
  707. elements of `recog_data.operand' for use by the vector of
  708. insn-patterns.
  709. (`operands' is an alias here for `recog_data.operand'). */
  710. DEF_RTL_EXPR(DEFINE_SPLIT, "define_split", "EsES", RTX_EXTRA)
  711. /* Definition of an insn and associated split.
  712. This is the concatenation, with a few modifications, of a define_insn
  713. and a define_split which share the same pattern.
  714. Operand:
  715. 0: names this instruction.
  716. If the name is the null string, the instruction is in the
  717. machine description just to be recognized, and will never be emitted by
  718. the tree to rtl expander.
  719. 1: is the pattern.
  720. 2: is a string which is a C expression
  721. giving an additional condition for recognizing this pattern.
  722. A null string means no extra condition.
  723. 3: is the action to execute if this pattern is matched.
  724. If this assembler code template starts with a * then it is a fragment of
  725. C code to run to decide on a template to use. Otherwise, it is the
  726. template to use.
  727. 4: C expression that must be true for split. This may start with "&&"
  728. in which case the split condition is the logical and of the insn
  729. condition and what follows the "&&" of this operand.
  730. 5: vector of insn patterns to place into a SEQUENCE
  731. 6: optionally, some C code to execute before generating the
  732. insns. This might, for example, create some RTX's and store them in
  733. elements of `recog_data.operand' for use by the vector of
  734. insn-patterns.
  735. (`operands' is an alias here for `recog_data.operand').
  736. 7: optionally, a vector of attributes for this insn. */
  737. DEF_RTL_EXPR(DEFINE_INSN_AND_SPLIT, "define_insn_and_split", "sEsTsESV", RTX_EXTRA)
  738. /* Definition of an RTL peephole operation.
  739. Follows the same arguments as define_split. */
  740. DEF_RTL_EXPR(DEFINE_PEEPHOLE2, "define_peephole2", "EsES", RTX_EXTRA)
  741. /* Define how to generate multiple insns for a standard insn name.
  742. 1st operand: the insn name.
  743. 2nd operand: vector of insn-patterns.
  744. Use match_operand to substitute an element of `recog_data.operand'.
  745. 3rd operand: C expression that must be true for this to be available.
  746. This may not test any operands.
  747. 4th operand: Extra C code to execute before generating the insns.
  748. This might, for example, create some RTX's and store them in
  749. elements of `recog_data.operand' for use by the vector of
  750. insn-patterns.
  751. (`operands' is an alias here for `recog_data.operand').
  752. 5th: optionally, a vector of attributes for this expand. */
  753. DEF_RTL_EXPR(DEFINE_EXPAND, "define_expand", "sEssV", RTX_EXTRA)
  754. /* Define a requirement for delay slots.
  755. 1st operand: Condition involving insn attributes that, if true,
  756. indicates that the insn requires the number of delay slots
  757. shown.
  758. 2nd operand: Vector whose length is the three times the number of delay
  759. slots required.
  760. Each entry gives three conditions, each involving attributes.
  761. The first must be true for an insn to occupy that delay slot
  762. location. The second is true for all insns that can be
  763. annulled if the branch is true and the third is true for all
  764. insns that can be annulled if the branch is false.
  765. Multiple DEFINE_DELAYs may be present. They indicate differing
  766. requirements for delay slots. */
  767. DEF_RTL_EXPR(DEFINE_DELAY, "define_delay", "eE", RTX_EXTRA)
  768. /* Define attribute computation for `asm' instructions. */
  769. DEF_RTL_EXPR(DEFINE_ASM_ATTRIBUTES, "define_asm_attributes", "V", RTX_EXTRA)
  770. /* Definition of a conditional execution meta operation. Automatically
  771. generates new instances of DEFINE_INSN, selected by having attribute
  772. "predicable" true. The new pattern will contain a COND_EXEC and the
  773. predicate at top-level.
  774. Operand:
  775. 0: The predicate pattern. The top-level form should match a
  776. relational operator. Operands should have only one alternative.
  777. 1: A C expression giving an additional condition for recognizing
  778. the generated pattern.
  779. 2: A template or C code to produce assembler output.
  780. 3: A vector of attributes to append to the resulting cond_exec insn. */
  781. DEF_RTL_EXPR(DEFINE_COND_EXEC, "define_cond_exec", "EssV", RTX_EXTRA)
  782. /* Definition of an operand predicate. The difference between
  783. DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE is that genrecog will
  784. not warn about a match_operand with no mode if it has a predicate
  785. defined with DEFINE_SPECIAL_PREDICATE.
  786. Operand:
  787. 0: The name of the predicate.
  788. 1: A boolean expression which computes whether or not the predicate
  789. matches. This expression can use IOR, AND, NOT, MATCH_OPERAND,
  790. MATCH_CODE, and MATCH_TEST. It must be specific enough that genrecog
  791. can calculate the set of RTX codes that can possibly match.
  792. 2: A C function body which must return true for the predicate to match.
  793. Optional. Use this when the test is too complicated to fit into a
  794. match_test expression. */
  795. DEF_RTL_EXPR(DEFINE_PREDICATE, "define_predicate", "ses", RTX_EXTRA)
  796. DEF_RTL_EXPR(DEFINE_SPECIAL_PREDICATE, "define_special_predicate", "ses", RTX_EXTRA)
  797. /* Definition of a register operand constraint. This simply maps the
  798. constraint string to a register class.
  799. Operand:
  800. 0: The name of the constraint (often, but not always, a single letter).
  801. 1: A C expression which evaluates to the appropriate register class for
  802. this constraint. If this is not just a constant, it should look only
  803. at -m switches and the like.
  804. 2: A docstring for this constraint, in Texinfo syntax; not currently
  805. used, in future will be incorporated into the manual's list of
  806. machine-specific operand constraints. */
  807. DEF_RTL_EXPR(DEFINE_REGISTER_CONSTRAINT, "define_register_constraint", "sss", RTX_EXTRA)
  808. /* Definition of a non-register operand constraint. These look at the
  809. operand and decide whether it fits the constraint.
  810. DEFINE_CONSTRAINT gets no special treatment if it fails to match.
  811. It is appropriate for constant-only constraints, and most others.
  812. DEFINE_MEMORY_CONSTRAINT tells reload that this constraint can be made
  813. to match, if it doesn't already, by converting the operand to the form
  814. (mem (reg X)) where X is a base register. It is suitable for constraints
  815. that describe a subset of all memory references.
  816. DEFINE_ADDRESS_CONSTRAINT tells reload that this constraint can be made
  817. to match, if it doesn't already, by converting the operand to the form
  818. (reg X) where X is a base register. It is suitable for constraints that
  819. describe a subset of all address references.
  820. When in doubt, use plain DEFINE_CONSTRAINT.
  821. Operand:
  822. 0: The name of the constraint (often, but not always, a single letter).
  823. 1: A docstring for this constraint, in Texinfo syntax; not currently
  824. used, in future will be incorporated into the manual's list of
  825. machine-specific operand constraints.
  826. 2: A boolean expression which computes whether or not the constraint
  827. matches. It should follow the same rules as a define_predicate
  828. expression, including the bit about specifying the set of RTX codes
  829. that could possibly match. MATCH_TEST subexpressions may make use of
  830. these variables:
  831. `op' - the RTL object defining the operand.
  832. `mode' - the mode of `op'.
  833. `ival' - INTVAL(op), if op is a CONST_INT.
  834. `hval' - CONST_DOUBLE_HIGH(op), if op is an integer CONST_DOUBLE.
  835. `lval' - CONST_DOUBLE_LOW(op), if op is an integer CONST_DOUBLE.
  836. `rval' - CONST_DOUBLE_REAL_VALUE(op), if op is a floating-point
  837. CONST_DOUBLE.
  838. Do not use ival/hval/lval/rval if op is not the appropriate kind of
  839. RTL object. */
  840. DEF_RTL_EXPR(DEFINE_CONSTRAINT, "define_constraint", "sse", RTX_EXTRA)
  841. DEF_RTL_EXPR(DEFINE_MEMORY_CONSTRAINT, "define_memory_constraint", "sse", RTX_EXTRA)
  842. DEF_RTL_EXPR(DEFINE_ADDRESS_CONSTRAINT, "define_address_constraint", "sse", RTX_EXTRA)
  843. /* Constructions for CPU pipeline description described by NDFAs. */
  844. /* (define_cpu_unit string [string]) describes cpu functional
  845. units (separated by comma).
  846. 1st operand: Names of cpu functional units.
  847. 2nd operand: Name of automaton (see comments for DEFINE_AUTOMATON).
  848. All define_reservations, define_cpu_units, and
  849. define_query_cpu_units should have unique names which may not be
  850. "nothing". */
  851. DEF_RTL_EXPR(DEFINE_CPU_UNIT, "define_cpu_unit", "sS", RTX_EXTRA)
  852. /* (define_query_cpu_unit string [string]) describes cpu functional
  853. units analogously to define_cpu_unit. The reservation of such
  854. units can be queried for automaton state. */
  855. DEF_RTL_EXPR(DEFINE_QUERY_CPU_UNIT, "define_query_cpu_unit", "sS", RTX_EXTRA)
  856. /* (exclusion_set string string) means that each CPU functional unit
  857. in the first string can not be reserved simultaneously with any
  858. unit whose name is in the second string and vise versa. CPU units
  859. in the string are separated by commas. For example, it is useful
  860. for description CPU with fully pipelined floating point functional
  861. unit which can execute simultaneously only single floating point
  862. insns or only double floating point insns. All CPU functional
  863. units in a set should belong to the same automaton. */
  864. DEF_RTL_EXPR(EXCLUSION_SET, "exclusion_set", "ss", RTX_EXTRA)
  865. /* (presence_set string string) means that each CPU functional unit in
  866. the first string can not be reserved unless at least one of pattern
  867. of units whose names are in the second string is reserved. This is
  868. an asymmetric relation. CPU units or unit patterns in the strings
  869. are separated by commas. Pattern is one unit name or unit names
  870. separated by white-spaces.
  871. For example, it is useful for description that slot1 is reserved
  872. after slot0 reservation for a VLIW processor. We could describe it
  873. by the following construction
  874. (presence_set "slot1" "slot0")
  875. Or slot1 is reserved only after slot0 and unit b0 reservation. In
  876. this case we could write
  877. (presence_set "slot1" "slot0 b0")
  878. All CPU functional units in a set should belong to the same
  879. automaton. */
  880. DEF_RTL_EXPR(PRESENCE_SET, "presence_set", "ss", RTX_EXTRA)
  881. /* (final_presence_set string string) is analogous to `presence_set'.
  882. The difference between them is when checking is done. When an
  883. instruction is issued in given automaton state reflecting all
  884. current and planned unit reservations, the automaton state is
  885. changed. The first state is a source state, the second one is a
  886. result state. Checking for `presence_set' is done on the source
  887. state reservation, checking for `final_presence_set' is done on the
  888. result reservation. This construction is useful to describe a
  889. reservation which is actually two subsequent reservations. For
  890. example, if we use
  891. (presence_set "slot1" "slot0")
  892. the following insn will be never issued (because slot1 requires
  893. slot0 which is absent in the source state).
  894. (define_reservation "insn_and_nop" "slot0 + slot1")
  895. but it can be issued if we use analogous `final_presence_set'. */
  896. DEF_RTL_EXPR(FINAL_PRESENCE_SET, "final_presence_set", "ss", RTX_EXTRA)
  897. /* (absence_set string string) means that each CPU functional unit in
  898. the first string can be reserved only if each pattern of units
  899. whose names are in the second string is not reserved. This is an
  900. asymmetric relation (actually exclusion set is analogous to this
  901. one but it is symmetric). CPU units or unit patterns in the string
  902. are separated by commas. Pattern is one unit name or unit names
  903. separated by white-spaces.
  904. For example, it is useful for description that slot0 can not be
  905. reserved after slot1 or slot2 reservation for a VLIW processor. We
  906. could describe it by the following construction
  907. (absence_set "slot2" "slot0, slot1")
  908. Or slot2 can not be reserved if slot0 and unit b0 are reserved or
  909. slot1 and unit b1 are reserved . In this case we could write
  910. (absence_set "slot2" "slot0 b0, slot1 b1")
  911. All CPU functional units in a set should to belong the same
  912. automaton. */
  913. DEF_RTL_EXPR(ABSENCE_SET, "absence_set", "ss", RTX_EXTRA)
  914. /* (final_absence_set string string) is analogous to `absence_set' but
  915. checking is done on the result (state) reservation. See comments
  916. for `final_presence_set'. */
  917. DEF_RTL_EXPR(FINAL_ABSENCE_SET, "final_absence_set", "ss", RTX_EXTRA)
  918. /* (define_bypass number out_insn_names in_insn_names) names bypass
  919. with given latency (the first number) from insns given by the first
  920. string (see define_insn_reservation) into insns given by the second
  921. string. Insn names in the strings are separated by commas. The
  922. third operand is optional name of function which is additional
  923. guard for the bypass. The function will get the two insns as
  924. parameters. If the function returns zero the bypass will be
  925. ignored for this case. Additional guard is necessary to recognize
  926. complicated bypasses, e.g. when consumer is load address. If there
  927. are more one bypass with the same output and input insns, the
  928. chosen bypass is the first bypass with a guard in description whose
  929. guard function returns nonzero. If there is no such bypass, then
  930. bypass without the guard function is chosen. */
  931. DEF_RTL_EXPR(DEFINE_BYPASS, "define_bypass", "issS", RTX_EXTRA)
  932. /* (define_automaton string) describes names of automata generated and
  933. used for pipeline hazards recognition. The names are separated by
  934. comma. Actually it is possibly to generate the single automaton
  935. but unfortunately it can be very large. If we use more one
  936. automata, the summary size of the automata usually is less than the
  937. single one. The automaton name is used in define_cpu_unit and
  938. define_query_cpu_unit. All automata should have unique names. */
  939. DEF_RTL_EXPR(DEFINE_AUTOMATON, "define_automaton", "s", RTX_EXTRA)
  940. /* (automata_option string) describes option for generation of
  941. automata. Currently there are the following options:
  942. o "no-minimization" which makes no minimization of automata. This
  943. is only worth to do when we are debugging the description and
  944. need to look more accurately at reservations of states.
  945. o "time" which means printing additional time statistics about
  946. generation of automata.
  947. o "v" which means generation of file describing the result
  948. automata. The file has suffix `.dfa' and can be used for the
  949. description verification and debugging.
  950. o "w" which means generation of warning instead of error for
  951. non-critical errors.
  952. o "ndfa" which makes nondeterministic finite state automata.
  953. o "progress" which means output of a progress bar showing how many
  954. states were generated so far for automaton being processed. */
  955. DEF_RTL_EXPR(AUTOMATA_OPTION, "automata_option", "s", RTX_EXTRA)
  956. /* (define_reservation string string) names reservation (the first
  957. string) of cpu functional units (the 2nd string). Sometimes unit
  958. reservations for different insns contain common parts. In such
  959. case, you can describe common part and use its name (the 1st
  960. parameter) in regular expression in define_insn_reservation. All
  961. define_reservations, define_cpu_units, and define_query_cpu_units
  962. should have unique names which may not be "nothing". */
  963. DEF_RTL_EXPR(DEFINE_RESERVATION, "define_reservation", "ss", RTX_EXTRA)
  964. /* (define_insn_reservation name default_latency condition regexpr)
  965. describes reservation of cpu functional units (the 3nd operand) for
  966. instruction which is selected by the condition (the 2nd parameter).
  967. The first parameter is used for output of debugging information.
  968. The reservations are described by a regular expression according
  969. the following syntax:
  970. regexp = regexp "," oneof
  971. | oneof
  972. oneof = oneof "|" allof
  973. | allof
  974. allof = allof "+" repeat
  975. | repeat
  976. repeat = element "*" number
  977. | element
  978. element = cpu_function_unit_name
  979. | reservation_name
  980. | result_name
  981. | "nothing"
  982. | "(" regexp ")"
  983. 1. "," is used for describing start of the next cycle in
  984. reservation.
  985. 2. "|" is used for describing the reservation described by the
  986. first regular expression *or* the reservation described by the
  987. second regular expression *or* etc.
  988. 3. "+" is used for describing the reservation described by the
  989. first regular expression *and* the reservation described by the
  990. second regular expression *and* etc.
  991. 4. "*" is used for convenience and simply means sequence in
  992. which the regular expression are repeated NUMBER times with
  993. cycle advancing (see ",").
  994. 5. cpu functional unit name which means its reservation.
  995. 6. reservation name -- see define_reservation.
  996. 7. string "nothing" means no units reservation. */
  997. DEF_RTL_EXPR(DEFINE_INSN_RESERVATION, "define_insn_reservation", "sies", RTX_EXTRA)
  998. /* Expressions used for insn attributes. */
  999. /* Definition of an insn attribute.
  1000. 1st operand: name of the attribute
  1001. 2nd operand: comma-separated list of possible attribute values
  1002. 3rd operand: expression for the default value of the attribute. */
  1003. DEF_RTL_EXPR(DEFINE_ATTR, "define_attr", "sse", RTX_EXTRA)
  1004. /* Definition of an insn attribute that uses an existing enumerated type.
  1005. 1st operand: name of the attribute
  1006. 2nd operand: the name of the enumerated type
  1007. 3rd operand: expression for the default value of the attribute. */
  1008. DEF_RTL_EXPR(DEFINE_ENUM_ATTR, "define_enum_attr", "sse", RTX_EXTRA)
  1009. /* Marker for the name of an attribute. */
  1010. DEF_RTL_EXPR(ATTR, "attr", "s", RTX_EXTRA)
  1011. /* For use in the last (optional) operand of DEFINE_INSN or DEFINE_PEEPHOLE and
  1012. in DEFINE_ASM_INSN to specify an attribute to assign to insns matching that
  1013. pattern.
  1014. (set_attr "name" "value") is equivalent to
  1015. (set (attr "name") (const_string "value")) */
  1016. DEF_RTL_EXPR(SET_ATTR, "set_attr", "ss", RTX_EXTRA)
  1017. /* In the last operand of DEFINE_INSN and DEFINE_PEEPHOLE, this can be used to
  1018. specify that attribute values are to be assigned according to the
  1019. alternative matched.
  1020. The following three expressions are equivalent:
  1021. (set (attr "att") (cond [(eq_attrq "alternative" "1") (const_string "a1")
  1022. (eq_attrq "alternative" "2") (const_string "a2")]
  1023. (const_string "a3")))
  1024. (set_attr_alternative "att" [(const_string "a1") (const_string "a2")
  1025. (const_string "a3")])
  1026. (set_attr "att" "a1,a2,a3")
  1027. */
  1028. DEF_RTL_EXPR(SET_ATTR_ALTERNATIVE, "set_attr_alternative", "sE", RTX_EXTRA)
  1029. /* A conditional expression true if the value of the specified attribute of
  1030. the current insn equals the specified value. The first operand is the
  1031. attribute name and the second is the comparison value. */
  1032. DEF_RTL_EXPR(EQ_ATTR, "eq_attr", "ss", RTX_EXTRA)
  1033. /* A special case of the above representing a set of alternatives. The first
  1034. operand is bitmap of the set, the second one is the default value. */
  1035. DEF_RTL_EXPR(EQ_ATTR_ALT, "eq_attr_alt", "ii", RTX_EXTRA)
  1036. /* A conditional expression which is true if the specified flag is
  1037. true for the insn being scheduled in reorg.
  1038. genattr.c defines the following flags which can be tested by
  1039. (attr_flag "foo") expressions in eligible_for_delay: forward, backward. */
  1040. DEF_RTL_EXPR (ATTR_FLAG, "attr_flag", "s", RTX_EXTRA)
  1041. /* General conditional. The first operand is a vector composed of pairs of
  1042. expressions. The first element of each pair is evaluated, in turn.
  1043. The value of the conditional is the second expression of the first pair
  1044. whose first expression evaluates nonzero. If none of the expressions is
  1045. true, the second operand will be used as the value of the conditional. */
  1046. DEF_RTL_EXPR(COND, "cond", "Ee", RTX_EXTRA)
  1047. /* Definition of a pattern substitution meta operation on a DEFINE_EXPAND
  1048. or a DEFINE_INSN. Automatically generates new instances of DEFINE_INSNs
  1049. that match the substitution pattern.
  1050. Operand:
  1051. 0: The name of the substitition template.
  1052. 1: Input template to match to see if a substitution is applicable.
  1053. 2: A C expression giving an additional condition for the generated
  1054. new define_expand or define_insn.
  1055. 3: Output tempalate to generate via substitution.
  1056. Within a DEFINE_SUBST template, the meaning of some RTL expressions is
  1057. different from their usual interpretation: a MATCH_OPERAND matches any
  1058. expression tree with matching machine mode or with VOIDmode. Likewise,
  1059. MATCH_OP_DUP and MATCH_DUP match more liberally in a DEFINE_SUBST than
  1060. in other RTL expressions. MATCH_OPERATOR matches all common operators
  1061. but also UNSPEC, UNSPEC_VOLATILE, and MATCH_OPERATORS from the input
  1062. DEFINE_EXPAND or DEFINE_INSN. */
  1063. DEF_RTL_EXPR(DEFINE_SUBST, "define_subst", "sEsE", RTX_EXTRA)
  1064. /* Substitution attribute to apply a DEFINE_SUBST to a pattern.
  1065. Operand:
  1066. 0: The name of the subst-attribute.
  1067. 1: The name of the DEFINE_SUBST to be applied for this attribute.
  1068. 2: String to substitute for the subst-attribute name in the pattern
  1069. name, for the case that the DEFINE_SUBST is not applied (i.e. the
  1070. unmodified version of the pattern).
  1071. 3: String to substitute for the subst-attribute name in the pattern
  1072. name, for the case that the DEFINE_SUBST is applied to the patten.
  1073. The use of DEFINE_SUBST and DEFINE_SUBST_ATTR is explained in the
  1074. GCC internals manual, under "RTL Templates Transformations". */
  1075. DEF_RTL_EXPR(DEFINE_SUBST_ATTR, "define_subst_attr", "ssss", RTX_EXTRA)
  1076. #endif /* GENERATOR_FILE */
  1077. /*
  1078. Local variables:
  1079. mode:c
  1080. End:
  1081. */