fcpsgn

Floating Copy Sign

fcpsgn FRT, FRA, FRB

Copies sign from FRB to FRA.

Details

The fcpsgn instruction copies the sign bit from one floating-point register (FRA) to another (FRB), while copying the magnitude of FRB to FRT. This effectively changes the sign of FRT to match that of FRA.

Pseudocode Operation

FRT ← CopySign(FRB, FRA)

Programming Note

Use fcpsgn to change the sign of a floating-point number without altering its magnitude. Ensure both source and target registers are properly aligned and accessible. This instruction operates at user privilege level but may raise exceptions if operands are invalid or if there are precision issues.

Example

fcpsgn f1, f2, f3

Encoding

Binary Layout
63
0
FRT
6
FRA
11
FRB
16
8
21
/
31
 
Format X-form
Opcode 0xFC000010
Extension Floating-Point
Registers Altered FPSCR

Operands

  • FRT
    Target
  • FRA
    Source
  • FRB
    Sign Source