fcpsgn.

Copy Sign

fcpsgn. FRT,FRB,FRA

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

Encoding

Binary Layout
18
0:5
LI
6:10
AA
11:15
LK
16: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.