xvcvuxwsp
VSX Vector Convert Unsigned Word to Single
Converts four 32-bit unsigned integers to four floats.
Details
The xvcvuxwsp instruction converts each unsigned integer word from the source vector register to a single-precision floating-point value, rounds it according to the rounding mode specified by FPSCR.RN, and stores the result in the target vector register. If any trap-enabled exception occurs during the conversion of any element, no results are written to the target register.
Pseudocode Operation
if MSR.VSX=0 then VSX_Unavailable()
ex_flag ←0b0
do i = 0 to 3
reset_xflags()
src ←bfp_CONVERT_FROM_UI32(VSR[32×BX+B].word[i])
rnd ←bfp_ROUND_TO_BFP32(FPSCR.RN,src)
vresult.word[i] ←bfp32_CONVERT_FROM_BFP(rnd)
if xx_flag=1 then SetFX(FPSCR.XX)
ex_flag ←ex_flag | (FPSCR.XE & xx_flag)
end
if ex_flag=0 then VSR[32×TX+T] ←vresult
Programming Note
This instruction is commonly used for converting unsigned integer data to floating-point format in vector operations. Ensure that the VSX (Vector Scalar Extensions) are enabled by checking and setting MSR.VSX before using this instruction. Be aware of potential exceptions during conversion, as no results will be written to the target register if any trap-enabled exception occurs. The rounding mode is determined by FPSCR.RN, so ensure it's set appropriately for your application.
Example
Encoding
Operands
-
XT
Target -
XB
Source