fcpsgn.
Copy Sign
fcpsgn. FRT,FRB,FRA
Copies the sign of one floating-point number to another.
Details
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.
Pseudocode 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.
Example
fcpsgn. f1, f3, f2
Encoding
Binary Layout
18
0
LI
1
AA
31
LK
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)