Webcentive RISC-V Reference

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)

MnemonicName (riscv-unified-db)XLEN
c.lbuLoad unsigned byte, 16-bit encodingRV32 and RV64
c.lhLoad signed halfword, 16-bit encodingRV32 and RV64
c.lhuLoad unsigned halfword, 16-bit encodingRV32 and RV64
c.mulMultiply, 16-bit encodingRV32 and RV64
c.notBitwise not, 16-bit encodingRV32 and RV64
c.sbStore unsigned byte, 16-bit encodingRV32 and RV64
c.sext.bSign-extend byte, 16-bit encodingRV32 and RV64
c.sext.hSign-extend halfword, 16-bit encodingRV32 and RV64
c.sext.w (pseudo-op)RV64 only
c.shStore unsigned halfword, 16-bit encodingRV32 and RV64
c.zext.bZero-extend byte, 16-bit encodingRV32 and RV64
c.zext.hZero-extend halfword, 16-bit encodingRV32 and RV64
c.zext.wZero-extend word, 16-bit encodingRV64 only