Does VMADC.VI write the add/subtract result?
No. VMADC.VI writes only each body element's carry-out destination-mask bit; use the corresponding VADC form when an integer sum is required.
With vm=1, compute each vs2-plus-immediate carry-out and write the Boolean result to mask destination vd.
VMADC.VI is a RISC-V V vector-immediate add carry-out instruction. It is encoded with vm=1 and, for each body element, computes the carry-out of vs2[i] plus the 5-bit sign-extended immediate and writes it as a destination mask bit. It writes no integer sum and reads no v0 carry-in.
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.VI 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.vi uses OP-V encoding. The animation places fixed fields, register fields, vm, and the imm 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.VI generates a carry mask; in m forms, v0 is the carry/borrow input, not an ordinary execution mask.
32-bit OP-V: opcode=1010111, funct6=010001, funct3=011 (OPIVI). vd is a one-bit-per-element mask destination, vs2 a SEW source, and imm is -16..15, sign-extended to SEW.
Fixed vm=1, no v0 carry-in and no v0.t syntax operand; every body element writes the unsigned carry-out of vs2+imm, not the integer sum. vd may be v0 and may overlap vs2 at the same start; mask tails are always agnostic.
Mask bit i is bit i in one vector register, independent of LMUL; carry is 1 exactly when the SEW-width unsigned sum exceeds 2^SEW−1.
Require V 1.0, enabled VS, valid vtype, and supported widths. Prestart stays unchanged; body is vstart≤i<vl. VL=0 or vstart≥vl updates no destination, including tails; normal completion resets vstart=0 and leaves vl unchanged.
The animation fixes LMUL=m1, VLEN=4096, vstart=0 and shows only body mask bits, without claiming zero tails.
Assume RV32/RV64 V; enabled VS, valid vtype, VLEN≥128, and supported widths; vsetvli gives vl=4, vstart=0, ta/ma, unmasked. x10=4; e8,m1; v2=[255,0,254,1]; imm=1 → v1.mask=[1,0,0,0]. Results use source values before writeback. Tails are not guaranteed zero; normal completion resets vstart=0.
Assume RV32/RV64 V; enabled VS, valid vtype, VLEN≥128, and supported widths; vsetvli gives vl=4, vstart=0, ta/ma, unmasked. x10=4; e8,m1; v2=[255,0,254,1]; imm=1 → v1.mask=[1,0,0,0]. Results use source values before writeback. Tails are not guaranteed zero; normal completion resets vstart=0.
Assume RV32/RV64 V; enabled VS, valid vtype, VLEN≥128, and supported widths; vsetvli gives vl=4, vstart=0, ta/ma, unmasked. x10=4; e8,m1; v2=[255,0,254,1]; imm=1 → v1.mask=[1,0,0,0]. Results use source values before writeback. Tails are not guaranteed zero; normal completion resets vstart=0.
No. VMADC.VI writes only each body element's carry-out destination-mask bit; use the corresponding VADC form when an integer sum is required.