Unless otherwise specified, all the operands of arithmetic expressions
must be valid for mode m. An operand is valid for mode m
if it has mode m, or if it is a
const_double and m is a mode of class
For commutative binary operations, constants should be placed in the second operand.
(plus:m x y)
(lo_sum:m x y)
plus, except that it represents that sum of x and the low-order bits of y. The number of low order bits is machine-dependent but is normally the number of bits in a
Pmodeitem minus the number of bits set by the
highcode (see section Constant Expression Types). m should be
(minus:m x y)
plusbut represents subtraction.
(compare:m x y)
(cc0)is used, it is
VOIDmode. Otherwise it is some mode in class
CCmode. See section Condition Code Status. Normally, x and y must have the same mode. Otherwise,
compareis valid only if the mode of x is in class
MODE_INTand y is a
VOIDmode. The mode of x determines what mode the comparison is to be done in; thus it must not be
VOIDmode. If one of the operands is a constant, it should be placed in the second operand and the comparison code adjusted as appropriate. A
VOIDmodeconstants is not valid since there is no way to know in what mode the comparison is to be performed; the comparison must either be folded during the compilation or the first operand must be loaded into a register while its mode is still known.
(mult:m x y)
(mult:m (sign_extend:m x) (sign_extend:m y))where m is wider than the modes of x and y, which need not be the same. Write patterns for unsigned widening multiplication similarly using
(div:m x y)
(truncate:m1 (div:m2 x (sign_extend:m2 y)))
(udiv:m x y)
divbut represents unsigned division.
(mod:m x y)
(umod:m x y)
udivbut represent the remainder instead of the quotient.
(smin:m x y)
(smax:m x y)
smin) or larger (for
smax) of x and y, interpreted as signed integers in mode m.
(umin:m x y)
(umax:m x y)
smax, but the values are interpreted as unsigned integers.
(and:m x y)
(ior:m x y)
(xor:m x y)
(ashift:m x c)
VOIDmode; which mode is determined by the mode called for in the machine description entry for the left-shift instruction. For example, on the Vax, the mode of c is
QImoderegardless of m.
(lshiftrt:m x c)
(ashiftrt:m x c)
ashiftbut for right shift. Unlike the case for left shift, these two operations are distinct.
(rotate:m x c)
(rotatert:m x c)