ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 919 microarchs · 15,488 chips · 105 sources
Arch:
Tier:

c.addi

T1 riscv alu insn
Add a sign-extended non-zero immediate
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zca, Zkt-DIT
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZca, Zkt-DIT

Summary

C.ADDI adds the non-zero sign-extended 6-bit immediate to the value in register xd then writes the result to xd. C.ADDI expands into addi xd, xd, imm. C.ADDI is only valid when xd ≠ x0 and imm ≠ 0. The code points with xd=x0 encode the C.NOP instruction; the remaining code points with imm=0 encode HINTs.

Syntax / Encoding

c.addi xd, imm | 000xxxxxxxxxxx01 (mask=0xe003 match=0x0001)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
16RV000xxxxxxxxxxx010xe003 / 0x0001

Operands

NameDescription
immbits [12,6:2], sign-extended, not 0
xdbits [11:7], not 0

Reference Notes

C.ADDI adds the non-zero sign-extended 6-bit immediate to the value in register xd then writes the result to xd.
C.ADDI expands into `addi xd, xd, imm`.
C.ADDI is only valid when xd ≠ x0 and imm ≠ 0.
The code points with xd=x0 encode the C.NOP instruction; the remaining code points with imm=0 encode HINTs.