xvrsqrtesp
VSX Vector Reciprocal Square Root Estimate Single-Precision
Estimates the reciprocal square root of single-precision floating-point values in a vector.
Details
The instruction estimates the reciprocal square root of each element in the source vector and stores the result in the target vector. The estimate has a relative error no greater than one part in 16384 of the reciprocal of the square root of the source value.
Pseudocode Operation
if MSR.VSX=0 then VSX_Unavailable()
ex_flag ←0b0
do i = 0 to 3
reset_xflags()
src ←bfp_CONVERT_FROM_BFP32(VSR[32×BX+B].word[i])
v ←bfp_RECIPROCAL_SQUARE_ROOT_ESTIMATE(src)
rnd ←bfp_ROUND_TO_BFP32(FPSCR.RN,v)
vresult.word[i] ←bfp32_CONVERT_FROM_BFP(rnd)
if vxsqrt_flag=1 then SetFX(FPSCR.VXSQRT)
if zx_flag=1 then SetFX(FPSCR.ZX)
end
if ex_flag=0 then VSR[32×TX+T] ←vresult
Programming Note
The xvrsqrtesp instruction is commonly used for fast reciprocal square root estimation in single-precision floating-point operations. Ensure that the VSX (Vector Scalar Extensions) are enabled by checking and setting the MSR.VSX bit. Be aware of potential exceptions such as VXSNAN or VXSQRT, which can be handled by examining the FPSCR register flags. The instruction operates on 4-element vectors, so ensure proper alignment and ordering of data for accurate results.
Example
Encoding
Operands
-
XT
Target Vector Register -
XB
Source Vector Register