Check vl first
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
Subtract narrow vector vs1 from wide vector vs2 and write the 2*SEW result to vd.
VFWSUB.WV is a RISC-V V widening floating-point subtract instruction. The left operand vs2 is already 2*SEW wide, and the right operand is widened as needed before subtraction. The result is written to 2*SEW vd elements, with floating-point rounding, exception flags, and NaN handling following RVV FP rules.
VFWSUB.WV subtracts vs1 from vs2; it is not a reversed subtract.
When reading VFWSUB.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.
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.
e.g., sub t0, a0, a1 — compute the difference a0 - a1.
It writes 2*SEW floating-point results, so destination register-group use is based on the widened result.
With vm=0, v0 selects active elements; with vm=1, all body elements participate. Inactive and tail elements follow the current policies.