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 xd right by shamt, and store the result in xd. The xd register index should be used as xd+8 (registers x8-x15). C.SRAI expands into srai xd, xd, shamt.

Access

M HS U VS VU

Always

Always

Always

Always

Always

Decode Variables

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

Execution

  • Pruned, XLEN == 64

  • Original

X[creg2reg(xd)] = X[creg2reg(xd)] >>> shamt;
X[creg2reg(xd)] = X[creg2reg(xd)] >>> shamt;