Is it always equivalent to a same-named 32-bit instruction?
Not always. Some C/Zc instructions compress common 32-bit operations, while others have dedicated stack-frame or table-jump semantics.
Load non-zero 6-bit imm to rd[17:12]; clear lower 12 bits; sign-extend. CI format.
C.LUI (CI format) loads non-zero 6-bit immediate into bits 17:12 of rd, clears lower 12 bits, sign-extends bit 17. Expands to lui rd,imm. rd≠{x0,x2} and imm≠0. HINT when rd=x0. C.ADDI16SP when rd=x2.
C.LUI is the 16-bit encoding form for compressed load upper immediate; its semantics and encodable register/immediate ranges must be read from the official C extension rules.
Understand this scenario with real code like «c.lui x10, 1 # x10 = 0x00001000».
Not always. Some C/Zc instructions compress common 32-bit operations, while others have dedicated stack-frame or table-jump semantics.
Many 16-bit encodings can represent only a compressed register subset or fixed registers such as sp, ra, a0/a1.