From: Andrew Waterman Date: Wed, 26 Jan 2011 06:51:24 +0000 (-0800) Subject: [opcodes,pk,sim,xcc] great renumbering of 2011, part deux X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5bae2bf37228d1a67d8f4c6175a6cda768d8b3e6;p=riscv-isa-sim.git [opcodes,pk,sim,xcc] great renumbering of 2011, part deux --- diff --git a/riscv/decode.h b/riscv/decode.h index fff6e0e..c462dcb 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -25,7 +25,6 @@ const int NFPR = 1 << FPRID_BITS; const int IMM_BITS = 12; const int IMMLO_BITS = 7; const int TARGET_BITS = 25; -const int SHAMT_BITS = 6; const int FUNCT_BITS = 3; const int FUNCTR_BITS = 7; const int FFUNCT_BITS = 5; @@ -167,8 +166,8 @@ private: #define BIGIMM insn.ltype.bigimm #define SIMM insn.itype.imm12 #define BIMM ((signed)insn.btype.immlo | (insn.btype.immhi << IMMLO_BITS)) -#define SHAMT ((insn.itype.imm12 >> (IMM_BITS-6)) & 0x3F) -#define SHAMTW ((insn.itype.imm12 >> (IMM_BITS-6)) & 0x1F) +#define SHAMT (insn.itype.imm12 & 0x3F) +#define SHAMTW (insn.itype.imm12 & 0x1F) #define TARGET insn.jtype.target #define BRANCH_TARGET (npc + (BIMM << BRANCH_ALIGN_BITS)) #define JUMP_TARGET (npc + (TARGET << JUMP_ALIGN_BITS)) diff --git a/riscv/execute.h b/riscv/execute.h index 88b5a84..8539974 100644 --- a/riscv/execute.h +++ b/riscv/execute.h @@ -21,35 +21,54 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x60: - { - #include "insns/j.h" - break; - } - case 0x61: - { - #include "insns/jal.h" - break; - } - case 0x62: + case 0x3: { switch((insn.bits >> 0x7) & 0x7) { case 0x0: { - #include "insns/jalr_c.h" + #include "insns/l_b.h" break; } case 0x1: { - #include "insns/jalr_r.h" + #include "insns/l_h.h" break; } case 0x2: { - #include "insns/jalr_j.h" + #include "insns/l_w.h" + break; + } + case 0x3: + { + #include "insns/l_d.h" + break; + } + case 0x4: + { + #include "insns/l_bu.h" + break; + } + case 0x5: + { + #include "insns/l_hu.h" + break; + } + case 0x6: + { + #include "insns/l_wu.h" break; } + case 0x7: + { + if((insn.bits & 0xf80003ff) == 0x383) + { + #include "insns/synci.h" + break; + } + #include "insns/unimp.h" + } default: { #include "insns/unimp.h" @@ -57,38 +76,82 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x63: + case 0x7: + { + switch((insn.bits >> 0x7) & 0x7) + { + case 0x2: + { + #include "insns/lf_w.h" + break; + } + case 0x3: + { + #include "insns/lf_d.h" + break; + } + default: + { + #include "insns/unimp.h" + } + } + break; + } + case 0x13: { switch((insn.bits >> 0x7) & 0x7) { case 0x0: { - #include "insns/beq.h" + #include "insns/addi.h" break; } case 0x1: { - #include "insns/bne.h" + if((insn.bits & 0x3f03ff) == 0x93) + { + #include "insns/slli.h" + break; + } + #include "insns/unimp.h" + } + case 0x2: + { + #include "insns/slti.h" + break; + } + case 0x3: + { + #include "insns/sltiu.h" break; } case 0x4: { - #include "insns/blt.h" + #include "insns/xori.h" break; } case 0x5: { - #include "insns/bge.h" - break; + if((insn.bits & 0x3f03ff) == 0x293) + { + #include "insns/srli.h" + break; + } + if((insn.bits & 0x3f03ff) == 0x10293) + { + #include "insns/srai.h" + break; + } + #include "insns/unimp.h" } case 0x6: { - #include "insns/bltu.h" + #include "insns/ori.h" break; } case 0x7: { - #include "insns/bgeu.h" + #include "insns/andi.h" break; } default: @@ -98,24 +161,86 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x67: + case 0x17: { switch((insn.bits >> 0x7) & 0x7) { case 0x0: { - if((insn.bits & 0xfff) == 0x67) + if((insn.bits & 0x7ffffff) == 0x17) + { + #include "insns/rdnpc.h" + break; + } + #include "insns/unimp.h" + } + case 0x1: + { + if((insn.bits & 0x7c1ffff) == 0x97) + { + #include "insns/mfcr.h" + break; + } + if((insn.bits & 0xf801ffff) == 0x497) + { + #include "insns/mtcr.h" + break; + } + #include "insns/unimp.h" + } + case 0x2: + { + if((insn.bits & 0xffffffff) == 0x117) { - #include "insns/fsel_s.h" + #include "insns/sync.h" break; } #include "insns/unimp.h" } case 0x3: { - if((insn.bits & 0xfff) == 0x1e7) + if((insn.bits & 0xffc003ff) == 0x197) + { + #include "insns/syscall.h" + break; + } + #include "insns/unimp.h" + } + default: + { + #include "insns/unimp.h" + } + } + break; + } + case 0x1b: + { + switch((insn.bits >> 0x7) & 0x7) + { + case 0x0: + { + #include "insns/addiw.h" + break; + } + case 0x1: + { + if((insn.bits & 0x3f83ff) == 0x9b) + { + #include "insns/slliw.h" + break; + } + #include "insns/unimp.h" + } + case 0x5: + { + if((insn.bits & 0x3f83ff) == 0x29b) + { + #include "insns/srliw.h" + break; + } + if((insn.bits & 0x3f83ff) == 0x1029b) { - #include "insns/fsel_d.h" + #include "insns/sraiw.h" break; } #include "insns/unimp.h" @@ -127,18 +252,28 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x68: + case 0x23: { switch((insn.bits >> 0x7) & 0x7) { + case 0x0: + { + #include "insns/s_b.h" + break; + } + case 0x1: + { + #include "insns/s_h.h" + break; + } case 0x2: { - #include "insns/lf_w.h" + #include "insns/s_w.h" break; } case 0x3: { - #include "insns/lf_d.h" + #include "insns/s_d.h" break; } default: @@ -148,7 +283,7 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x69: + case 0x27: { switch((insn.bits >> 0x7) & 0x7) { @@ -169,301 +304,322 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x6a: + case 0x33: { switch((insn.bits >> 0x7) & 0x7) { case 0x0: { - if((insn.bits & 0x1ffff) == 0x606a) + if((insn.bits & 0x1ffff) == 0x33) { - #include "insns/fsinjn_s.h" + #include "insns/add.h" break; } - if((insn.bits & 0x7c1ffff) == 0x1846a) + if((insn.bits & 0x1ffff) == 0x433) { - #include "insns/mff_s.h" + #include "insns/mul.h" break; } - if((insn.bits & 0x3ff1ff) == 0x1306a) + if((insn.bits & 0x1ffff) == 0x10033) { - #include "insns/fcvt_s_d.h" + #include "insns/sub.h" break; } - if((insn.bits & 0x1f1ff) == 0x6a) + #include "insns/unimp.h" + } + case 0x1: + { + if((insn.bits & 0x1ffff) == 0xb3) { - #include "insns/fadd_s.h" + #include "insns/sll.h" break; } - if((insn.bits & 0x3ff1ff) == 0xe06a) + #include "insns/unimp.h" + } + case 0x2: + { + if((insn.bits & 0x1ffff) == 0x533) { - #include "insns/fcvt_s_w.h" + #include "insns/mulh.h" break; } - if((insn.bits & 0x3ff1ff) == 0xb06a) + if((insn.bits & 0x1ffff) == 0x133) { - #include "insns/fcvtu_w_s.h" + #include "insns/slt.h" break; } - if((insn.bits & 0x3ff1ff) == 0x806a) + #include "insns/unimp.h" + } + case 0x3: + { + if((insn.bits & 0x1ffff) == 0x1b3) { - #include "insns/fcvt_l_s.h" + #include "insns/sltu.h" break; } - if((insn.bits & 0x3fffff) == 0x1c46a) + if((insn.bits & 0x1ffff) == 0x5b3) { - #include "insns/mtf_s.h" + #include "insns/mulhu.h" break; } - if((insn.bits & 0x1f1ff) == 0x306a) + #include "insns/unimp.h" + } + case 0x4: + { + if((insn.bits & 0x1ffff) == 0x633) { - #include "insns/fdiv_s.h" + #include "insns/div.h" break; } - if((insn.bits & 0x1ffff) == 0x1606a) + if((insn.bits & 0x1ffff) == 0x233) { - #include "insns/fc_lt_s.h" + #include "insns/xor.h" break; } - if((insn.bits & 0x1f1ff) == 0x206a) + #include "insns/unimp.h" + } + case 0x5: + { + if((insn.bits & 0x1ffff) == 0x102b3) { - #include "insns/fmul_s.h" + #include "insns/sra.h" break; } - if((insn.bits & 0x1ffff) == 0x706a) + if((insn.bits & 0x1ffff) == 0x2b3) { - #include "insns/fsmul_s.h" + #include "insns/srl.h" break; } - if((insn.bits & 0x3ff1ff) == 0xa06a) + if((insn.bits & 0x1ffff) == 0x6b3) { - #include "insns/fcvt_w_s.h" + #include "insns/divu.h" break; } - if((insn.bits & 0x1ffff) == 0x506a) + #include "insns/unimp.h" + } + case 0x6: + { + if((insn.bits & 0x1ffff) == 0x733) { - #include "insns/fsinj_s.h" + #include "insns/rem.h" break; } - if((insn.bits & 0x1f1ff) == 0x106a) + if((insn.bits & 0x1ffff) == 0x333) { - #include "insns/fsub_s.h" + #include "insns/or.h" break; } - if((insn.bits & 0x1ffff) == 0x1706a) + #include "insns/unimp.h" + } + case 0x7: + { + if((insn.bits & 0x1ffff) == 0x7b3) { - #include "insns/fc_le_s.h" + #include "insns/remu.h" break; } - if((insn.bits & 0x3ff1ff) == 0xf06a) + if((insn.bits & 0x1ffff) == 0x3b3) { - #include "insns/fcvtu_s_w.h" + #include "insns/and.h" break; } - if((insn.bits & 0x3ff1ff) == 0xd06a) + #include "insns/unimp.h" + } + default: + { + #include "insns/unimp.h" + } + } + break; + } + case 0x37: + { + #include "insns/lui.h" + break; + } + case 0x3b: + { + switch((insn.bits >> 0x7) & 0x7) + { + case 0x0: + { + if((insn.bits & 0x1ffff) == 0x3b) { - #include "insns/fcvtu_s_l.h" + #include "insns/addw.h" break; } - if((insn.bits & 0x3ff1ff) == 0x906a) + if((insn.bits & 0x1ffff) == 0x1003b) { - #include "insns/fcvtu_l_s.h" + #include "insns/subw.h" break; } - if((insn.bits & 0x3ff1ff) == 0xc06a) + if((insn.bits & 0x1ffff) == 0x43b) { - #include "insns/fcvt_s_l.h" - break; - } - if((insn.bits & 0x3ff1ff) == 0x406a) - { - #include "insns/fsqrt_s.h" - break; - } - if((insn.bits & 0x1ffff) == 0x1506a) - { - #include "insns/fc_eq_s.h" + #include "insns/mulw.h" break; } #include "insns/unimp.h" } - case 0x3: + case 0x1: { - if((insn.bits & 0x7c1ffff) == 0x185ea) - { - #include "insns/mff_d.h" - break; - } - if((insn.bits & 0x1ffff) == 0x61ea) - { - #include "insns/fsinjn_d.h" - break; - } - if((insn.bits & 0x3ff1ff) == 0xc1ea) - { - #include "insns/fcvt_d_l.h" - break; - } - if((insn.bits & 0x3fffff) == 0xe1ea) - { - #include "insns/fcvt_d_w.h" - break; - } - if((insn.bits & 0x3fffff) == 0x101ea) - { - #include "insns/fcvt_d_s.h" - break; - } - if((insn.bits & 0x7c1ffff) == 0x195ea) - { - #include "insns/mffl_d.h" - break; - } - if((insn.bits & 0x7c1ffff) == 0x1a5ea) - { - #include "insns/mffh_d.h" - break; - } - if((insn.bits & 0x3ff1ff) == 0x81ea) + if((insn.bits & 0x1ffff) == 0xbb) { - #include "insns/fcvt_l_d.h" + #include "insns/sllw.h" break; } - if((insn.bits & 0x3fffff) == 0xf1ea) + #include "insns/unimp.h" + } + case 0x4: + { + if((insn.bits & 0x1ffff) == 0x63b) { - #include "insns/fcvtu_d_w.h" + #include "insns/divw.h" break; } - if((insn.bits & 0x1ffff) == 0x161ea) + #include "insns/unimp.h" + } + case 0x5: + { + if((insn.bits & 0x1ffff) == 0x6bb) { - #include "insns/fc_lt_d.h" + #include "insns/divuw.h" break; } - if((insn.bits & 0x1f1ff) == 0x21ea) + if((insn.bits & 0x1ffff) == 0x2bb) { - #include "insns/fmul_d.h" + #include "insns/srlw.h" break; } - if((insn.bits & 0x1ffff) == 0x151ea) + if((insn.bits & 0x1ffff) == 0x102bb) { - #include "insns/fc_eq_d.h" + #include "insns/sraw.h" break; } - if((insn.bits & 0x1ffff) == 0x71ea) + #include "insns/unimp.h" + } + case 0x6: + { + if((insn.bits & 0x1ffff) == 0x73b) { - #include "insns/fsmul_d.h" + #include "insns/remw.h" break; } - if((insn.bits & 0x1ffff) == 0x51ea) + #include "insns/unimp.h" + } + case 0x7: + { + if((insn.bits & 0x1ffff) == 0x7bb) { - #include "insns/fsinj_d.h" + #include "insns/remuw.h" break; } - if((insn.bits & 0x3ff1ff) == 0xa1ea) + #include "insns/unimp.h" + } + default: + { + #include "insns/unimp.h" + } + } + break; + } + case 0x43: + { + switch((insn.bits >> 0x7) & 0x7) + { + case 0x0: + { + #include "insns/fmadd_s.h" + break; + } + case 0x1: + { + #include "insns/fmadd_d.h" + break; + } + case 0x2: + { + if((insn.bits & 0x1ffff) == 0x1943) { - #include "insns/fcvt_w_d.h" + #include "insns/amominu_w.h" break; } - if((insn.bits & 0x3fffff) == 0x1c5ea) + if((insn.bits & 0x1ffff) == 0x943) { - #include "insns/mtf_d.h" + #include "insns/amoand_w.h" break; } - if((insn.bits & 0x1ffff) == 0x171ea) + if((insn.bits & 0x1ffff) == 0x1d43) { - #include "insns/fc_le_d.h" + #include "insns/amomaxu_w.h" break; } - if((insn.bits & 0x3ff1ff) == 0xb1ea) + if((insn.bits & 0x1ffff) == 0x1543) { - #include "insns/fcvtu_w_d.h" + #include "insns/amomax_w.h" break; } - if((insn.bits & 0x1f1ff) == 0x1ea) + if((insn.bits & 0x1ffff) == 0x143) { - #include "insns/fadd_d.h" + #include "insns/amoadd_w.h" break; } - if((insn.bits & 0x3ff1ff) == 0x91ea) + if((insn.bits & 0x1ffff) == 0xd43) { - #include "insns/fcvtu_l_d.h" + #include "insns/amoor_w.h" break; } - if((insn.bits & 0x1f1ff) == 0x11ea) + if((insn.bits & 0x1ffff) == 0x1143) { - #include "insns/fsub_d.h" + #include "insns/amomin_w.h" break; } - if((insn.bits & 0x3ff1ff) == 0x41ea) + if((insn.bits & 0x1ffff) == 0x543) { - #include "insns/fsqrt_d.h" + #include "insns/amoswap_w.h" break; } - if((insn.bits & 0x1f1ff) == 0x31ea) + #include "insns/unimp.h" + } + case 0x3: + { + if((insn.bits & 0x1ffff) == 0x19c3) { - #include "insns/fdiv_d.h" + #include "insns/amominu_d.h" break; } - if((insn.bits & 0x3ff1ff) == 0xd1ea) + if((insn.bits & 0x1ffff) == 0x9c3) { - #include "insns/fcvtu_d_l.h" + #include "insns/amoand_d.h" break; } - #include "insns/unimp.h" - } - case 0x7: - { - if((insn.bits & 0x1ffff) == 0x1c7ea) + if((insn.bits & 0x1ffff) == 0x1dc3) { - #include "insns/mtflh_d.h" + #include "insns/amomaxu_d.h" break; } - #include "insns/unimp.h" - } - default: - { - #include "insns/unimp.h" - } - } - break; - } - case 0x6b: - { - switch((insn.bits >> 0x7) & 0x7) - { - case 0x0: - { - if((insn.bits & 0x7ffffff) == 0x46b) + if((insn.bits & 0x1ffff) == 0x11c3) { - #include "insns/di.h" + #include "insns/amomin_d.h" break; } - if((insn.bits & 0x7ffffff) == 0x6b) + if((insn.bits & 0x1ffff) == 0x1c3) { - #include "insns/ei.h" + #include "insns/amoadd_d.h" break; } - #include "insns/unimp.h" - } - case 0x1: - { - if((insn.bits & 0x7c1ffff) == 0xeb) + if((insn.bits & 0x1ffff) == 0x15c3) { - #include "insns/mfpcr.h" + #include "insns/amomax_d.h" break; } - if((insn.bits & 0xf801ffff) == 0x4eb) + if((insn.bits & 0x1ffff) == 0xdc3) { - #include "insns/mtpcr.h" + #include "insns/amoor_d.h" break; } - #include "insns/unimp.h" - } - case 0x2: - { - if((insn.bits & 0xffffffff) == 0x16b) + if((insn.bits & 0x1ffff) == 0x5c3) { - #include "insns/eret.h" + #include "insns/amoswap_d.h" break; } #include "insns/unimp.h" @@ -475,28 +631,7 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x6c: - { - switch((insn.bits >> 0x7) & 0x7) - { - case 0x0: - { - #include "insns/fmadd_s.h" - break; - } - case 0x3: - { - #include "insns/fmadd_d.h" - break; - } - default: - { - #include "insns/unimp.h" - } - } - break; - } - case 0x6d: + case 0x47: { switch((insn.bits >> 0x7) & 0x7) { @@ -505,7 +640,7 @@ switch((insn.bits >> 0x0) & 0x7f) #include "insns/fmsub_s.h" break; } - case 0x3: + case 0x1: { #include "insns/fmsub_d.h" break; @@ -517,7 +652,7 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x6e: + case 0x4b: { switch((insn.bits >> 0x7) & 0x7) { @@ -526,7 +661,7 @@ switch((insn.bits >> 0x0) & 0x7f) #include "insns/fnmsub_s.h" break; } - case 0x3: + case 0x1: { #include "insns/fnmsub_d.h" break; @@ -538,7 +673,7 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x6f: + case 0x4f: { switch((insn.bits >> 0x7) & 0x7) { @@ -547,7 +682,7 @@ switch((insn.bits >> 0x0) & 0x7f) #include "insns/fnmadd_s.h" break; } - case 0x3: + case 0x1: { #include "insns/fnmadd_d.h" break; @@ -559,276 +694,253 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x71: - { - #include "insns/lui.h" - break; - } - case 0x74: + case 0x53: { switch((insn.bits >> 0x7) & 0x7) { case 0x0: { - #include "insns/addi.h" - break; - } - case 0x2: - { - #include "insns/slti.h" - break; - } - case 0x3: - { - #include "insns/sltiu.h" - break; - } - case 0x4: - { - #include "insns/andi.h" - break; - } - case 0x5: - { - #include "insns/ori.h" - break; - } - case 0x6: - { - #include "insns/xori.h" - break; - } - case 0x7: - { - if((insn.bits & 0xffff) == 0xbf4) + if((insn.bits & 0x1ffff) == 0x6053) { - #include "insns/srli.h" + #include "insns/fsinjn_s.h" break; } - if((insn.bits & 0xffff) == 0xff4) + if((insn.bits & 0x7c1ffff) == 0x18453) { - #include "insns/srai.h" + #include "insns/mff_s.h" break; } - if((insn.bits & 0xffff) == 0x7f4) + if((insn.bits & 0x3ff1ff) == 0x11053) { - #include "insns/slli.h" + #include "insns/fcvt_s_d.h" break; } - #include "insns/unimp.h" - } - default: - { - #include "insns/unimp.h" - } - } - break; - } - case 0x75: - { - switch((insn.bits >> 0x7) & 0x7) - { - case 0x0: - { - if((insn.bits & 0x1ffff) == 0x75) + if((insn.bits & 0x1f1ff) == 0x53) { - #include "insns/add.h" + #include "insns/fadd_s.h" break; } - if((insn.bits & 0x1ffff) == 0xc75) + if((insn.bits & 0x3ff1ff) == 0xe053) { - #include "insns/sltu.h" + #include "insns/fcvt_s_w.h" break; } - if((insn.bits & 0x1ffff) == 0x1875) + if((insn.bits & 0x3ff1ff) == 0xb053) { - #include "insns/xor.h" + #include "insns/fcvtu_w_s.h" break; } - if((insn.bits & 0x1ffff) == 0x475) + if((insn.bits & 0x3ff1ff) == 0x8053) { - #include "insns/sub.h" + #include "insns/fcvt_l_s.h" break; } - if((insn.bits & 0x1ffff) == 0x1475) + if((insn.bits & 0x3fffff) == 0x1c453) { - #include "insns/or.h" + #include "insns/mtf_s.h" break; } - if((insn.bits & 0x1ffff) == 0x875) + if((insn.bits & 0x1f1ff) == 0x3053) { - #include "insns/slt.h" + #include "insns/fdiv_s.h" break; } - if((insn.bits & 0x1ffff) == 0x1075) + if((insn.bits & 0x1ffff) == 0x16053) { - #include "insns/and.h" + #include "insns/fc_lt_s.h" break; } - #include "insns/unimp.h" - } - case 0x1: - { - if((insn.bits & 0x1ffff) == 0xf5) + if((insn.bits & 0x1f1ff) == 0x2053) { - #include "insns/mul.h" + #include "insns/fmul_s.h" break; } - if((insn.bits & 0x1ffff) == 0x10f5) + if((insn.bits & 0x1ffff) == 0x7053) { - #include "insns/div.h" + #include "insns/fsmul_s.h" break; } - if((insn.bits & 0x1ffff) == 0x18f5) + if((insn.bits & 0x3ff1ff) == 0xa053) { - #include "insns/rem.h" + #include "insns/fcvt_w_s.h" break; } - if((insn.bits & 0x1ffff) == 0x8f5) + if((insn.bits & 0x1ffff) == 0x5053) { - #include "insns/mulh.h" + #include "insns/fsinj_s.h" break; } - if((insn.bits & 0x1ffff) == 0x1cf5) + if((insn.bits & 0x1f1ff) == 0x1053) { - #include "insns/remu.h" + #include "insns/fsub_s.h" break; } - if((insn.bits & 0x1ffff) == 0xcf5) + if((insn.bits & 0x1ffff) == 0x17053) { - #include "insns/mulhu.h" + #include "insns/fc_le_s.h" break; } - if((insn.bits & 0x1ffff) == 0x14f5) + if((insn.bits & 0x3ff1ff) == 0xf053) { - #include "insns/divu.h" + #include "insns/fcvtu_s_w.h" break; } - #include "insns/unimp.h" - } - case 0x7: - { - if((insn.bits & 0x1ffff) == 0xff5) + if((insn.bits & 0x3ff1ff) == 0xd053) { - #include "insns/sra.h" + #include "insns/fcvtu_s_l.h" break; } - if((insn.bits & 0x1ffff) == 0xbf5) + if((insn.bits & 0x3ff1ff) == 0x9053) { - #include "insns/srl.h" + #include "insns/fcvtu_l_s.h" break; } - if((insn.bits & 0x1ffff) == 0x7f5) + if((insn.bits & 0x3ff1ff) == 0xc053) { - #include "insns/sll.h" + #include "insns/fcvt_s_l.h" + break; + } + if((insn.bits & 0x3ff1ff) == 0x4053) + { + #include "insns/fsqrt_s.h" + break; + } + if((insn.bits & 0x1ffff) == 0x15053) + { + #include "insns/fc_eq_s.h" break; } #include "insns/unimp.h" } - default: - { - #include "insns/unimp.h" - } - } - break; - } - case 0x76: - { - switch((insn.bits >> 0x7) & 0x7) - { - case 0x0: - { - #include "insns/addiw.h" - break; - } - case 0x7: + case 0x1: { - if((insn.bits & 0x20ffff) == 0x7f6) + if((insn.bits & 0x7c1ffff) == 0x184d3) { - #include "insns/slliw.h" + #include "insns/mff_d.h" break; } - if((insn.bits & 0x20ffff) == 0xbf6) + if((insn.bits & 0x1ffff) == 0x60d3) { - #include "insns/srliw.h" + #include "insns/fsinjn_d.h" break; } - if((insn.bits & 0x20ffff) == 0xff6) + if((insn.bits & 0x3ff1ff) == 0xc0d3) { - #include "insns/sraiw.h" + #include "insns/fcvt_d_l.h" break; } - #include "insns/unimp.h" - } - default: - { - #include "insns/unimp.h" - } - } - break; - } - case 0x77: - { - switch((insn.bits >> 0x7) & 0x7) - { - case 0x0: - { - if((insn.bits & 0x1ffff) == 0x77) + if((insn.bits & 0x3fffff) == 0xe0d3) { - #include "insns/addw.h" + #include "insns/fcvt_d_w.h" break; } - if((insn.bits & 0x1ffff) == 0x477) + if((insn.bits & 0x3fffff) == 0x100d3) { - #include "insns/subw.h" + #include "insns/fcvt_d_s.h" break; } - #include "insns/unimp.h" - } - case 0x1: - { - if((insn.bits & 0x1ffff) == 0x1cf7) + if((insn.bits & 0x7c1ffff) == 0x194d3) { - #include "insns/remuw.h" + #include "insns/mffl_d.h" break; } - if((insn.bits & 0x1ffff) == 0x14f7) + if((insn.bits & 0x7c1ffff) == 0x1a4d3) { - #include "insns/divuw.h" + #include "insns/mffh_d.h" break; } - if((insn.bits & 0x1ffff) == 0xf7) + if((insn.bits & 0x3ff1ff) == 0x80d3) { - #include "insns/mulw.h" + #include "insns/fcvt_l_d.h" break; } - if((insn.bits & 0x1ffff) == 0x18f7) + if((insn.bits & 0x3fffff) == 0xf0d3) { - #include "insns/remw.h" + #include "insns/fcvtu_d_w.h" break; } - if((insn.bits & 0x1ffff) == 0x10f7) + if((insn.bits & 0x1ffff) == 0x160d3) { - #include "insns/divw.h" + #include "insns/fc_lt_d.h" break; } - #include "insns/unimp.h" - } - case 0x7: - { - if((insn.bits & 0x1ffff) == 0xbf7) + if((insn.bits & 0x1f1ff) == 0x20d3) { - #include "insns/srlw.h" + #include "insns/fmul_d.h" break; } - if((insn.bits & 0x1ffff) == 0xff7) + if((insn.bits & 0x1ffff) == 0x150d3) { - #include "insns/sraw.h" + #include "insns/fc_eq_d.h" break; } - if((insn.bits & 0x1ffff) == 0x7f7) + if((insn.bits & 0x1ffff) == 0x70d3) { - #include "insns/sllw.h" + #include "insns/fsmul_d.h" + break; + } + if((insn.bits & 0x1ffff) == 0x50d3) + { + #include "insns/fsinj_d.h" + break; + } + if((insn.bits & 0x3ff1ff) == 0xa0d3) + { + #include "insns/fcvt_w_d.h" + break; + } + if((insn.bits & 0x3fffff) == 0x1c4d3) + { + #include "insns/mtf_d.h" + break; + } + if((insn.bits & 0x1ffff) == 0x170d3) + { + #include "insns/fc_le_d.h" + break; + } + if((insn.bits & 0x3ff1ff) == 0xb0d3) + { + #include "insns/fcvtu_w_d.h" + break; + } + if((insn.bits & 0x1f1ff) == 0xd3) + { + #include "insns/fadd_d.h" + break; + } + if((insn.bits & 0x3ff1ff) == 0x90d3) + { + #include "insns/fcvtu_l_d.h" + break; + } + if((insn.bits & 0x1f1ff) == 0x10d3) + { + #include "insns/fsub_d.h" + break; + } + if((insn.bits & 0x3ff1ff) == 0x40d3) + { + #include "insns/fsqrt_d.h" + break; + } + if((insn.bits & 0x1f1ff) == 0x30d3) + { + #include "insns/fdiv_d.h" + break; + } + if((insn.bits & 0x3ff1ff) == 0xd0d3) + { + #include "insns/fcvtu_d_l.h" + break; + } + #include "insns/unimp.h" + } + case 0x5: + { + if((insn.bits & 0x1ffff) == 0x1c6d3) + { + #include "insns/mtflh_d.h" break; } #include "insns/unimp.h" @@ -840,53 +952,39 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x78: + case 0x63: { switch((insn.bits >> 0x7) & 0x7) { case 0x0: { - #include "insns/l_b.h" + #include "insns/beq.h" break; } case 0x1: { - #include "insns/l_h.h" - break; - } - case 0x2: - { - #include "insns/l_w.h" - break; - } - case 0x3: - { - #include "insns/l_d.h" + #include "insns/bne.h" break; } case 0x4: { - #include "insns/l_bu.h" + #include "insns/blt.h" break; } case 0x5: { - #include "insns/l_hu.h" + #include "insns/bge.h" break; } case 0x6: { - #include "insns/l_wu.h" + #include "insns/bltu.h" break; } case 0x7: { - if((insn.bits & 0xf80003ff) == 0x3f8) - { - #include "insns/synci.h" - break; - } - #include "insns/unimp.h" + #include "insns/bgeu.h" + break; } default: { @@ -895,28 +993,28 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x79: + case 0x67: + { + #include "insns/j.h" + break; + } + case 0x6b: { switch((insn.bits >> 0x7) & 0x7) { case 0x0: { - #include "insns/s_b.h" + #include "insns/jalr_c.h" break; } case 0x1: { - #include "insns/s_h.h" + #include "insns/jalr_r.h" break; } case 0x2: { - #include "insns/s_w.h" - break; - } - case 0x3: - { - #include "insns/s_d.h" + #include "insns/jalr_j.h" break; } default: @@ -926,146 +1024,48 @@ switch((insn.bits >> 0x0) & 0x7f) } break; } - case 0x7a: + case 0x6f: { - switch((insn.bits >> 0x7) & 0x7) - { - case 0x2: - { - if((insn.bits & 0x1ffff) == 0x197a) - { - #include "insns/amominu_w.h" - break; - } - if((insn.bits & 0x1ffff) == 0x97a) - { - #include "insns/amoand_w.h" - break; - } - if((insn.bits & 0x1ffff) == 0x1d7a) - { - #include "insns/amomaxu_w.h" - break; - } - if((insn.bits & 0x1ffff) == 0x157a) - { - #include "insns/amomax_w.h" - break; - } - if((insn.bits & 0x1ffff) == 0x17a) - { - #include "insns/amoadd_w.h" - break; - } - if((insn.bits & 0x1ffff) == 0xd7a) - { - #include "insns/amoor_w.h" - break; - } - if((insn.bits & 0x1ffff) == 0x117a) - { - #include "insns/amomin_w.h" - break; - } - if((insn.bits & 0x1ffff) == 0x57a) - { - #include "insns/amoswap_w.h" - break; - } - #include "insns/unimp.h" - } - case 0x3: - { - if((insn.bits & 0x1ffff) == 0x19fa) - { - #include "insns/amominu_d.h" - break; - } - if((insn.bits & 0x1ffff) == 0x9fa) - { - #include "insns/amoand_d.h" - break; - } - if((insn.bits & 0x1ffff) == 0x1dfa) - { - #include "insns/amomaxu_d.h" - break; - } - if((insn.bits & 0x1ffff) == 0x11fa) - { - #include "insns/amomin_d.h" - break; - } - if((insn.bits & 0x1ffff) == 0x1fa) - { - #include "insns/amoadd_d.h" - break; - } - if((insn.bits & 0x1ffff) == 0x15fa) - { - #include "insns/amomax_d.h" - break; - } - if((insn.bits & 0x1ffff) == 0xdfa) - { - #include "insns/amoor_d.h" - break; - } - if((insn.bits & 0x1ffff) == 0x5fa) - { - #include "insns/amoswap_d.h" - break; - } - #include "insns/unimp.h" - } - default: - { - #include "insns/unimp.h" - } - } + #include "insns/jal.h" break; } - case 0x7b: + case 0x7f: { switch((insn.bits >> 0x7) & 0x7) { case 0x0: { - if((insn.bits & 0x7ffffff) == 0x7b) + if((insn.bits & 0x7ffffff) == 0x47f) { - #include "insns/rdnpc.h" + #include "insns/di.h" + break; + } + if((insn.bits & 0x7ffffff) == 0x7f) + { + #include "insns/ei.h" break; } #include "insns/unimp.h" } case 0x1: { - if((insn.bits & 0x7c1ffff) == 0xfb) + if((insn.bits & 0x7c1ffff) == 0xff) { - #include "insns/mfcr.h" + #include "insns/mfpcr.h" break; } - if((insn.bits & 0xf801ffff) == 0x4fb) + if((insn.bits & 0xf801ffff) == 0x4ff) { - #include "insns/mtcr.h" + #include "insns/mtpcr.h" break; } #include "insns/unimp.h" } case 0x2: { - if((insn.bits & 0xffffffff) == 0x17b) - { - #include "insns/sync.h" - break; - } - #include "insns/unimp.h" - } - case 0x3: - { - if((insn.bits & 0xffc003ff) == 0x1fb) + if((insn.bits & 0xffffffff) == 0x17f) { - #include "insns/syscall.h" + #include "insns/eret.h" break; } #include "insns/unimp.h" diff --git a/riscv/insns/fsel_d.h b/riscv/insns/fsel_d.h deleted file mode 100644 index fe74bcd..0000000 --- a/riscv/insns/fsel_d.h +++ /dev/null @@ -1,3 +0,0 @@ -require_fp; -FRD = !f64_eq(FRS1, 0) ? FRS2 : FRS3; -set_fp_exceptions; diff --git a/riscv/insns/fsel_s.h b/riscv/insns/fsel_s.h deleted file mode 100644 index 78b8f5d..0000000 --- a/riscv/insns/fsel_s.h +++ /dev/null @@ -1,3 +0,0 @@ -require_fp; -FRD = !f32_eq(FRS1, 0) ? FRS2 : FRS3; -set_fp_exceptions;