gccint: Conversions
1
1 14.13 Conversions
1 =================
1
1 All conversions between machine modes must be represented by explicit
1 conversion operations. For example, an expression which is the sum of a
1 byte and a full word cannot be written as '(plus:SI (reg:QI 34) (reg:SI
1 80))' because the 'plus' operation requires two operands of the same
1 machine mode. Therefore, the byte-sized operand is enclosed in a
1 conversion operation, as in
1
1 (plus:SI (sign_extend:SI (reg:QI 34)) (reg:SI 80))
1
1 The conversion operation is not a mere placeholder, because there may
1 be more than one way of converting from a given starting mode to the
1 desired final mode. The conversion operation code says how to do it.
1
1 For all conversion operations, X must not be 'VOIDmode' because the
1 mode in which to do the conversion would not be known. The conversion
1 must either be done at compile-time or X must be placed into a register.
1
1 '(sign_extend:M X)'
1 Represents the result of sign-extending the value X to machine mode
1 M. M must be a fixed-point mode and X a fixed-point value of a
1 mode narrower than M.
1
1 '(zero_extend:M X)'
1 Represents the result of zero-extending the value X to machine mode
1 M. M must be a fixed-point mode and X a fixed-point value of a
1 mode narrower than M.
1
1 '(float_extend:M X)'
1 Represents the result of extending the value X to machine mode M.
1 M must be a floating point mode and X a floating point value of a
1 mode narrower than M.
1
1 '(truncate:M X)'
1 Represents the result of truncating the value X to machine mode M.
1 M must be a fixed-point mode and X a fixed-point value of a mode
1 wider than M.
1
1 '(ss_truncate:M X)'
1 Represents the result of truncating the value X to machine mode M,
1 using signed saturation in the case of overflow. Both M and the
1 mode of X must be fixed-point modes.
1
1 '(us_truncate:M X)'
1 Represents the result of truncating the value X to machine mode M,
1 using unsigned saturation in the case of overflow. Both M and the
1 mode of X must be fixed-point modes.
1
1 '(float_truncate:M X)'
1 Represents the result of truncating the value X to machine mode M.
1 M must be a floating point mode and X a floating point value of a
1 mode wider than M.
1
1 '(float:M X)'
1 Represents the result of converting fixed point value X, regarded
1 as signed, to floating point mode M.
1
1 '(unsigned_float:M X)'
1 Represents the result of converting fixed point value X, regarded
1 as unsigned, to floating point mode M.
1
1 '(fix:M X)'
1 When M is a floating-point mode, represents the result of
1 converting floating point value X (valid for mode M) to an integer,
1 still represented in floating point mode M, by rounding towards
1 zero.
1
1 When M is a fixed-point mode, represents the result of converting
1 floating point value X to mode M, regarded as signed. How rounding
1 is done is not specified, so this operation may be used validly in
1 compiling C code only for integer-valued operands.
1
1 '(unsigned_fix:M X)'
1 Represents the result of converting floating point value X to fixed
1 point mode M, regarded as unsigned. How rounding is done is not
1 specified.
1
1 '(fract_convert:M X)'
1 Represents the result of converting fixed-point value X to
1 fixed-point mode M, signed integer value X to fixed-point mode M,
1 floating-point value X to fixed-point mode M, fixed-point value X
1 to integer mode M regarded as signed, or fixed-point value X to
1 floating-point mode M. When overflows or underflows happen, the
1 results are undefined.
1
1 '(sat_fract:M X)'
1 Represents the result of converting fixed-point value X to
1 fixed-point mode M, signed integer value X to fixed-point mode M,
1 or floating-point value X to fixed-point mode M. When overflows or
1 underflows happen, the results are saturated to the maximum or the
1 minimum.
1
1 '(unsigned_fract_convert:M X)'
1 Represents the result of converting fixed-point value X to integer
1 mode M regarded as unsigned, or unsigned integer value X to
1 fixed-point mode M. When overflows or underflows happen, the
1 results are undefined.
1
1 '(unsigned_sat_fract:M X)'
1 Represents the result of converting unsigned integer value X to
1 fixed-point mode M. When overflows or underflows happen, the
1 results are saturated to the maximum or the minimum.
1