Does VMADC.VX write the addition result?
No. It writes only carry-out mask bits; an SEW-wide sum comes from a data instruction such as VADC.
Compute element-wise add carry-out and write the Boolean result to mask destination vd.
VMADC.VX is a RISC-V V vector-scalar add carry-out instruction. It does not write the integer sum; it writes the carry-out of vs2[i] + x[rs1] for each element as a destination mask bit. When XLEN is greater than SEW, the scalar uses its low SEW bits; when XLEN is less than SEW, it is sign-extended to SEW. The form without the m suffix has no carry input and no ordinary execution-mask operand. The destination is a mask register, not an ordinary SEW-width integer result.
Starts from OP-V encoding fields, then shows how a non-m VMADC form uses vm=1 for all body elements, reads no carry-in, and writes each carry-out to a destination mask bit.
The teaching model fixes LMUL=m1 and vstart=0 and shows only body elements in the selected VL. It fixes VLEN=4096, VLMAX=4096/16=256, and assumes support for the selected SEW; equal vector sources require equal elements. VMADC mask destinations are always tail-agnostic; tails are not guaranteed to be preserved, while VL=0 updates no destination bits, including tails. With LMUL=m1, vd may equal a SEW data source; with carry-in, v0 cannot also be a SEW data source, but vd may be v0. VMADC.VX fixes vm=1 with no v0 carry-in; when v0 is specified as a SEW data source, its data is still read. Each body element produces one destination-mask bit.
vmadc.vx 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, SEW-width integer carry-out generation, fixed vm=1 with no carry-in, and vd writeback. It does not model pipelines, caches, or timing.
VMADC.VX fixes vm=1 and generates a carry mask from vs2[i] + x[rs1] for every body element; it reads no v0 carry-in, but still reads v0 when specified as a SEW data source.
32-bit OP-V: opcode=1010111, funct6=010001, funct3=100 (OPIVX), vm=1. vd is a single mask destination with one bit per element; vs2 is the SEW data source.
rs1 selects an integer register: use low SEW bits when XLEN>SEW, or sign-extend to SEW when XLEN<SEW. x0 supplies zero.
Fixed vm=1 has no carry-in and no ordinary v0.t execution mask. All body elements execute.
Add both SEW-bit sources as unsigned values; vd.mask[i]=1 iff the sum≥2^SEW, otherwise 0. No SEW-wide sum is written; mask bit i is vd bit i, independent of SEW/LMUL.
Source/destination register-group overlap rules apply: masks have EEW=1; a narrower destination must start at the source group's low end. With carry-in, v0 cannot also be a SEW data source, but the mask destination may be v0. The animation fixes LMUL=m1, so vd may equal a data source.
Require V 1.0, enabled vector state, valid vtype, and support for the selected width. Body is vstart≤i<vl; prestart stays unchanged and mask tails are always agnostic, regardless of vta. VL=0 or vstart≥vl updates no destination bits, including tails. The animation fixes VLEN=4096 and vstart=0 and shows only body bits.
Assume V, valid e8,m1, vl=1, vstart=0 and initialized sources: vs2[0]=255 and the second source is 1. The sum is 256, so destination mask bit 0 is 1. No integer sum is written and tails are not guaranteed to be preserved.
Assume V, valid e8,m1, vl=1, vstart=0 and initialized sources: vs2[0]=255 and the second source is 1. The sum is 256, so destination mask bit 0 is 1. No integer sum is written and tails are not guaranteed to be preserved.
Assume V, valid e8,m1, vl=1, vstart=0 and initialized sources: vs2[0]=255 and the second source is 1. The sum is 256, so destination mask bit 0 is 1. No integer sum is written and tails are not guaranteed to be preserved.
No. It writes only carry-out mask bits; an SEW-wide sum comes from a data instruction such as VADC.