ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,761 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

c.addiw

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.ADDIW is an RV64C/RV128C-only instruction that performs the same computation as C.ADDI but produces a 32-bit result, then sign-extends result to 64 bits. C.ADDIW expands into addiw xd, xd, imm. The immediate can be zero for C.ADDIW, where this corresponds to sext.w xd. C.ADDIW is only valid when xd ≠ x0; the code points with xd=x0 are reserved.

Syntax / Encoding

c.addiw xd, imm | 001xxxxxxxxxxx01 (mask=0xe003 match=0x2001)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
16RV001xxxxxxxxxxx010xe003 / 0x2001

Operands

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

Reference Notes

C.ADDIW is an RV64C/RV128C-only instruction that performs the same computation as C.ADDI but produces a 32-bit result, then sign-extends result to 64 bits.
C.ADDIW expands into `addiw xd, xd, imm`.
The immediate can be zero for C.ADDIW, where this corresponds to `sext.w xd`.
C.ADDIW is only valid when xd ≠ x0; the code points with xd=x0 are reserved.