xvmulsp
VSX Vector Multiply Single-Precision
Multiplies the contents of two single-precision floating-point values and places the result into a vector register.
Details
The xvmulsp instruction multiplies the single-precision floating-point value in word element i of VSR[XA] with the single-precision floating-point value in word element i of VSR[XB], and stores the result in word element i of VSR[XT].
Pseudocode Operation
for i = 0 to 3 do
src1 <- VSR[XA][i]
src2 <- VSR[XB][i]
if src1 is QNaN or src2 is QNaN then
v <- src1
else if src1 is SNaN or src2 is SNaN then
v <- Q(src1)
else if src1 is +Infinity and src2 is +NZF then
v <- +Infinity
else if src1 is +Infinity and src2 is -NZF then
v <- -Infinity
else if src1 is -Infinity and src2 is +NZF then
v <- -Infinity
else if src1 is -Infinity and src2 is -NZF then
v <- +Infinity
else if src1 is +NZF and src2 is +Infinity then
v <- +Infinity
else if src1 is +NZF and src2 is -Infinity then
v <- -Infinity
else if src1 is -NZF and src2 is +Infinity then
v <- -Infinity
else if src1 is -NZF and src2 is -Infinity then
v <- +Infinity
else if src1 is +Zero and src2 is +Zero then
v <- +Zero
else if src1 is +Zero and src2 is -Zero then
v <- -Zero
else if src1 is -Zero and src2 is +Zero then
v <- -Zero
else if src1 is -Zero and src2 is -Zero then
v <- +Zero
else if src1 is +NZF and src2 is +Zero then
v <- +Infinity
else if src1 is +NZF and src2 is -Zero then
v <- -Infinity
else if src1 is -NZF and src2 is +Zero then
v <- -Infinity
else if src1 is -NZF and src2 is -Zero then
v <- +Infinity
else if src1 is +Zero and src2 is +NZF then
v <- +Infinity
else if src1 is +Zero and src2 is -NZF then
v <- -Infinity
else if src1 is -Zero and src2 is +NZF then
v <- -Infinity
else if src1 is -Zero and src2 is -NZF then
v <- +Infinity
else
v <- M(src1, src2)
VSR[XT][i] <- Q(v)
end for
Programming Note
The xvmulsp instruction performs element-wise multiplication of single-precision floating-point values in vector registers. Ensure that the input vectors are properly aligned to avoid alignment faults. Be cautious with NaN and infinity handling, as they follow specific rules for propagation and sign determination. This instruction operates at user privilege level.
Example
Encoding
Operands
-
XT
Target -
XA
Src A -
XB
Src B