Is VSUB.VX scalar minus vector?
No. VSUB.VX is vs2[i] - x[rs1]. Use VRSUB.VX for scalar minus vector.
VSUB.VX subtracts an integer scalar from active vs2 elements, keeping low SEW bits.
VSUB.VX computes vs2[i] - scalar for active elements, wrapping at SEW width. The rs1 scalar uses low SEW bits when XLEN>SEW and is sign-extended when XLEN<SEW; x0 supplies zero.
Starts from OP-V encoding fields, then shows how VSUB subtracts the second source from vs2, wraps at SEW, and writes vd.
Require V 1.0, enabled vector state and valid supported vtype/SEW. Fix LMUL=m1, vstart=0, VLEN=4096 and VLMAX=4096/16=256. An ordinary masked vd cannot be v0; equal-width source/destination overlap is legal. XLEN>SEW takes low scalar bits; XLEN<SEW sign-extends; x0 supplies zero. When v0 supplies the EEW=1 mask it cannot also supply SEW data. VL=0 updates no destination elements. Only body is shown without definite inactive/tail values. Steps are teaching stages, not processor cycles.
vsub.vx uses OP-V encoding. The animation places fixed fields, register fields, vm, and the rs1 field in one encoding strip.
This animation shows OP-V field decode, active-element reads, SEW-width integer subtraction, mask control, and vd writeback. These are teaching stages; they do not model pipelines, caches, or timing.
VSUB.VX computes vs2[i] - scalar for active elements, wrapping at SEW width. The rs1 scalar uses low SEW bits when XLEN>SEW and is sign-extended when XLEN<SEW; x0 supplies zero.
vd/vs2 are aligned EEW=SEW, EMUL=LMUL groups. Equal-width source/destination overlap is legal; equal sources read equal values. The rs1 scalar takes low SEW bits for XLEN>SEW and sign-extends for XLEN<SEW; x0 supplies zero.
32-bit OP-V: opcode=1010111, funct6=000010, funct3=100; vm at bit25, vs2 at bits24:20, rs1 at bits19:15, vd at bits11:7.
Active vd[i]=(vs2[i] - the converted scalar) mod 2^SEW, without a borrow flag, integer overflow trap, saturation or vxsat change. VRSUB reverses the subtraction direction.
Require RV32/RV64 V 1.0, enabled vector state, vill=0 and supported vtype/SEW. v0.t means vm=0; omission means vm=1. Only mask-enabled vstart<=i<vl elements compute; prestart stays unchanged, inactive/tail follow vma/vta, retaining or all ones; masked vd excludes v0. vstart>=vl (including vl=0) leaves vd unchanged; v0 cannot supply both EEW=1 mask and data. Success resets vstart=0.
Assume enabled V/VS, valid m1,tu,mu, VLEN=4096, vl=4, vstart=0, v0.mask[0..3]=1101; SEW=8, v12=[0,1,255,7], XLEN=64, x5=1. v8[0]=255, v8[1]=0, v8[3]=6. Lane2 and tails keep old values; vxsat stays unchanged. Success resets vstart=0.
Assume enabled V/VS, valid m1,tu,mu, VLEN=4096, vl=4, vstart=0, v0.mask[0..3]=1101; SEW=8, v12=[0,1,255,7], XLEN=64, x5=1. v8[0]=255, v8[1]=0, v8[3]=6. Lane2 and tails keep old values; vxsat stays unchanged. Success resets vstart=0.
No. VSUB.VX is vs2[i] - x[rs1]. Use VRSUB.VX for scalar minus vector.
The VX scalar comes from integer register rs1 and is used for each active element.