Movatterモバイル変換


[0]ホーム

URL:


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


13.13 Conversions

All conversions between machine modes must be represented byexplicit conversion operations. For example, an expressionwhich is the sum of a byte and a full word cannot be written as(plus:SI (reg:QI 34) (reg:SI 80)) because theplusoperation requires two operands of the same machine mode.Therefore, the byte-sized operand is enclosed in a conversionoperation, as in

(plus:SI (sign_extend:SI (reg:QI 34)) (reg:SI 80))

The conversion operation is not a mere placeholder, because theremay be more than one way of converting from a given starting modeto the desired final mode. The conversion operation code says howto do it.

For all conversion operations,x must not beVOIDmodebecause the mode in which to do the conversion would not be known.The conversion must either be done at compile-time orxmust be placed into a register.

(sign_extend:mx)

Represents the result of sign-extending the valuexto machine modem.m must be a fixed-point modeandx a fixed-point value of a mode narrower thanm.

(zero_extend:mx)

Represents the result of zero-extending the valuexto machine modem.m must be a fixed-point modeandx a fixed-point value of a mode narrower thanm.

(float_extend:mx)

Represents the result of extending the valuexto machine modem.m must be a floating point modeandx a floating point value of a mode narrower thanm.

(truncate:mx)

Represents the result of truncating the valuexto machine modem.m must be a fixed-point modeandx a fixed-point value of a mode wider thanm.

(ss_truncate:mx)

Represents the result of truncating the valuexto machine modem, using signed saturation in the case ofoverflow. Bothm and the mode ofx must be fixed-pointmodes.

(us_truncate:mx)

Represents the result of truncating the valuexto machine modem, using unsigned saturation in the case ofoverflow. Bothm and the mode ofx must be fixed-pointmodes.

(float_truncate:mx)

Represents the result of truncating the valuexto machine modem.m must be a floating point modeandx a floating point value of a mode wider thanm.

(float:mx)

Represents the result of converting fixed point valuex,regarded as signed, to floating point modem.

(unsigned_float:mx)

Represents the result of converting fixed point valuex,regarded as unsigned, to floating point modem.

(fix:mx)

Whenm is a floating-point mode, represents the result ofconverting floating point valuex (valid for modem) to aninteger, still represented in floating point modem, by roundingtowards zero.

Whenm is a fixed-point mode, represents the result ofconverting floating point valuex to modem, regarded assigned. How rounding is done is not specified, so this operation maybe used validly in compiling C code only for integer-valued operands.

(unsigned_fix:mx)

Represents the result of converting floating point valuex tofixed point modem, regarded as unsigned. How rounding is doneis not specified.

(fract_convert:mx)

Represents the result of converting fixed-point valuex tofixed-point modem, signed integer valuex tofixed-point modem, floating-point valuex tofixed-point modem, fixed-point valuex to integer modemregarded as signed, or fixed-point valuex to floating-point modem.When overflows or underflows happen, the results are undefined.

(sat_fract:mx)

Represents the result of converting fixed-point valuex tofixed-point modem, signed integer valuex tofixed-point modem, or floating-point valuex tofixed-point modem.When overflows or underflows happen, the results are saturated to themaximum or the minimum.

(unsigned_fract_convert:mx)

Represents the result of converting fixed-point valuex tointeger modem regarded as unsigned, or unsigned integer valuex tofixed-point modem.When overflows or underflows happen, the results are undefined.

(unsigned_sat_fract:mx)

Represents the result of converting unsigned integer valuex tofixed-point modem.When overflows or underflows happen, the results are saturated to themaximum or the minimum.


Next:Declarations, Previous:Vector Operations, Up:RTL Representation   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp