xvcvspdp
VSX Vector Convert Single to Double
Converts two floats to two doubles.
Details
The xvcvspdp instruction converts a vector of single-precision floating-point values to double-precision floating-point values. It processes each element of the input vector, converting it to double precision and storing the result in the corresponding element of the output vector.
Pseudocode Operation
if MSR.VSX=0 then VSX_Unavailable()
reset_flags()
ex_flag ←0b0
do i = 0 to 1
src ←bfp_CONVERT_FROM_BFP32(
VSR[BX×32+B].word[i])
if src.class.SNaN=1 then
vresult.word[2*i] ← bfp64_CONVERT_FROM_BFP(bfp_QUIET(src))
vresult.word[2*i+1] ← 0x00000000
vxsnan_flag ←src.class.SNaN
if vxsnan_flag=1 then SetFX(FPSCR.VXSNAN)
ex_flag ←ex_flag | (FPSCR.VE & vxsnan_flag)
else
vresult.word[2*i] ←bfp64_CONVERT_FROM_BFP(src)
vresult.word[2*i+1] ← 0x00000000
if ex_flag=0 then VSR[32×TX+T].word[2*i] ←vresult.word[2*i]
VSR[32×TX+T].word[2*i+1] ←vresult.word[2*i+1]
Programming Note
The xvcvspdp instruction is used to convert a vector of single-precision floating-point values to double-precision. Ensure that the VSX (Vector Scalar Extensions) are enabled in the MSR register, otherwise, an exception will be raised. Handle special cases like signaling NaNs by checking and setting the appropriate flags in FPSCR.
Example
Encoding
Operands
-
XT
Target -
XB
Source