srai
lyszt.net covers srai and other RISC-V instructions in more detail.
Encoding format
Description
Shifts a register's bits to the right by a constant and copies the sign bit into the emptied positions. In srai rd, rs1, shamt, the value moves right by shamt positions. The copies keep negative values negative, and the result matches a division of a signed value by a power of two.
Official definition
Shifts by a constant are encoded as a specialization of the I-type format. The operand to be shifted is in rs1, and the shift amount is encoded in the lower 5 bits of the I-immediate field. The right-shift type is encoded in bit 30. SLLI is a logical left shift (zeros are shifted into the lower bits); SRLI is a logical right shift (zeros are shifted into the upper bits); and SRAI is an arithmetic right shift (the original sign bit is copied into the vacated upper bits).