In the RISC-V mannual for this instructions is written:
C.LUI loads the non-zero 6-bit immediate field into bits 17–12 of the destination register, clearsthe bottom 12 bits, and sign-extends bit 17 into all higher bits of the destination
And from this I made the conclusion that the immediate should be 6 bits, but then I was compiling something and this line can be compiled but the immediate is more than 6 bits wide, so I am confused
c.lui x14,0xffff8
lui
, then you specify the value you want for the upper bits, not the value you want for the entire register. – Michael