lui
Load upper immediate
- Extension
- RV32I/RV64I base integer
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
lui xd, imm- Length
- 32-bit
Encoding
| 3112 | 117 | 62 | 10 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| imm[31:12] | rd | 01101 | 11 | ||||||||||||||||||||||||||||
Match 0x00000037, mask 0x0000007f. Source: lui rd imm20 6..2=0x0D 1..0=3 in riscv-opcodes/extensions/rv_i.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| imm[31:12] | 31:12 | imm20 |
| rd | 11:7 | rd |
Description
Load the zero-extended imm into xd.
Description from riscv-unified-db, reformatted.
Operation
X[xd] = $signed(imm);
Pseudocode in riscv-unified-db’s IDL, quoted unchanged.