slli
Shift left logical immediate
- Extension
- RV32I/RV64I base integer
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
slli xd, xs1, shamt- Length
- 32-bit
Encoding
RV64 form
| 3126 | 2520 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 000000 | shamt | rs1 | 001 | rd | 00100 | 11 | |||||||||||||||||||||||||
Match 0x00001013, mask 0xfc00707f. Source: slli rd rs1 31..26=0 shamtd 14..12=1 6..2=0x04 1..0=3 in riscv-opcodes/extensions/rv64_i.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| shamt | 25:20 | shamtd |
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
RV32 form; listed in riscv-opcodes as a pseudo-op of slli
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0000000 | shamt | rs1 | 001 | rd | 00100 | 11 | |||||||||||||||||||||||||
Match 0x00001013, mask 0xfe00707f. Source: $pseudo_op rv64_i::slli slli rd rs1 shamtw 31..25=0 14..12=1 6..2=0x04 1..0=3 in riscv-opcodes/extensions/rv32_i.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| shamt | 24:20 | shamtw |
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
Description
Shift the value in xs1 left by shamt, and store the result in xd
Description from riscv-unified-db, reformatted.
Operation
# shamt is between 0-(XLEN-1) X[xd] = X[xs1] << shamt;
Pseudocode in riscv-unified-db’s IDL, quoted unchanged.