xscpsgnqp

VSX Scalar Copy Sign Quad-Precision

xscpsgnqp vD, vA, vB

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

Details

The xscpsgnqp instruction copies the sign bit from a source quad-precision floating-point number to another quad-precision floating-point number while preserving its magnitude.

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()
src1 ←VSR[VRA+32] & 0x8000_0000_0000_0000_0000_0000_0000_0000
src2 ←VSR[VRB+32] & 0x7FFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF
VSR[VRT+32] ←src1 | src2

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.

Example

xscpsgnqp vd, va, vb

Encoding

Binary Layout
63
0
vD
6
vA
11
vB
16
100
21
/
31
 
Format X-form
Opcode 0xFC0000C4
Extension VSX
Registers Altered MSR

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B