xvcvspdp

VSX Vector Convert Single to Double

xvcvspdp XT, XB

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

xvcvspdp vs1, vs3

Encoding

Binary Layout
60
0
XT
6
0
11
XB
16
457
21
 
Format XX2-form
Opcode 0xF00001C9
Extension VSX
Registers Altered FPSCR, MSR

Operands

  • XT
    Target
  • XB
    Source