Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:RTL Representation   [Contents][Index]


13.2 RTL Classes and Formats

The various expression codes are divided into severalclasses,which are represented by single characters. You can determine the classof an RTX code with the macroGET_RTX_CLASS (code).Currently,rtl.def defines these classes:

RTX_OBJ

An RTX code that represents an actual object, such as a register(REG) or a memory location (MEM,SYMBOL_REF).LO_SUM is also included; instead,SUBREG andSTRICT_LOW_PART are not in this class, but in classRTX_EXTRA.

RTX_CONST_OBJ

An RTX code that represents a constant object.HIGH is alsoincluded in this class.

RTX_COMPARE

An RTX code for a non-symmetric comparison, such asGEU orLT.

RTX_COMM_COMPARE

An RTX code for a symmetric (commutative) comparison, such asEQorORDERED.

RTX_UNARY

An RTX code for a unary arithmetic operation, such asNEG,NOT, orABS. This category also includes value extension(sign or zero) and conversions between integer and floating point.

RTX_COMM_ARITH

An RTX code for a commutative binary operation, such asPLUS orAND.NE andEQ are comparisons, so they have classRTX_COMM_COMPARE.

RTX_BIN_ARITH

An RTX code for a non-commutative binary operation, such asMINUS,DIV, orASHIFTRT.

RTX_BITFIELD_OPS

An RTX code for a bit-field operation. Currently onlyZERO_EXTRACT andSIGN_EXTRACT. These have three inputsand are lvalues (so they can be used for insertion as well).SeeBit-Fields.

RTX_TERNARY

An RTX code for other three input operations. Currently onlyIF_THEN_ELSE,VEC_MERGE,SIGN_EXTRACT,ZERO_EXTRACT, andFMA.

RTX_INSN

An RTX code for an entire instruction:INSN,JUMP_INSN, andCALL_INSN. SeeInsns.

RTX_MATCH

An RTX code for something that matches in insns, such asMATCH_DUP. These only occur in machine descriptions.

RTX_AUTOINC

An RTX code for an auto-increment addressing mode, such asPOST_INC. ‘XEXP (x, 0)’ gives the auto-modifiedregister.

RTX_EXTRA

All other RTX codes. This category includes the remaining codes usedonly in machine descriptions (DEFINE_*, etc.). It also includesall the codes describing side effects (SET,USE,CLOBBER, etc.) and the non-insns that may appear on an insnchain, such asNOTE,BARRIER, andCODE_LABEL.SUBREG is also part of this class.

For each expression code,rtl.def specifies the number ofcontained objects and their kinds using a sequence of characterscalled theformat of the expression code. For example,the format ofsubreg is ‘ep’.

These are the most commonly used format characters:

e

An expression (actually a pointer to an expression).

i

An integer.

w

A wide integer.

s

A string.

E

A vector of expressions.

A few other format characters are used occasionally:

u

u’ is equivalent to ‘e’ except that it is printed differentlyin debugging dumps. It is used for pointers to insns.

n

n’ is equivalent to ‘i’ except that it is printed differentlyin debugging dumps. It is used for the line number or code number of anote insn.

S

S’ indicates a string which is optional. In the RTL objects incore, ‘S’ is equivalent to ‘s’, but when the object is read,from an ‘md’ file, the string value of this operand may be omitted.An omitted string is taken to be the null string.

V

V’ indicates a vector which is optional. In the RTL objects incore, ‘V’ is equivalent to ‘E’, but when the object is readfrom an ‘md’ file, the vector value of this operand may be omitted.An omitted vector is effectively the same as a vector of no elements.

B

B’ indicates a pointer to basic block structure.

p

A polynomial integer. At present this is used only forSUBREG_BYTE.

0

0’ means a slot whose contents do not fit any normal category.‘0’ slots are not printed at all in dumps, and are often used inspecial ways by small parts of the compiler.

There are macros to get the number of operands and the formatof an expression code:

GET_RTX_LENGTH (code)

Number of operands of an RTX of codecode.

GET_RTX_FORMAT (code)

The format of an RTX of codecode, as a C string.

Some classes of RTX codes always have the same format. For example, itis safe to assume that all comparison operations have formatee.

RTX_UNARY

All codes of this class have formate.

RTX_BIN_ARITH
RTX_COMM_ARITH
RTX_COMM_COMPARE
RTX_COMPARE

All codes of these classes have formatee.

RTX_BITFIELD_OPS
RTX_TERNARY

All codes of these classes have formateee.

RTX_INSN

All codes of this class have formats that begin withiuueiee.SeeInsns. Note that not all RTL objects linked onto an insn chainare of classRTX_INSN.

RTX_CONST_OBJ
RTX_OBJ
RTX_MATCH
RTX_EXTRA

You can make no assumptions about the format of these codes.


Next:Access to Operands, Previous:RTL Object Types, Up:RTL Representation   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp