fnabs
Floating Negative Absolute Value
fnabs FRT, FRB
Computes negative absolute value of a float.
Encoding
Binary Layout
63
0:5
FRT
6:10
0
11:15
FRB
16:20
136
21:30
/
31
Operands
-
FRT
Target -
FRB
Source
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Computes the negative absolute value of a double-precision floating-point number in FRB and places the result in FRT. The sign bit is set to 1 while all other bits are taken from the absolute value. No exception flags are set.
Operation
FRT ← -abs(FRB)
Programming Note
The fnabs instruction is useful for converting a positive floating-point number to its negative counterpart while maintaining its magnitude. Ensure that the input register (FRB) contains a valid floating-point value; otherwise, the result may be undefined. This operation does not affect the FPSCR register, so no exception flags are set based on the input value.