VFMUL.VF

RISC-V VFMUL.VF Instruction Details

Instruction ManualV-type

VFMUL.VF computes vd[i] = vs2[i] * f[rs1] on active elements.

Instruction Syntax

vfmul.vf vd, vs2, rs1, vm
Operand Breakdown
Binary assembly order is vd, vs2, rs1, vm. There is no implicit old-vd multiplicand; same-width source/destination overlap is legal.
rs1 selects FP f0–f31 or an ABI name. FLEN>SEW checks NaN-boxing and supplies canonical NaN for an invalid box; FLEN<SEW is reserved.
Only active elements with vstart≤i<vl and (vm=1 or v0[i]=1) compute; prestart is unchanged. At vl=0 or vstart≥vl all destination elements, including tails, remain unchanged. Otherwise inactive/tail values follow vma/vta; successful execution resets vstart=0.
Assembly vm is optional v0.t; omission means vm=1. Masked vd cannot overlap v0; v0 cannot supply both an EEW=1 mask and SEW data.
Require valid vtype, supported FP widths and matching scalar FP extensions, and enabled VS/FS; with H and virtualization V=1, vsstatus.VS/FS must also be enabled. Invalid frm use is reserved even at vl=0; vxrm is not used. Only active-element exceptions accrue in fflags.
V supports FP32/FP64 and depends on F/D; FP16 arithmetic requires Zvfh. The animation fixes VLEN=4096, m1, vstart=0, valid NaN-boxing and finite RNE paths, without full fflags.
VVector Multiply

Instruction Behavior

VFMUL.VF is an RVV single-width floating-point multiplication instruction with syntax vfmul.vf vd, vs2, rs1, vm. Each active element uses the current SEW FP format to execute vd[i] = vs2[i] * f[rs1]; this is ordinary lane-wise multiplication with no implicit old-vd multiplicand; if vd overlaps vs2, that source still reads its old value. With vm=0, v0.t controls active elements; with vm=1, execution is unmasked. Rounding mode and exception flags follow the official RVV floating-point rules, and fixed-point vxrm does not control these instructions.

VFMUL.VF Decode And Execute Animation

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

Instruction input
vfmul.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
0x90855257
31..26
25
24..20
19..15
14..12
11..7
6..0
100100
funct6
0
vm
01000
vs2
01010
rs1
101
funct3
00100
vd
1010111
OP-V
Execution data path

lane 0: 1 * 1.5 -> 1.5

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
1.5
i=1active
1.5 * 1.5
2.25
i=2skip
v0.t=0, not executed
--
i=3active
2.5 * 1.5
3.75
i=4active
-3 * 1.5
-4.5
i=5active
3.5 * 1.5
5.25
i=6skip
v0.t=0, not executed
--
i=7active
4.5 * 1.5
6.75
This finite multiplication model represents inputs as the selected binary32/64, then rounds the product under RNE. Scalars are read at FLEN=64, with a valid NaN box assumed for SEW=32. NaNs, infinities, overflow, and fflags are outside this model; these are legal FP conditions handled by 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

VFMUL.VF is best understood through OP-V encoding, the floating-point scalar register f[rs1], v0.t masking, and per-element vd[i] = vs2[i] * f[rs1].

funct6=100100, funct3=101, and opcode=1010111 identify this OP-V FP arithmetic form.
In vfmul.vf vd, vs2, rs1, vm, vm controls execution masking; vm=0 uses v0.t and vm=1 is unmasked.
For `.vf` forms, rs1 names a floating-point register f[rs1], not an integer GPR value.
Results, NaNs, infinities, rounding, and fflags follow the official vector floating-point rules.
Active elements satisfy vstart≤i<vl and (vm=1 or v0[i]=1). Prestart is unchanged; vl=0 or vstart≥vl leaves all destination elements, including tails, unchanged.
Assembly vm is optional v0.t; omission means vm=1. Masked vd cannot overlap v0; v0 cannot supply both EEW=1 mask and SEW data sources.
Require valid vtype, supported FP widths and matching scalar extensions, and enabled VS/FS; with H and virtualization V=1, vsstatus.VS/FS must also be enabled. Invalid frm use is reserved even at vl=0. Only active-element exceptions accrue in fflags.

Vector Execution Context

Binary assembly order is vd, vs2, rs1, vm. There is no implicit old-vd multiplicand; same-width source/destination overlap is legal.

rs1 selects FP f0–f31 or an ABI name. FLEN>SEW checks NaN-boxing and supplies canonical NaN for an invalid box; FLEN<SEW is reserved.

Only active elements with vstart≤i<vl and (vm=1 or v0[i]=1) compute; prestart is unchanged. At vl=0 or vstart≥vl all destination elements, including tails, remain unchanged. Otherwise inactive/tail values follow vma/vta; successful execution resets vstart=0.

Assembly vm is optional v0.t; omission means vm=1. Masked vd cannot overlap v0; v0 cannot supply both an EEW=1 mask and SEW data.

Require valid vtype, supported FP widths and matching scalar FP extensions, and enabled VS/FS; with H and virtualization V=1, vsstatus.VS/FS must also be enabled. Invalid frm use is reserved even at vl=0; vxrm is not used. Only active-element exceptions accrue in fflags.

V supports FP32/FP64 and depends on F/D; FP16 arithmetic requires Zvfh. The animation fixes VLEN=4096, m1, vstart=0, valid NaN-boxing and finite RNE paths, without full fflags.

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

Common Usage Scenarios

Scaling

Assume V/VS/FS enabled, frm=RNE, vstart=0, supported e32,m1, VLMAX≥4 and a0=4; the example is unmasked and VF scalars are validly NaN-boxed at FLEN=64. v2=[2,4,-2,0], ft0=1.5 → v1=[3,6,-3,+0]. Tails follow ta without assumed zeroing.

Gain Adjustment

Assume V/VS/FS enabled, frm=RNE, vstart=0, supported e32,m1, VLMAX≥4 and a0=4; the example is unmasked and VF scalars are validly NaN-boxed at FLEN=64. v2=[2,4,-2,0], ft0=1.5 → v1=[3,6,-3,+0]. Tails follow ta without assumed zeroing.

Pre-Use Checklist

Syntax Check
  • Binary assembly order is vd, vs2, rs1, vm. There is no implicit old-vd multiplicand; same-width source/destination overlap is legal.
  • rs1 selects FP f0–f31 or an ABI name. FLEN>SEW checks NaN-boxing and supplies canonical NaN for an invalid box; FLEN<SEW is reserved.
Semantic Check
  • Only active elements with vstart≤i<vl and (vm=1 or v0[i]=1) compute; prestart is unchanged. At vl=0 or vstart≥vl all destination elements, including tails, remain unchanged. Otherwise inactive/tail values follow vma/vta; successful execution resets vstart=0.
  • Assembly vm is optional v0.t; omission means vm=1. Masked vd cannot overlap v0; v0 cannot supply both an EEW=1 mask and SEW data.
  • Require valid vtype, supported FP widths and matching scalar FP extensions, and enabled VS/FS; with H and virtualization V=1, vsstatus.VS/FS must also be enabled. Invalid frm use is reserved even at vl=0; vxrm is not used. Only active-element exceptions accrue in fflags.
  • V supports FP32/FP64 and depends on F/D; FP16 arithmetic requires Zvfh. The animation fixes VLEN=4096, m1, vstart=0, valid NaN-boxing and finite RNE paths, without full fflags.

Pitfalls / Common Confusions

There is no implicit old-vd multiplicand; when vd overlaps vs2, vs2 still reads its pre-execution source value.
Only elements within VL whose execution mask is true execute; inactive and tail elements follow the current vma/vta policy.
Ordinary RVV FP arithmetic uses the floating-point rounding environment frm / dynamic rounding semantics, not fixed-point vxrm.
Do not treat finite demo values in the browser animation as a full IEEE 754 exception simulator; NaN, infinity, and fflags follow the official manual.

FAQ

Does VFMUL.VF use vxrm?

No. Ordinary RVV FP arithmetic uses the floating-point rounding environment frm or the instruction-defined FP rounding rule; vxrm is for fixed-point rounding instructions.

What does the vm operand mean for VFMUL.VF?

vm=0 uses v0.t as the execution mask; vm=1 is unmasked. It is not an ordinary data source register.