gccint: RTL Classes
1
1 14.2 RTL Classes and Formats
1 ============================
1
1 The various expression codes are divided into several "classes", which
1 are represented by single characters. You can determine the class of an
1 RTX code with the macro 'GET_RTX_CLASS (CODE)'. Currently, 'rtl.def'
1 defines these classes:
1
1 'RTX_OBJ'
1 An RTX code that represents an actual object, such as a register
1 ('REG') or a memory location ('MEM', 'SYMBOL_REF'). 'LO_SUM') is
1 also included; instead, 'SUBREG' and 'STRICT_LOW_PART' are not in
1 this class, but in class 'x'.
1
1 'RTX_CONST_OBJ'
1 An RTX code that represents a constant object. 'HIGH' is also
1 included in this class.
1
1 'RTX_COMPARE'
1 An RTX code for a non-symmetric comparison, such as 'GEU' or 'LT'.
1
1 'RTX_COMM_COMPARE'
1 An RTX code for a symmetric (commutative) comparison, such as 'EQ'
1 or 'ORDERED'.
1
1 'RTX_UNARY'
1 An RTX code for a unary arithmetic operation, such as 'NEG', 'NOT',
1 or 'ABS'. This category also includes value extension (sign or
1 zero) and conversions between integer and floating point.
1
1 'RTX_COMM_ARITH'
1 An RTX code for a commutative binary operation, such as 'PLUS' or
1 'AND'. 'NE' and 'EQ' are comparisons, so they have class '<'.
1
1 'RTX_BIN_ARITH'
1 An RTX code for a non-commutative binary operation, such as
1 'MINUS', 'DIV', or 'ASHIFTRT'.
1
1 'RTX_BITFIELD_OPS'
1 An RTX code for a bit-field operation. Currently only
1 'ZERO_EXTRACT' and 'SIGN_EXTRACT'. These have three inputs and are
11 lvalues (so they can be used for insertion as well). ⇒
Bit-Fields.
1
1 'RTX_TERNARY'
1 An RTX code for other three input operations. Currently only
1 'IF_THEN_ELSE', 'VEC_MERGE', 'SIGN_EXTRACT', 'ZERO_EXTRACT', and
1 'FMA'.
1
1 'RTX_INSN'
1 An RTX code for an entire instruction: 'INSN', 'JUMP_INSN', and
1 'CALL_INSN'. ⇒Insns.
1
1 'RTX_MATCH'
1 An RTX code for something that matches in insns, such as
1 'MATCH_DUP'. These only occur in machine descriptions.
1
1 'RTX_AUTOINC'
1 An RTX code for an auto-increment addressing mode, such as
1 'POST_INC'. 'XEXP (X, 0)' gives the auto-modified register.
1
1 'RTX_EXTRA'
1 All other RTX codes. This category includes the remaining codes
1 used only in machine descriptions ('DEFINE_*', etc.). It also
1 includes all the codes describing side effects ('SET', 'USE',
1 'CLOBBER', etc.) and the non-insns that may appear on an insn
1 chain, such as 'NOTE', 'BARRIER', and 'CODE_LABEL'. 'SUBREG' is
1 also part of this class.
1
1 For each expression code, 'rtl.def' specifies the number of contained
1 objects and their kinds using a sequence of characters called the
1 "format" of the expression code. For example, the format of 'subreg' is
1 'ep'.
1
1 These are the most commonly used format characters:
1
1 'e'
1 An expression (actually a pointer to an expression).
1
1 'i'
1 An integer.
1
1 'w'
1 A wide integer.
1
1 's'
1 A string.
1
1 'E'
1 A vector of expressions.
1
1 A few other format characters are used occasionally:
1
1 'u'
1 'u' is equivalent to 'e' except that it is printed differently in
1 debugging dumps. It is used for pointers to insns.
1
1 'n'
1 'n' is equivalent to 'i' except that it is printed differently in
1 debugging dumps. It is used for the line number or code number of
1 a 'note' insn.
1
1 'S'
1 'S' indicates a string which is optional. In the RTL objects in
1 core, 'S' is equivalent to 's', but when the object is read, from
1 an 'md' file, the string value of this operand may be omitted. An
1 omitted string is taken to be the null string.
1
1 'V'
1 'V' indicates a vector which is optional. In the RTL objects in
1 core, 'V' is equivalent to 'E', but when the object is read from an
1 'md' file, the vector value of this operand may be omitted. An
1 omitted vector is effectively the same as a vector of no elements.
1
1 'B'
1 'B' indicates a pointer to basic block structure.
1
1 'p'
1 A polynomial integer. At present this is used only for
1 'SUBREG_BYTE'.
1
1 '0'
1 '0' means a slot whose contents do not fit any normal category.
1 '0' slots are not printed at all in dumps, and are often used in
1 special ways by small parts of the compiler.
1
1 There are macros to get the number of operands and the format of an
1 expression code:
1
1 'GET_RTX_LENGTH (CODE)'
1 Number of operands of an RTX of code CODE.
1
1 'GET_RTX_FORMAT (CODE)'
1 The format of an RTX of code CODE, as a C string.
1
1 Some classes of RTX codes always have the same format. For example, it
1 is safe to assume that all comparison operations have format 'ee'.
1
1 '1'
1 All codes of this class have format 'e'.
1
1 '<'
1 'c'
1 '2'
1 All codes of these classes have format 'ee'.
1
1 'b'
1 '3'
1 All codes of these classes have format 'eee'.
1
1 'i'
1 All codes of this class have formats that begin with 'iuueiee'.
1 ⇒Insns. Note that not all RTL objects linked onto an insn
1 chain are of class 'i'.
1
1 'o'
1 'm'
1 'x'
1 You can make no assumptions about the format of these codes.
1