Home/Instructions/VFNCVT-X-F-W
VFNCVT.X.F.W

RISC-V VFNCVT.X.F.W Instruction Details

Instruction ManualR-type

Narrow wide float to signed int, rounding from frm.

Instruction Syntax

vfncvt.x.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.
VVector Type ConvertFloating-Point

Instruction Behavior

VFNCVT.X.F.W performs RVV narrowing floating-point/integer conversion. Conversions that require rounding use frm. The source is 2*SEW wide and the result is SEW wide. 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.

Quick Understanding & Search Notes

VFNCVT.X.F.W converts element types; first check whether the form is single-width, widening, or narrowing, then check where rounding comes from.

FP conversions without a fixed-rounding suffix round according to frm.
Narrowing conversion reduces element width, often after wider computation.
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.

Common Usage Scenarios

Precision Reduction

Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vfncvt.x.f.w v1, v2».

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

Dynamic frm rounding vs rtz fixed truncation — key difference.
Src EEW=2×SEW; mind register group sizes.

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.