RISC-V ISA Explorer · Single-Letter Extensions

C: Compressed

Ratified 2019-12 · version 2.0.0

Short 16-bit encodings of common instructions, typically cutting program size by 25 to 30 percent.

Typical use: 16-bit instruction encodings

Specification

Open C in the explorer

Dependencies

Requires

Instructions (34)

MnemonicNameEncodingMatchMask
C.ADDAdd----------------1001----------100x90020xf003
C.ADDIAdd a sign-extended non-zero immediate----------------000-----------010x10xe003
C.ADDI16SPAdd a sign-extended non-zero immediate----------------011-00010-----010x61010xef83
C.ADDI4SPNAdd a zero-extended non-zero immediate, scaled by 4, to the stack pointer----------------000-----------000x00xe003
C.ADDIWAdd a sign-extended non-zero immediate----------------001-----------010x20010xe003
C.ADDWAdd word----------------100111---01---010x9c210xfc63
C.ANDAnd----------------100011---11---010x8c610xfc63
C.ANDIAnd immediate----------------100-10--------010x88010xec03
C.BEQZBranch if Equal Zero----------------110-----------010xc0010xe003
C.BNEZBranch if NOT Equal Zero----------------111-----------010xe0010xe003
C.EBREAKBreakpoint exception----------------10010000000000100x90020xffff
C.JJump----------------101-----------010xa0010xe003
C.JALJump and Link----------------001-----------010x20010xe003
C.JALRJump and Link Register----------------1001-----00000100x90020xf07f
C.JRJump Register----------------1000-----00000100x80020xf07f
C.LDLoad double----------------011-----------000x60000xe003
C.LDSPLoad doubleword from stack pointer----------------011-----------100x60020xe003
C.LILoad the sign-extended 6-bit immediate----------------010-----------010x40010xe003
C.LUILoad Upper Immediate----------------011-----------010x60010xe003
C.LWLoad word----------------010-----------000x40000xe003
C.LWSPLoad word from stack pointer----------------010-----------100x40020xe003
C.MVMove Register----------------1000----------100x80020xf003
C.NOPNon-operation----------------000-00000-----010x10xef83
C.OROr----------------100011---10---010x8c410xfc63
C.SDStore double----------------111-----------000xe0000xe003
C.SDSPStore doubleword to stack----------------111-----------100xe0020xe003
C.SLLIShift left logical immediate----------------000-----------100x20xe003
C.SRAIShift right arithmetical immediate----------------100-01--------010x84010xec03
C.SRLIShift right logical immediate----------------100-00--------010x80010xec03
C.SUBSubtract----------------100011---00---010x8c010xfc63
C.SUBWSubtract word----------------100111---00---010x9c010xfc63
C.SWStore word----------------110-----------000xc0000xe003
C.SWSPStore word to stack----------------110-----------100xc0020xe003
C.XORExclusive Or----------------100011---01---010x8c210xfc63