fneg

Floating Negate

fneg FRT, FRB

Negates a float.

Encoding

Binary Layout
63
0:5
FRT
6:10
0
11:15
FRB
16:20
40
21:30
/
31
 
Format X-form
Opcode 0xFC000050
Extension Floating-Point

Operands

  • FRT
    Target
  • FRB
    Source

Example

fneg f1, f3

Registers Altered

FPSCR

Related

More in Floating-Point

Reference

Description

Negates a double-precision floating-point number in FRB by flipping the sign bit and places the result in FRT. No exception flags are set.

Operation

FRT ← -FRB

Programming Note

The fneg instruction is commonly used to change the sign of a floating-point number. Ensure that the source register (FRA) contains a valid floating-point value before executing this instruction. The result is stored in the target register (FRT), which must be distinct from FRA. This operation does not affect any special registers like FPSCR unless there are exceptions such as invalid operations or overflow.