xvresp
Vector Reciprocal Estimate Single-Precision
Estimates the reciprocal of single-precision floating-point values in a vector.
Details
A single-precision floating-point estimate of the reciprocal of src is placed into word element i of VSR[XT] in single-precision format. Unless the reciprocal of src would be a zero, an infinity, or a QNaN, the estimate has a relative error in precision no greater than one part in 16384 of the reciprocal of src.
Pseudocode Operation
if MSR.VSX=0 then VSX_Unavailable()
ex_flag ←0b0
reset_xflags()
do i = 0 to 3
src ←bfp_CONVERT_FROM_BFP32(VSR[32×BX+B].word[i])
rnd ←bfp_ROUND_TO_BFP32(FPSCR.RN,v)
vresult.word[i] ←bfp32_CONVERT_FROM_BFP(rnd)
if vxsnan_flag=1 then SetFX(FPSCR.VXSNAN)
if ox_flag=1 then SetFX(FPSCR.OX)
if ux_flag=1 then SetFX(FPSCR.UX)
if zx_flag=1 then SetFX(FPSCR.ZX)
ex_flag ←ex_flag | (FPSCR.VE & vxsnan_flag) | (FPSCR.OE & ox_flag) | (FPSCR.UE & ux_flag) | (FPSCR.ZE & zx_flag)
end
if ex_flag=0 then VSR[32×TX+T] ←vresult
Programming Note
The xvresp instruction is used to estimate the reciprocal of single-precision floating-point numbers in vector registers. It's important to ensure that the VSX (Vector Scalar Extensions) are enabled, as attempting to use this instruction when they are not will result in an exception. The instruction handles NaNs and infinities by setting appropriate flags in the FPSCR register, but developers should be cautious of potential precision loss due to the estimation process.
Example
Encoding
Operands
-
XT
Target Vector Register -
XB
Source Vector Register