fcpsgn.

Copy Sign

fcpsgn. FRT,FRB,FRA

Copies the sign of one floating-point number to another.

Encoding

Binary Layout
63
0:5
FRT
6:10
FRA
11:15
FRB
16:20
8
21:30
Rc
31
 
Format X-form
Opcode 0xFC000010
Extension Floating-Point

Operands

  • FRT
    Target Floating-Point Register
  • FRB
    Source Floating-Point Register (sign source)
  • FRA
    Source Floating-Point Register (magnitude source)
  • RT
    Target Floating-Point Register
  • RB
    Source Floating-Point Register (sign source)
  • RA
    Source Floating-Point Register (magnitude source)

Example

fcpsgn. f1, f3, f2

Related

More in Floating-Point

Reference

Description

The fcpsgn. instruction copies the sign bit from the source operand B to the target operand A and places the result in the destination operand C.

Operation

if 'fcpsgn.' then
    RT <- (RA) with sign of (RB)

Programming Note

The fcpsgn. instruction is useful for manipulating the sign of floating-point numbers without changing their magnitude. Ensure that operands A and B are properly aligned in memory to avoid alignment faults. This operation does not require any special privileges and will not generate exceptions under normal circumstances.