xssubqpo

VSX Scalar Subtract Quad-Precision Odd

xssubqpo vD, vA, vB

Used for Quad-Precision arithmetic on hardware that splits quads.

Details

The VSX Scalar Subtract Quad-Precision Odd instruction subtracts two double-precision floating-point values, src1 and src2. If src2 is a Quiet NaN, the result is src2. If both src1 and src2 are Infinity with the same sign, the result is the default Quiet NaN. Otherwise, it performs the subtraction and handles various special cases like exact-zero-difference results and overflow.

Pseudocode Operation

if src2 is QNaN then
    v ← src2
else if src1 and src2 are +Infinity or -Infinity with same sign then
    v ← dQNaN
else
    v ← S(src1, -src2)
end if

Programming Note

This instruction is commonly used for precise floating-point arithmetic operations in scientific computing. Be cautious of NaN handling; if src2 is a Quiet NaN, it will propagate as the result without performing any subtraction. Ensure that inputs are properly aligned to avoid alignment faults. This operation requires FPSCR for exception flags and rounding modes.

Example

xssubqpo vd, va, vb

Encoding

Binary Layout
63
0
vD
6
vA
11
vB
16
516
21
/
31
 
Format X-form
Opcode 0xFC000404
Extension VSX
Registers Altered FPSCR

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B