#define MASK_FNMSUB_D 0x600007f
#define MATCH_FNMADD_D 0x200004f
#define MASK_FNMADD_D 0x600007f
-#define MATCH_C_NOP 0x8001
+#define MATCH_C_NOP 0x1
#define MASK_C_NOP 0xffff
-#define MATCH_C_ADDI16SP 0xe101
+#define MATCH_C_ADDI16SP 0x6101
#define MASK_C_ADDI16SP 0xef83
#define MATCH_C_JR 0x8002
#define MASK_C_JR 0xf07f
#define MASK_C_LD 0xe003
#define MATCH_C_SD 0xe000
#define MASK_C_SD 0xe003
-#define MATCH_C_ADDIW 0xa001
+#define MATCH_C_ADDIW 0x2001
#define MASK_C_ADDIW 0xe003
#define MATCH_C_LDSP 0x6002
#define MASK_C_LDSP 0xe003
#define MASK_C_SW 0xe003
#define MATCH_C_FSW 0xe000
#define MASK_C_FSW 0xe003
-#define MATCH_C_SRLI 0x1
+#define MATCH_C_ADDI 0x1
+#define MASK_C_ADDI 0xe003
+#define MATCH_C_JAL 0x2001
+#define MASK_C_JAL 0xe003
+#define MATCH_C_LI 0x4001
+#define MASK_C_LI 0xe003
+#define MATCH_C_LUI 0x6001
+#define MASK_C_LUI 0xe003
+#define MATCH_C_SRLI 0x8001
#define MASK_C_SRLI 0xec03
-#define MATCH_C_SRAI 0x401
+#define MATCH_C_SRAI 0x8401
#define MASK_C_SRAI 0xec03
-#define MATCH_C_ANDI 0x801
+#define MATCH_C_ANDI 0x8801
#define MASK_C_ANDI 0xec03
-#define MATCH_C_ADDW 0xc01
+#define MATCH_C_ADDW 0x8c01
#define MASK_C_ADDW 0xfc63
-#define MATCH_C_SLL 0xc21
+#define MATCH_C_SLL 0x8c21
#define MASK_C_SLL 0xfc63
-#define MATCH_C_SUBW 0xc41
+#define MATCH_C_SUBW 0x8c41
#define MASK_C_SUBW 0xfc63
-#define MATCH_C_SUB 0xc61
+#define MATCH_C_SUB 0x8c61
#define MASK_C_SUB 0xfc63
-#define MATCH_C_XOR 0x1c01
+#define MATCH_C_XOR 0x9c01
#define MASK_C_XOR 0xfc63
-#define MATCH_C_SRL 0x1c21
+#define MATCH_C_SRL 0x9c21
#define MASK_C_SRL 0xfc63
-#define MATCH_C_OR 0x1c41
+#define MATCH_C_OR 0x9c41
#define MASK_C_OR 0xfc63
-#define MATCH_C_AND 0x1c61
+#define MATCH_C_AND 0x9c61
#define MASK_C_AND 0xfc63
-#define MATCH_C_J 0x2001
+#define MATCH_C_J 0xa001
#define MASK_C_J 0xe003
-#define MATCH_C_BEQZ 0x4001
+#define MATCH_C_BEQZ 0xc001
#define MASK_C_BEQZ 0xe003
-#define MATCH_C_BNEZ 0x6001
+#define MATCH_C_BNEZ 0xe001
#define MASK_C_BNEZ 0xe003
-#define MATCH_C_ADDI 0x8001
-#define MASK_C_ADDI 0xe003
-#define MATCH_C_JAL 0xa001
-#define MASK_C_JAL 0xe003
-#define MATCH_C_LI 0xc001
-#define MASK_C_LI 0xe003
-#define MATCH_C_LUI 0xe001
-#define MASK_C_LUI 0xe003
#define MATCH_C_SLLI 0x2
#define MASK_C_SLLI 0xe003
#define MATCH_C_FLDSP 0x2002
DECLARE_INSN(c_fsd, MATCH_C_FSD, MASK_C_FSD)
DECLARE_INSN(c_sw, MATCH_C_SW, MASK_C_SW)
DECLARE_INSN(c_fsw, MATCH_C_FSW, MASK_C_FSW)
+DECLARE_INSN(c_addi, MATCH_C_ADDI, MASK_C_ADDI)
+DECLARE_INSN(c_jal, MATCH_C_JAL, MASK_C_JAL)
+DECLARE_INSN(c_li, MATCH_C_LI, MASK_C_LI)
+DECLARE_INSN(c_lui, MATCH_C_LUI, MASK_C_LUI)
DECLARE_INSN(c_srli, MATCH_C_SRLI, MASK_C_SRLI)
DECLARE_INSN(c_srai, MATCH_C_SRAI, MASK_C_SRAI)
DECLARE_INSN(c_andi, MATCH_C_ANDI, MASK_C_ANDI)
DECLARE_INSN(c_j, MATCH_C_J, MASK_C_J)
DECLARE_INSN(c_beqz, MATCH_C_BEQZ, MASK_C_BEQZ)
DECLARE_INSN(c_bnez, MATCH_C_BNEZ, MASK_C_BNEZ)
-DECLARE_INSN(c_addi, MATCH_C_ADDI, MASK_C_ADDI)
-DECLARE_INSN(c_jal, MATCH_C_JAL, MASK_C_JAL)
-DECLARE_INSN(c_li, MATCH_C_LI, MASK_C_LI)
-DECLARE_INSN(c_lui, MATCH_C_LUI, MASK_C_LUI)
DECLARE_INSN(c_slli, MATCH_C_SLLI, MASK_C_SLLI)
DECLARE_INSN(c_fldsp, MATCH_C_FLDSP, MASK_C_FLDSP)
DECLARE_INSN(c_lwsp, MATCH_C_LWSP, MASK_C_LWSP)