C.SLLI

RISC-V C.SLLI Instruction Details

Instruction ManualC-type

Logical left shift of rd. CI format.

Instruction Syntax

c.slli rd, uimm
Operand Breakdown
Compressed instructions are 16 bits; registers are often limited to x8–x15.
Immediate fields are narrower. Refer to the full encoding for this compressed instruction.
CCompressed Instruction

Instruction Behavior

C.SLLI uses CI format to logically shift the value in rd left by shamt and write it back to rd; it expands to slli rd, rd, shamt[5:0]. Code points with shamt=0 or rd=x0 are HINTs. In RV32C, shamt[5] must be zero; shamt[5]=1 code points are designated for custom extensions.

C.SLLI Decode & Execute Animation

Shows only RISC-V ISA-visible 16-bit encoding, operands, and state; it does not simulate a pipeline, cache, endianness implementation, or timing.

c.slli,
Execution context
16-bit encoding fields
15..13
funct3
000
12
shamt[5]
0
11..7
rd/rs1
01010
6..2
shamt[4:0]
00010
1..0
op
10
Execution data path
Read
x10 = 0x00000003
Logical left shift
0x00000003 << 2 = 0x0000000C
Writeback
x10 <- 0x0000000C
Architectural result

x10 <- 0x0000000C

Quick Understanding & Search Notes

C.SLLI is a 16-bit CI logical left shift that updates rd in place; shamt=0 or rd=x0 is a HINT rather than ordinary C.SLLI execution.

In RV32C, shamt[5]=1 is designated for custom extensions and cannot be interpreted as standard C.SLLI.
HINT code points should not be presented as ordinary register writeback in a teaching animation.

Common Usage Scenarios

Shift Operations

Understand this scenario with real code like «c.slli x10, 2 # x10 <<= 2».

Pre-Use Checklist

Syntax Check
  • Verify the 16-bit compressed encoding is only available on CPUs supporting the C extension.
  • Confirm rd/rs1'/rs2' fields map to x8–x15.
Semantic Check
  • Note the limited operand space of compressed instructions.
  • Verify this compressed instruction has a corresponding 32-bit expansion.

Pitfalls / Common Confusions

HINT when shamt=0 or rd=x0

FAQ

Is shamt=0 in C.SLLI an illegal instruction?

No; that code point is a HINT, not an ordinary C.SLLI shift writeback.