xsrqpix

VSX Scalar Round Quad-Precision to Integer Extended

xsrqpix vD, vB, R

Rounds a Quad float to a Quad integer (Exact).

Details

The xsrqpix instruction rounds a quad-precision floating-point value in VSR[VRB] to an integer using the specified rounding mode, places the result into doubleword element 0 of VSR[VRT], and sets doubleword element 1 of VSR[VRT] to 0. It also updates the FPSCR register with flags related to the operation.

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()
reset_xflags()
src ←bfp_CONVERT_FROM_BFP128(VSR[VRB].quad[0])
rnd ←bfp_ROUND_TO_INTEGER(RMC, src)
result ←bfp64_CONVERT_FROM_BFP(rnd)
if vxsnan_flag=1 then SetFX(FPSCR.VXSNAN)
vex_flag ←FPSCR.VE & vxsnan_flag
if vex_flag=0 then do
   VSR[32×VRT+R].dword[0] ←result
   VSR[32×VRT+R].dword[1] ←0x0000_0000_0000_0000
   FPSCR.FPRF ←fprf_CLASS_BFP64(result)
FPSCR.FR ←0b0
FPSCR.FI ←0b0

Programming Note

The xsrqpix instruction is used to round a quad-precision floating-point number to an integer. Ensure that the VSX (Vector Scalar Extensions) are enabled in the MSR register, as attempting to use this instruction when VSX is unavailable will result in an exception. The rounding mode is determined by the FPSCR register, and the instruction handles special cases like NaNs by setting appropriate flags in the FPSCR.

Example

xsrqpix vd, vb, 0

Encoding

Binary Layout
63
0
FRT
6
/
11
FRB
16
Rc
21
37
22
 
Format Z23-form
Opcode 0xFC000025
Extension VSX
Registers Altered FPSCR, MSR

Operands

  • vD
    Target
  • vB
    Source
  • R
    Mode