fabs
Floating Absolute Value
Computes absolute value of a float.
Details
Computes the absolute value of a double-precision floating-point number in FRB and places the result in FRT. The sign bit is cleared while all other bits remain unchanged. No exception flags are set.
Pseudocode Operation
FRT ← abs(FRB)
Programming Note
The fabs instruction is commonly used when you need to ensure that a floating-point number is positive without altering its magnitude. Be cautious with NaN (Not-a-Number) values, as fabs will return a quiet NaN if the input is a signaling NaN. This instruction operates at user privilege level and does not raise exceptions for normal inputs; however, it respects the rounding mode set in the FPSCR register.
Example
Encoding
Operands
-
FRT
Target -
FRB
Source