What determines the element count for vwsubu.wx?
Body elements satisfy vstart<=i<vl; with vm=0, v0.mask[i]=1 is also required for activity. SEW/LMUL determine register layout and VLMAX; tail policy does not change the active-element count.
VWSUBU.WX performs unsigned widening subtraction.
Extension condition: RV32/RV64 V 1.0; require enabled vector state, vill=0 and support for the selected SEW and 2*SEW; SEW=64 requires additional 128-bit integer element support.
vwsubu.wx is a V extension unsigned widening subtraction instruction. For active elements, vs2 is read as an unsigned 2*SEW value and x[rs1] is converted to a SEW value by the .vx rule, zero-extended to 2*SEW, and subtracted from vs2 to write a 2*SEW-wide vd result.
Starts from OP-V encoding fields, then shows how VWSUBU subtracts a zero-extended SEW second source from a 2*SEW-wide vs2 value and writes a 2*SEW-wide vd result.
Teaching context: V 1.0, enabled vector state and valid supported vtype; fix LMUL=m1, VLEN=4096, vstart=0, VLMAX=4096/16. Enter nonnegative bit patterns. Require SEW and 2*SEW support; SEW=64 needs additional 128-bit integer elements beyond baseline V guarantees. Read 32-bit vs2 and a SEW-bit second source; zero-extend narrow sources, subtract the second source from vs2 and keep low 32 bits, without saturation, vxrm use or vxsat change. Wide vs2 has EMUL=2 and an even start; equal-width vd/vs2 may overlap. Wide vd has EMUL=2 and an even start; a narrow source may overlap only its highest register, forcing mask- and tail-agnostic behavior. Scalars first follow XLEN/SEW conversion: take low bits if wider, sign-extend if narrower, then zero-extend to 2*SEW; x0 supplies zero. With v0.t, vd and data sources exclude v0. Only body is shown; inactive/tail follow vma/vta without definite displayed values. VL=0 updates nothing; success resets vstart=0. Stages are teaching steps, not processor cycles.
vwsubu.wx uses OP-V encoding. The animation places fixed fields, register fields, vm, and the rs1 field in one encoding strip.
This animation shows only ISA-visible relationships from the official V extension: OP-V field decode, active-element reads, 2*SEW widening integer unsigned widening subtraction, mask control, and vd writeback. It does not model pipelines, caches, or timing.
VWSUBU.WX subtracts a SEW scalar, formed by the .vx rule and zero-extended, from unsigned 2*SEW vs2; vl, vtype, vstart, and optional v0.t masking determine the active elements.
vd has EEW=2*SEW and EMUL=2*LMUL<=8; vs2 is a 2*SEW/2*LMUL wide source, and the second source is rs1 converted to SEW. Wide groups align to their size.
32-bit OP-V: opcode=1010111, funct6=110110, funct3=110 (OPMVX); vm bit25, vs2 bits24:20, rs1 bits19:15, vd bits11:7. Optional v0.t means vm=0; omission means vm=1.
Zero-extend narrow sources to 2*SEW, subtract the second source from vs2 and keep low 2*SEW bits without accumulating old vd. rs1 first takes low bits when XLEN>SEW or sign-extends to SEW when XLEN<SEW, then zero-extends to 2*SEW; x0 supplies zero. No saturation, vxrm use or vxsat change.
Narrow sources overlap wide vd only with EMUL>=1 and equal highest registers, forcing mask/tail-agnostic behavior. Equal-width vd/vs2 may overlap. Masked vd excludes v0, which cannot supply mask and data together. Prestart stays unchanged; inactive/tail follow vma/vta, retaining old values or allowing all ones, without guaranteed zeroing.
RV32/RV64 V 1.0; require enabled vector state, vill=0 and support for the selected SEW and 2*SEW; SEW=64 needs additional 128-bit integer elements. Active elements satisfy vstart<=i<vl with masking enabled; vstart>=vl (including vl=0) updates nothing. Implementations may reject nonzero vstart values they cannot produce; success resets vstart=0. The animation fixes LMUL=m1, VLEN=4096, vstart=0; stages are not processor cycles.
Assume RV32/RV64 V 1.0, enabled vector state, valid supported e16,m1,tu,mu, supported 32-bit results, XLEN=64, VLEN=4096, vl=4, vstart=0, initialized sources, and v0.mask[0..3]=1111. vs2[0]=65536, x5=1 → vd[0]=65535 (0x0000ffff); other active elements follow the same rule and tails retain old values. Success resets vstart=0.
Assume RV32/RV64 V 1.0, enabled vector state, valid supported e16,m1,tu,mu, supported 32-bit results, XLEN=64, VLEN=4096, vl=4, vstart=0, initialized sources, and v0.mask[0..3]=1111. vs2[0]=65536, x5=1 → vd[0]=65535 (0x0000ffff); other active elements follow the same rule and tails retain old values. Success resets vstart=0.
Assume RV32/RV64 V 1.0, enabled vector state, valid supported e16,m1,tu,mu, supported 32-bit results, XLEN=64, VLEN=4096, vl=4, vstart=0, initialized sources, and v0.mask[0..3]=1111. vs2[0]=65536, x5=1 → vd[0]=65535 (0x0000ffff); other active elements follow the same rule and tails retain old values. Success resets vstart=0.
Body elements satisfy vstart<=i<vl; with vm=0, v0.mask[i]=1 is also required for activity. SEW/LMUL determine register layout and VLMAX; tail policy does not change the active-element count.
No. V instructions operate on active elements; register grouping and inactive-element behavior are controlled by vtype and policy bits.