What happens when shamt is zero?
These eight C.SRAI encodings are HINTs designated for custom use, not ordinary arithmetic shifts. A HINT changes no architectural state except PC advance and applicable performance counters.
CB format: arithmetic-right-shift rd' and write it back to rd'.
Extension condition: RV32/RV64 C/Zca; regular shifts use 1–31 on RV32 or 1–63 on RV64. Zero-shift encodings are HINTs.
C.SRAI uses the CB format with rd' limited to x8-x15. It arithmetic-right-shifts rd' by shamt and writes rd', expanding to srai rd', rd', shamt. In RV32C shamt[5] must be zero; the eight shamt=0 encodings are HINTs designated for custom use, not ordinary C.SRAI instructions.
Shows only official 16-bit fields, operands, conditions, and architectural state; it does not model a pipeline, cache, or timing.
RV32/RV64 C/Zca
C.SRAI uses rd' as the same read/write register; arithmetic right shift fills vacated high bits with the original sign bit.
RV32 C/Zca, x8=0xffffff80 (-128): c.srai x8, 2 writes x8=0xffffffe0 (-32), filling high bits with the original sign bit.
These eight C.SRAI encodings are HINTs designated for custom use, not ordinary arithmetic shifts. A HINT changes no architectural state except PC advance and applicable performance counters.
RV32C requires shamt[5]=0 and designates shamt[5]=1 encodings for custom extensions; RV64C uses the full six-bit shamt field.