C.LUI 指令(RISC-V 的压缩子集)的操作数是什么?

What are the operands of C.LUI instruction(compressed subset of RISC-V)?

在 RISC-V manmanual for this instructions 中写道:

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

由此我得出立即数应该是6位的结论,但后来我正在编译一些东西,这一行可以编译但是立即数超过6位宽,所以我很困惑 c.lui x14,0xffff8

c.lui 将接受任何 20 位立即数,只要所有位 5 到 19 具有相同的值(1 或 0)。
所以基本上 c.lui 将接受 0xfffe0 和 0xfffff 之间的任何值以及 1 和 0x1f 之间的任何值。 0x0 也不被接受(参见 https://riscv.org//wp-content/uploads/2017/05/riscv-spec-v2.2.pdf

以你为例
c.lui a4, 0xffff8 将给出指令 0x7761 从该指令中提取的立即数是 0x38,如果将其移动 12,您将得到 0x38000,之后当您对其进行签名扩展时,您将得到:0xffff8000