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
60
0:5
T
6:10
/
11:15
B
16:20
185
21:29
BX
30
TX
31
 
Format XX2-form
Opcode 0xF00002E4
Extension VSX

Operands

  • XT
    Target Vector Register
  • XB
    Source Vector Register

Example

xvrspim vs1, vs3

Registers Altered

FPSCR.FX, FPSCR.VXSNAN

Related

More in VSX

Reference

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.