c.srai

Shift right arithmetical immediate

This instruction is defined by:

Encoding

svg

Synopsis

Arithmetic shift (the original sign bit is copied into the vacated upper bits) the value in rd right by shamt, and store the result in rd. The rd register index should be used as rd+8 (registers x8-x15). C.SRAI expands into srai rd, rd, shamt.

Access

M

HS

U

VS

VU

Always

Always

Always

Always

Always

Decode Variables

Bits<6> shamt = {$encoding[12], $encoding[6:2]};
Bits<3> rd = $encoding[9:7];

Execution

  • Pruned, XLEN == 64

  • Original

X[rd + 8] = X[rd + 8] >>> shamt;
X[rd + 8] = X[rd + 8] >>> shamt;