xvrdpim
VSX Vector Round to Double-Precision Integer using round toward -Infinity
Rounds the contents of a vector register towards negative infinity and stores the result in another vector register.
Details
The xvrdpim instruction rounds each double-precision floating-point element in the source vector register towards negative infinity and stores the results in the target vector register. If any element is a signaling NaN, it is converted to a quiet NaN, and VXSNAN is set.
Pseudocode Operation
if MSR.VSX=0 then VSX_Unavailable()
ex_flag ←0b0
do i = 0 to 1
reset_xflags()
src ←bfp_CONVERT_FROM_BFP64(VSR[32×BX+B].dword[i])
rnd ←bfp_ROUND_TO_INTEGER(0b011, src)
vresult.dword[i] ←bfp64_CONVERT_FROM_BFP(rnd)
if vxsnan_flag=1 then SetFX(FPSCR.VXSNAN)
ex_flag ←ex_flag | (FPSCR.VE & vxsnan_flag)
end
if ex_flag=0 then VSR[32×TX+T] ←vresult
Programming Note
The xvrdpim instruction is commonly used for rounding double-precision floating-point numbers towards negative infinity in vector operations. Ensure that the VSX (Vector Scalar Extensions) are enabled, as attempting to use this instruction when they are not will result in an unavailable exception. Be cautious with signaling NaNs, as they are converted to quiet NaNs and VXSNAN is set in the FPSCR register.
Example
Encoding
Operands
-
XT
Target Vector Register -
XB
Source Vector Register