Browse Source

[sim, opcodes] made sim more decoupled from opcodes

cs250
Andrew Waterman 15 years ago
parent
commit
3fcb2cbe79
  1. 1028
      riscv/dispatch.h
  2. 887
      riscv/dispatch_0.cc
  3. 1227
      riscv/dispatch_1.cc
  4. 887
      riscv/dispatch_2.cc
  5. 1211
      riscv/dispatch_3.cc
  6. 880
      riscv/dispatch_4.cc
  7. 1148
      riscv/dispatch_5.cc
  8. 880
      riscv/dispatch_6.cc
  9. 1086
      riscv/dispatch_7.cc
  10. 892
      riscv/dispatch_8.cc
  11. 1144
      riscv/dispatch_9.cc
  12. 1026
      riscv/dispatch_decl.h
  13. 2
      riscv/insn_footer.h
  14. 22
      riscv/insn_header.h
  15. 7
      riscv/insn_includes.h
  16. 2
      riscv/insns/jalr_j.h
  17. 2
      riscv/insns/jalr_r.h
  18. 272
      riscv/opcodes.h
  19. 56
      riscv/processor.cc
  20. 14
      riscv/processor.h
  21. 26
      riscv/riscv.mk.in

1028
riscv/dispatch.h

File diff suppressed because it is too large

887
riscv/dispatch_0.cc

@ -1,887 +0,0 @@
#include "insn_includes.h"
reg_t processor_t::opcode_func_000(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_00a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_014(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_01e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_028(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_032(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_03c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000001c);
#include "insns/c_add3.h"
return npc;
}
reg_t processor_t::opcode_func_046(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_050(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_05a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_064(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_06e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_078(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_082(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_08c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_096(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_0a0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_0aa(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_0b4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_0be(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0c8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_0d2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0dc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000001c);
#include "insns/c_add3.h"
return npc;
}
reg_t processor_t::opcode_func_0e6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_0f0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_0fa(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_104(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_10e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_118(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_122(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_12c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_136(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_140(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_14a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_154(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_15e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_168(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_172(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_17c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000011c);
#include "insns/c_sub3.h"
return npc;
}
reg_t processor_t::opcode_func_186(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_190(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_19a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1a4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_1ae(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1b8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_1c2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1cc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_1d6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_1e0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_1ea(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_1f4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_1fe(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_208(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_212(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_21c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000021c);
#include "insns/c_or3.h"
return npc;
}
reg_t processor_t::opcode_func_226(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_230(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_23a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_244(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_24e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_258(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_262(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_26c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_276(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_280(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_28a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_294(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_29e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2a8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_2b2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2bc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000021c);
#include "insns/c_or3.h"
return npc;
}
reg_t processor_t::opcode_func_2c6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_2d0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_2da(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2e4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_2ee(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2f8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_302(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_30c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_316(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_320(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_32a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_334(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_33e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_348(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_352(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_35c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000031c);
#include "insns/c_and3.h"
return npc;
}
reg_t processor_t::opcode_func_366(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_370(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_37a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_384(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_38e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_398(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_3a2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3ac(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_3b6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_3c0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_3ca(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_3d4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_3de(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3e8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_3f2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3fc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000031c);
#include "insns/c_and3.h"
return npc;
}

1227
riscv/dispatch_1.cc

File diff suppressed because it is too large

887
riscv/dispatch_2.cc

@ -1,887 +0,0 @@
#include "insn_includes.h"
reg_t processor_t::opcode_func_002(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_00c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_016(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_020(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_02a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_034(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_03e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_048(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_052(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_05c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000001c);
#include "insns/c_add3.h"
return npc;
}
reg_t processor_t::opcode_func_066(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_070(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_07a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_084(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_08e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_098(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_0a2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0ac(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_0b6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_0c0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_0ca(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_0d4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_0de(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0e8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_0f2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0fc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000001c);
#include "insns/c_add3.h"
return npc;
}
reg_t processor_t::opcode_func_106(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_110(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_11a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_124(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_12e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_138(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_142(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_14c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_156(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_160(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_16a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_174(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_17e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_188(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_192(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_19c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000011c);
#include "insns/c_sub3.h"
return npc;
}
reg_t processor_t::opcode_func_1a6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_1b0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_1ba(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1c4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_1ce(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1d8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_1e2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1ec(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_1f6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_200(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_20a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_214(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_21e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_228(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_232(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_23c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000021c);
#include "insns/c_or3.h"
return npc;
}
reg_t processor_t::opcode_func_246(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_250(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_25a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_264(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_26e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_278(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_282(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_28c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_296(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_2a0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_2aa(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_2b4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_2be(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2c8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_2d2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2dc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000021c);
#include "insns/c_or3.h"
return npc;
}
reg_t processor_t::opcode_func_2e6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_2f0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_2fa(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_304(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_30e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_318(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_322(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_32c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_336(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_340(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_34a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_354(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_35e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_368(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_372(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_37c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000031c);
#include "insns/c_and3.h"
return npc;
}
reg_t processor_t::opcode_func_386(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_390(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_39a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3a4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_3ae(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3b8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_3c2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3cc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_3d6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_3e0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_3ea(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_3f4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_3fe(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}

1211
riscv/dispatch_3.cc

File diff suppressed because it is too large

880
riscv/dispatch_4.cc

@ -1,880 +0,0 @@
#include "insn_includes.h"
reg_t processor_t::opcode_func_004(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_00e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_018(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_022(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_02c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_036(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_040(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_04a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_054(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_05e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_068(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_072(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_07c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000001c);
#include "insns/c_add3.h"
return npc;
}
reg_t processor_t::opcode_func_086(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_090(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_09a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0a4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_0ae(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0b8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_0c2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0cc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_0d6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_0e0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_0ea(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_0f4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_0fe(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_108(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_112(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_11c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000011c);
#include "insns/c_sub3.h"
return npc;
}
reg_t processor_t::opcode_func_126(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_130(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_13a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_144(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_14e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_158(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_162(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_16c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_176(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_180(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_18a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_194(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_19e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1a8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_1b2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1bc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000011c);
#include "insns/c_sub3.h"
return npc;
}
reg_t processor_t::opcode_func_1c6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_1d0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_1da(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1e4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_1ee(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1f8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_202(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_20c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_216(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_220(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_22a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_234(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_23e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_248(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_252(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_25c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000021c);
#include "insns/c_or3.h"
return npc;
}
reg_t processor_t::opcode_func_266(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_270(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_27a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_284(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_28e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_298(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_2a2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2ac(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_2b6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_2c0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_2ca(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_2d4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_2de(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2e8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_2f2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2fc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000021c);
#include "insns/c_or3.h"
return npc;
}
reg_t processor_t::opcode_func_306(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_310(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_31a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_324(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_32e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_338(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_342(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_34c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_356(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_360(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_36a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_374(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_37e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_388(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_392(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_39c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000031c);
#include "insns/c_and3.h"
return npc;
}
reg_t processor_t::opcode_func_3a6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_3b0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_3ba(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3c4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_3ce(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3d8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_3e2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3ec(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_3f6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}

1148
riscv/dispatch_5.cc

File diff suppressed because it is too large

880
riscv/dispatch_6.cc

@ -1,880 +0,0 @@
#include "insn_includes.h"
reg_t processor_t::opcode_func_006(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_010(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_01a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_024(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_02e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_038(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_042(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_04c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_056(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_060(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_06a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_074(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_07e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_088(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_092(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_09c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000001c);
#include "insns/c_add3.h"
return npc;
}
reg_t processor_t::opcode_func_0a6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_0b0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_0ba(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0c4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_0ce(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0d8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_0e2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0ec(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_0f6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_100(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_10a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_114(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_11e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_128(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_132(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_13c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000011c);
#include "insns/c_sub3.h"
return npc;
}
reg_t processor_t::opcode_func_146(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_150(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_15a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_164(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_16e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_178(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_182(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_18c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_196(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_1a0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_1aa(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_1b4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_1be(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1c8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_1d2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1dc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000011c);
#include "insns/c_sub3.h"
return npc;
}
reg_t processor_t::opcode_func_1e6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_1f0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_1fa(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_204(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_20e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_218(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_222(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_22c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_236(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_240(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_24a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_254(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_25e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_268(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_272(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_27c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000021c);
#include "insns/c_or3.h"
return npc;
}
reg_t processor_t::opcode_func_286(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_290(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_29a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2a4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_2ae(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2b8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_2c2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2cc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_2d6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_2e0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_2ea(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_2f4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_2fe(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_308(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_312(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_31c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000031c);
#include "insns/c_and3.h"
return npc;
}
reg_t processor_t::opcode_func_326(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_330(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_33a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_344(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_34e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_358(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_362(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_36c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_376(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_380(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_38a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_394(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_39e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3a8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_3b2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3bc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000031c);
#include "insns/c_and3.h"
return npc;
}
reg_t processor_t::opcode_func_3c6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_3d0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_3da(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3e4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_3ee(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3f8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}

1086
riscv/dispatch_7.cc

File diff suppressed because it is too large

892
riscv/dispatch_8.cc

@ -1,892 +0,0 @@
#include "insn_includes.h"
reg_t processor_t::opcode_func_008(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_012(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_01c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000001c);
#include "insns/c_add3.h"
return npc;
}
reg_t processor_t::opcode_func_026(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_030(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_03a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_044(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_04e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_058(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_062(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_06c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_076(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_080(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_08a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_094(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_09e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0a8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_0b2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0bc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000001c);
#include "insns/c_add3.h"
return npc;
}
reg_t processor_t::opcode_func_0c6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_0d0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_0da(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0e4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_0ee(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_0f8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_102(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_10c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_116(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_120(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_12a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_134(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_13e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_148(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_152(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_15c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000011c);
#include "insns/c_sub3.h"
return npc;
}
reg_t processor_t::opcode_func_166(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_170(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_17a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_184(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_18e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_198(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_1a2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1ac(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_1b6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_1c0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_1ca(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_1d4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_1de(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1e8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_1f2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_1fc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000011c);
#include "insns/c_sub3.h"
return npc;
}
reg_t processor_t::opcode_func_206(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_210(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_21a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_224(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_22e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_238(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_242(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_24c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_256(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_260(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_26a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_274(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_27e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_288(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_292(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_29c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000021c);
#include "insns/c_or3.h"
return npc;
}
reg_t processor_t::opcode_func_2a6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_2b0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_2ba(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2c4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_2ce(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2d8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_2e2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_2ec(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_2f6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_300(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_30a(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_314(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_31e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_328(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_332(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_33c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000031c);
#include "insns/c_and3.h"
return npc;
}
reg_t processor_t::opcode_func_346(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_350(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_35a(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_364(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000004);
#include "insns/c_ldsp.h"
return npc;
}
reg_t processor_t::opcode_func_36e(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_378(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000018);
#include "insns/c_fsd.h"
return npc;
}
reg_t processor_t::opcode_func_382(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x2)
{
reg_t npc = pc + insn_length(0x00000002);
#include "insns/c_move.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8002)
{
reg_t npc = pc + insn_length(0x00008002);
#include "insns/c_j.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_38c(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000c);
#include "insns/c_sd.h"
return npc;
}
reg_t processor_t::opcode_func_396(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000016);
#include "insns/c_fsw.h"
return npc;
}
reg_t processor_t::opcode_func_3a0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000000);
#include "insns/c_li.h"
return npc;
}
reg_t processor_t::opcode_func_3aa(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000000a);
#include "insns/c_lw.h"
return npc;
}
reg_t processor_t::opcode_func_3b4(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000014);
#include "insns/c_flw.h"
return npc;
}
reg_t processor_t::opcode_func_3be(insn_t insn, reg_t pc)
{
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3c8(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000008);
#include "insns/c_swsp.h"
return npc;
}
reg_t processor_t::opcode_func_3d2(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x12)
{
reg_t npc = pc + insn_length(0x00000012);
#include "insns/c_lw0.h"
return npc;
}
if((insn.bits & 0x801f) == 0x8012)
{
reg_t npc = pc + insn_length(0x00008012);
#include "insns/c_ld0.h"
return npc;
}
throw trap_illegal_instruction;
}
reg_t processor_t::opcode_func_3dc(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x0000031c);
#include "insns/c_and3.h"
return npc;
}
reg_t processor_t::opcode_func_3e6(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000006);
#include "insns/c_sdsp.h"
return npc;
}
reg_t processor_t::opcode_func_3f0(insn_t insn, reg_t pc)
{
reg_t npc = pc + insn_length(0x00000010);
#include "insns/c_beq.h"
return npc;
}
reg_t processor_t::opcode_func_3fa(insn_t insn, reg_t pc)
{
if((insn.bits & 0x801f) == 0x801a)
{
reg_t npc = pc + insn_length(0x0000801a);
#include "insns/c_sub.h"
return npc;
}
if((insn.bits & 0x801f) == 0x1a)
{
reg_t npc = pc + insn_length(0x0000001a);
#include "insns/c_add.h"
return npc;
}
throw trap_illegal_instruction;
}

1144
riscv/dispatch_9.cc

File diff suppressed because it is too large

1026
riscv/dispatch_decl.h

File diff suppressed because it is too large

2
riscv/insn_footer.h

@ -0,0 +1,2 @@
return npc;
}

22
riscv/insn_header.h

@ -0,0 +1,22 @@
#include "processor.h"
#include "common.h"
#include "config.h"
#include "sim.h"
#include "softfloat.h"
#include "platform.h" // softfloat isNaNF32UI, etc.
#include "internals.h" // ditto
#define DECLARE_INSN(name, opcode, mask) \
const uint32_t MATCH_ ## name = opcode; \
const uint32_t MASK_ ## name = mask;
#include "opcodes.h"
#undef DECLARE_INSN
reg_t processor_t::FUNC (insn_t insn, reg_t pc)
{
#define MASK (~(DISPATCH_TABLE_SIZE-1) & OPCODE_MASK)
#define MATCH (~(DISPATCH_TABLE_SIZE-1) & OPCODE_MATCH)
if(unlikely((insn.bits & MASK) != MATCH))
throw trap_illegal_instruction;
reg_t npc = pc + insn_length(OPCODE_MATCH);

7
riscv/insn_includes.h

@ -1,7 +0,0 @@
#include "processor.h"
#include "common.h"
#include "config.h"
#include "sim.h"
#include "softfloat.h"
#include "platform.h" // softfloat isNaNF32UI, etc.
#include "internals.h" // ditto

2
riscv/insns/jalr_j.h

@ -1 +1 @@
#include "jalr_c.h"
#include "insns/jalr_c.h"

2
riscv/insns/jalr_r.h

@ -1 +1 @@
#include "jalr_c.h"
#include "insns/jalr_c.h"

272
riscv/opcodes.h

@ -0,0 +1,272 @@
DECLARE_INSN(movn, 0x6f7, 0x1ffff)
DECLARE_INSN(vfsstw, 0x150f, 0x1ffff)
DECLARE_INSN(remuw, 0x7bb, 0x1ffff)
DECLARE_INSN(fmin_d, 0x180d3, 0x1ffff)
DECLARE_INSN(vlsthu, 0x128b, 0x1ffff)
DECLARE_INSN(c_swsp, 0x8, 0x1f)
DECLARE_INSN(bltu, 0x363, 0x3ff)
DECLARE_INSN(vlsegstwu, 0xb0b, 0xfff)
DECLARE_INSN(movz, 0x2f7, 0x1ffff)
DECLARE_INSN(fcvt_lu_s, 0x9053, 0x3ff1ff)
DECLARE_INSN(fence_l_cv, 0x32f, 0x3ff)
DECLARE_INSN(fmin_s, 0x18053, 0x1ffff)
DECLARE_INSN(c_lw0, 0x12, 0x801f)
DECLARE_INSN(slliw, 0x9b, 0x3f83ff)
DECLARE_INSN(lb, 0x3, 0x3ff)
DECLARE_INSN(vlwu, 0x30b, 0x3fffff)
DECLARE_INSN(fcvt_d_l, 0xc0d3, 0x3ff1ff)
DECLARE_INSN(lh, 0x83, 0x3ff)
DECLARE_INSN(fcvt_d_w, 0xe0d3, 0x3ff1ff)
DECLARE_INSN(lw, 0x103, 0x3ff)
DECLARE_INSN(add, 0x33, 0x1ffff)
DECLARE_INSN(fcvt_d_s, 0x100d3, 0x3ff1ff)
DECLARE_INSN(fence_g_v, 0x2af, 0x3ff)
DECLARE_INSN(mfpcr, 0x17b, 0x7c1ffff)
DECLARE_INSN(c_fsd, 0x18, 0x1f)
DECLARE_INSN(fmax_d, 0x190d3, 0x1ffff)
DECLARE_INSN(bne, 0xe3, 0x3ff)
DECLARE_INSN(rdcycle, 0x277, 0x7ffffff)
DECLARE_INSN(fcvt_s_d, 0x11053, 0x3ff1ff)
DECLARE_INSN(vlh, 0x8b, 0x3fffff)
DECLARE_INSN(bgeu, 0x3e3, 0x3ff)
DECLARE_INSN(vflstd, 0x158b, 0x1ffff)
DECLARE_INSN(c_li, 0x0, 0x1f)
DECLARE_INSN(di, 0xfb, 0x7ffffff)
DECLARE_INSN(sltiu, 0x193, 0x3ff)
DECLARE_INSN(mtpcr, 0x1fb, 0xf801ffff)
DECLARE_INSN(vlb, 0xb, 0x3fffff)
DECLARE_INSN(stop, 0x177, 0xffffffff)
DECLARE_INSN(vld, 0x18b, 0x3fffff)
DECLARE_INSN(c_slli, 0x19, 0x1c1f)
DECLARE_INSN(break, 0xf7, 0xffffffff)
DECLARE_INSN(cflush, 0x2fb, 0xffffffff)
DECLARE_INSN(fcvt_s_w, 0xe053, 0x3ff1ff)
DECLARE_INSN(vflstw, 0x150b, 0x1ffff)
DECLARE_INSN(mul, 0x433, 0x1ffff)
DECLARE_INSN(c_lw, 0xa, 0x1f)
DECLARE_INSN(vlw, 0x10b, 0x3fffff)
DECLARE_INSN(vssegstw, 0x90f, 0xfff)
DECLARE_INSN(amominu_d, 0x19ab, 0x1ffff)
DECLARE_INSN(c_sdsp, 0x6, 0x1f)
DECLARE_INSN(utidx, 0x1f7, 0x7ffffff)
DECLARE_INSN(srli, 0x293, 0x3f03ff)
DECLARE_INSN(c_srli, 0x819, 0x1c1f)
DECLARE_INSN(c_ldsp, 0x4, 0x1f)
DECLARE_INSN(c_flw, 0x14, 0x1f)
DECLARE_INSN(c_srai32, 0x1419, 0x1c1f)
DECLARE_INSN(amominu_w, 0x192b, 0x1ffff)
DECLARE_INSN(divuw, 0x6bb, 0x1ffff)
DECLARE_INSN(mulw, 0x43b, 0x1ffff)
DECLARE_INSN(vssegstd, 0x98f, 0xfff)
DECLARE_INSN(srlw, 0x2bb, 0x1ffff)
DECLARE_INSN(vssegstb, 0x80f, 0xfff)
DECLARE_INSN(mftx_d, 0x1c0d3, 0x7c1ffff)
DECLARE_INSN(div, 0x633, 0x1ffff)
DECLARE_INSN(c_ld, 0x9, 0x1f)
DECLARE_INSN(mftx_s, 0x1c053, 0x7c1ffff)
DECLARE_INSN(vssegsth, 0x88f, 0xfff)
DECLARE_INSN(vvcfgivl, 0xf3, 0x3ff)
DECLARE_INSN(j, 0x67, 0x7f)
DECLARE_INSN(ei, 0x7b, 0x7ffffff)
DECLARE_INSN(fence, 0x12f, 0x3ff)
DECLARE_INSN(vsw, 0x10f, 0x3fffff)
DECLARE_INSN(fnmsub_s, 0x4b, 0x1ff)
DECLARE_INSN(vfssegstd, 0xd8f, 0xfff)
DECLARE_INSN(fcvt_l_s, 0x8053, 0x3ff1ff)
DECLARE_INSN(fle_s, 0x17053, 0x1ffff)
DECLARE_INSN(vsb, 0xf, 0x3fffff)
DECLARE_INSN(mffsr, 0x1d053, 0x7ffffff)
DECLARE_INSN(fdiv_s, 0x3053, 0x1f1ff)
DECLARE_INSN(vlstbu, 0x120b, 0x1ffff)
DECLARE_INSN(vsetvl, 0x2f3, 0x3fffff)
DECLARE_INSN(fle_d, 0x170d3, 0x1ffff)
DECLARE_INSN(fence_i, 0xaf, 0x3ff)
DECLARE_INSN(vlsegbu, 0x220b, 0x1ffff)
DECLARE_INSN(fnmsub_d, 0xcb, 0x1ff)
DECLARE_INSN(addw, 0x3b, 0x1ffff)
DECLARE_INSN(sll, 0xb3, 0x1ffff)
DECLARE_INSN(xor, 0x233, 0x1ffff)
DECLARE_INSN(sub, 0x10033, 0x1ffff)
DECLARE_INSN(eret, 0x27b, 0xffffffff)
DECLARE_INSN(blt, 0x263, 0x3ff)
DECLARE_INSN(vsstw, 0x110f, 0x1ffff)
DECLARE_INSN(mtfsr, 0x1f053, 0x3fffff)
DECLARE_INSN(vssth, 0x108f, 0x1ffff)
DECLARE_INSN(rem, 0x733, 0x1ffff)
DECLARE_INSN(srliw, 0x29b, 0x3f83ff)
DECLARE_INSN(lui, 0x37, 0x7f)
DECLARE_INSN(vsstb, 0x100f, 0x1ffff)
DECLARE_INSN(fcvt_s_lu, 0xd053, 0x3ff1ff)
DECLARE_INSN(vsstd, 0x118f, 0x1ffff)
DECLARE_INSN(addi, 0x13, 0x3ff)
DECLARE_INSN(vfmst, 0x1173, 0x1ffff)
DECLARE_INSN(mulh, 0x4b3, 0x1ffff)
DECLARE_INSN(fmul_s, 0x2053, 0x1f1ff)
DECLARE_INSN(vlsegsthu, 0xa8b, 0xfff)
DECLARE_INSN(srai, 0x10293, 0x3f03ff)
DECLARE_INSN(amoand_d, 0x9ab, 0x1ffff)
DECLARE_INSN(flt_d, 0x160d3, 0x1ffff)
DECLARE_INSN(sraw, 0x102bb, 0x1ffff)
DECLARE_INSN(fmul_d, 0x20d3, 0x1f1ff)
DECLARE_INSN(ld, 0x183, 0x3ff)
DECLARE_INSN(ori, 0x313, 0x3ff)
DECLARE_INSN(flt_s, 0x16053, 0x1ffff)
DECLARE_INSN(addiw, 0x1b, 0x3ff)
DECLARE_INSN(amoand_w, 0x92b, 0x1ffff)
DECLARE_INSN(feq_s, 0x15053, 0x1ffff)
DECLARE_INSN(fsgnjx_d, 0x70d3, 0x1ffff)
DECLARE_INSN(sra, 0x102b3, 0x1ffff)
DECLARE_INSN(c_lwsp, 0x5, 0x1f)
DECLARE_INSN(bge, 0x2e3, 0x3ff)
DECLARE_INSN(c_add3, 0x1c, 0x31f)
DECLARE_INSN(sraiw, 0x1029b, 0x3f83ff)
DECLARE_INSN(vssegd, 0x218f, 0x1ffff)
DECLARE_INSN(srl, 0x2b3, 0x1ffff)
DECLARE_INSN(vfmts, 0x1973, 0x1ffff)
DECLARE_INSN(fsgnjx_s, 0x7053, 0x1ffff)
DECLARE_INSN(vfmsv, 0x973, 0x3fffff)
DECLARE_INSN(feq_d, 0x150d3, 0x1ffff)
DECLARE_INSN(fcvt_d_wu, 0xf0d3, 0x3ff1ff)
DECLARE_INSN(vmts, 0x1873, 0x1ffff)
DECLARE_INSN(or, 0x333, 0x1ffff)
DECLARE_INSN(rdinstret, 0xa77, 0x7ffffff)
DECLARE_INSN(fcvt_wu_d, 0xb0d3, 0x3ff1ff)
DECLARE_INSN(subw, 0x1003b, 0x1ffff)
DECLARE_INSN(jalr_c, 0x6b, 0x3ff)
DECLARE_INSN(fmax_s, 0x19053, 0x1ffff)
DECLARE_INSN(amomaxu_d, 0x1dab, 0x1ffff)
DECLARE_INSN(c_slliw, 0x1819, 0x1c1f)
DECLARE_INSN(jalr_j, 0x16b, 0x3ff)
DECLARE_INSN(c_fld, 0x15, 0x1f)
DECLARE_INSN(vlstw, 0x110b, 0x1ffff)
DECLARE_INSN(vlsth, 0x108b, 0x1ffff)
DECLARE_INSN(xori, 0x213, 0x3ff)
DECLARE_INSN(jalr_r, 0xeb, 0x3ff)
DECLARE_INSN(amomaxu_w, 0x1d2b, 0x1ffff)
DECLARE_INSN(fcvt_wu_s, 0xb053, 0x3ff1ff)
DECLARE_INSN(vlstb, 0x100b, 0x1ffff)
DECLARE_INSN(vlstd, 0x118b, 0x1ffff)
DECLARE_INSN(c_ld0, 0x8012, 0x801f)
DECLARE_INSN(rdtime, 0x677, 0x7ffffff)
DECLARE_INSN(andi, 0x393, 0x3ff)
DECLARE_INSN(c_srli32, 0xc19, 0x1c1f)
DECLARE_INSN(fsgnjn_d, 0x60d3, 0x1ffff)
DECLARE_INSN(fnmadd_s, 0x4f, 0x1ff)
DECLARE_INSN(jal, 0x6f, 0x7f)
DECLARE_INSN(lwu, 0x303, 0x3ff)
DECLARE_INSN(vlsegstbu, 0xa0b, 0xfff)
DECLARE_INSN(c_beq, 0x10, 0x1f)
DECLARE_INSN(vlhu, 0x28b, 0x3fffff)
DECLARE_INSN(vfsstd, 0x158f, 0x1ffff)
DECLARE_INSN(c_bne, 0x11, 0x1f)
DECLARE_INSN(fnmadd_d, 0xcf, 0x1ff)
DECLARE_INSN(fence_g_cv, 0x3af, 0x3ff)
DECLARE_INSN(amoadd_d, 0x1ab, 0x1ffff)
DECLARE_INSN(c_sw, 0xd, 0x1f)
DECLARE_INSN(amomax_w, 0x152b, 0x1ffff)
DECLARE_INSN(c_move, 0x2, 0x801f)
DECLARE_INSN(fmovn, 0xef7, 0x1ffff)
DECLARE_INSN(c_fsw, 0x16, 0x1f)
DECLARE_INSN(c_j, 0x8002, 0x801f)
DECLARE_INSN(mulhsu, 0x533, 0x1ffff)
DECLARE_INSN(c_sd, 0xc, 0x1f)
DECLARE_INSN(amoadd_w, 0x12b, 0x1ffff)
DECLARE_INSN(fcvt_d_lu, 0xd0d3, 0x3ff1ff)
DECLARE_INSN(amomax_d, 0x15ab, 0x1ffff)
DECLARE_INSN(fcvt_w_d, 0xa0d3, 0x3ff1ff)
DECLARE_INSN(fmovz, 0xaf7, 0x1ffff)
DECLARE_INSN(c_or3, 0x21c, 0x31f)
DECLARE_INSN(vmvv, 0x73, 0x3fffff)
DECLARE_INSN(vfssegstw, 0xd0f, 0xfff)
DECLARE_INSN(slt, 0x133, 0x1ffff)
DECLARE_INSN(mxtf_d, 0x1e0d3, 0x3fffff)
DECLARE_INSN(sllw, 0xbb, 0x1ffff)
DECLARE_INSN(amoor_d, 0xdab, 0x1ffff)
DECLARE_INSN(slti, 0x113, 0x3ff)
DECLARE_INSN(remu, 0x7b3, 0x1ffff)
DECLARE_INSN(flw, 0x107, 0x3ff)
DECLARE_INSN(remw, 0x73b, 0x1ffff)
DECLARE_INSN(sltu, 0x1b3, 0x1ffff)
DECLARE_INSN(slli, 0x93, 0x3f03ff)
DECLARE_INSN(c_and3, 0x31c, 0x31f)
DECLARE_INSN(vssegw, 0x210f, 0x1ffff)
DECLARE_INSN(amoor_w, 0xd2b, 0x1ffff)
DECLARE_INSN(vsd, 0x18f, 0x3fffff)
DECLARE_INSN(beq, 0x63, 0x3ff)
DECLARE_INSN(fld, 0x187, 0x3ff)
DECLARE_INSN(mxtf_s, 0x1e053, 0x3fffff)
DECLARE_INSN(fsub_s, 0x1053, 0x1f1ff)
DECLARE_INSN(and, 0x3b3, 0x1ffff)
DECLARE_INSN(vtcfgivl, 0x1f3, 0x3ff)
DECLARE_INSN(lbu, 0x203, 0x3ff)
DECLARE_INSN(vf, 0x3f3, 0xf80003ff)
DECLARE_INSN(vlsegstw, 0x90b, 0xfff)
DECLARE_INSN(syscall, 0x77, 0xffffffff)
DECLARE_INSN(fsgnj_s, 0x5053, 0x1ffff)
DECLARE_INSN(c_addi, 0x1, 0x1f)
DECLARE_INSN(vfmvv, 0x173, 0x3fffff)
DECLARE_INSN(vlstwu, 0x130b, 0x1ffff)
DECLARE_INSN(c_sub3, 0x11c, 0x31f)
DECLARE_INSN(vsh, 0x8f, 0x3fffff)
DECLARE_INSN(vlsegstb, 0x80b, 0xfff)
DECLARE_INSN(vlsegstd, 0x98b, 0xfff)
DECLARE_INSN(vflsegd, 0x258b, 0x1ffff)
DECLARE_INSN(vflsegw, 0x250b, 0x1ffff)
DECLARE_INSN(vlsegsth, 0x88b, 0xfff)
DECLARE_INSN(fsgnj_d, 0x50d3, 0x1ffff)
DECLARE_INSN(vflsegstw, 0xd0b, 0xfff)
DECLARE_INSN(c_sub, 0x801a, 0x801f)
DECLARE_INSN(mulhu, 0x5b3, 0x1ffff)
DECLARE_INSN(fcvt_l_d, 0x80d3, 0x3ff1ff)
DECLARE_INSN(vmsv, 0x873, 0x3fffff)
DECLARE_INSN(vmst, 0x1073, 0x1ffff)
DECLARE_INSN(fadd_d, 0xd3, 0x1f1ff)
DECLARE_INSN(fcvt_s_wu, 0xf053, 0x3ff1ff)
DECLARE_INSN(rdnpc, 0x26b, 0x7ffffff)
DECLARE_INSN(fcvt_s_l, 0xc053, 0x3ff1ff)
DECLARE_INSN(vflsegstd, 0xd8b, 0xfff)
DECLARE_INSN(c_add, 0x1a, 0x801f)
DECLARE_INSN(fcvt_lu_d, 0x90d3, 0x3ff1ff)
DECLARE_INSN(vfld, 0x58b, 0x3fffff)
DECLARE_INSN(fsub_d, 0x10d3, 0x1f1ff)
DECLARE_INSN(fmadd_s, 0x43, 0x1ff)
DECLARE_INSN(fcvt_w_s, 0xa053, 0x3ff1ff)
DECLARE_INSN(vssegh, 0x208f, 0x1ffff)
DECLARE_INSN(fsqrt_s, 0x4053, 0x3ff1ff)
DECLARE_INSN(c_srai, 0x1019, 0x1c1f)
DECLARE_INSN(amomin_w, 0x112b, 0x1ffff)
DECLARE_INSN(fsgnjn_s, 0x6053, 0x1ffff)
DECLARE_INSN(c_slli32, 0x419, 0x1c1f)
DECLARE_INSN(vlsegwu, 0x230b, 0x1ffff)
DECLARE_INSN(vfsw, 0x50f, 0x3fffff)
DECLARE_INSN(amoswap_d, 0x5ab, 0x1ffff)
DECLARE_INSN(fence_l_v, 0x22f, 0x3ff)
DECLARE_INSN(fsqrt_d, 0x40d3, 0x3ff1ff)
DECLARE_INSN(vflw, 0x50b, 0x3fffff)
DECLARE_INSN(fdiv_d, 0x30d3, 0x1f1ff)
DECLARE_INSN(fmadd_d, 0xc3, 0x1ff)
DECLARE_INSN(divw, 0x63b, 0x1ffff)
DECLARE_INSN(amomin_d, 0x11ab, 0x1ffff)
DECLARE_INSN(divu, 0x6b3, 0x1ffff)
DECLARE_INSN(amoswap_w, 0x52b, 0x1ffff)
DECLARE_INSN(vfsd, 0x58f, 0x3fffff)
DECLARE_INSN(fadd_s, 0x53, 0x1f1ff)
DECLARE_INSN(vlsegb, 0x200b, 0x1ffff)
DECLARE_INSN(fsd, 0x1a7, 0x3ff)
DECLARE_INSN(vlsegd, 0x218b, 0x1ffff)
DECLARE_INSN(vlsegh, 0x208b, 0x1ffff)
DECLARE_INSN(sw, 0x123, 0x3ff)
DECLARE_INSN(fmsub_s, 0x47, 0x1ff)
DECLARE_INSN(vfssegw, 0x250f, 0x1ffff)
DECLARE_INSN(c_addiw, 0x1d, 0x1f)
DECLARE_INSN(lhu, 0x283, 0x3ff)
DECLARE_INSN(sh, 0xa3, 0x3ff)
DECLARE_INSN(vlsegw, 0x210b, 0x1ffff)
DECLARE_INSN(fsw, 0x127, 0x3ff)
DECLARE_INSN(vlbu, 0x20b, 0x3fffff)
DECLARE_INSN(sb, 0x23, 0x3ff)
DECLARE_INSN(fmsub_d, 0xc7, 0x1ff)
DECLARE_INSN(vlseghu, 0x228b, 0x1ffff)
DECLARE_INSN(vssegb, 0x200f, 0x1ffff)
DECLARE_INSN(vfssegd, 0x258f, 0x1ffff)
DECLARE_INSN(sd, 0x1a3, 0x3ff)

56
riscv/processor.cc

@ -12,6 +12,7 @@
processor_t::processor_t(sim_t* _sim, char* _mem, size_t _memsz)
: sim(_sim), mmu(_mem,_memsz)
{
initialize_dispatch_table();
// a few assumptions about endianness, including freg_t union
static_assert(BYTE_ORDER == LITTLE_ENDIAN);
static_assert(sizeof(freg_t) == 8);
@ -172,12 +173,10 @@ void processor_t::step(size_t n, bool noisy)
{
take_interrupt();
#include "dispatch.h"
#define execute_insn(noisy) \
do { insn_t insn = mmu.load_insn(pc, sr & SR_EC); \
if(noisy) disasm(insn,pc); \
pc = dispatch_table[dispatch_index(insn)](this, insn, pc); \
pc = dispatch_table[insn.bits % DISPATCH_TABLE_SIZE](this, insn, pc); \
XPR[0] = 0; } while(0)
if(noisy) for( ; i < n; i++)
@ -267,3 +266,54 @@ void processor_t::disasm(insn_t insn, reg_t pc)
#endif
printf("\n");
}
// if the lower log2(DISPATCH_TABLE_SIZE) bits of an instruction
// uniquely identify that instruction, the dispatch table points
// directly to that insn_func. otherwise, we search the short
// list of instructions that match.
insn_func_t processor_t::dispatch_table[DISPATCH_TABLE_SIZE];
struct insn_chain_t
{
insn_func_t func;
uint32_t opcode;
uint32_t mask;
};
static std::vector<insn_chain_t> dispatch_chain[DISPATCH_TABLE_SIZE];
reg_t processor_t::dispatch(insn_t insn, reg_t pc)
{
size_t idx = insn.bits % DISPATCH_TABLE_SIZE;
for(size_t i = 0; i < dispatch_chain[idx].size(); i++)
{
insn_chain_t& c = dispatch_chain[idx][i];
if((insn.bits & c.mask) == c.opcode)
return c.func(this, insn, pc);
}
throw trap_illegal_instruction;
}
void processor_t::initialize_dispatch_table()
{
if(dispatch_table[0] != NULL)
return;
for(size_t i = 0; i < DISPATCH_TABLE_SIZE; i++)
{
#define DECLARE_INSN(name, opcode, mask) \
if((i & (mask)) == ((opcode) & (mask) & (DISPATCH_TABLE_SIZE-1))) \
dispatch_chain[i].push_back( \
(insn_chain_t){&processor_t::insn_func_ ## name, opcode, mask});
#include "opcodes.h"
#undef DECLARE_INSN
}
for(size_t i = 0; i < DISPATCH_TABLE_SIZE; i++)
{
if(dispatch_chain[i].size() == 1)
dispatch_table[i] = dispatch_chain[i][0].func;
else
dispatch_table[i] = &processor_t::dispatch;
}
}

14
riscv/processor.h

@ -9,6 +9,10 @@
#define MAX_UTS 2048
#define DISPATCH_TABLE_SIZE 1024
class processor_t;
typedef reg_t (*insn_func_t)(processor_t*, insn_t, reg_t);
class sim_t;
class processor_t
@ -87,8 +91,14 @@ private:
icsim_t* dtlbsim;
friend class sim_t;
#include "dispatch_decl.h"
static insn_func_t dispatch_table[DISPATCH_TABLE_SIZE];
reg_t dispatch(insn_t insn, reg_t pc);
static void initialize_dispatch_table();
#define DECLARE_INSN(name, m, o) reg_t insn_func_ ## name (insn_t, reg_t);
#include "opcodes.h"
#undef DECLARE_INSN
};
#endif

26
riscv/riscv.mk.in

@ -2,16 +2,27 @@ riscv_subproject_deps = \
softfloat_riscv \
softfloat \
riscv_insn_hdrs := $(notdir $(wildcard $(src_dir)/riscv/insns/*.h))
riscv_hdrs = \
applink.h \
common.h \
decode.h \
dispatch.h \
mmu.h \
processor.h \
sim.h \
trap.h \
insns/*.h \
opcodes.h \
insn_header.h \
insn_footer.h \
$(patsubst %.h, %.cc, $(riscv_insn_hdrs)): %.cc: insns/%.h $(riscv_hdrs)
@echo \#define FUNC insn_func_$(@:.cc=) > $@
@echo \#define OPCODE_MASK MASK_$(@:.cc=) >> $@
@echo \#define OPCODE_MATCH MATCH_$(@:.cc=) >> $@
@cat $(src_dir)/riscv/insn_header.h >> $@
@cat $< >> $@
@cat $(src_dir)/riscv/insn_footer.h >> $@
riscv_srcs = \
applink.cc \
@ -20,16 +31,7 @@ riscv_srcs = \
trap.cc \
icsim.cc \
mmu.cc \
dispatch_0.cc \
dispatch_1.cc \
dispatch_2.cc \
dispatch_3.cc \
dispatch_4.cc \
dispatch_5.cc \
dispatch_6.cc \
dispatch_7.cc \
dispatch_8.cc \
dispatch_9.cc \
$(patsubst %.h, %.cc, $(riscv_insn_hdrs)) \
riscv_test_srcs =

Loading…
Cancel
Save