Why does c.andi have register restrictions?
Many C formats encode registers with shorter fields, so some forms can access only x8..x15 or fixed registers.
Bitwise AND of rd' with sign-extended 6-bit imm. CB format.
rd′ selects x8–x15 and is both the old source and the writeback destination; read the old value before writing.
imm is a signed 6-bit immediate from -32 through 31, sign-extended to XLEN.
RV32C/RV64C: compute x[rd′] AND sext(imm) across XLEN bits and write rd′.
A 16-bit RV32C/RV64C CB instruction: AND x[rd'] with a 6-bit immediate sign-extended to XLEN and write rd'. rd' is x8–x15; imm is -32–31.
Shows only manual-defined 16-bit fields, operands, and ISA-visible results; it does not model a pipeline, cache, timing, or an implementation's memory-fault handling.
Scope: RV32C/RV64C, 16-bit CB encoding.
rd'=000 -> x8; imm[5:0]=110000 -> sext(-16)
A 16-bit RV32C/RV64C CB instruction: AND x[rd'] with a 6-bit immediate sign-extended to XLEN and write rd'. rd' is x8–x15; imm is -32–31.
RV32C/RV64C, old x8=0x1234: c.andi x8, 0xF writes x8=0x4; 0xF is the legal signed 6-bit immediate 15.
Many C formats encode registers with shorter fields, so some forms can access only x8..x15 or fixed registers.
No. It is a 16-bit encoded instruction defined by the C extension.