Zcb instructions
Simple code-size saving instructions
Zcb has simple code-size saving instructions which are easy to implement on all CPUs. All proposed encodings are currently reserved for all architectures, and have no conflicts with any existing extensions.
The Zcb extension depends on the Zca extension.
As shown on the individual instruction pages, many of the instructions in Zcb depend upon another extension being implemented. For example, c.mul is only implemented if M or Zmmul is implemented, and c.sext.b is only implemented if Zbb is implemented.
Extension description from riscv-unified-db, reformatted.
Specification chapter: The RISC-V Instruction Set Manual, src/unpriv/zcb.adoc.
Instructions (13)
| Mnemonic | Name (riscv-unified-db) | XLEN |
|---|---|---|
c.lbu | Load unsigned byte, 16-bit encoding | RV32 and RV64 |
c.lh | Load signed halfword, 16-bit encoding | RV32 and RV64 |
c.lhu | Load unsigned halfword, 16-bit encoding | RV32 and RV64 |
c.mul | Multiply, 16-bit encoding | RV32 and RV64 |
c.not | Bitwise not, 16-bit encoding | RV32 and RV64 |
c.sb | Store unsigned byte, 16-bit encoding | RV32 and RV64 |
c.sext.b | Sign-extend byte, 16-bit encoding | RV32 and RV64 |
c.sext.h | Sign-extend halfword, 16-bit encoding | RV32 and RV64 |
c.sext.w | (pseudo-op) | RV64 only |
c.sh | Store unsigned halfword, 16-bit encoding | RV32 and RV64 |
c.zext.b | Zero-extend byte, 16-bit encoding | RV32 and RV64 |
c.zext.h | Zero-extend halfword, 16-bit encoding | RV32 and RV64 |
c.zext.w | Zero-extend word, 16-bit encoding | RV64 only |