xvrspim
VSX Vector Round to Single-Precision Integer using round toward -Infinity
xvrspim XT,XB
Rounds each element of a vector from single-precision floating-point format to integer format, rounding towards negative infinity.
Encoding
Binary Layout
0
0
6
6
11
11
16
16
21
21
30
30
31
31
Operands
-
XT
Target Vector Register -
XB
Source Vector Register
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Rounds each single-precision floating-point element in the source VSR towards negative infinity (-∞) and stores the result in the target VSR using floor rounding semantics. This operates on four single-precision elements per 128-bit VSR in VSX mode.
Operation
XT[0:31] ← RoundTowardMinusInfinity(XB[0:31])
XT[32:63] ← RoundTowardMinusInfinity(XB[32:63])
XT[64:95] ← RoundTowardMinusInfinity(XB[64:95])
XT[96:127] ← RoundTowardMinusInfinity(XB[96:127])
Programming Note
The xvrspim instruction is commonly used for converting single-precision floating-point numbers to integers with rounding towards negative infinity. Ensure that the VSX (Vector Scalar Extensions) are enabled in the MSR register; otherwise, a VSX_Unavailable exception will be raised. Be cautious of NaN values, as they can set the VXSNAN flag in the FPSCR register and trigger an exception if VE is also set.