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
 
Format X-form
Opcode 0xFC000110
Extension Floating-Point

Operands

  • FRT
    Target
  • FRB
    Source

Example

fnabs f1, f3

Registers Altered

FPSCR

Related

More in Floating-Point

Reference

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.