c.lui

C.LUI loads the non-zero 6-bit immediate field into bits 17-12 of the destination register, clears the bottom 12 bits, and sign-extends bit 17 into all higher bits of the destination. C.LUI expands into `lui xd, imm`. C.LUI is only valid when xd≠x0 and xd≠x2, and when the immediate is not equal to zero. The code points with imm=0 are reserved; the remaining code points with xd=x0 are HINTs; and the remaining code points with xd=x2 correspond to the C.ADDI16SP instruction

Synopsis

c.lui xd, imm

Encoding

Type:

012671112131501immxdimm011

RISC-V Instruction Encoder/Decoder

open c.lui in rvcodecjs

Availability