fneg

Floating Negate

fneg FRT, FRB

Negates a float.

Details

The TARGET instruction fneg (Floating Negate) negates the value of a floating-point number in register FRA and stores the result back into register FRT.

Pseudocode Operation

FRT ← -FRA

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.

Example

fneg f1, f3

Encoding

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

Operands

  • FRT
    Target
  • FRB
    Source