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