xscpsgnqp

VSX Scalar Copy Sign Quad-Precision

xscpsgnqp vD, vA, vB

Copies sign from B to A (128-bit).

Encoding

Binary Layout
63
0:5
vD
6:10
vA
11:15
vB
16:20
100
21:30
/
31
 
Format X-form
Opcode 0xFC0000C8
Extension VSX

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B

Example

xscpsgnqp vd, va, vb

Registers Altered

MSR

Related

More in VSX

Reference

Description

Copies the sign bit from the quad-precision floating-point value in vB to the quad-precision value in vA, placing the result in vD. The magnitude of vA is preserved while the sign of vB is applied. No condition register or status flags are affected.

Operation

vD[0] ← vB[0] || vA[1:127]

Programming Note

The xscpsgnqp instruction is used to copy the sign bit from one quad-precision floating-point number to another while keeping its magnitude unchanged. Ensure that the VSX (Vector Scalar Extensions) are enabled by checking and setting the appropriate bit in the MSR register. This instruction operates on 128-bit values, so both source operands must be properly aligned. Be cautious of potential exceptions if the VSX is not available or if there are alignment issues.