risc-v Definition srai (RISC-V) Performs an arithmetic right shift on the value in register b by the shift amount specified by the 5-bit immediate shamt, copying the original sign bit into the vacated upper bits (sign-extending), and stores the result in register a. srai a, b, shamt Equivalent C code: a = b >> shamt // assuming b is a signed integer