FADD.S

RISC-V FADD.S Instruction Details

Instruction ManualR-type

Performs single-precision floating-point addition: rd = rs1+rs2.

Instruction Syntax

fadd.s rd, rs1, rs2, rm
Operand Breakdown
rd: destination floating-point register receiving the formatted result.
rs1/rs2: source floating-point registers; arithmetic/rounding forms with rm use rm or dynamic frm for rounding mode.
FFloating-Point Arithmetic

Instruction Behavior

FADD.S adds single-precision values in rs1 and rs2; result to rd. R-type using OP-FP opcode. Rounding by rm (static or dynamic from frm). IEEE 754 subnormal arithmetic supported.

Common Usage Scenarios

Floating Point Basic

Understand this scenario with real code like «fadd.s f0, f1, f2 # f0 = f1+f2 (RNE)».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is R-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

floating-point addition is not associative