Check vl first
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
Floating-point fused multiply-add/subtract: vd[i] = +(f[rs1] * vd[i]) - vs2[i].
VFMSUB.VF follows the official RVV FMA formula: vd[i] = +(f[rs1] * vd[i]) - vs2[i]. The multiply and add/subtract are fused with one rounding and no intermediate rounded product; the old vd value is also a multiplicand, and vs2 is the subtrahend. Vector FP32/FP64 operation requires the corresponding scalar F/D support; FP16 is controlled by the relevant vector half-precision extensions, and the base V extension does not automatically include half-precision arithmetic.
Decode the OP-V encoding and execute fused multiply-subtract lane by lane: each active lane multiplies f[rs1] and old vd[i], then subtracts vs2[i] with one rounding.
lane 0: fma(1.5, 0.5, -1) -> -0.25
This lane follows the current-step highlight; the remaining lane results appear below.
V-extension FP instructions use the OP-V major opcode, with funct6, source registers, vm, funct3, vd, and opcode fields.
The key facts for VFMSUB.VF are the official FMA formula vd[i] = +(f[rs1] * vd[i]) - vs2[i] and single-rounding semantics.
When reading VFMSUB.VF, do not stop at the mnemonic. Official V-extension semantics also depend on the current vl, vtype, and mask state. .vf: one vector source and one floating-point scalar source participate.
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
The current vtype supplies SEW, LMUL, tail policy, and mask policy; these affect element width, register-group size, and inactive/tail destination elements.
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.
Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vfmsub.vf v1, ft0, v2 # vd[i] = +(f[rs1] * vd[i]) - vs2[i]».
No. FP arithmetic and conversions use frm or an instruction-specified fixed rounding mode; vxrm is for fixed-point rounding instructions.