Home/Instructions/VFNCVTBF16-F-F-W
VFNCVTBF16.F.F.W

RISC-V VFNCVTBF16.F.F.W Instruction Details

Instruction ManualR-type

Narrow FP32 to BF16, rounded by rm/frm.

Instruction Syntax

vfncvtbf16.f.f.w vd, vs2, vm
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
ZvfbfminVector Operations

Instruction Behavior

VFNCVTBF16.F.F.W narrows 2*SEW-width fp32 elements to SEW-width BFloat16 using frm rounding. Each output BF16 has only 1 sign + 8 exponent + 7 mantissa bits — far less precision than source fp32. Zvfbfmin extension.

Quick Understanding & Search Notes

VFNCVTBF16.F.F.W belongs to the RISC-V BF16 extensions; BF16 is a 16-bit FP format with 1 sign bit, 8 exponent bits, and 7 fraction bits.

Narrowing to BF16 rounds and may set OF/UF/NX/NV.
BF16 scalar inputs/results follow RISC-V NaN-boxing rules.

Common Usage Scenarios

Vector Operations

Understand this scenario with real code like «vfncvtbf16.f.f.w v4, v8 # v4[bf16] = bf16(v8[fp32])».

Machine Learning

Understand this scenario with real code like «vfncvtbf16.f.f.w v4, v8 # v4[bf16] = bf16(v8[fp32])».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is R-type.
  • 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.
BF16 output has very low precision (7 mantissa bits) — unsuitable for exact computation
Source is 2*SEW wide (vs2), destination is SEW wide (vd)
Requires Zvfbfmin extension
The narrowing conversion rounds according to the rounding mode; it is not just truncating the upper 16 bits.

FAQ

Does VFNCVTBF16.F.F.W imply BF16 add/sub/mul/div support?

No. Zfbfmin/Zvfbfmin mainly provide BF16/FP32 conversion; Zvfbfwma provides widening multiply-accumulate.

What is the SEW restriction for VFNCVTBF16.F.F.W?

Vector BF16 instructions require SEW=16.