vsubfp

Vector Subtract Floating-Point

vsubfp vD, vA, vB

Subtracts four single-precision floats (Classic VMX).

Details

The vsubfp instruction performs a vectorized subtraction of single-precision floating-point numbers. It subtracts the elements of VRB from the corresponding elements of VRA and stores the results in VRT.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 3
   src1 ←VSR[VRA+32].word[i]
   src2 ←VSR[VRB+32].word[i]
   VSR[VRT+32].word[i] ←bfp32_SUBTRACT(src1,src2)
end

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.

Example

vsubfp vd, va, vb

Encoding

Binary Layout
4
0
vD
6
vA
11
vB
16
74
21
 
Format VA-form
Opcode 0x1000004A
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B