fnabs

Floating Negative Absolute Value

fnabs FRT, FRB

Computes negative absolute value of a float.

Details

The fnabs instruction computes the negative absolute value of a floating-point number. It sets the sign bit to one and clears all other bits, effectively negating the absolute value of the input.

Pseudocode Operation

FRT ← NOT(FRB) & SIGN_MASK

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.

Example

fnabs f1, f3

Encoding

Binary Layout
63
0
FRT
6
0
11
FRB
16
136
21
/
31
 
Format X-form
Opcode 0xFC000110
Extension Floating-Point
Registers Altered FPSCR

Operands

  • FRT
    Target
  • FRB
    Source