FMSUB.H

Float Fused Multiply-Subtract (Half)

FMSUB.H rd, rs1, rs2, rs3

Computes (rs1 * rs2) - rs3 with single rounding (16-bit).

Encoding

Binary Layout
rs3
31:27
10
26:25
rs2
24:20
rs1
19:15
rm
14:12
rd
11:7
1000111
6:0
 
Format R4-Type
Opcode 0x04000047
Extension Zfh

Operands

  • rd
    Destination floating-point register
  • rs1
    Floating-point register (multiplicand)
  • rs2
    Floating-point register (multiplier)
  • rs3
    Floating-point register (addend)

Example

FMSUB.H ft0, fa0, fa1, fa2

Related

More in Zfh

Description

FMSUB.H computes rs1 * rs2 - rs3 on half-precision values with a single rounding and writes the result to rd. The result is rounded according to the rm field (rm=DYN selects the rounding mode held in frm) and the accrued exception flags are updated in fflags. It sets the invalid-operation flag for (infinity x 0) even when an addend is a quiet NaN.

Operation

F[rd] = (F[rs1] * F[rs2]) - F[rs3];