Is it always equivalent to a same-named 32-bit instruction?
Not always. Some C/Zc instructions compress common 32-bit operations, while others have dedicated stack-frame or table-jump semantics.
Arithmetic right shift of rd'. CB format.
C.SRAI (CB format, rd' x8-x15 only) shifts rd' right arithmetically by shamt. Expands to srai rd',rd',shamt. In RV32C, shamt[5] must be 0. HINT when shamt=0.
C.SRAI is the 16-bit encoding form for compressed arithmetic right shift immediate; its semantics and encodable register/immediate ranges must be read from the official C extension rules.
Understand this scenario with real code like «c.srai x8, 2 # x8 >>= 2 (arithmetic)».
Understand this scenario with real code like «c.srai x8, 2 # x8 >>= 2 (arithmetic)».
Not always. Some C/Zc instructions compress common 32-bit operations, while others have dedicated stack-frame or table-jump semantics.
Many 16-bit encodings can represent only a compressed register subset or fixed registers such as sp, ra, a0/a1.