fsub.s

Floating subtract

Subtracts the third register from the second in single precision and stores the difference in the first.

RISC-V manual: fsub.s

Forms

  • fsub.s , , ,

Pseudo-instructions

The processor does not have these forms. The assembler replaces each of them with one or more real instructions. Open a row to see them.

Operands

f1
Any floating-point register, f0 to f31, or its named alias, such as ft0, fa0 or ft11.
f2
A floating-point register. It may be the same register as f1.
f3
A floating-point register. It may be the same register as f1.
rm
A rounding mode: rne (nearest, ties to even), rtz (toward zero), rdn (toward negative infinity), rup (toward positive infinity), rmm (nearest, ties away from zero) or dyn (use the rounding mode in fcsr).
.data
a: .float 6.0
b: .float 2.0
.text
la t0, a
flw f1, 0(t0)
la t1, b
flw f2, 0(t1)
# f1 (ft1)=6 and f2 (ft2)=2; fsub.s writes 4.
fsub.s f3, f1, f2