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

c.srai

T1 riscv alu insn
Shift right arithmetical 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

Arithmetic shift (the original sign bit is copied into the vacated upper bits) the value in xd right by shamt, and store the result in xd. The xd register index should be used as xd+8 (registers x8-x15). C.SRAI expands into srai xd, xd, shamt.

Syntax / Encoding

c.srai xd, shamt | 100001xxxxxxxx01 (mask=0xfc03 match=0x8401)

Binary Encodings (2)

WidthFormatBit PatternMask / Match
16RV32100001xxxxxxxx010xfc03 / 0x8401
16RV64100x01xxxxxxxx010xec03 / 0x8401

Operands

NameDescription
shamtbits [6:2], not 0
xdbits [9:7]

Reference Notes

Arithmetic shift (the original sign bit is copied into the vacated upper bits) the value in xd right by shamt, and store the result in xd.
The xd register index should be used as xd+8 (registers x8-x15).
C.SRAI expands into `srai xd, xd, shamt`.