Which operand is selected when the mask bit is 1?
It selects floating-point scalar f[rs1]; mask bit 0 selects vs2[i].
Merge vs2[i] with f[rs1] under v0: mask 1 selects f[rs1], mask 0 selects vs2[i].
VFMERGE.VFM merges a floating-point scalar with vector elements. For each body element from vstart through vl-1, v0.mask[i]=1 selects f[rs1] for vd[i], while v0.mask[i]=0 selects vs2[i]; v0 is the selection mask rather than a normal execution mask.
Decode OP-V and merge every body element: fixed vm=0 makes each v0 bit select f[rs1] or vs2[i], without masking execution.
lane 0: v0[i]=1: 1.5 -> 0x3fc00000 (1.5)
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.
This teaching context fixes VS/FS enabled, valid vtype, frm=RNE, and FLEN=64; a SEW=32 scalar input represents the low 32 bits of a valid NaN box. Equal sources require equal bits. Same-width destination/source overlap is legal; ta/ma gives no definite inactive or tail value. At VL=0 no destination elements, including tails, are updated.
VFMERGE.VFM is conditional selection, not arithmetic. The common mistake is reversing the selection direction: mask bit 1 selects the FP scalar, and mask bit 0 selects the vs2 element.
vd and vs2 are SEW-wide vector groups; same-EEW destination/source overlap is legal and equal sources read equal initial values. There is no immediate operand.
rs1 selects FP f0–f31 or an ABI name; when FLEN>SEW an invalid NaN box is read as canonical NaN.
v0 is a required selection source with fixed vm=0: v0[i]=1 selects f[rs1], 0 selects vs2[i], and all body elements are written.
Require V, supported vtype and FP widths, and enabled VS/FS; V supports FP32/FP64 and depends on F/D. With H and virtualization V=1, vsstatus.VS/FS must also be enabled. Invalid frm use is reserved even if no rounding occurs or vl=0.
Prestart is unchanged; vl=0 or vstart≥vl leaves every destination element, including tails, unchanged. Otherwise inactive/tail elements follow vma/vta, with no guaranteed zeroing or preservation.
With vm=0, vd cannot overlap v0; v0 cannot supply both an EEW=1 selection/mask source and SEW data. Successful execution resets vstart to zero.
Assume V/VS/FS enabled, valid frm, supported e32,m1, VLMAX≥4, x10=4, vstart=0, and v2=[1,-2,3,+0]; scalars are validly NaN-boxed. v0=[1,0,1,0], f0=1.5 → v1=[1.5,-2,1.5,+0]. Min/max examples omit v0.t, so all four body elements execute; merge uses v0 only for selection. Tails follow ta without assumed zeroing.
Assume V/VS/FS enabled, valid frm, supported e32,m1, VLMAX≥4, x10=4, vstart=0, and v2=[1,-2,3,+0]; scalars are validly NaN-boxed. v0=[1,0,1,0], f0=1.5 → v1=[1.5,-2,1.5,+0]. Min/max examples omit v0.t, so all four body elements execute; merge uses v0 only for selection. Tails follow ta without assumed zeroing.
It selects floating-point scalar f[rs1]; mask bit 0 selects vs2[i].