Home/Instructions/VFWMACCBF16-VV
VFWMACCBF16.VV

RISC-V VFWMACCBF16.VV Instruction Details

Instruction ManualOP-V

BF16 vector-vector widening fused multiply-accumulate into FP32 vd.

Instruction Syntax

vfwmaccbf16.vv vd, vs1, vs2, vm
Operand Breakdown
vd is both the FP32 accumulator input and result, EEW=32 and EMUL=2*LMUL; BF16 vector sources have EEW=16 and EMUL=LMUL. Groups align to EMUL; the accumulator cannot share a register read with a BF16 source at a different EEW.
vs1 and vs2 provide same-lane BF16 sources; equal sources read equal initial values.
SEW must be 16. vm denotes optional v0.t; omission is unmasked. Only mask-enabled vstart<=i<vl elements execute; vstart>=vl (including vl=0) updates no destination elements.
ZvfbfwmaVector Operations

Instruction Behavior

VFWMACCBF16.VV, with SEW=16, reads BF16 elements from vs1 and vs2 plus the FP32 accumulator in vd, multiplies the BF16 sources, adds the unrounded product to the corresponding FP32 accumulator, then rounds by frm and writes FP32 vd; it belongs to Zvfbfwma.

VFWMACCBF16.VV Decode And Execute Animation

Decode the OP-V encoding and execute BF16 widening fused multiply-accumulate: each active lane multiplies vs1[i] and vs2[i] as BF16 sources and accumulates into FP32 vd[i].

Instruction input
vfwmaccbf16.vv
Execution context
LMULm1fixed register-group multiplier
VLEN4096fixed vector-register length (bits)
VLMAX256maximum element count at m1
vstart0prestart elements are outside this animation
FP stateFS enabledFS=Off raises illegal instruction; this animation fixes the architectural state to FS enabled
acc EEW32vd accumulator is FP32
vta/vmata, matail/inactive policy
opcode1010111OP-V major opcode
Encoding fields
0xec861257
31..26
25
24..20
19..15
14..12
11..7
6..0
111011
funct6
0
vm
01000
vs2
01100
vs1
001
funct3
00100
vd
1010111
OP-V
Execution data path

lane 0: fma_rne(1.5, 0.5, 0.5) -> 1.25 / 0x3fa00000

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
fma_rne(1.5, 0.5, 0.5)
1.25 / 0x3fa00000
i=1active
fma_rne(-2.25, 1, -1)
-3.25 / 0xc0500000
i=2skip
v0.t=0, not executed
--
i=3active
fma_rne(-6, 2, -2.5)
-14.5 / 0xc1680000
i=4active
fma_rne(8, 2.5, 4)
24 / 0x41c00000
i=5active
fma_rne(-10, 3, -4.5)
-34.5 / 0xc20a0000
i=6skip
v0.t=0, not executed
--
i=7active
fma_rne(-20, 4, -8.5)
-88.5 / 0xc2b10000

The teaching context fixes SEW=16, LMUL=m1, VLEN=4096, VLMAX=256, vstart=0, valid vtype, enabled VS/FS, and ta/ma. BF16 sources occupy single registers; the FP32 accumulator occupies an even vd..vd+1 group. Since the accumulator is also a source, it cannot overlap a BF16 source read at a different EEW. Equal BF16 sources require equal bits. Numeric input is represented as FP32 and then as BF16 under RNE; raw patterns directly provide BF16 bits. The exact product-plus-FP32-addend is rounded once by the selected frm; scalar input assumes valid NaN-boxing. VL=0 updates no destination elements; inactive/tail values are unspecified by this display. NaNs, infinities, and fflags are outside this finite-sample model; exceeding its range does not mean an illegal instruction.

SEW=16, BF16 sources come from vs2 and vs1/rs1, and vd is both the FP32 accumulator input and FP32 result. The animation exactly widens BF16 sources first, then shows the equivalent FP32 fused multiply-accumulate path; exception flags follow the official BF16 rules.

Quick Understanding & Search Notes

This is the BF16 vector-vector widening FMA: the syntax is vd, vs1, vs2, vm; vd is first read as an FP32 accumulator and then written with the FP32 result.

OP-V encoding: funct6=111011, funct3=001 (OPFVV), opcode=1010111; the vs1 field is a real BF16 vector source.
Official reserved encoding: any SEW value other than 16 is reserved.
vs1/vs2 sources have EEW=16 BF16, while vd input and output have EEW=32 FP32.
The official equivalent sequence widens BF16 sources to FP32 and then performs vfmacc.vv; the fused semantics and frm rounding must not be split into ordinary BF16 arithmetic.
Only active elements within vl execute; with vm=0, v0.t controls activity.
FP32 vd is also a read accumulator source; it cannot overlap a BF16 source that reads the same vector register at a different EEW.

Vector Execution Context

SEW=16. Active elements satisfy vstart<=i<vl and mask enablement. vstart>=vl (including vl=0) updates no destination elements; prestart stays unchanged, while inactive/tail follow vma/vta. BF16 sources use EMUL=LMUL and FP32 accumulator/results use EMUL=2*LMUL<=8. Require valid supported vtype, required extensions and enabled vector/FP state; each active element uses one fused rounding by frm.

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

Common Usage Scenarios

Vector Operations

Understand this scenario with real code like «vfwmaccbf16.vv v4, v8, v12 # v4[fp32] += bf16(v8) * bf16(v12)».

Machine Learning

Understand this scenario with real code like «vfwmaccbf16.vv v4, v8, v12 # v4[fp32] += bf16(v8) * bf16(v12)».

Pre-Use Checklist

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

SEW must be 16; other SEW encodings are reserved.
vs1 and vs2 are BF16 sources, while vd is both the FP32 accumulator input and FP32 output.
This is fused multiply-accumulate; do not model it as separate BF16 multiply then BF16 add.
Zvfbfwma depends on Zvfbfmin and Zfbfmin.
Exceptions include Overflow, Underflow, Inexact, and Invalid; the animation only demonstrates finite checkable examples.

FAQ

Do these vector BF16 instructions support any SEW?

No. The official vector BF16 instructions reserve encodings when SEW is not 16; this page animation fixes SEW=16.

Is BF16 the same as IEEE binary16?

No. BF16 has 1 sign bit, 8 exponent bits, and 7 fraction bits; it differs from half-precision binary16 in exponent and fraction widths.

Is VFWMACCBF16 the same as ordinary vfmacc?

Not exactly. The official description gives an equivalent sequence that widens BF16 sources to FP32 and then uses vfmacc, but the source format, SEW=16 restriction, and Zvfbfwma requirement are different.