Home/Instructions/VFWADD-WV
VFWADD.WV

RISC-V VFWADD.WV Instruction Details

Instruction ManualOPFVV

Add 2*SEW float elements of vs2 with widened vs1 (SEW) elements, writing 2*SEW result to vd.

Instruction Syntax

vfwadd.wv vd, vs2, vs1, vm
Operand Breakdown
vd: destination vector register group.
vs2/vs1 or scalar source: selected by suffixes such as .vv, .vx, .vi, or .vf.
vm: when present, vm=0 uses v0 as the execution mask and vm=1 is unmasked.
VVector OperationsFloating-Point

Instruction Behavior

VFWADD.WV performs widening floating-point addition. One source operand is already 2*SEW wide and the other is widened before addition. Vector FP32/FP64 operation requires the corresponding scalar F/D support; FP16 is controlled by the relevant vector half-precision extensions; do not assume the base V extension includes half-precision arithmetic.

VFWADD.WV Decode And Execute Animation

Decode the OP-V encoding and execute lane-wise widening FP addition: vs2 is already 2*SEW=64 wide, while vs1[i] is exactly widened from SEW=32 before writing the 2*SEW=64 result.

Instruction input
vfwadd.wv
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
dest EEW64destination element width
vs2 EEW64wide left operand element width
vta/vmata, matail/inactive policy
opcode1010111OP-V major opcode
Encoding fields
0xd0861257
31..26
25
24..20
19..15
14..12
11..7
6..0
110100
funct6
0
vm
01000
vs2
01100
vs1
001
funct3
00100
vd
1010111
OP-V
Execution data path

lane 0: 1 + 0.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 + 0.5
1.5
i=1active
1.5 + 1
2.5
i=2skip
v0.t=0, not executed
--
i=3active
2.5 + 2
4.5
i=4active
-3 + 2.5
-0.5
i=5active
3.5 + 3
6.5
i=6skip
v0.t=0, not executed
--
i=7active
4.5 + 4
8.5
In the fixed VLEN=4096, LMUL=m1, vstart=0 teaching context, vs2 is read as 2*SEW=64 / binary64; vs1[i] or f[rs1] is read as SEW=32 / binary32 and widened exactly to binary64. addition executes in binary64 and writes a 2*SEW=64 result. This animation uses RNE as a checkable demo mode; NaNs, infinities, and exception flags remain governed by the official RVV FP rules.

Quick Understanding & Search Notes

VFWADD.WV keeps the add result at wider precision, unlike single-width VFADD.

Widening forms change destination element width and register-group usage, so LMUL/EMUL must be checked.
The operation applies only to active elements within vl; inactive and tail elements follow the current vma/vta policy.
Except for dedicated mask forms, vm=0 uses v0 as the execution mask and vm=1 is unmasked.
Floating-point operations follow the vector FP rules: normal FP operations use frm rounding and set FP exception flags; fixed-point vxrm does not control them.

Vector Execution Context

When reading VFWADD.WV, do not stop at the mnemonic. Official V-extension semantics also depend on the current vl, vtype, and mask state. The suffix and operand form determine whether sources are vector, scalar, or immediate values.

Check vl first

The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.

Then check vtype

The current vtype supplies SEW, LMUL, tail policy, and mask policy; these affect element width, register-group size, and inactive/tail destination elements.

Then check vm/v0

For ordinary vector instructions with vm, vm=0 uses v0 as the execution mask and vm=1 is unmasked. A few forms such as VMERGE use v0 as data-selection input.

Official source: RISC-V V Standard Extension for Vector Operations

Common Usage Scenarios

High-Precision Accum

Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vfwadd.wv v2, v4, v8 # wide+widened(narrow)».

Mixed Precision

Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vfwadd.wv v2, v4, v8 # wide+widened(narrow)».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is OPFVV.
  • 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

vs2 is wide (2*SEW), vs1 is narrow (SEW). Note EMUL differences from EEW mismatch.
Vector FP32/FP64 operations require matching scalar F/D support; FP16 operation is not implied by V alone.

FAQ

Do these floating-point instructions use vxrm?

No. Ordinary RVV floating-point operations and FP conversions use floating-point frm or an instruction-specified fixed rounding mode; vxrm is for fixed-point rounding instructions.