vsubfp

Vector Subtract Floating-Point

vsubfp vD, vA, vB

Subtracts four single-precision floats (Classic VMX).

Encoding

Binary Layout
4
0:5
vD
6:10
vA
11:15
vB
16:20
74
21:31
 
Format VA-form
Opcode 0x1000004A
Extension VMX (AltiVec)

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B

Example

vsubfp vd, va, vb

Registers Altered

MSR

Related

More in VMX (AltiVec)

Reference

Description

Subtracts four single-precision floating-point elements in vB from the corresponding elements in vA, storing the IEEE 754 results in vD. No condition flags are set by this instruction. This is a Classic VMX (AltiVec) floating-point operation.

Operation

for i in 0 to 3 do
  vD[i] ← vA[i] - vB[i]  (IEEE 754 single precision)
endfor

Programming Note

The vsubfp instruction is used for vectorized subtraction of single-precision floating-point numbers. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The operation processes four elements at a time, so ensure that the input vectors are properly aligned and contain valid floating-point data to avoid unexpected results.