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