Does VNSRA.WX round?
No. It is a narrowing right shift; use VNCLIP/VNCLIPU when fixed-point rounding and saturation are required.
Arithmetic narrowing right shift from 2*SEW source elements to SEW results.
VNSRA.WX performs an arithmetic right shift on signed 2*SEW-wide source elements and writes the low SEW bits to destination elements. The shift amount comes from a scalar integer register.
Starts from OP-V encoding fields, then shows how VNSRA reads signed 2*SEW-wide vs2, takes the low lg2(2*SEW) shift-count bits for an arithmetic right shift, and writes the low SEW bits to vd.
Require enabled vector state, valid vtype, and support for source 2*SEW and destination SEW; VL=0 updates no destination elements. Same-start narrow-destination/wide-source overlap is legal and forces mask- and tail-agnostic behavior. Only body elements are shown; no definite inactive or tail values are invented.
The teaching model fixes LMUL=m1, vstart=0, and VLEN=4096, so VLMAX=4096/16=256. Only body elements for selected VL=8 are shown; support for source 2*SEW and destination SEW is assumed. Wide vs2 has EMUL=2 and must start at an even register; .wv vs1 cannot overlap the wide source group. No definite inactive or tail results are shown; legal different-EEW overlap forces agnostic behavior. Steps are teaching stages, not processor cycles.
vnsra.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-to-SEW integer arithmetic narrowing right shift, mask control, and vd writeback. It does not model pipelines, caches, or timing.
VNSRA.WX shrinks wide integer results back to SEW width with an arithmetic right shift.
Syntax: vnsra.wx vd, vs2, rs1[, v0.t]; omit v0.t for vm=1 and include it for vm=0. 32-bit OP-V: opcode=1010111, funct6=101101, funct3=100.
vd is the SEW/LMUL narrow destination; vs2 is the 2*SEW/2*LMUL wide source. Arithmetic-right-shift the signed wide source, then take low SEW bits, without vxrm rounding or vxsat updates. vd may overlap the wide source only at the same lowest register, forcing mask/tail agnostic; .wv vs1 cannot share registers with the wide source.
rs1 is an integer x register: XLEN>SEW takes low SEW bits, XLEN<SEW sign-extends; x0 supplies zero.
Only low lg2(2*SEW) count bits are used; .wi can encode only 0–31 even when 2*SEW permits larger counts. Group starts align to EMUL, with EMUL≤8; the implementation must support both widths.
Require V 1.0, enabled vector state, and valid supported vtype. Masked vd cannot contain v0; v0 cannot supply both the EEW=1 mask and data. Active body satisfies vstart≤i<vl with mask enabled; prestart is unchanged and inactive/tail follow vma/vta. vstart≥vl (including vl=0) updates no destination elements.
Assume enabled V/VS, valid m1, VLEN≥128, supported operand widths, vl=4, vstart=0, v0.mask[0..3]=1111 and initialized sources. SEW=8, v12=[-17,32767,-32768,-1], x5=4 → v8=[254,255,0,255]. Arithmetic-right-shift signed 16-bit sources by 4, then take low 8 bits, without rounding or saturation. Inactive/tail values follow policy without assumed zeroing.
Assume enabled V/VS, valid m1, VLEN≥128, supported operand widths, vl=4, vstart=0, v0.mask[0..3]=1111 and initialized sources. SEW=8, v12=[-17,32767,-32768,-1], x5=4 → v8=[254,255,0,255]. Arithmetic-right-shift signed 16-bit sources by 4, then take low 8 bits, without rounding or saturation. Inactive/tail values follow policy without assumed zeroing.
No. It is a narrowing right shift; use VNCLIP/VNCLIPU when fixed-point rounding and saturation are required.