risc-v

Definition

sra (RISC-V)

Performs an arithmetic right shift on the value in register b by the shift amount held in the lower 5 bits of register c, copying the original sign bit into the vacated upper bits (sign-extending), and stores the result in register a.

sra a, b, c

Equivalent C code:

a = b >> (c & 0x1F) // assuming b is a signed integer