xscvdpsxw
VSX Scalar Convert with round to zero Double-Precision to Signed Word
Converts a double-precision floating-point number to a signed word, rounding towards zero.
Details
This instruction converts the double-precision floating-point number in VSR[XB] to a signed word and places it into word elements 0 and 1 of VSR[XT]. If the operand is positive or +Infinity, 0x7FFF_FFFF is placed. If negative, −Infinity, or NaN, 0x8000_0000 is placed.
Pseudocode Operation
Programming Note
This instruction is useful for converting double-precision floating-point numbers to a signed word format, with specific handling for edge cases like infinity and NaN. Ensure that the input register contains valid double-precision values to avoid unexpected results. The instruction operates at user privilege level and does not generate exceptions under normal conditions.
Example
Encoding
Operands
-
XT
Target Vector-Scalar Register -
XB
Source Vector-Scalar Register