Is VSEXT.VF2 zero extension?
No. VSEXT performs sign extension; zero extension uses VZEXT.VF2/VF4/VF8.
VSEXT.VF2 sign-extends EEW=SEW/2 source elements into SEW-wide destination elements.
vsext.vf2 is a RISC-V V-extension vector integer sign-extension instruction. Syntax is `vsext.vf2 vd, vs2, vm`: active vs2 elements are read at EEW=SEW/2 and written as SEW-wide vd elements. Source EMUL is (EEW/SEW)*LMUL; the encoding is reserved when source EEW is unsupported or source EMUL is below the minimum legal LMUL.
Official V-extension integer zero/sign extension from EEW to SEW.
The strip shows opcode, funct6, the VXUNARY0 selector, register fields, and vm.
Based on The RISC-V Instruction Set Manual, Volume I: Unprivileged Architecture. The teaching context assumes enabled V/vector state, valid vtype, and that the selected SEW/EEW values are supported by the implementation and fixes VLEN=4096, LMUL=m1, and vstart=0; VLMAX=4096/SEW, so the animation's maximum VL of 64 does not exceed VLMAX. The encoding is reserved when source EEW is unsupported or source EMUL is below the minimum legal LMUL; this animation assumes supported SEW/EEW and fractional LMUL for every offered choice. Steps explain the ISA, not hardware cycles.
vsext.vf2 processes only active elements within vl: it sign-extends EEW=SEW/2 vs2 elements into SEW-wide vd elements; optional v0.t permits only mask-selected body elements to execute.
vd is the SEW/LMUL destination group; the sole data source vs2 has EEW=SEW/2 and EMUL=LMUL/2. Active elements copy the source sign bit into new upper bits; this is unary arithmetic without memory access.
32-bit OP-V: funct6=010010, funct3=010, opcode=1010111; vs1 is the fixed VXUNARY0 selector 00111, not a second source. vd/vs2 name v0–v31 group starts.
Source EEW must be supported and source EMUL must not be below the minimum legal LMUL; otherwise the encoding is reserved. A wider destination can overlap only a source with EMUL≥1 located in the highest-numbered part of its group. Legal overlap at different EEWs forces mask/tail agnostic regardless of vma/vta. This m1 demo has source EMUL<1, so overlap is prohibited.
vm denotes optional v0.t; omission means vm=1. Masked vd cannot contain v0; v0 cannot supply both an EEW=1 mask and data at another EEW. Active body is vstart≤i<vl with mask enabled; prestart is unchanged, and without overlap inactive/tail follow vma/vta without guaranteed zeroing.
Require V 1.0, enabled vector state and valid supported vtype. vstart≥vl (including vl=0) updates no destination elements; successful completion resets vstart=0. An implementation may reject nonzero vstart values it cannot produce.
Assume RV32/RV64 V, enabled vector state, valid e16,m1, VLEN≥64, vl=4, vstart=0, supported widths and source EMUL=1/2. v12 holds 8-bit sources [0x01,0x83,0x07,0x7F] and v0.mask=[1,1,0,1]: active v8[0]=1, v8[1]=0xFF83 (−125), v8[3]=127; lane2 follows vma and tails follow vta, without guaranteed zeroing. Success resets vstart=0.
Assume RV32/RV64 V, enabled vector state, valid e16,m1, VLEN≥64, vl=4, vstart=0, supported widths and source EMUL=1/2. v12 holds 8-bit sources [0x01,0x83,0x07,0x7F] and v0.mask=[1,1,0,1]: active v8[0]=1, v8[1]=0xFF83 (−125), v8[3]=127; lane2 follows vma and tails follow vta, without guaranteed zeroing. Success resets vstart=0.
Assume RV32/RV64 V, enabled vector state, valid e16,m1, VLEN≥64, vl=4, vstart=0, supported widths and source EMUL=1/2. v12 holds 8-bit sources [0x01,0x83,0x07,0x7F] and v0.mask=[1,1,0,1]: active v8[0]=1, v8[1]=0xFF83 (−125), v8[3]=127; lane2 follows vma and tails follow vta, without guaranteed zeroing. Success resets vstart=0.
No. VSEXT performs sign extension; zero extension uses VZEXT.VF2/VF4/VF8.