RISC-V ISA Explorer · Compressed (Zc*)
Zce: Embedded Compressed
Ratified 2023-04 · version 1.0.0
Bundles the code-size-reduction Zc extensions that microcontroller-class cores are expected to implement.
Typical use: RV32E/RV64E-focused compressed subset
Open Zce in the explorerDependencies
Requires
Incompatible with
Members
Instructions (54)
| Mnemonic | Name | Encoding | Match | Mask |
|---|---|---|---|---|
C.ADD | Add | ----------------1001----------10 | 0x9002 | 0xf003 |
C.ADDI | Add a sign-extended non-zero immediate | ----------------000-----------01 | 0x1 | 0xe003 |
C.ADDI16SP | Add a sign-extended non-zero immediate | ----------------011-00010-----01 | 0x6101 | 0xef83 |
C.ADDI4SPN | Add a zero-extended non-zero immediate, scaled by 4, to the stack pointer | ----------------000-----------00 | 0x0 | 0xe003 |
C.ADDIW | Add a sign-extended non-zero immediate | ----------------001-----------01 | 0x2001 | 0xe003 |
C.ADDW | Add word | ----------------100111---01---01 | 0x9c21 | 0xfc63 |
C.AND | And | ----------------100011---11---01 | 0x8c61 | 0xfc63 |
C.ANDI | And immediate | ----------------100-10--------01 | 0x8801 | 0xec03 |
C.BEQZ | Branch if Equal Zero | ----------------110-----------01 | 0xc001 | 0xe003 |
C.BNEZ | Branch if NOT Equal Zero | ----------------111-----------01 | 0xe001 | 0xe003 |
C.EBREAK | Breakpoint exception | ----------------1001000000000010 | 0x9002 | 0xffff |
C.J | Jump | ----------------101-----------01 | 0xa001 | 0xe003 |
C.JAL | Jump and Link | ----------------001-----------01 | 0x2001 | 0xe003 |
C.JALR | Jump and Link Register | ----------------1001-----0000010 | 0x9002 | 0xf07f |
C.JR | Jump Register | ----------------1000-----0000010 | 0x8002 | 0xf07f |
C.LBU | Load unsigned byte, 16-bit encoding | ----------------100000--------00 | 0x8000 | 0xfc03 |
C.LD | Load double | ----------------011-----------00 | 0x6000 | 0xe003 |
C.LDSP | Load doubleword from stack pointer | ----------------011-----------10 | 0x6002 | 0xe003 |
C.LH | Load signed halfword, 16-bit encoding | ----------------100001---1----00 | 0x8440 | 0xfc43 |
C.LHU | Load unsigned halfword, 16-bit encoding | ----------------100001---0----00 | 0x8400 | 0xfc43 |
C.LI | Load the sign-extended 6-bit immediate | ----------------010-----------01 | 0x4001 | 0xe003 |
C.LUI | Load Upper Immediate | ----------------011-----------01 | 0x6001 | 0xe003 |
C.LW | Load word | ----------------010-----------00 | 0x4000 | 0xe003 |
C.LWSP | Load word from stack pointer | ----------------010-----------10 | 0x4002 | 0xe003 |
C.MUL | Multiply, 16-bit encoding | ----------------100111---10---01 | 0x9c41 | 0xfc63 |
C.MV | Move Register | ----------------1000----------10 | 0x8002 | 0xf003 |
C.NOP | Non-operation | ----------------000-00000-----01 | 0x1 | 0xef83 |
C.NOT | Bitwise not, 16-bit encoding | ----------------100111---1110101 | 0x9c75 | 0xfc7f |
C.OR | Or | ----------------100011---10---01 | 0x8c41 | 0xfc63 |
C.SB | Store unsigned byte, 16-bit encoding | ----------------100010--------00 | 0x8800 | 0xfc03 |
C.SD | Store double | ----------------111-----------00 | 0xe000 | 0xe003 |
C.SDSP | Store doubleword to stack | ----------------111-----------10 | 0xe002 | 0xe003 |
C.SEXT.B | Sign-extend byte, 16-bit encoding | ----------------100111---1100101 | 0x9c65 | 0xfc7f |
C.SEXT.H | Sign-extend halfword, 16-bit encoding | ----------------100111---1101101 | 0x9c6d | 0xfc7f |
C.SH | Store unsigned halfword, 16-bit encoding | ----------------100011---0----00 | 0x8c00 | 0xfc43 |
C.SLLI | Shift left logical immediate | ----------------000-----------10 | 0x2 | 0xe003 |
C.SRAI | Shift right arithmetical immediate | ----------------100-01--------01 | 0x8401 | 0xec03 |
C.SRLI | Shift right logical immediate | ----------------100-00--------01 | 0x8001 | 0xec03 |
C.SUB | Subtract | ----------------100011---00---01 | 0x8c01 | 0xfc63 |
C.SUBW | Subtract word | ----------------100111---00---01 | 0x9c01 | 0xfc63 |
C.SW | Store word | ----------------110-----------00 | 0xc000 | 0xe003 |
C.SWSP | Store word to stack | ----------------110-----------10 | 0xc002 | 0xe003 |
C.XOR | Exclusive Or | ----------------100011---01---01 | 0x8c21 | 0xfc63 |
C.ZEXT.B | Zero-extend byte, 16-bit encoding | ----------------100111---1100001 | 0x9c61 | 0xfc7f |
C.ZEXT.H | Zero-extend halfword, 16-bit encoding | ----------------100111---1101001 | 0x9c69 | 0xfc7f |
C.ZEXT.W | Zero-extend word, 16-bit encoding | ----------------100111---1110001 | 0x9c71 | 0xfc7f |
CM.JALT | Jump Via Table with Optional Link | ----------------101000--------10 | 0xa002 | 0xfc03 |
CM.JT | Jump Via Table | ----------------101000000-----10 | 0xa002 | 0xff83 |
CM.MVA01S | Move two s0-s7 registers into a0-a1 | ----------------101011---11---10 | 0xac62 | 0xfc63 |
CM.MVSA01 | Move a0-a1 into two registers of s0-s7 | ----------------101011---01---10 | 0xac22 | 0xfc63 |
CM.POP | Destroy function call stack frame | ----------------10111010------10 | 0xba02 | 0xff03 |
CM.POPRET | Destroy function call stack frame and return to `ra` | ----------------10111110------10 | 0xbe02 | 0xff03 |
CM.POPRETZ | Destroy function call stack frame, move zero to `a0` and return to `ra` | ----------------10111100------10 | 0xbc02 | 0xff03 |
CM.PUSH | Create function call stack frame | ----------------10111000------10 | 0xb802 | 0xff03 |