xvmulsp

VSX Vector Multiply Single-Precision

xvmulsp XT, XA, XB

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

xvmulsp vs1, vs2, vs3

Encoding

Binary Layout
60
0
XT
6
XA
11
XB
16
80
21
 
Format XX3-form
Opcode 0xF0000050
Extension VSX
Registers Altered FPSCR

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B