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'.
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.
C.SRAI uses rd' as the same read/write register; arithmetic right shift fills vacated high bits with the original sign bit.
Understand this scenario with real code like «c.srai x8, 2 # x8 >>= 2 (arithmetic)».
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.