Webcentive RISC-V Reference

c.slli

Shift left logical immediate

Extension
C
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
c.slli xd, shamt
Length
16-bit (compressed)

Encoding

RV64 form

1513121176210
000nzuimm[5]rd/rs≠0nzuimm[4:0]10

Match 0x0002, mask 0xe003. Source: c.slli rd_rs1_n0 c_nzuimm6hi c_nzuimm6lo 1..0=2 15..13=0 in riscv-opcodes/extensions/rv64_c.

FieldBitsriscv-opcodes name
nzuimm[5]12c_nzuimm6hi
rd/rs≠011:7rd_rs1_n0
nzuimm[4:0]6:2c_nzuimm6lo

RV32 form; listed in riscv-opcodes as a pseudo-op of c.slli

15121176210
0000rd/rs≠0nzuimm[4:0]10

Match 0x0002, mask 0xf003. Source: $pseudo_op rv64_c::c.slli c.slli rd_rs1_n0 c_nzuimm6lo 1..0=2 15..12=0 in riscv-opcodes/extensions/rv32_c.

FieldBitsriscv-opcodes name
rd/rs≠011:7rd_rs1_n0
nzuimm[4:0]6:2c_nzuimm6lo

Description

Shift the value in xd left by shamt, and store the result back in xd. C.SLLI expands into slli xd, xd, shamt.

Description from riscv-unified-db, reformatted.

Operation

# shamt is between 0-63
X[xd] = X[xd] << shamt;

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages