xscpsgndp

VSX Scalar Copy Sign Double-Precision

xscpsgndp XT,XA,XB

Copies the sign of a double-precision floating-point value from one register to another.

Details

The xscpsgndp instruction copies the sign bit of the source operand in VSR[XA] to the target operand in VSR[XT], while preserving the magnitude of the source operand in VSR[XB].

Pseudocode Operation

if MSR.VSX=0 then
    VSX_Unavailable()
src1 ←VSR[XA].dword[0] & 0x8000_0000_0000_0000_0000_0000_0000_0000
src2 ←VSR[XB].dword[0] & 0x7FFF_FFFF_FFFF_FFFF
VSR[XT].dword[0] ←src1 | src2
VSR[XT].dword[1] ←0x0000_0000_0000_0000

Programming Note

This instruction can be used to operate on single-precision source operands. Previous versions of the architecture allowed the contents of doubleword 1 of the result register to be undefined. However, all processors that support this instruction write 0s into doubleword 1 of the result register, as is required by this version of the architecture.

Example

xscpsgndp vs1, vs2, vs3

Encoding

Binary Layout
176
0
AX
6
BX
11
TX
16
T
21
A
29
B
30
 
Format X-form
Opcode 0xF0000580
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target Vector-Scalar Register
  • XA
    Source Vector-Scalar Register for Sign Bit
  • XB
    Source Vector-Scalar Register for Magnitude