Does it use integer or floating-point registers?
rd, rs1, and rs2 select FP registers f0–f31. f0 is an ordinary FP register; its writeback is not discarded like integer x0.
Performs single-precision floating-point addition: rd = rs1 + rs2, rounded by the rm field or dynamic frm.
FADD.S adds the single-precision values in rs1 and rs2 and writes the result to rd. This R-type instruction uses the OP-FP opcode with fmt=S(00); rm selects static rounding and rm=111 uses frm. Its applicable exception flags are NV, OF, and NX, accrued in fflags. Subnormals follow IEEE 754-2008 rules; when FLEN is greater than 32, inputs must be valid NaN-boxed single-precision values or are treated as canonical NaN.
Shows the F-extension single-precision OP-FP flow: decode fields, read FP operands, perform FADD semantics, then write rd.
The word is split as an R-type OP-FP instruction; single-precision OP-FP instructions use opcode 1010011.
This animation accepts only finite whitelisted examples whose inputs and result are exactly checkable; this example needs no rounding and sets no FP exception flags. NaN, infinity, overflow, underflow, and inexact paths are covered in static text.
This animation accepts only finite whitelisted examples whose inputs and result are exactly checkable; this example needs no rounding and sets no FP exception flags. NaN, infinity, overflow, underflow, and inexact paths are covered in static text.
Assumes the extension is available, FS enabled, correctly NaN-boxed inputs, and initial fflags=0. Only nonzero finite exact whitelisted inputs and nonzero whitelisted results are accepted; zero and rounding/exception boundaries are outside this animation. One source register must have one initial value; rd may overlap a source, and f0 accepts writeback. Steps are teaching views.
This animation shows only F-extension ISA-visible OP-FP encoding, example numeric results, and fflags relationship; it does not model FPU pipelines, latency, every IEEE 754 corner case, or microarchitecture.
FADD.S is an OP-FP arithmetic instruction from the RISC-V F extension. It reads two single-precision FP registers, rounds by rm/frm, writes the result to FP register rd, and records FP exceptions in fflags.
Understand this scenario with real code like «fadd.s f0, f1, f2, rne # f0 = f1 + f2».
Understand this scenario with real code like «fadd.s f0, f1, f2, rne # f0 = f1 + f2».
rd, rs1, and rs2 select FP registers f0–f31. f0 is an ordinary FP register; its writeback is not discarded like integer x0.
rm selects the rounding mode, or uses frm for the dyn encoding. For inexact results, the rounding mode affects the written value and may set fflags.
The base ISA does not generate a trap when an FP exception flag is set; software explicitly inspects fflags. An illegal instruction caused by disabled FP state is a separate case.
Omitting rm in assembly defaults to dyn and uses frm; explicit rne selects static nearest-even rounding. Behavior for static rm=101/110 or dynamic frm=101/110/111 is reserved; a trap is not universally required.
FP exception flags accrue in fflags; the base ISA does not trap on setting them. The animation assumes the extension is available, FP state is enabled, inputs are correctly NaN-boxed, and initial fflags=0. It accepts only nonzero finite exact whitelisted inputs and nonzero whitelisted results, excluding zero, NaN, infinity, overflow, underflow, and inexact paths. With wider FLEN, result upper bits are all 1s for valid NaN-boxing.