VFDIV.VF

RISC-V VFDIV.VF Instruction Details

Instruction ManualV-type

VFDIV.VF is an RVV single-width vector-scalar floating-point divide instruction with syntax vfdiv.vf vd, vs2, rs1, vm; each active element computes vd[i] = vs2[i] / f[rs1].

Instruction Syntax

vfdiv.vf vd, vs2, rs1[, v0.t]
Operand Breakdown
vd and vs2 are SEW-wide vector groups; same-EEW source/destination overlap is allowed. The assembly vm operand is optional v0.t; omitting it means vm=1.
rs1 selects FP register f0–f31 or an ABI alias; with FLEN>SEW, valid NaN-boxing is required or canonical NaN is supplied. Compute vs2[i]/f[rs1].
Require V, enabled VS/FS, and supported vtype. V supports binary32/64; these instructions at SEW=16 require Zvfh. VS/FS=Off raises illegal instruction; with H and virtualization V=1, vsstatus.VS/FS must also be enabled.
Active elements satisfy vstart≤i<vl and (vm=1 or v0[i]=1). Prestart elements are unchanged; inactive/tail elements follow vma/vta. VL=0 or vstart≥vl leaves the entire destination unchanged; successful completion resets vstart=0.
Masked vd cannot overlap v0; v0 cannot supply both an EEW=1 mask and SEW data source. Invalid frm use is reserved even at VL=0 or vstart≥vl; an illegal-instruction exception is not guaranteed. Only active-element exceptions accrue in fflags; fixed-point vxrm is not used.
The FP quotient rounds using dynamic frm. The animation fixes RNE and shows only finite results and non-zero divisors; legal zero divisors, NaNs, infinities, overflow, and fflags are outside this model.
VVector OperationsFloating-Point

Instruction Behavior

VFDIV.VF divides each active vector element by a floating-point scalar within vl. The scalar source is floating-point register f[rs1], not integer x[rs1]; use VFRDIV.VF for f[rs1] / vs2[i]. Rounding mode, NaNs, infinities, divide-by-zero, and exception flags follow the official RVV floating-point rules.

VFDIV.VF Decode And Execute Animation

Decode the OP-V encoding and execute lane-wise FP division with the second source from scalar f[rs1].

Instruction input
vfdiv.vf
Execution context
LMULm1fixed register-group multiplier
VLEN4096fixed vector-register length (bits)
VLMAX128maximum element count at m1
vstart0prestart elements are outside this animation
frmRNEfinite teaching context fixed at RNE; the architectural instruction uses dynamic frm
FP stateFS enabledFS=Off raises illegal instruction; this animation fixes the architectural state to FS enabled
vta/vmata, matail/inactive policy
opcode1010111OP-V major opcode
Encoding fields
0x80855257
31..26
25
24..20
19..15
14..12
11..7
6..0
100000
funct6
0
vm
01000
vs2
01010
rs1
101
funct3
00100
vd
1010111
OP-V
Execution data path

lane 0: 1 / 1.5 -> 0.6666666865348816

This lane follows the current-step highlight; the remaining lane results appear below.

Step 1 / 15
Read OP-V encoding fields

V-extension FP instructions use the OP-V major opcode, with funct6, source registers, vm, funct3, vd, and opcode fields.

Lane results
Long vectors scroll inside this module without page overflow.
i=0active
1 / 1.5
0.6666666865348816
i=1active
1.5 / 1.5
1
i=2skip
v0.t=0, not executed
--
i=3active
2.5 / 1.5
1.6666666269302368
i=4active
-3 / 1.5
-2
i=5active
3.5 / 1.5
2.3333332538604736
i=6skip
v0.t=0, not executed
--
i=7active
4.5 / 1.5
3
SEW=32 / binary32 finite teaching model represents inputs before rounding the quotient under RNE; VF scalars are read at FLEN=64, with valid NaN-boxing assumed for SEW=32. Only finite results and non-zero divisors are shown; overflow, NaNs, infinities, zero divisors, and fflags are outside this model. These FP conditions do not imply an illegal encoding; the real instruction uses dynamic frm and the official exception rules.

The teaching context fixes VLEN=4096, LMUL=m1, vstart=0, enabled VS/FS, and supported SEW. FP inputs are first represented as binary32/64. VL=0 updates no destination elements; same-width source/destination overlap is allowed. Inactive and tail values follow ma/ta without definite displayed values.

Quick Understanding & Search Notes

VFDIV.VF divides each vs2[i] by the same FP scalar f[rs1]; it is not reverse division and does not read an integer GPR as the scalar source.

In the OP-V encoding, funct6=100000 and funct3=101 select vector-scalar FP division.
The semantic operation is vd[i] = vs2[i] / f[rs1], with the scalar source from the FP register file.
vm=0 uses v0.t to control active elements; vm=1 is unmasked.
Rounding, NaNs, infinities, divide-by-zero, and fflags follow the official RVV FP rules; vxrm is not involved.
For ordinary masked vector instructions, the destination vector register group must not overlap the v0 mask source; the animation rejects vd=v0 when vm=0.

Vector Execution Context

vd and vs2 are SEW-wide vector groups; same-EEW source/destination overlap is allowed. The assembly vm operand is optional v0.t; omitting it means vm=1.

rs1 selects FP register f0–f31 or an ABI alias; with FLEN>SEW, valid NaN-boxing is required or canonical NaN is supplied. Compute vs2[i]/f[rs1].

Require V, enabled VS/FS, and supported vtype. V supports binary32/64; these instructions at SEW=16 require Zvfh. VS/FS=Off raises illegal instruction; with H and virtualization V=1, vsstatus.VS/FS must also be enabled.

Active elements satisfy vstart≤i<vl and (vm=1 or v0[i]=1). Prestart elements are unchanged; inactive/tail elements follow vma/vta. VL=0 or vstart≥vl leaves the entire destination unchanged; successful completion resets vstart=0.

Masked vd cannot overlap v0; v0 cannot supply both an EEW=1 mask and SEW data source. Invalid frm use is reserved even at VL=0 or vstart≥vl; an illegal-instruction exception is not guaranteed. Only active-element exceptions accrue in fflags; fixed-point vxrm is not used.

The FP quotient rounds using dynamic frm. The animation fixes RNE and shows only finite results and non-zero divisors; legal zero divisors, NaNs, infinities, overflow, and fflags are outside this model.

The RISC-V Instruction Set Manual, Volume I: Unprivileged Architecture — Version 20260120, Chapter 31

Common Usage Scenarios

Vector normalization

Assume V/VS/FS enabled, frm=RNE, vstart=0, supported e32,m1, VLMAX≥4 and a0=4. The example is unmasked, so all four body elements execute. Initial values and results: v2=[1,2,-3,4.5], ft0=1.5 → v1=[0.6666666865348816,1.3333333730697632,-2,3]. VF scalars are assumed validly NaN-boxed; tails follow ta without assumed zeroing.

Scalar scaling

Assume V/VS/FS enabled, frm=RNE, vstart=0, supported e32,m1, VLMAX≥4 and a0=4. The example is unmasked, so all four body elements execute. Initial values and results: v2=[1,2,-3,4.5], ft0=1.5 → v1=[0.6666666865348816,1.3333333730697632,-2,3]. VF scalars are assumed validly NaN-boxed; tails follow ta without assumed zeroing.

Numeric computing

Assume V/VS/FS enabled, frm=RNE, vstart=0, supported e32,m1, VLMAX≥4 and a0=4. The example is unmasked, so all four body elements execute. Initial values and results: v2=[1,2,-3,4.5], ft0=1.5 → v1=[0.6666666865348816,1.3333333730697632,-2,3]. VF scalars are assumed validly NaN-boxed; tails follow ta without assumed zeroing.

Pre-Use Checklist

Syntax Check
  • vd and vs2 are SEW-wide vector groups; same-EEW source/destination overlap is allowed. The assembly vm operand is optional v0.t; omitting it means vm=1.
  • rs1 selects FP register f0–f31 or an ABI alias; with FLEN>SEW, valid NaN-boxing is required or canonical NaN is supplied. Compute vs2[i]/f[rs1].
Semantic Check
  • Require V, enabled VS/FS, and supported vtype. V supports binary32/64; these instructions at SEW=16 require Zvfh. VS/FS=Off raises illegal instruction; with H and virtualization V=1, vsstatus.VS/FS must also be enabled.
  • Active elements satisfy vstart≤i<vl and (vm=1 or v0[i]=1). Prestart elements are unchanged; inactive/tail elements follow vma/vta. VL=0 or vstart≥vl leaves the entire destination unchanged; successful completion resets vstart=0.
  • Masked vd cannot overlap v0; v0 cannot supply both an EEW=1 mask and SEW data source. Invalid frm use is reserved even at VL=0 or vstart≥vl; an illegal-instruction exception is not guaranteed. Only active-element exceptions accrue in fflags; fixed-point vxrm is not used.
  • The FP quotient rounds using dynamic frm. The animation fixes RNE and shows only finite results and non-zero divisors; legal zero divisors, NaNs, infinities, overflow, and fflags are outside this model.

Pitfalls / Common Confusions

Operand order is vs2[i] / f[rs1]; reverse division is vfrdiv.vf.
rs1 names floating-point register f[rs1], not integer register x[rs1].
Divide-by-zero, NaNs, infinities, rounding, and fflags follow the official FP rules.
When vm=0 uses v0.t as the execution mask, the ordinary destination vector register group must not overlap the v0 mask register.

FAQ

What does the vm operand control for VFDIV.VF?

With vm=0, only active elements selected by v0.t execute; vm=1 is unmasked. The page formula is vd[i] = vs2[i] / f[rs1].

Do these vector floating-point instructions use vxrm?

No. Ordinary RVV floating-point operations use the floating-point rounding mode frm and set FP exception flags; vxrm is for fixed-point rounding instructions.

How does VFDIV.VF handle NaNs, infinities, divide-by-zero, or invalid inputs?

Divide-by-zero, 0/0, NaN operands, and infinity inputs are handled by the FP rules. Results, rounding, and fflags follow the official RVV floating-point rules; this page does not simplify them into integer-style fixed results.