VMADC.VI

RISC-V VMADC.VI Instruction Details

Instruction ManualI-type

Compute element-wise add carry-out and write the Boolean result to mask destination vd.

Instruction Syntax

vmadc.vi vd, vs2, imm
Operand Breakdown
Destination rd: general-purpose register receiving the result.
Source rs1: register holding the first operand.
Immediate imm: 12-bit signed value, sign-extended before operation with rs1.
VVector IntegerCarry/Borrow

Instruction Behavior

VMADC.VI is a RISC-V V vector add carry-out instruction. It does not write the integer sum or difference; it writes each element's carry-out as a destination mask bit. 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.

Quick Understanding & Search Notes

VMADC.VI generates a carry mask; in m forms, v0 is the carry/borrow input, not an ordinary execution mask.

Destination vd holds a one-bit mask result, one bit per element.
Forms without the m suffix do not read v0 as carry/borrow input.
Pair with VADC/VSBC for multiword add/subtract.

Common Usage Scenarios

Multi-Precision Add

Understand this scenario with real code like «vmadc.vi v1, v2, 1».

BigInt

Understand this scenario with real code like «vmadc.vi v1, v2, 1».

Carry Propagation

Understand this scenario with real code like «vmadc.vi v1, v2, 1».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is I-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

Carry stored as single mask bit, not full SEW data register
No carry-in in the non-m form; use vmadc.vim/vvm/vxm for carry-in.
Destination must be mask register; mask tail always agnostic

FAQ

Does VMADC.VI write the add/subtract result?

No. It writes only carry or borrow mask bits; data results come from instructions such as VADC/VSBC.