FDIV.D

RISC-V FDIV.D Instruction Details

Instruction ManualR-type

Performs double-precision floating-point division: f[rd] = f[rs1] / f[rs2].

Instruction Syntax

fdiv.d 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.
DFloating-Point Arithmetic

Instruction Behavior

FDIV.D uses OP-FP encoding with fmt=D to divide two double-precision floating-point operands, rounds according to rm or dynamic frm, and writes FP register rd. Special-value results, NaN-boxed input checks, and fflags behavior are constrained by the RISC-V D/F-extension FP rules; execution latency is not ISA semantics.

FDIV.D Decode And Execute Animation

Shows the D-extension double-precision OP-FP flow: decode fields, read FP operands, perform FDIV semantics, then write rd.

rd
rs1
rs2
rm
fdiv.d
,
,
,
Execution Context
FLEN=64 / fmt=D (01)
rounding: RNE nearest-even
fflags: example fflags remains 0
31..27
26..25
24..20
19..15
14..12
11..7
6..0
00011
FDIV
01
fmt=D
01100
rs2
01011
rs1
000
rm
01010
rd
1010011
OP-FP
Execution Data Path
instruction
0x1AC58553
opcode
1010011 -> OP-FP
funct5/fmt
00011 + D(01) -> FDIV.D
rm
000 -> RNE nearest-even
rd/rs
fa0(f10) / fa1(f11) / fa2(f12)
read
7.5, 2.5
FP op
7.5 / 2.5 = 3.0
write
fa0(f10) = 3.0; example fflags remains 0
Current Step

Fetch: show the 32-bit OP-FP encoding

The word is split as an R-type OP-FP instruction; double-precision OP-FP instructions use opcode 1010011.

encoding: 0x1AC58553
syntax : fdiv.d fa0(f10), fa1(f11), fa2(f12), rne
result : fa0(f10) = 3.0; example fflags remains 0

The default example 7.5 / 2.5 = 3.0 is exactly representable, so example fflags remains 0.

Double-precision Calculation
rs1
fa1(f11) = 7.5
rs2
fa2(f12) = 2.5
result
7.5 / 2.5 = 3.0

The default example 7.5 / 2.5 = 3.0 is exactly representable, so example fflags remains 0.

This animation shows only D-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.

Quick Understanding & Search Notes

FDIV.D is the D-extension double-precision divide. The encoding uses opcode=OP-FP, funct5=FDIV, fmt=D, and rm; the result is written to an FP register, while special values, NaN-boxing, and exception flags follow the official D/F FP rules.

The syntax operands are rd, rs1, rs2, and rm; source values, FLEN, and fflags are execution context, not assembly operands.
fmt=D denotes 64-bit double precision; the D extension depends on the F-extension floating-point control state.
The animation uses the exact example 7.5 / 2.5 = 3.0, so example fflags remains 0; real inexact or special-value cases may still set fflags.

Common Usage Scenarios

Multiplication & Division

Understand this scenario with real code like «fdiv.d f0, f1, f2 # f0 = f1/f2 (RNE)».

Pre-Use Checklist

Syntax Check
  • 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.
Semantic Check
  • Confirm the floating-point format suffix (.H/.S/.D/.Q) matches the data width.
  • Decide whether software must inspect fflags for NV, DZ, OF, UF, or NX.

Pitfalls / Common Confusions

rm=111 selects dynamic frm rounding; other valid rm values are static rounding modes.
D-extension double-precision operands in wider FLEN are constrained by NaN-boxing rules.
Concrete division latency is implementation-dependent and is not ISA semantics or part of the page animation.

FAQ

Why does the FDIV.D animation not directly show division by zero?

The animation teaches encoding, register read, rounding-field decode, and the ordinary execution path. Zero divisors, 0/0, NaNs, and infinities are covered in static text to avoid oversimplifying special-value rules.

Does FDIV.D raise integer exceptions?

It does not report results through integer condition codes; floating-point exceptions are recorded in fflags and results follow the RISC-V FP rules.