From df03e90181776897b0f7f8de21bf85a54f05243d Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 22 Nov 2018 20:28:36 +0100 Subject: [PATCH] Adapted to vm_base refactoring (move into llvm package) --- dbt-core | 2 +- platform/src/sc_main.cpp | 2 +- .../templates/vm-vm_CORENAME.cpp.gtl | 2 +- riscv/gen_input/templates/vm_riscv.in.cpp | 2 +- riscv/src/internal/fp_functions.cpp | 2 +- riscv/src/internal/vm_rv32gc.cpp | 1505 +++++++++-------- riscv/src/internal/vm_rv32imac.cpp | 423 ++--- riscv/src/internal/vm_rv64ia.cpp | 749 ++++---- riscv/src/main.cpp | 2 +- 9 files changed, 1346 insertions(+), 1343 deletions(-) diff --git a/dbt-core b/dbt-core index d73fee6..0b499d2 160000 --- a/dbt-core +++ b/dbt-core @@ -1 +1 @@ -Subproject commit d73fee68dd164c016721ae76d1538136513e6b37 +Subproject commit 0b499d216a2835015b889180ca5108b2daaed9b9 diff --git a/platform/src/sc_main.cpp b/platform/src/sc_main.cpp index d9d60e3..27c058a 100644 --- a/platform/src/sc_main.cpp +++ b/platform/src/sc_main.cpp @@ -32,7 +32,6 @@ #include "CLIParser.h" #include -#include #include #include @@ -45,6 +44,7 @@ #include #include +#include #include #include diff --git a/riscv/gen_input/templates/vm-vm_CORENAME.cpp.gtl b/riscv/gen_input/templates/vm-vm_CORENAME.cpp.gtl index b56fad8..c6f8d37 100644 --- a/riscv/gen_input/templates/vm-vm_CORENAME.cpp.gtl +++ b/riscv/gen_input/templates/vm-vm_CORENAME.cpp.gtl @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/riscv/gen_input/templates/vm_riscv.in.cpp b/riscv/gen_input/templates/vm_riscv.in.cpp index 46a9529..cead0af 100644 --- a/riscv/gen_input/templates/vm_riscv.in.cpp +++ b/riscv/gen_input/templates/vm_riscv.in.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/riscv/src/internal/fp_functions.cpp b/riscv/src/internal/fp_functions.cpp index 34c1bac..4c53f6f 100644 --- a/riscv/src/internal/fp_functions.cpp +++ b/riscv/src/internal/fp_functions.cpp @@ -33,7 +33,7 @@ //////////////////////////////////////////////////////////////////////////////// #include -#include +#include extern "C" { #include diff --git a/riscv/src/internal/vm_rv32gc.cpp b/riscv/src/internal/vm_rv32gc.cpp index bd78915..e6d195d 100644 --- a/riscv/src/internal/vm_rv32gc.cpp +++ b/riscv/src/internal/vm_rv32gc.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include @@ -58,10 +58,11 @@ namespace rv32gc { using namespace iss::arch; using namespace llvm; using namespace iss::debugger; +using namespace iss::vm::llvm; -template class vm_impl : public vm::vm_base { +template class vm_impl : public vm_base { public: - using super = typename vm::vm_base; + using super = typename iss::vm::llvm::vm_base; using virt_addr_t = typename super::virt_addr_t; using phys_addr_t = typename super::phys_addr_t; using code_word_t = typename super::code_word_t; @@ -75,31 +76,31 @@ public: target_adapter_if *accquire_target_adapter(server_if *srv) { debugger_if::dbg_enabled = true; - if (vm::vm_base::tgt_adapter == nullptr) - vm::vm_base::tgt_adapter = new riscv_target_adapter(srv, this->get_arch()); - return vm::vm_base::tgt_adapter; + if (vm_base::tgt_adapter == nullptr) + vm_base::tgt_adapter = new riscv_target_adapter(srv, this->get_arch()); + return vm_base::tgt_adapter; } protected: - using vm::vm_base::get_reg_ptr; + using vm_base::get_reg_ptr; - template inline llvm::ConstantInt *size(T type) { - return llvm::ConstantInt::get(getContext(), llvm::APInt(32, type->getType()->getScalarSizeInBits())); + template inline ConstantInt *size(T type) { + return ConstantInt::get(getContext(), APInt(32, type->getType()->getScalarSizeInBits())); } - void setup_module(llvm::Module* m) override { + void setup_module(Module* m) override { super::setup_module(m); - vm::fp_impl::add_fp_functions_2_module(m, traits::FP_REGS_SIZE); + iss::vm::fp_impl::add_fp_functions_2_module(m, traits::FP_REGS_SIZE); } - inline llvm::Value *gen_choose(llvm::Value *cond, llvm::Value *trueVal, llvm::Value *falseVal, unsigned size) { + inline Value *gen_choose(Value *cond, Value *trueVal, Value *falseVal, unsigned size) { return super::gen_cond_assign(cond, this->gen_ext(trueVal, size), this->gen_ext(falseVal, size)); } - std::tuple gen_single_inst_behavior(virt_addr_t &, unsigned int &, - llvm::BasicBlock *) override; + std::tuple gen_single_inst_behavior(virt_addr_t &, unsigned int &, + BasicBlock *) override; - void gen_leave_behavior(llvm::BasicBlock *leave_blk) override; + void gen_leave_behavior(BasicBlock *leave_blk) override; void gen_raise_trap(uint16_t trap_id, uint16_t cause); @@ -107,16 +108,16 @@ protected: void gen_wait(unsigned type); - void gen_trap_behavior(llvm::BasicBlock *) override; + void gen_trap_behavior(BasicBlock *) override; - void gen_trap_check(llvm::BasicBlock *bb); + void gen_trap_check(BasicBlock *bb); - inline llvm::Value *gen_reg_load(unsigned i, unsigned level = 0) { + inline Value *gen_reg_load(unsigned i, unsigned level = 0) { return this->builder.CreateLoad(get_reg_ptr(i), false); } inline void gen_set_pc(virt_addr_t pc, unsigned reg_num) { - llvm::Value *next_pc_v = this->builder.CreateSExtOrTrunc(this->gen_const(traits::XLEN, pc.val), + Value *next_pc_v = this->builder.CreateSExtOrTrunc(this->gen_const(traits::XLEN, pc.val), this->get_type(traits::XLEN)); this->builder.CreateStore(next_pc_v, get_reg_ptr(reg_num), true); } @@ -128,9 +129,9 @@ protected: enum { LUT_SIZE = 1 << util::bit_count(EXTR_MASK32), LUT_SIZE_C = 1 << util::bit_count(EXTR_MASK16) }; using this_class = vm_impl; - using compile_func = std::tuple (this_class::*)(virt_addr_t &pc, + using compile_func = std::tuple (this_class::*)(virt_addr_t &pc, code_word_t instr, - llvm::BasicBlock *bb); + BasicBlock *bb); std::array lut; std::array lut_00, lut_01, lut_10; @@ -512,7 +513,7 @@ private: /* instruction definitions */ /* instruction 0: LUI */ - std::tuple __lui(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lui(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LUI"); this->gen_sync(iss::PRE_SYNC, 0); @@ -523,7 +524,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LUI x%1$d, 0x%2$05x"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -540,13 +541,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 0); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 1: AUIPC */ - std::tuple __auipc(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __auipc(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AUIPC"); this->gen_sync(iss::PRE_SYNC, 1); @@ -557,7 +558,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AUIPC x%1%, 0x%2$08x"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -578,13 +579,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 1); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 2: JAL */ - std::tuple __jal(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __jal(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("JAL"); this->gen_sync(iss::PRE_SYNC, 2); @@ -595,7 +596,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("JAL x%1$d, 0x%2$x"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -622,11 +623,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 2); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 3: JALR */ - std::tuple __jalr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __jalr(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("JALR"); this->gen_sync(iss::PRE_SYNC, 3); @@ -638,7 +639,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("JALR x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -658,9 +659,9 @@ private: new_pc_val, this->gen_const(32U, 0x1)); { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -693,11 +694,11 @@ private: this->builder.SetInsertPoint(bb); this->gen_sync(iss::POST_SYNC, 3); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 4: BEQ */ - std::tuple __beq(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __beq(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BEQ"); this->gen_sync(iss::PRE_SYNC, 4); @@ -709,7 +710,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BEQ x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -739,11 +740,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 4); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 5: BNE */ - std::tuple __bne(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bne(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BNE"); this->gen_sync(iss::PRE_SYNC, 5); @@ -755,7 +756,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BNE x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -785,11 +786,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 5); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 6: BLT */ - std::tuple __blt(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __blt(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BLT"); this->gen_sync(iss::PRE_SYNC, 6); @@ -801,7 +802,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BLT x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -835,11 +836,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 6); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 7: BGE */ - std::tuple __bge(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bge(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BGE"); this->gen_sync(iss::PRE_SYNC, 7); @@ -851,7 +852,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BGE x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -885,11 +886,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 7); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 8: BLTU */ - std::tuple __bltu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bltu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BLTU"); this->gen_sync(iss::PRE_SYNC, 8); @@ -901,7 +902,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BLTU x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -931,11 +932,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 8); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 9: BGEU */ - std::tuple __bgeu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bgeu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BGEU"); this->gen_sync(iss::PRE_SYNC, 9); @@ -947,7 +948,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BGEU x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -977,11 +978,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 9); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 10: LB */ - std::tuple __lb(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lb(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LB"); this->gen_sync(iss::PRE_SYNC, 10); @@ -993,7 +994,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LB x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1018,13 +1019,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 10); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 11: LH */ - std::tuple __lh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lh(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LH"); this->gen_sync(iss::PRE_SYNC, 11); @@ -1036,7 +1037,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LH x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1061,13 +1062,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 11); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 12: LW */ - std::tuple __lw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LW"); this->gen_sync(iss::PRE_SYNC, 12); @@ -1079,7 +1080,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LW x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1104,13 +1105,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 12); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 13: LBU */ - std::tuple __lbu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lbu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LBU"); this->gen_sync(iss::PRE_SYNC, 13); @@ -1122,7 +1123,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LBU x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1147,13 +1148,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 13); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 14: LHU */ - std::tuple __lhu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lhu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LHU"); this->gen_sync(iss::PRE_SYNC, 14); @@ -1165,7 +1166,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LHU x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1190,13 +1191,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 14); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 15: SB */ - std::tuple __sb(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sb(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SB"); this->gen_sync(iss::PRE_SYNC, 15); @@ -1208,7 +1209,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SB x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1231,13 +1232,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(8))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 15); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 16: SH */ - std::tuple __sh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sh(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SH"); this->gen_sync(iss::PRE_SYNC, 16); @@ -1249,7 +1250,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SH x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1272,13 +1273,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(16))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 16); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 17: SW */ - std::tuple __sw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SW"); this->gen_sync(iss::PRE_SYNC, 17); @@ -1290,7 +1291,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SW x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1313,13 +1314,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 17); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 18: ADDI */ - std::tuple __addi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __addi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ADDI"); this->gen_sync(iss::PRE_SYNC, 18); @@ -1331,7 +1332,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ADDI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1352,13 +1353,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 18); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 19: SLTI */ - std::tuple __slti(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slti(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLTI"); this->gen_sync(iss::PRE_SYNC, 19); @@ -1370,7 +1371,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLTI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1396,13 +1397,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 19); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 20: SLTIU */ - std::tuple __sltiu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sltiu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLTIU"); this->gen_sync(iss::PRE_SYNC, 20); @@ -1414,7 +1415,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLTIU x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1439,13 +1440,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 20); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 21: XORI */ - std::tuple __xori(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __xori(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("XORI"); this->gen_sync(iss::PRE_SYNC, 21); @@ -1457,7 +1458,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("XORI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1476,13 +1477,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 21); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 22: ORI */ - std::tuple __ori(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ori(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ORI"); this->gen_sync(iss::PRE_SYNC, 22); @@ -1494,7 +1495,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ORI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1513,13 +1514,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 22); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 23: ANDI */ - std::tuple __andi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __andi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ANDI"); this->gen_sync(iss::PRE_SYNC, 23); @@ -1531,7 +1532,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ANDI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1550,13 +1551,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 23); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 24: SLLI */ - std::tuple __slli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slli(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLLI"); this->gen_sync(iss::PRE_SYNC, 24); @@ -1568,7 +1569,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLLI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1591,13 +1592,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 24); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 25: SRLI */ - std::tuple __srli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srli(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRLI"); this->gen_sync(iss::PRE_SYNC, 25); @@ -1609,7 +1610,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRLI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1632,13 +1633,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 25); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 26: SRAI */ - std::tuple __srai(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srai(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRAI"); this->gen_sync(iss::PRE_SYNC, 26); @@ -1650,7 +1651,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRAI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1673,13 +1674,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 26); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 27: ADD */ - std::tuple __add(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __add(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ADD"); this->gen_sync(iss::PRE_SYNC, 27); @@ -1691,7 +1692,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ADD x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1710,13 +1711,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 27); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 28: SUB */ - std::tuple __sub(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sub(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SUB"); this->gen_sync(iss::PRE_SYNC, 28); @@ -1728,7 +1729,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SUB x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1747,13 +1748,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 28); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 29: SLL */ - std::tuple __sll(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sll(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLL"); this->gen_sync(iss::PRE_SYNC, 29); @@ -1765,7 +1766,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLL x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1786,13 +1787,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 29); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 30: SLT */ - std::tuple __slt(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slt(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLT"); this->gen_sync(iss::PRE_SYNC, 30); @@ -1804,7 +1805,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLT x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1832,13 +1833,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 30); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 31: SLTU */ - std::tuple __sltu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sltu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLTU"); this->gen_sync(iss::PRE_SYNC, 31); @@ -1850,7 +1851,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLTU x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1880,13 +1881,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 31); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 32: XOR */ - std::tuple __xor(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __xor(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("XOR"); this->gen_sync(iss::PRE_SYNC, 32); @@ -1898,7 +1899,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("XOR x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1917,13 +1918,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 32); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 33: SRL */ - std::tuple __srl(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srl(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRL"); this->gen_sync(iss::PRE_SYNC, 33); @@ -1935,7 +1936,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRL x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1956,13 +1957,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 33); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 34: SRA */ - std::tuple __sra(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sra(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRA"); this->gen_sync(iss::PRE_SYNC, 34); @@ -1974,7 +1975,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRA x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1995,13 +1996,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 34); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 35: OR */ - std::tuple __or(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __or(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("OR"); this->gen_sync(iss::PRE_SYNC, 35); @@ -2013,7 +2014,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("OR x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2032,13 +2033,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 35); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 36: AND */ - std::tuple __and(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __and(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AND"); this->gen_sync(iss::PRE_SYNC, 36); @@ -2050,7 +2051,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AND x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2069,13 +2070,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 36); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 37: FENCE */ - std::tuple __fence(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fence(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FENCE"); this->gen_sync(iss::PRE_SYNC, 37); @@ -2086,7 +2087,7 @@ private: uint8_t fld_pred_val = ((bit_sub<24,4>(instr))); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("FENCE"), @@ -2108,13 +2109,13 @@ private: this->builder.CreateZExtOrTrunc(FENCEtmp0_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 37); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 38: FENCE_I */ - std::tuple __fence_i(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fence_i(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FENCE_I"); this->gen_sync(iss::PRE_SYNC, 38); @@ -2124,7 +2125,7 @@ private: uint16_t fld_imm_val = ((bit_sub<20,12>(instr))); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("FENCE_I"), @@ -2144,18 +2145,18 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 38); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::FLUSH, nullptr); + return std::make_tuple(FLUSH, nullptr); } /* instruction 39: ECALL */ - std::tuple __ecall(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ecall(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ECALL"); this->gen_sync(iss::PRE_SYNC, 39); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("ECALL"), @@ -2169,18 +2170,18 @@ private: this->gen_raise_trap(0, 11); this->gen_sync(iss::POST_SYNC, 39); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 40: EBREAK */ - std::tuple __ebreak(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ebreak(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("EBREAK"); this->gen_sync(iss::PRE_SYNC, 40); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("EBREAK"), @@ -2194,18 +2195,18 @@ private: this->gen_raise_trap(0, 3); this->gen_sync(iss::POST_SYNC, 40); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 41: URET */ - std::tuple __uret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __uret(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("URET"); this->gen_sync(iss::PRE_SYNC, 41); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("URET"), @@ -2219,18 +2220,18 @@ private: this->gen_leave_trap(0); this->gen_sync(iss::POST_SYNC, 41); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 42: SRET */ - std::tuple __sret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sret(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRET"); this->gen_sync(iss::PRE_SYNC, 42); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("SRET"), @@ -2244,18 +2245,18 @@ private: this->gen_leave_trap(1); this->gen_sync(iss::POST_SYNC, 42); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 43: MRET */ - std::tuple __mret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mret(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("MRET"); this->gen_sync(iss::PRE_SYNC, 43); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("MRET"), @@ -2269,18 +2270,18 @@ private: this->gen_leave_trap(3); this->gen_sync(iss::POST_SYNC, 43); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 44: WFI */ - std::tuple __wfi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __wfi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("WFI"); this->gen_sync(iss::PRE_SYNC, 44); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("WFI"), @@ -2294,13 +2295,13 @@ private: this->gen_wait(1); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 44); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 45: SFENCE.VMA */ - std::tuple __sfence_vma(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sfence_vma(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SFENCE.VMA"); this->gen_sync(iss::PRE_SYNC, 45); @@ -2309,7 +2310,7 @@ private: uint8_t fld_rs2_val = ((bit_sub<20,5>(instr))); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("SFENCE.VMA"), @@ -2332,13 +2333,13 @@ private: this->builder.CreateZExtOrTrunc(FENCEtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 45); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 46: CSRRW */ - std::tuple __csrrw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRW"); this->gen_sync(iss::PRE_SYNC, 46); @@ -2350,7 +2351,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRW x%1$d, %2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2380,13 +2381,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 46); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 47: CSRRS */ - std::tuple __csrrs(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrs(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRS"); this->gen_sync(iss::PRE_SYNC, 47); @@ -2398,7 +2399,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRS x%1$d, %2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2426,13 +2427,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 47); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 48: CSRRC */ - std::tuple __csrrc(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrc(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRC"); this->gen_sync(iss::PRE_SYNC, 48); @@ -2444,7 +2445,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRC x%1$d, %2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2472,13 +2473,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 48); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 49: CSRRWI */ - std::tuple __csrrwi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrwi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRWI"); this->gen_sync(iss::PRE_SYNC, 49); @@ -2490,7 +2491,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRWI x%1$d, %2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_zimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2515,13 +2516,13 @@ private: this->builder.CreateZExtOrTrunc(CSRtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 49); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 50: CSRRSI */ - std::tuple __csrrsi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrsi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRSI"); this->gen_sync(iss::PRE_SYNC, 50); @@ -2533,7 +2534,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRSI x%1$d, %2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_zimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2563,13 +2564,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 50); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 51: CSRRCI */ - std::tuple __csrrci(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrci(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRCI"); this->gen_sync(iss::PRE_SYNC, 51); @@ -2581,7 +2582,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRCI x%1$d, %2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_zimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2611,13 +2612,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 51); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 52: MUL */ - std::tuple __mul(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mul(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("MUL"); this->gen_sync(iss::PRE_SYNC, 52); @@ -2629,7 +2630,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("MUL x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2658,13 +2659,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 52); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 53: MULH */ - std::tuple __mulh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mulh(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("MULH"); this->gen_sync(iss::PRE_SYNC, 53); @@ -2676,7 +2677,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("MULH x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2707,13 +2708,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 53); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 54: MULHSU */ - std::tuple __mulhsu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mulhsu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("MULHSU"); this->gen_sync(iss::PRE_SYNC, 54); @@ -2725,7 +2726,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("MULHSU x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2756,13 +2757,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 54); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 55: MULHU */ - std::tuple __mulhu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mulhu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("MULHU"); this->gen_sync(iss::PRE_SYNC, 55); @@ -2774,7 +2775,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("MULHU x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2805,13 +2806,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 55); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 56: DIV */ - std::tuple __div(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __div(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("DIV"); this->gen_sync(iss::PRE_SYNC, 56); @@ -2823,7 +2824,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("DIV x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2836,9 +2837,9 @@ private: if(fld_rd_val != 0){ { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -2851,9 +2852,9 @@ private: uint32_t M1_val = - 1; uint32_t MMIN_val = - 1 << 32 - 1; { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_EQ, @@ -2868,9 +2869,9 @@ private: this->builder.SetInsertPoint(bb_then); { { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_EQ, @@ -2934,13 +2935,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 56); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 57: DIVU */ - std::tuple __divu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __divu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("DIVU"); this->gen_sync(iss::PRE_SYNC, 57); @@ -2952,7 +2953,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("DIVU x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2965,9 +2966,9 @@ private: if(fld_rd_val != 0){ { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -3001,13 +3002,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 57); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 58: REM */ - std::tuple __rem(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __rem(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("REM"); this->gen_sync(iss::PRE_SYNC, 58); @@ -3019,7 +3020,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("REM x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3032,9 +3033,9 @@ private: if(fld_rd_val != 0){ { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -3047,9 +3048,9 @@ private: uint32_t M1_val = - 1; uint32_t MMIN_val = - 1 << 32 - 1; { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_EQ, @@ -3064,9 +3065,9 @@ private: this->builder.SetInsertPoint(bb_then); { { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_EQ, @@ -3134,13 +3135,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 58); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 59: REMU */ - std::tuple __remu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __remu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("REMU"); this->gen_sync(iss::PRE_SYNC, 59); @@ -3152,7 +3153,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("REMU x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3165,9 +3166,9 @@ private: if(fld_rd_val != 0){ { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -3201,13 +3202,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 59); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 60: LR.W */ - std::tuple __lr_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lr_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LR.W"); this->gen_sync(iss::PRE_SYNC, 60); @@ -3220,7 +3221,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LR.W x%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3249,13 +3250,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 60); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 61: SC.W */ - std::tuple __sc_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sc_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SC.W"); this->gen_sync(iss::PRE_SYNC, 61); @@ -3269,7 +3270,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SC.W x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3283,8 +3284,8 @@ private: Value* offs_val = this->gen_reg_load(fld_rs1_val + traits::X0, 0); Value* res1_val = this->gen_read_mem(traits::RES, offs_val, 32/8); { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -3317,13 +3318,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 61); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 62: AMOSWAP.W */ - std::tuple __amoswap_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoswap_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOSWAP.W"); this->gen_sync(iss::PRE_SYNC, 62); @@ -3337,7 +3338,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOSWAP.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3363,13 +3364,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 62); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 63: AMOADD.W */ - std::tuple __amoadd_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoadd_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOADD.W"); this->gen_sync(iss::PRE_SYNC, 63); @@ -3383,7 +3384,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOADD.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3413,13 +3414,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 63); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 64: AMOXOR.W */ - std::tuple __amoxor_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoxor_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOXOR.W"); this->gen_sync(iss::PRE_SYNC, 64); @@ -3433,7 +3434,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOXOR.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3463,13 +3464,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 64); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 65: AMOAND.W */ - std::tuple __amoand_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoand_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOAND.W"); this->gen_sync(iss::PRE_SYNC, 65); @@ -3483,7 +3484,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOAND.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3513,13 +3514,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 65); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 66: AMOOR.W */ - std::tuple __amoor_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoor_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOOR.W"); this->gen_sync(iss::PRE_SYNC, 66); @@ -3533,7 +3534,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOOR.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3563,13 +3564,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 66); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 67: AMOMIN.W */ - std::tuple __amomin_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomin_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMIN.W"); this->gen_sync(iss::PRE_SYNC, 67); @@ -3583,7 +3584,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMIN.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3622,13 +3623,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 67); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 68: AMOMAX.W */ - std::tuple __amomax_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomax_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMAX.W"); this->gen_sync(iss::PRE_SYNC, 68); @@ -3642,7 +3643,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMAX.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3681,13 +3682,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 68); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 69: AMOMINU.W */ - std::tuple __amominu_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amominu_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMINU.W"); this->gen_sync(iss::PRE_SYNC, 69); @@ -3701,7 +3702,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMINU.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3736,13 +3737,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 69); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 70: AMOMAXU.W */ - std::tuple __amomaxu_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomaxu_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMAXU.W"); this->gen_sync(iss::PRE_SYNC, 70); @@ -3756,7 +3757,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMAXU.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3791,13 +3792,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 70); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 71: C.ADDI4SPN */ - std::tuple __c_addi4spn(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_addi4spn(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.ADDI4SPN"); this->gen_sync(iss::PRE_SYNC, 71); @@ -3808,7 +3809,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.ADDI4SPN x%1$d, 0x%2$05x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3828,13 +3829,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + 8 + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 71); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 72: C.LW */ - std::tuple __c_lw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_lw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.LW"); this->gen_sync(iss::PRE_SYNC, 72); @@ -3846,7 +3847,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.LW x(8+%1$d), x(8+%2$d), 0x%3$05x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_uimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3864,13 +3865,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + 8 + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 72); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 73: C.SW */ - std::tuple __c_sw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_sw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.SW"); this->gen_sync(iss::PRE_SYNC, 73); @@ -3882,7 +3883,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.SW x(8+%1$d), x(8+%2$d), 0x%3$05x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_uimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3903,13 +3904,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 73); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 74: C.ADDI */ - std::tuple __c_addi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_addi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.ADDI"); this->gen_sync(iss::PRE_SYNC, 74); @@ -3920,7 +3921,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.ADDI x%1$d, 0x%2$05x"); ins_fmter % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3939,20 +3940,20 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rs1_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 74); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 75: C.NOP */ - std::tuple __c_nop(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_nop(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.NOP"); this->gen_sync(iss::PRE_SYNC, 75); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("C.NOP"), @@ -3966,13 +3967,13 @@ private: /* TODO: describe operations for C.NOP ! */ this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 75); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 76: C.JAL */ - std::tuple __c_jal(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_jal(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.JAL"); this->gen_sync(iss::PRE_SYNC, 76); @@ -3982,7 +3983,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.JAL 0x%1$05x"); ins_fmter % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4007,11 +4008,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 76); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 77: C.LI */ - std::tuple __c_li(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_li(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.LI"); this->gen_sync(iss::PRE_SYNC, 77); @@ -4022,7 +4023,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.LI x%1$d, 0x%2$05x"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4040,13 +4041,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 77); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 78: C.LUI */ - std::tuple __c_lui(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_lui(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.LUI"); this->gen_sync(iss::PRE_SYNC, 78); @@ -4057,7 +4058,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.LUI x%1$d, 0x%2$05x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4078,13 +4079,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 78); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 79: C.ADDI16SP */ - std::tuple __c_addi16sp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_addi16sp(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.ADDI16SP"); this->gen_sync(iss::PRE_SYNC, 79); @@ -4094,7 +4095,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.ADDI16SP 0x%1$05x"); ins_fmter % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4113,13 +4114,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(2 + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 79); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 80: C.SRLI */ - std::tuple __c_srli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_srli(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.SRLI"); this->gen_sync(iss::PRE_SYNC, 80); @@ -4130,7 +4131,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.SRLI x(8+%1$d), %2$d"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4148,13 +4149,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(rs1_idx_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 80); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 81: C.SRAI */ - std::tuple __c_srai(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_srai(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.SRAI"); this->gen_sync(iss::PRE_SYNC, 81); @@ -4165,7 +4166,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.SRAI x(8+%1$d), %2$d"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4183,13 +4184,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(rs1_idx_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 81); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 82: C.ANDI */ - std::tuple __c_andi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_andi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.ANDI"); this->gen_sync(iss::PRE_SYNC, 82); @@ -4200,7 +4201,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.ANDI x(8+%1$d), 0x%2$05x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4218,13 +4219,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(rs1_idx_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 82); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 83: C.SUB */ - std::tuple __c_sub(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_sub(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.SUB"); this->gen_sync(iss::PRE_SYNC, 83); @@ -4235,7 +4236,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.SUB x(8+%1$d), x(8+%2$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4253,13 +4254,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(rd_idx_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 83); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 84: C.XOR */ - std::tuple __c_xor(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_xor(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.XOR"); this->gen_sync(iss::PRE_SYNC, 84); @@ -4270,7 +4271,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.XOR x(8+%1$d), x(8+%2$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4288,13 +4289,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(rd_idx_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 84); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 85: C.OR */ - std::tuple __c_or(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_or(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.OR"); this->gen_sync(iss::PRE_SYNC, 85); @@ -4305,7 +4306,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.OR x(8+%1$d), x(8+%2$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4323,13 +4324,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(rd_idx_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 85); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 86: C.AND */ - std::tuple __c_and(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_and(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.AND"); this->gen_sync(iss::PRE_SYNC, 86); @@ -4340,7 +4341,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.AND x(8+%1$d), x(8+%2$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4358,13 +4359,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(rd_idx_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 86); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 87: C.J */ - std::tuple __c_j(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_j(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.J"); this->gen_sync(iss::PRE_SYNC, 87); @@ -4374,7 +4375,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.J 0x%1$05x"); ins_fmter % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4395,11 +4396,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 87); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 88: C.BEQZ */ - std::tuple __c_beqz(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_beqz(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.BEQZ"); this->gen_sync(iss::PRE_SYNC, 88); @@ -4410,7 +4411,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.BEQZ x(8+%1$d), 0x%2$05x"); ins_fmter % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4440,11 +4441,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 88); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 89: C.BNEZ */ - std::tuple __c_bnez(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_bnez(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.BNEZ"); this->gen_sync(iss::PRE_SYNC, 89); @@ -4455,7 +4456,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.BNEZ x(8+%1$d), 0x%2$05x"); ins_fmter % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4485,11 +4486,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 89); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 90: C.SLLI */ - std::tuple __c_slli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_slli(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.SLLI"); this->gen_sync(iss::PRE_SYNC, 90); @@ -4500,7 +4501,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.SLLI x%1$d, %2$d"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4520,13 +4521,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rs1_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 90); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 91: C.LWSP */ - std::tuple __c_lwsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_lwsp(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.LWSP"); this->gen_sync(iss::PRE_SYNC, 91); @@ -4537,7 +4538,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.LWSP x%1$d, sp, 0x%2$05x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_uimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4555,13 +4556,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 91); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 92: C.MV */ - std::tuple __c_mv(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_mv(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.MV"); this->gen_sync(iss::PRE_SYNC, 92); @@ -4572,7 +4573,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.MV x%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4587,13 +4588,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 92); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 93: C.JR */ - std::tuple __c_jr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_jr(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.JR"); this->gen_sync(iss::PRE_SYNC, 93); @@ -4603,7 +4604,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.JR x%1$d"); ins_fmter % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4619,11 +4620,11 @@ private: this->builder.CreateStore(this->gen_const(32U, std::numeric_limits::max()), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 93); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 94: C.ADD */ - std::tuple __c_add(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_add(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.ADD"); this->gen_sync(iss::PRE_SYNC, 94); @@ -4634,7 +4635,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.ADD x%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4651,13 +4652,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 94); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 95: C.JALR */ - std::tuple __c_jalr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_jalr(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.JALR"); this->gen_sync(iss::PRE_SYNC, 95); @@ -4667,7 +4668,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.JALR x%1$d"); ins_fmter % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4687,18 +4688,18 @@ private: this->builder.CreateStore(this->gen_const(32U, std::numeric_limits::max()), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 95); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 96: C.EBREAK */ - std::tuple __c_ebreak(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_ebreak(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.EBREAK"); this->gen_sync(iss::PRE_SYNC, 96); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("C.EBREAK"), @@ -4712,11 +4713,11 @@ private: this->gen_raise_trap(0, 3); this->gen_sync(iss::POST_SYNC, 96); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 97: C.SWSP */ - std::tuple __c_swsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_swsp(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.SWSP"); this->gen_sync(iss::PRE_SYNC, 97); @@ -4727,7 +4728,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.SWSP x2+0x%1$05x, x%2$d"); ins_fmter % (uint64_t)fld_uimm_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4748,20 +4749,20 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 97); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 98: DII */ - std::tuple __dii(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __dii(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("DII"); this->gen_sync(iss::PRE_SYNC, 98); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("DII"), @@ -4775,13 +4776,13 @@ private: this->gen_raise_trap(0, 2); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 98); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 99: FLW */ - std::tuple __flw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __flw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FLW"); this->gen_sync(iss::PRE_SYNC, 99); @@ -4793,7 +4794,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FLW f%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4827,13 +4828,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 99); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 100: FSW */ - std::tuple __fsw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSW"); this->gen_sync(iss::PRE_SYNC, 100); @@ -4845,7 +4846,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSW f%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4871,13 +4872,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 100); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 101: FMADD.S */ - std::tuple __fmadd_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmadd_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMADD.S"); this->gen_sync(iss::PRE_SYNC, 101); @@ -4891,7 +4892,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMADD.S x%1$d, f%2$d, f%3$d, f%4$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_rs3_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4902,7 +4903,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -4946,7 +4947,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -4956,13 +4957,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 101); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 102: FMSUB.S */ - std::tuple __fmsub_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmsub_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMSUB.S"); this->gen_sync(iss::PRE_SYNC, 102); @@ -4976,7 +4977,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMSUB.S x%1$d, f%2$d, f%3$d, f%4$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_rs3_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4987,7 +4988,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5031,7 +5032,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5041,13 +5042,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 102); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 103: FNMADD.S */ - std::tuple __fnmadd_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fnmadd_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FNMADD.S"); this->gen_sync(iss::PRE_SYNC, 103); @@ -5061,7 +5062,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FNMADD.S x%1$d, f%2$d, f%3$d, f%4$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_rs3_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5072,7 +5073,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5116,7 +5117,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5126,13 +5127,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 103); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 104: FNMSUB.S */ - std::tuple __fnmsub_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fnmsub_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FNMSUB.S"); this->gen_sync(iss::PRE_SYNC, 104); @@ -5146,7 +5147,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FNMSUB.S x%1$d, f%2$d, f%3$d, f%4$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_rs3_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5157,7 +5158,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5201,7 +5202,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5211,13 +5212,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 104); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 105: FADD.S */ - std::tuple __fadd_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fadd_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FADD.S"); this->gen_sync(iss::PRE_SYNC, 105); @@ -5230,7 +5231,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FADD.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5241,7 +5242,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fadd_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fadd_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5277,7 +5278,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5287,13 +5288,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 105); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 106: FSUB.S */ - std::tuple __fsub_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsub_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSUB.S"); this->gen_sync(iss::PRE_SYNC, 106); @@ -5306,7 +5307,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSUB.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5317,7 +5318,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsub_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsub_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5353,7 +5354,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5363,13 +5364,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 106); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 107: FMUL.S */ - std::tuple __fmul_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmul_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMUL.S"); this->gen_sync(iss::PRE_SYNC, 107); @@ -5382,7 +5383,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMUL.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5393,7 +5394,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmul_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmul_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5429,7 +5430,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5439,13 +5440,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 107); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 108: FDIV.S */ - std::tuple __fdiv_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fdiv_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FDIV.S"); this->gen_sync(iss::PRE_SYNC, 108); @@ -5458,7 +5459,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FDIV.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5469,7 +5470,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fdiv_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fdiv_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5505,7 +5506,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5515,13 +5516,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 108); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 109: FSQRT.S */ - std::tuple __fsqrt_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsqrt_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSQRT.S"); this->gen_sync(iss::PRE_SYNC, 109); @@ -5533,7 +5534,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSQRT.S f%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5544,7 +5545,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsqrt_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsqrt_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5576,7 +5577,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5586,13 +5587,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 109); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 110: FSGNJ.S */ - std::tuple __fsgnj_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsgnj_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSGNJ.S"); this->gen_sync(iss::PRE_SYNC, 110); @@ -5604,7 +5605,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSGNJ.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5645,13 +5646,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 110); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 111: FSGNJN.S */ - std::tuple __fsgnjn_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsgnjn_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSGNJN.S"); this->gen_sync(iss::PRE_SYNC, 111); @@ -5663,7 +5664,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSGNJN.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5704,13 +5705,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 111); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 112: FSGNJX.S */ - std::tuple __fsgnjx_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsgnjx_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSGNJX.S"); this->gen_sync(iss::PRE_SYNC, 112); @@ -5722,7 +5723,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSGNJX.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5761,13 +5762,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 112); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 113: FMIN.S */ - std::tuple __fmin_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmin_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMIN.S"); this->gen_sync(iss::PRE_SYNC, 113); @@ -5779,7 +5780,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMIN.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5790,7 +5791,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsel_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsel_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5819,7 +5820,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5829,13 +5830,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 113); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 114: FMAX.S */ - std::tuple __fmax_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmax_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMAX.S"); this->gen_sync(iss::PRE_SYNC, 114); @@ -5847,7 +5848,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMAX.S f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5858,7 +5859,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsel_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsel_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5887,7 +5888,7 @@ private: false)); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5897,13 +5898,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 114); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 115: FCVT.W.S */ - std::tuple __fcvt_w_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_w_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.W.S"); this->gen_sync(iss::PRE_SYNC, 115); @@ -5915,7 +5916,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.W.S x%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5927,7 +5928,7 @@ private: pc=pc+4; Value* Xtmp0_val = this->gen_ext( - this->builder.CreateCall(this->mod->getFunction("fcvt_s"), std::vector{ + this->builder.CreateCall(this->mod->getFunction("fcvt_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5941,7 +5942,7 @@ private: 32, true); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -5951,13 +5952,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 115); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 116: FCVT.WU.S */ - std::tuple __fcvt_wu_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_wu_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.WU.S"); this->gen_sync(iss::PRE_SYNC, 116); @@ -5969,7 +5970,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.WU.S x%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -5981,7 +5982,7 @@ private: pc=pc+4; Value* Xtmp0_val = this->gen_ext( - this->builder.CreateCall(this->mod->getFunction("fcvt_s"), std::vector{ + this->builder.CreateCall(this->mod->getFunction("fcvt_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -5995,7 +5996,7 @@ private: 32, false); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -6005,13 +6006,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 116); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 117: FEQ.S */ - std::tuple __feq_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __feq_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FEQ.S"); this->gen_sync(iss::PRE_SYNC, 117); @@ -6023,7 +6024,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FEQ.S x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6034,7 +6035,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_s"), std::vector{ + Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -6049,7 +6050,7 @@ private: false) }); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -6059,13 +6060,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 117); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 118: FLT.S */ - std::tuple __flt_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __flt_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FLT.S"); this->gen_sync(iss::PRE_SYNC, 118); @@ -6077,7 +6078,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FLT.S x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6088,7 +6089,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_s"), std::vector{ + Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -6103,7 +6104,7 @@ private: false) }); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -6113,13 +6114,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 118); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 119: FLE.S */ - std::tuple __fle_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fle_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FLE.S"); this->gen_sync(iss::PRE_SYNC, 119); @@ -6131,7 +6132,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FLE.S x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6142,7 +6143,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_s"), std::vector{ + Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -6157,7 +6158,7 @@ private: false) }); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -6167,13 +6168,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 119); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 120: FCLASS.S */ - std::tuple __fclass_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fclass_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCLASS.S"); this->gen_sync(iss::PRE_SYNC, 120); @@ -6184,7 +6185,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCLASS.S x%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6195,7 +6196,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fclass_s"), std::vector{ + Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fclass_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -6204,13 +6205,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 120); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 121: FCVT.S.W */ - std::tuple __fcvt_s_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_s_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.S.W"); this->gen_sync(iss::PRE_SYNC, 121); @@ -6222,7 +6223,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.S.W f%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6233,7 +6234,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fcvt_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fcvt_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::X0, 0), this-> get_type(32) @@ -6261,13 +6262,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 121); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 122: FCVT.S.WU */ - std::tuple __fcvt_s_wu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_s_wu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.S.WU"); this->gen_sync(iss::PRE_SYNC, 122); @@ -6279,7 +6280,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.S.WU f%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6290,7 +6291,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fcvt_s"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fcvt_s"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::X0, 0), this-> get_type(32) @@ -6318,13 +6319,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 122); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 123: FMV.X.W */ - std::tuple __fmv_x_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmv_x_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMV.X.W"); this->gen_sync(iss::PRE_SYNC, 123); @@ -6335,7 +6336,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMV.X.W x%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6356,13 +6357,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 123); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 124: FMV.W.X */ - std::tuple __fmv_w_x(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmv_w_x(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMV.W.X"); this->gen_sync(iss::PRE_SYNC, 124); @@ -6373,7 +6374,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMV.W.X f%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6401,13 +6402,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 124); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 125: C.FLW */ - std::tuple __c_flw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_flw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.FLW"); this->gen_sync(iss::PRE_SYNC, 125); @@ -6419,7 +6420,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.FLW f(8+%1$d), %2%(x(8+%3$d))"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_uimm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6451,13 +6452,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 125); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 126: C.FSW */ - std::tuple __c_fsw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_fsw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.FSW"); this->gen_sync(iss::PRE_SYNC, 126); @@ -6469,7 +6470,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.FSW f(8+%1$d), %2%(x(8+%3$d))"); ins_fmter % (uint64_t)fld_rs2_val % (uint64_t)fld_uimm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6493,13 +6494,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 126); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 127: C.FLWSP */ - std::tuple __c_flwsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_flwsp(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.FLWSP"); this->gen_sync(iss::PRE_SYNC, 127); @@ -6510,7 +6511,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.FLWSP f%1$d, %2%(x2)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_uimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6542,13 +6543,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 127); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 128: C.FSWSP */ - std::tuple __c_fswsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_fswsp(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.FSWSP"); this->gen_sync(iss::PRE_SYNC, 128); @@ -6559,7 +6560,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.FSWSP f%1$d, %2%(x2), "); ins_fmter % (uint64_t)fld_rs2_val % (uint64_t)fld_uimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6583,13 +6584,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 128); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 129: FLD */ - std::tuple __fld(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fld(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FLD"); this->gen_sync(iss::PRE_SYNC, 129); @@ -6601,7 +6602,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FLD f%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6632,13 +6633,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 129); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 130: FSD */ - std::tuple __fsd(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsd(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSD"); this->gen_sync(iss::PRE_SYNC, 130); @@ -6650,7 +6651,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSD f%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6676,13 +6677,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 130); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 131: FMADD.D */ - std::tuple __fmadd_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmadd_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMADD.D"); this->gen_sync(iss::PRE_SYNC, 131); @@ -6696,7 +6697,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMADD.D x%1$d, f%2$d, f%3$d, f%4$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_rs3_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6707,7 +6708,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -6748,7 +6749,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -6758,13 +6759,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 131); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 132: FMSUB.D */ - std::tuple __fmsub_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmsub_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMSUB.D"); this->gen_sync(iss::PRE_SYNC, 132); @@ -6778,7 +6779,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMSUB.D x%1$d, f%2$d, f%3$d, f%4$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_rs3_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6789,7 +6790,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -6830,7 +6831,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -6840,13 +6841,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 132); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 133: FNMADD.D */ - std::tuple __fnmadd_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fnmadd_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FNMADD.D"); this->gen_sync(iss::PRE_SYNC, 133); @@ -6860,7 +6861,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FNMADD.D x%1$d, f%2$d, f%3$d, f%4$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_rs3_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6871,7 +6872,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -6912,7 +6913,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -6922,13 +6923,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 133); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 134: FNMSUB.D */ - std::tuple __fnmsub_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fnmsub_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FNMSUB.D"); this->gen_sync(iss::PRE_SYNC, 134); @@ -6942,7 +6943,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FNMSUB.D x%1$d, f%2$d, f%3$d, f%4$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_rs3_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -6953,7 +6954,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmadd_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -6994,7 +6995,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7004,13 +7005,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 134); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 135: FADD.D */ - std::tuple __fadd_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fadd_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FADD.D"); this->gen_sync(iss::PRE_SYNC, 135); @@ -7023,7 +7024,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FADD.D x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7034,7 +7035,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fadd_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fadd_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7067,7 +7068,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7077,13 +7078,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 135); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 136: FSUB.D */ - std::tuple __fsub_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsub_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSUB.D"); this->gen_sync(iss::PRE_SYNC, 136); @@ -7096,7 +7097,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSUB.D x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7107,7 +7108,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsub_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsub_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7140,7 +7141,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7150,13 +7151,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 136); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 137: FMUL.D */ - std::tuple __fmul_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmul_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMUL.D"); this->gen_sync(iss::PRE_SYNC, 137); @@ -7169,7 +7170,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMUL.D x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7180,7 +7181,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmul_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fmul_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7213,7 +7214,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7223,13 +7224,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 137); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 138: FDIV.D */ - std::tuple __fdiv_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fdiv_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FDIV.D"); this->gen_sync(iss::PRE_SYNC, 138); @@ -7242,7 +7243,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FDIV.D x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7253,7 +7254,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fdiv_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fdiv_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7286,7 +7287,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7296,13 +7297,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 138); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 139: FSQRT.D */ - std::tuple __fsqrt_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsqrt_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSQRT.D"); this->gen_sync(iss::PRE_SYNC, 139); @@ -7314,7 +7315,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSQRT.D x%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7325,7 +7326,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsqrt_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsqrt_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7354,7 +7355,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7364,13 +7365,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 139); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 140: FSGNJ.D */ - std::tuple __fsgnj_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsgnj_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSGNJ.D"); this->gen_sync(iss::PRE_SYNC, 140); @@ -7382,7 +7383,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSGNJ.D f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7420,13 +7421,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 140); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 141: FSGNJN.D */ - std::tuple __fsgnjn_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsgnjn_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSGNJN.D"); this->gen_sync(iss::PRE_SYNC, 141); @@ -7438,7 +7439,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSGNJN.D f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7476,13 +7477,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 141); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 142: FSGNJX.D */ - std::tuple __fsgnjx_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fsgnjx_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FSGNJX.D"); this->gen_sync(iss::PRE_SYNC, 142); @@ -7494,7 +7495,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FSGNJX.D f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7530,13 +7531,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 142); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 143: FMIN.D */ - std::tuple __fmin_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmin_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMIN.D"); this->gen_sync(iss::PRE_SYNC, 143); @@ -7548,7 +7549,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMIN.D f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7559,7 +7560,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsel_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsel_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7585,7 +7586,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7595,13 +7596,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 143); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 144: FMAX.D */ - std::tuple __fmax_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fmax_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FMAX.D"); this->gen_sync(iss::PRE_SYNC, 144); @@ -7613,7 +7614,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FMAX.D f%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7624,7 +7625,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsel_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fsel_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7650,7 +7651,7 @@ private: res_val); this->builder.CreateStore(Ftmp1_val, get_reg_ptr(fld_rd_val + traits::F0), false); } - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7660,13 +7661,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 144); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 145: FCVT.S.D */ - std::tuple __fcvt_s_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_s_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.S.D"); this->gen_sync(iss::PRE_SYNC, 145); @@ -7678,7 +7679,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.S.D f%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7689,7 +7690,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fconv_d2f"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fconv_d2f"), std::vector{ this->gen_reg_load(fld_rs1_val + traits::F0, 0), this->gen_const(8U, fld_rm_val) }); @@ -7705,13 +7706,13 @@ private: this->builder.CreateStore(Ftmp0_val, get_reg_ptr(fld_rd_val + traits::F0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 145); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 146: FCVT.D.S */ - std::tuple __fcvt_d_s(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_d_s(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.D.S"); this->gen_sync(iss::PRE_SYNC, 146); @@ -7723,7 +7724,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.D.S f%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7734,7 +7735,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fconv_f2d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fconv_f2d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(32) @@ -7755,13 +7756,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 146); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 147: FEQ.D */ - std::tuple __feq_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __feq_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FEQ.D"); this->gen_sync(iss::PRE_SYNC, 147); @@ -7773,7 +7774,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FEQ.D x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7784,7 +7785,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_d"), std::vector{ + Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7799,7 +7800,7 @@ private: false) }); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7809,13 +7810,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 147); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 148: FLT.D */ - std::tuple __flt_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __flt_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FLT.D"); this->gen_sync(iss::PRE_SYNC, 148); @@ -7827,7 +7828,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FLT.D x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7838,7 +7839,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_d"), std::vector{ + Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7853,7 +7854,7 @@ private: false) }); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7863,13 +7864,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 148); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 149: FLE.D */ - std::tuple __fle_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fle_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FLE.D"); this->gen_sync(iss::PRE_SYNC, 149); @@ -7881,7 +7882,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FLE.D x%1$d, f%2$d, f%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7892,7 +7893,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_d"), std::vector{ + Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fcmp_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7907,7 +7908,7 @@ private: false) }); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -7917,13 +7918,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 149); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 150: FCLASS.D */ - std::tuple __fclass_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fclass_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCLASS.D"); this->gen_sync(iss::PRE_SYNC, 150); @@ -7934,7 +7935,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCLASS.D x%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7945,7 +7946,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fclass_d"), std::vector{ + Value* Xtmp0_val = this->builder.CreateCall(this->mod->getFunction("fclass_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7954,13 +7955,13 @@ private: this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 150); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 151: FCVT.W.D */ - std::tuple __fcvt_w_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_w_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.W.D"); this->gen_sync(iss::PRE_SYNC, 151); @@ -7972,7 +7973,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.W.D x%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -7984,7 +7985,7 @@ private: pc=pc+4; Value* Xtmp0_val = this->gen_ext( - this->builder.CreateCall(this->mod->getFunction("fcvt_d"), std::vector{ + this->builder.CreateCall(this->mod->getFunction("fcvt_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -7998,7 +7999,7 @@ private: 32, true); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -8008,13 +8009,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 151); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 152: FCVT.WU.D */ - std::tuple __fcvt_wu_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_wu_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.WU.D"); this->gen_sync(iss::PRE_SYNC, 152); @@ -8026,7 +8027,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.WU.D x%1$d, f%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -8038,7 +8039,7 @@ private: pc=pc+4; Value* Xtmp0_val = this->gen_ext( - this->builder.CreateCall(this->mod->getFunction("fcvt_d"), std::vector{ + this->builder.CreateCall(this->mod->getFunction("fcvt_d"), std::vector{ this->builder.CreateTrunc( this->gen_reg_load(fld_rs1_val + traits::F0, 0), this-> get_type(64) @@ -8052,7 +8053,7 @@ private: 32, false); this->builder.CreateStore(Xtmp0_val, get_reg_ptr(fld_rd_val + traits::X0), false); - Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ + Value* flags_val = this->builder.CreateCall(this->mod->getFunction("fget_flags"), std::vector{ }); Value* FCSR_val = this->builder.CreateAdd( this->builder.CreateAnd( @@ -8062,13 +8063,13 @@ private: this->builder.CreateStore(FCSR_val, get_reg_ptr(traits::FCSR), false); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 152); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 153: FCVT.D.W */ - std::tuple __fcvt_d_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_d_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.D.W"); this->gen_sync(iss::PRE_SYNC, 153); @@ -8080,7 +8081,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.D.W f%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -8091,7 +8092,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fcvt_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fcvt_d"), std::vector{ this->gen_ext( this->gen_reg_load(fld_rs1_val + traits::X0, 0), 64, @@ -8116,13 +8117,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 153); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 154: FCVT.D.WU */ - std::tuple __fcvt_d_wu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fcvt_d_wu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FCVT.D.WU"); this->gen_sync(iss::PRE_SYNC, 154); @@ -8134,7 +8135,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("FCVT.D.WU f%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -8145,7 +8146,7 @@ private: Value* cur_pc_val = this->gen_const(32, pc.val); pc=pc+4; - Value* res_val = this->builder.CreateCall(this->mod->getFunction("fcvt_d"), std::vector{ + Value* res_val = this->builder.CreateCall(this->mod->getFunction("fcvt_d"), std::vector{ this->gen_ext( this->gen_reg_load(fld_rs1_val + traits::X0, 0), 64, @@ -8170,13 +8171,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 154); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 155: C.FLD */ - std::tuple __c_fld(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_fld(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.FLD"); this->gen_sync(iss::PRE_SYNC, 155); @@ -8188,7 +8189,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.FLD f(8+%1$d), %2%(x(8+%3$d))"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_uimm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -8217,13 +8218,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 155); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 156: C.FSD */ - std::tuple __c_fsd(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_fsd(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.FSD"); this->gen_sync(iss::PRE_SYNC, 156); @@ -8235,7 +8236,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.FSD f(8+%1$d), %2%(x(8+%3$d))"); ins_fmter % (uint64_t)fld_rs2_val % (uint64_t)fld_uimm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -8259,13 +8260,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 156); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 157: C.FLDSP */ - std::tuple __c_fldsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_fldsp(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.FLDSP"); this->gen_sync(iss::PRE_SYNC, 157); @@ -8276,7 +8277,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.FLDSP f%1$d, %2%(x2)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_uimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -8308,13 +8309,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 157); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 158: C.FSDSP */ - std::tuple __c_fsdsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_fsdsp(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("C.FSDSP"); this->gen_sync(iss::PRE_SYNC, 158); @@ -8325,7 +8326,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("C.FSDSP f%1$d, %2%(x2), "); ins_fmter % (uint64_t)fld_rs2_val % (uint64_t)fld_uimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -8349,16 +8350,16 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 158); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /**************************************************************************** * end opcode definitions ****************************************************************************/ - std::tuple illegal_intruction(virt_addr_t &pc, code_word_t instr, - llvm::BasicBlock *bb) { + std::tuple illegal_intruction(virt_addr_t &pc, code_word_t instr, + BasicBlock *bb) { this->gen_sync(iss::PRE_SYNC, instr_descr.size()); this->builder.CreateStore(this->builder.CreateLoad(get_reg_ptr(traits::NEXT_PC), true), get_reg_ptr(traits::PC), true); @@ -8370,7 +8371,7 @@ private: this->gen_raise_trap(0, 2); // illegal instruction trap this->gen_sync(iss::POST_SYNC, instr_descr.size()); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } }; @@ -8383,7 +8384,7 @@ template vm_impl::vm_impl() { this(new ARCH()); } template vm_impl::vm_impl(ARCH &core, unsigned core_id, unsigned cluster_id) -: vm::vm_base(core, core_id, cluster_id) { +: vm_base(core, core_id, cluster_id) { qlut[0] = lut_00.data(); qlut[1] = lut_01.data(); qlut[2] = lut_10.data(); @@ -8395,8 +8396,8 @@ vm_impl::vm_impl(ARCH &core, unsigned core_id, unsigned cluster_id) } template -std::tuple -vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, llvm::BasicBlock *this_block) { +std::tuple +vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, BasicBlock *this_block) { // we fetch at max 4 byte, alignment is 2 code_word_t insn = 0; const typename traits::addr_t upper_bits = ~traits::PGMASK; @@ -8428,7 +8429,7 @@ vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, return (this->*f)(pc, insn, this_block); } -template void vm_impl::gen_leave_behavior(llvm::BasicBlock *leave_blk) { +template void vm_impl::gen_leave_behavior(BasicBlock *leave_blk) { this->builder.SetInsertPoint(leave_blk); this->builder.CreateRet(this->builder.CreateLoad(get_reg_ptr(arch::traits::NEXT_PC), false)); } @@ -8440,8 +8441,8 @@ template void vm_impl::gen_raise_trap(uint16_t trap_id, ui } template void vm_impl::gen_leave_trap(unsigned lvl) { - std::vector args{ - this->core_ptr, llvm::ConstantInt::get(getContext(), llvm::APInt(64, lvl)), + std::vector args{ + this->core_ptr, ConstantInt::get(getContext(), APInt(64, lvl)), }; this->builder.CreateCall(this->mod->getFunction("leave_trap"), args); auto *PC_val = this->gen_read_mem(traits::CSR, (lvl << 8) + 0x41, traits::XLEN / 8); @@ -8450,17 +8451,17 @@ template void vm_impl::gen_leave_trap(unsigned lvl) { } template void vm_impl::gen_wait(unsigned type) { - std::vector args{ - this->core_ptr, llvm::ConstantInt::get(getContext(), llvm::APInt(64, type)), + std::vector args{ + this->core_ptr, ConstantInt::get(getContext(), APInt(64, type)), }; this->builder.CreateCall(this->mod->getFunction("wait"), args); } -template void vm_impl::gen_trap_behavior(llvm::BasicBlock *trap_blk) { +template void vm_impl::gen_trap_behavior(BasicBlock *trap_blk) { this->builder.SetInsertPoint(trap_blk); auto *trap_state_val = this->builder.CreateLoad(get_reg_ptr(traits::TRAP_STATE), true); this->builder.CreateStore(this->gen_const(32U, std::numeric_limits::max()), get_reg_ptr(traits::LAST_BRANCH), false); - std::vector args{ + std::vector args{ this->core_ptr, this->adj_to64(trap_state_val), this->adj_to64(this->builder.CreateLoad(get_reg_ptr(traits::PC), false))}; @@ -8469,11 +8470,11 @@ template void vm_impl::gen_trap_behavior(llvm::BasicBlock this->builder.CreateRet(trap_addr_val); } -template inline void vm_impl::gen_trap_check(llvm::BasicBlock *bb) { +template inline void vm_impl::gen_trap_check(BasicBlock *bb) { auto *v = this->builder.CreateLoad(get_reg_ptr(arch::traits::TRAP_STATE), true); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_EQ, v, - llvm::ConstantInt::get(getContext(), llvm::APInt(v->getType()->getIntegerBitWidth(), 0))), + ConstantInt::get(getContext(), APInt(v->getType()->getIntegerBitWidth(), 0))), bb, this->trap_blk, 1); } diff --git a/riscv/src/internal/vm_rv32imac.cpp b/riscv/src/internal/vm_rv32imac.cpp index df40e5f..c8efdc1 100644 --- a/riscv/src/internal/vm_rv32imac.cpp +++ b/riscv/src/internal/vm_rv32imac.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -54,10 +54,11 @@ namespace rv32imac { using namespace iss::arch; using namespace llvm; using namespace iss::debugger; +using namespace iss::vm::llvm; -template class vm_impl : public vm::vm_base { +template class vm_impl : public vm_base { public: - using super = typename vm::vm_base; + using super = typename iss::vm::llvm::vm_base; using virt_addr_t = typename super::virt_addr_t; using phys_addr_t = typename super::phys_addr_t; using code_word_t = typename super::code_word_t; @@ -71,13 +72,13 @@ public: target_adapter_if *accquire_target_adapter(server_if *srv) override { debugger_if::dbg_enabled = true; - if (vm::vm_base::tgt_adapter == nullptr) - vm::vm_base::tgt_adapter = new riscv_target_adapter(srv, this->get_arch()); - return vm::vm_base::tgt_adapter; + if (vm_base::tgt_adapter == nullptr) + vm_base::tgt_adapter = new riscv_target_adapter(srv, this->get_arch()); + return vm_base::tgt_adapter; } protected: - using vm::vm_base::get_reg_ptr; + using vm_base::get_reg_ptr; template inline llvm::ConstantInt *size(T type) { return llvm::ConstantInt::get(getContext(), llvm::APInt(32, type->getType()->getScalarSizeInBits())); @@ -92,7 +93,7 @@ protected: return super::gen_cond_assign(cond, this->gen_ext(trueVal, size), this->gen_ext(falseVal, size)); } - std::tuple gen_single_inst_behavior(virt_addr_t &, unsigned int &, + std::tuple gen_single_inst_behavior(virt_addr_t &, unsigned int &, llvm::BasicBlock *) override; void gen_leave_behavior(llvm::BasicBlock *leave_blk) override; @@ -124,7 +125,7 @@ protected: enum { LUT_SIZE = 1 << util::bit_count(EXTR_MASK32), LUT_SIZE_C = 1 << util::bit_count(EXTR_MASK16) }; using this_class = vm_impl; - using compile_func = std::tuple (this_class::*)(virt_addr_t &pc, + using compile_func = std::tuple (this_class::*)(virt_addr_t &pc, code_word_t instr, llvm::BasicBlock *bb); std::array lut; @@ -388,7 +389,7 @@ private: /* instruction definitions */ /* instruction 0: LUI */ - std::tuple __lui(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lui(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("LUI"); this->gen_sync(iss::PRE_SYNC, 0); @@ -418,11 +419,11 @@ private: this->gen_sync(iss::POST_SYNC, 0); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 1: AUIPC */ - std::tuple __auipc(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __auipc(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AUIPC"); this->gen_sync(iss::PRE_SYNC, 1); @@ -456,11 +457,11 @@ private: this->gen_sync(iss::POST_SYNC, 1); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 2: JAL */ - std::tuple __jal(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __jal(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("JAL"); this->gen_sync(iss::PRE_SYNC, 2); @@ -498,11 +499,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 2); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 3: JALR */ - std::tuple __jalr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __jalr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("JALR"); this->gen_sync(iss::PRE_SYNC, 3); @@ -569,11 +570,11 @@ private: this->builder.SetInsertPoint(bb); this->gen_sync(iss::POST_SYNC, 3); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 4: BEQ */ - std::tuple __beq(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __beq(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("BEQ"); this->gen_sync(iss::PRE_SYNC, 4); @@ -615,11 +616,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 4); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 5: BNE */ - std::tuple __bne(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bne(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("BNE"); this->gen_sync(iss::PRE_SYNC, 5); @@ -661,11 +662,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 5); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 6: BLT */ - std::tuple __blt(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __blt(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("BLT"); this->gen_sync(iss::PRE_SYNC, 6); @@ -711,11 +712,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 6); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 7: BGE */ - std::tuple __bge(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bge(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("BGE"); this->gen_sync(iss::PRE_SYNC, 7); @@ -761,11 +762,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 7); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 8: BLTU */ - std::tuple __bltu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bltu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("BLTU"); this->gen_sync(iss::PRE_SYNC, 8); @@ -807,11 +808,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 8); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 9: BGEU */ - std::tuple __bgeu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bgeu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("BGEU"); this->gen_sync(iss::PRE_SYNC, 9); @@ -853,11 +854,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 9); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 10: LB */ - std::tuple __lb(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lb(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("LB"); this->gen_sync(iss::PRE_SYNC, 10); @@ -896,11 +897,11 @@ private: this->gen_sync(iss::POST_SYNC, 10); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 11: LH */ - std::tuple __lh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("LH"); this->gen_sync(iss::PRE_SYNC, 11); @@ -939,11 +940,11 @@ private: this->gen_sync(iss::POST_SYNC, 11); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 12: LW */ - std::tuple __lw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("LW"); this->gen_sync(iss::PRE_SYNC, 12); @@ -982,11 +983,11 @@ private: this->gen_sync(iss::POST_SYNC, 12); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 13: LBU */ - std::tuple __lbu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lbu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("LBU"); this->gen_sync(iss::PRE_SYNC, 13); @@ -1025,11 +1026,11 @@ private: this->gen_sync(iss::POST_SYNC, 13); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 14: LHU */ - std::tuple __lhu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lhu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("LHU"); this->gen_sync(iss::PRE_SYNC, 14); @@ -1068,11 +1069,11 @@ private: this->gen_sync(iss::POST_SYNC, 14); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 15: SB */ - std::tuple __sb(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sb(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SB"); this->gen_sync(iss::PRE_SYNC, 15); @@ -1109,11 +1110,11 @@ private: this->gen_sync(iss::POST_SYNC, 15); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 16: SH */ - std::tuple __sh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SH"); this->gen_sync(iss::PRE_SYNC, 16); @@ -1150,11 +1151,11 @@ private: this->gen_sync(iss::POST_SYNC, 16); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 17: SW */ - std::tuple __sw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SW"); this->gen_sync(iss::PRE_SYNC, 17); @@ -1191,11 +1192,11 @@ private: this->gen_sync(iss::POST_SYNC, 17); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 18: ADDI */ - std::tuple __addi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __addi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("ADDI"); this->gen_sync(iss::PRE_SYNC, 18); @@ -1230,11 +1231,11 @@ private: this->gen_sync(iss::POST_SYNC, 18); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 19: SLTI */ - std::tuple __slti(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slti(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SLTI"); this->gen_sync(iss::PRE_SYNC, 19); @@ -1274,11 +1275,11 @@ private: this->gen_sync(iss::POST_SYNC, 19); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 20: SLTIU */ - std::tuple __sltiu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sltiu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SLTIU"); this->gen_sync(iss::PRE_SYNC, 20); @@ -1317,11 +1318,11 @@ private: this->gen_sync(iss::POST_SYNC, 20); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 21: XORI */ - std::tuple __xori(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __xori(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("XORI"); this->gen_sync(iss::PRE_SYNC, 21); @@ -1354,11 +1355,11 @@ private: this->gen_sync(iss::POST_SYNC, 21); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 22: ORI */ - std::tuple __ori(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ori(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("ORI"); this->gen_sync(iss::PRE_SYNC, 22); @@ -1391,11 +1392,11 @@ private: this->gen_sync(iss::POST_SYNC, 22); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 23: ANDI */ - std::tuple __andi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __andi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("ANDI"); this->gen_sync(iss::PRE_SYNC, 23); @@ -1428,11 +1429,11 @@ private: this->gen_sync(iss::POST_SYNC, 23); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 24: SLLI */ - std::tuple __slli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SLLI"); this->gen_sync(iss::PRE_SYNC, 24); @@ -1469,11 +1470,11 @@ private: this->gen_sync(iss::POST_SYNC, 24); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 25: SRLI */ - std::tuple __srli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SRLI"); this->gen_sync(iss::PRE_SYNC, 25); @@ -1510,11 +1511,11 @@ private: this->gen_sync(iss::POST_SYNC, 25); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 26: SRAI */ - std::tuple __srai(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srai(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SRAI"); this->gen_sync(iss::PRE_SYNC, 26); @@ -1551,11 +1552,11 @@ private: this->gen_sync(iss::POST_SYNC, 26); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 27: ADD */ - std::tuple __add(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __add(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("ADD"); this->gen_sync(iss::PRE_SYNC, 27); @@ -1588,11 +1589,11 @@ private: this->gen_sync(iss::POST_SYNC, 27); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 28: SUB */ - std::tuple __sub(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sub(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SUB"); this->gen_sync(iss::PRE_SYNC, 28); @@ -1625,11 +1626,11 @@ private: this->gen_sync(iss::POST_SYNC, 28); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 29: SLL */ - std::tuple __sll(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sll(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SLL"); this->gen_sync(iss::PRE_SYNC, 29); @@ -1664,11 +1665,11 @@ private: this->gen_sync(iss::POST_SYNC, 29); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 30: SLT */ - std::tuple __slt(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slt(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SLT"); this->gen_sync(iss::PRE_SYNC, 30); @@ -1710,11 +1711,11 @@ private: this->gen_sync(iss::POST_SYNC, 30); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 31: SLTU */ - std::tuple __sltu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sltu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SLTU"); this->gen_sync(iss::PRE_SYNC, 31); @@ -1758,11 +1759,11 @@ private: this->gen_sync(iss::POST_SYNC, 31); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 32: XOR */ - std::tuple __xor(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __xor(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("XOR"); this->gen_sync(iss::PRE_SYNC, 32); @@ -1795,11 +1796,11 @@ private: this->gen_sync(iss::POST_SYNC, 32); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 33: SRL */ - std::tuple __srl(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srl(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SRL"); this->gen_sync(iss::PRE_SYNC, 33); @@ -1834,11 +1835,11 @@ private: this->gen_sync(iss::POST_SYNC, 33); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 34: SRA */ - std::tuple __sra(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sra(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SRA"); this->gen_sync(iss::PRE_SYNC, 34); @@ -1873,11 +1874,11 @@ private: this->gen_sync(iss::POST_SYNC, 34); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 35: OR */ - std::tuple __or(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __or(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("OR"); this->gen_sync(iss::PRE_SYNC, 35); @@ -1910,11 +1911,11 @@ private: this->gen_sync(iss::POST_SYNC, 35); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 36: AND */ - std::tuple __and(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __and(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AND"); this->gen_sync(iss::PRE_SYNC, 36); @@ -1947,11 +1948,11 @@ private: this->gen_sync(iss::POST_SYNC, 36); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 37: FENCE */ - std::tuple __fence(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fence(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("FENCE"); this->gen_sync(iss::PRE_SYNC, 37); @@ -1986,11 +1987,11 @@ private: this->gen_sync(iss::POST_SYNC, 37); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 38: FENCE_I */ - std::tuple __fence_i(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fence_i(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("FENCE_I"); this->gen_sync(iss::PRE_SYNC, 38); @@ -2020,11 +2021,11 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 38); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::FLUSH, nullptr); + return std::make_tuple(FLUSH, nullptr); } /* instruction 39: ECALL */ - std::tuple __ecall(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ecall(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("ECALL"); this->gen_sync(iss::PRE_SYNC, 39); @@ -2045,11 +2046,11 @@ private: this->gen_raise_trap(0, 11); this->gen_sync(iss::POST_SYNC, 39); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 40: EBREAK */ - std::tuple __ebreak(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ebreak(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("EBREAK"); this->gen_sync(iss::PRE_SYNC, 40); @@ -2070,11 +2071,11 @@ private: this->gen_raise_trap(0, 3); this->gen_sync(iss::POST_SYNC, 40); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 41: URET */ - std::tuple __uret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __uret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("URET"); this->gen_sync(iss::PRE_SYNC, 41); @@ -2095,11 +2096,11 @@ private: this->gen_leave_trap(0); this->gen_sync(iss::POST_SYNC, 41); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 42: SRET */ - std::tuple __sret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SRET"); this->gen_sync(iss::PRE_SYNC, 42); @@ -2120,11 +2121,11 @@ private: this->gen_leave_trap(1); this->gen_sync(iss::POST_SYNC, 42); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 43: MRET */ - std::tuple __mret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("MRET"); this->gen_sync(iss::PRE_SYNC, 43); @@ -2145,11 +2146,11 @@ private: this->gen_leave_trap(3); this->gen_sync(iss::POST_SYNC, 43); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 44: WFI */ - std::tuple __wfi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __wfi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("WFI"); this->gen_sync(iss::PRE_SYNC, 44); @@ -2172,11 +2173,11 @@ private: this->gen_sync(iss::POST_SYNC, 44); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 45: SFENCE.VMA */ - std::tuple __sfence_vma(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sfence_vma(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SFENCE.VMA"); this->gen_sync(iss::PRE_SYNC, 45); @@ -2210,11 +2211,11 @@ private: this->gen_sync(iss::POST_SYNC, 45); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 46: CSRRW */ - std::tuple __csrrw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("CSRRW"); this->gen_sync(iss::PRE_SYNC, 46); @@ -2258,11 +2259,11 @@ private: this->gen_sync(iss::POST_SYNC, 46); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 47: CSRRS */ - std::tuple __csrrs(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrs(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("CSRRS"); this->gen_sync(iss::PRE_SYNC, 47); @@ -2304,11 +2305,11 @@ private: this->gen_sync(iss::POST_SYNC, 47); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 48: CSRRC */ - std::tuple __csrrc(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrc(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("CSRRC"); this->gen_sync(iss::PRE_SYNC, 48); @@ -2350,11 +2351,11 @@ private: this->gen_sync(iss::POST_SYNC, 48); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 49: CSRRWI */ - std::tuple __csrrwi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrwi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("CSRRWI"); this->gen_sync(iss::PRE_SYNC, 49); @@ -2393,11 +2394,11 @@ private: this->gen_sync(iss::POST_SYNC, 49); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 50: CSRRSI */ - std::tuple __csrrsi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrsi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("CSRRSI"); this->gen_sync(iss::PRE_SYNC, 50); @@ -2441,11 +2442,11 @@ private: this->gen_sync(iss::POST_SYNC, 50); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 51: CSRRCI */ - std::tuple __csrrci(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrci(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("CSRRCI"); this->gen_sync(iss::PRE_SYNC, 51); @@ -2489,11 +2490,11 @@ private: this->gen_sync(iss::POST_SYNC, 51); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 52: MUL */ - std::tuple __mul(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mul(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("MUL"); this->gen_sync(iss::PRE_SYNC, 52); @@ -2536,11 +2537,11 @@ private: this->gen_sync(iss::POST_SYNC, 52); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 53: MULH */ - std::tuple __mulh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mulh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("MULH"); this->gen_sync(iss::PRE_SYNC, 53); @@ -2585,11 +2586,11 @@ private: this->gen_sync(iss::POST_SYNC, 53); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 54: MULHSU */ - std::tuple __mulhsu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mulhsu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("MULHSU"); this->gen_sync(iss::PRE_SYNC, 54); @@ -2634,11 +2635,11 @@ private: this->gen_sync(iss::POST_SYNC, 54); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 55: MULHU */ - std::tuple __mulhu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mulhu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("MULHU"); this->gen_sync(iss::PRE_SYNC, 55); @@ -2683,11 +2684,11 @@ private: this->gen_sync(iss::POST_SYNC, 55); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 56: DIV */ - std::tuple __div(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __div(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("DIV"); this->gen_sync(iss::PRE_SYNC, 56); @@ -2812,11 +2813,11 @@ private: this->gen_sync(iss::POST_SYNC, 56); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 57: DIVU */ - std::tuple __divu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __divu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("DIVU"); this->gen_sync(iss::PRE_SYNC, 57); @@ -2879,11 +2880,11 @@ private: this->gen_sync(iss::POST_SYNC, 57); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 58: REM */ - std::tuple __rem(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __rem(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("REM"); this->gen_sync(iss::PRE_SYNC, 58); @@ -3012,11 +3013,11 @@ private: this->gen_sync(iss::POST_SYNC, 58); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 59: REMU */ - std::tuple __remu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __remu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("REMU"); this->gen_sync(iss::PRE_SYNC, 59); @@ -3079,11 +3080,11 @@ private: this->gen_sync(iss::POST_SYNC, 59); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 60: LR.W */ - std::tuple __lr_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lr_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("LR.W"); this->gen_sync(iss::PRE_SYNC, 60); @@ -3127,11 +3128,11 @@ private: this->gen_sync(iss::POST_SYNC, 60); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 61: SC.W */ - std::tuple __sc_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sc_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("SC.W"); this->gen_sync(iss::PRE_SYNC, 61); @@ -3195,11 +3196,11 @@ private: this->gen_sync(iss::POST_SYNC, 61); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 62: AMOSWAP.W */ - std::tuple __amoswap_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoswap_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOSWAP.W"); this->gen_sync(iss::PRE_SYNC, 62); @@ -3241,11 +3242,11 @@ private: this->gen_sync(iss::POST_SYNC, 62); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 63: AMOADD.W */ - std::tuple __amoadd_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoadd_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOADD.W"); this->gen_sync(iss::PRE_SYNC, 63); @@ -3291,11 +3292,11 @@ private: this->gen_sync(iss::POST_SYNC, 63); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 64: AMOXOR.W */ - std::tuple __amoxor_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoxor_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOXOR.W"); this->gen_sync(iss::PRE_SYNC, 64); @@ -3341,11 +3342,11 @@ private: this->gen_sync(iss::POST_SYNC, 64); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 65: AMOAND.W */ - std::tuple __amoand_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoand_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOAND.W"); this->gen_sync(iss::PRE_SYNC, 65); @@ -3391,11 +3392,11 @@ private: this->gen_sync(iss::POST_SYNC, 65); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 66: AMOOR.W */ - std::tuple __amoor_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoor_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOOR.W"); this->gen_sync(iss::PRE_SYNC, 66); @@ -3441,11 +3442,11 @@ private: this->gen_sync(iss::POST_SYNC, 66); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 67: AMOMIN.W */ - std::tuple __amomin_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomin_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOMIN.W"); this->gen_sync(iss::PRE_SYNC, 67); @@ -3500,11 +3501,11 @@ private: this->gen_sync(iss::POST_SYNC, 67); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 68: AMOMAX.W */ - std::tuple __amomax_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomax_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOMAX.W"); this->gen_sync(iss::PRE_SYNC, 68); @@ -3559,11 +3560,11 @@ private: this->gen_sync(iss::POST_SYNC, 68); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 69: AMOMINU.W */ - std::tuple __amominu_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amominu_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOMINU.W"); this->gen_sync(iss::PRE_SYNC, 69); @@ -3614,11 +3615,11 @@ private: this->gen_sync(iss::POST_SYNC, 69); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 70: AMOMAXU.W */ - std::tuple __amomaxu_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomaxu_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("AMOMAXU.W"); this->gen_sync(iss::PRE_SYNC, 70); @@ -3669,11 +3670,11 @@ private: this->gen_sync(iss::POST_SYNC, 70); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 71: C.ADDI4SPN */ - std::tuple __c_addi4spn(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_addi4spn(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.ADDI4SPN"); this->gen_sync(iss::PRE_SYNC, 71); @@ -3706,11 +3707,11 @@ private: this->gen_sync(iss::POST_SYNC, 71); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 72: C.LW */ - std::tuple __c_lw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_lw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.LW"); this->gen_sync(iss::PRE_SYNC, 72); @@ -3742,11 +3743,11 @@ private: this->gen_sync(iss::POST_SYNC, 72); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 73: C.SW */ - std::tuple __c_sw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_sw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.SW"); this->gen_sync(iss::PRE_SYNC, 73); @@ -3781,11 +3782,11 @@ private: this->gen_sync(iss::POST_SYNC, 73); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 74: C.ADDI */ - std::tuple __c_addi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_addi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.ADDI"); this->gen_sync(iss::PRE_SYNC, 74); @@ -3817,11 +3818,11 @@ private: this->gen_sync(iss::POST_SYNC, 74); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 75: C.NOP */ - std::tuple __c_nop(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_nop(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.NOP"); this->gen_sync(iss::PRE_SYNC, 75); @@ -3844,11 +3845,11 @@ private: this->gen_sync(iss::POST_SYNC, 75); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 76: C.JAL */ - std::tuple __c_jal(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_jal(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.JAL"); this->gen_sync(iss::PRE_SYNC, 76); @@ -3883,11 +3884,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 76); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 77: C.LI */ - std::tuple __c_li(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_li(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.LI"); this->gen_sync(iss::PRE_SYNC, 77); @@ -3918,11 +3919,11 @@ private: this->gen_sync(iss::POST_SYNC, 77); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 78: C.LUI */ - std::tuple __c_lui(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_lui(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.LUI"); this->gen_sync(iss::PRE_SYNC, 78); @@ -3956,11 +3957,11 @@ private: this->gen_sync(iss::POST_SYNC, 78); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 79: C.ADDI16SP */ - std::tuple __c_addi16sp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_addi16sp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.ADDI16SP"); this->gen_sync(iss::PRE_SYNC, 79); @@ -3991,11 +3992,11 @@ private: this->gen_sync(iss::POST_SYNC, 79); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 80: C.SRLI */ - std::tuple __c_srli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_srli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.SRLI"); this->gen_sync(iss::PRE_SYNC, 80); @@ -4026,11 +4027,11 @@ private: this->gen_sync(iss::POST_SYNC, 80); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 81: C.SRAI */ - std::tuple __c_srai(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_srai(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.SRAI"); this->gen_sync(iss::PRE_SYNC, 81); @@ -4061,11 +4062,11 @@ private: this->gen_sync(iss::POST_SYNC, 81); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 82: C.ANDI */ - std::tuple __c_andi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_andi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.ANDI"); this->gen_sync(iss::PRE_SYNC, 82); @@ -4096,11 +4097,11 @@ private: this->gen_sync(iss::POST_SYNC, 82); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 83: C.SUB */ - std::tuple __c_sub(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_sub(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.SUB"); this->gen_sync(iss::PRE_SYNC, 83); @@ -4131,11 +4132,11 @@ private: this->gen_sync(iss::POST_SYNC, 83); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 84: C.XOR */ - std::tuple __c_xor(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_xor(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.XOR"); this->gen_sync(iss::PRE_SYNC, 84); @@ -4166,11 +4167,11 @@ private: this->gen_sync(iss::POST_SYNC, 84); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 85: C.OR */ - std::tuple __c_or(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_or(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.OR"); this->gen_sync(iss::PRE_SYNC, 85); @@ -4201,11 +4202,11 @@ private: this->gen_sync(iss::POST_SYNC, 85); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 86: C.AND */ - std::tuple __c_and(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_and(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.AND"); this->gen_sync(iss::PRE_SYNC, 86); @@ -4236,11 +4237,11 @@ private: this->gen_sync(iss::POST_SYNC, 86); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 87: C.J */ - std::tuple __c_j(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_j(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.J"); this->gen_sync(iss::PRE_SYNC, 87); @@ -4271,11 +4272,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 87); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 88: C.BEQZ */ - std::tuple __c_beqz(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_beqz(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.BEQZ"); this->gen_sync(iss::PRE_SYNC, 88); @@ -4316,11 +4317,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 88); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 89: C.BNEZ */ - std::tuple __c_bnez(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_bnez(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.BNEZ"); this->gen_sync(iss::PRE_SYNC, 89); @@ -4361,11 +4362,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 89); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 90: C.SLLI */ - std::tuple __c_slli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_slli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.SLLI"); this->gen_sync(iss::PRE_SYNC, 90); @@ -4398,11 +4399,11 @@ private: this->gen_sync(iss::POST_SYNC, 90); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 91: C.LWSP */ - std::tuple __c_lwsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_lwsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.LWSP"); this->gen_sync(iss::PRE_SYNC, 91); @@ -4433,11 +4434,11 @@ private: this->gen_sync(iss::POST_SYNC, 91); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 92: C.MV */ - std::tuple __c_mv(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_mv(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.MV"); this->gen_sync(iss::PRE_SYNC, 92); @@ -4465,11 +4466,11 @@ private: this->gen_sync(iss::POST_SYNC, 92); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 93: C.JR */ - std::tuple __c_jr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_jr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.JR"); this->gen_sync(iss::PRE_SYNC, 93); @@ -4495,11 +4496,11 @@ private: this->builder.CreateStore(this->gen_const(32U, std::numeric_limits::max()), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 93); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 94: C.ADD */ - std::tuple __c_add(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_add(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.ADD"); this->gen_sync(iss::PRE_SYNC, 94); @@ -4529,11 +4530,11 @@ private: this->gen_sync(iss::POST_SYNC, 94); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 95: C.JALR */ - std::tuple __c_jalr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_jalr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.JALR"); this->gen_sync(iss::PRE_SYNC, 95); @@ -4563,11 +4564,11 @@ private: this->builder.CreateStore(this->gen_const(32U, std::numeric_limits::max()), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 95); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 96: C.EBREAK */ - std::tuple __c_ebreak(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_ebreak(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.EBREAK"); this->gen_sync(iss::PRE_SYNC, 96); @@ -4588,11 +4589,11 @@ private: this->gen_raise_trap(0, 3); this->gen_sync(iss::POST_SYNC, 96); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 97: C.SWSP */ - std::tuple __c_swsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __c_swsp(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("C.SWSP"); this->gen_sync(iss::PRE_SYNC, 97); @@ -4626,11 +4627,11 @@ private: this->gen_sync(iss::POST_SYNC, 97); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 98: DII */ - std::tuple __dii(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __dii(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ bb->setName("DII"); this->gen_sync(iss::PRE_SYNC, 98); @@ -4653,13 +4654,13 @@ private: this->gen_sync(iss::POST_SYNC, 98); bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /**************************************************************************** * end opcode definitions ****************************************************************************/ - std::tuple illegal_intruction(virt_addr_t &pc, code_word_t instr, + std::tuple illegal_intruction(virt_addr_t &pc, code_word_t instr, llvm::BasicBlock *bb) { this->gen_sync(iss::PRE_SYNC, instr_descr.size()); this->builder.CreateStore(this->builder.CreateLoad(get_reg_ptr(traits::NEXT_PC), true), @@ -4672,7 +4673,7 @@ private: this->gen_raise_trap(0, 2); // illegal instruction trap this->gen_sync(iss::POST_SYNC, instr_descr.size()); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } }; @@ -4685,7 +4686,7 @@ template vm_impl::vm_impl() { this(new ARCH()); } template vm_impl::vm_impl(ARCH &core, unsigned core_id, unsigned cluster_id) -: vm::vm_base(core, core_id, cluster_id) { +: vm_base(core, core_id, cluster_id) { qlut[0] = lut_00.data(); qlut[1] = lut_01.data(); qlut[2] = lut_10.data(); @@ -4697,7 +4698,7 @@ vm_impl::vm_impl(ARCH &core, unsigned core_id, unsigned cluster_id) } template -std::tuple +std::tuple vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, llvm::BasicBlock *this_block) { // we fetch at max 4 byte, alignment is 2 code_word_t insn = 0; diff --git a/riscv/src/internal/vm_rv64ia.cpp b/riscv/src/internal/vm_rv64ia.cpp index 60c603e..5e3c2e1 100644 --- a/riscv/src/internal/vm_rv64ia.cpp +++ b/riscv/src/internal/vm_rv64ia.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include @@ -58,10 +58,11 @@ namespace rv64ia { using namespace iss::arch; using namespace llvm; using namespace iss::debugger; +using namespace iss::vm::llvm; -template class vm_impl : public vm::vm_base { +template class vm_impl : public vm_base { public: - using super = typename vm::vm_base; + using super = typename iss::vm::llvm::vm_base; using virt_addr_t = typename super::virt_addr_t; using phys_addr_t = typename super::phys_addr_t; using code_word_t = typename super::code_word_t; @@ -75,31 +76,31 @@ public: target_adapter_if *accquire_target_adapter(server_if *srv) { debugger_if::dbg_enabled = true; - if (vm::vm_base::tgt_adapter == nullptr) - vm::vm_base::tgt_adapter = new riscv_target_adapter(srv, this->get_arch()); - return vm::vm_base::tgt_adapter; + if (vm_base::tgt_adapter == nullptr) + vm_base::tgt_adapter = new riscv_target_adapter(srv, this->get_arch()); + return vm_base::tgt_adapter; } protected: - using vm::vm_base::get_reg_ptr; + using vm_base::get_reg_ptr; - template inline llvm::ConstantInt *size(T type) { - return llvm::ConstantInt::get(getContext(), llvm::APInt(32, type->getType()->getScalarSizeInBits())); + template inline ConstantInt *size(T type) { + return ConstantInt::get(getContext(), APInt(32, type->getType()->getScalarSizeInBits())); } - void setup_module(llvm::Module* m) override { + void setup_module(Module* m) override { super::setup_module(m); - vm::fp_impl::add_fp_functions_2_module(m, traits::FP_REGS_SIZE); + iss::vm::fp_impl::add_fp_functions_2_module(m, traits::FP_REGS_SIZE); } - inline llvm::Value *gen_choose(llvm::Value *cond, llvm::Value *trueVal, llvm::Value *falseVal, unsigned size) { + inline Value *gen_choose(Value *cond, Value *trueVal, Value *falseVal, unsigned size) { return super::gen_cond_assign(cond, this->gen_ext(trueVal, size), this->gen_ext(falseVal, size)); } - std::tuple gen_single_inst_behavior(virt_addr_t &, unsigned int &, - llvm::BasicBlock *) override; + std::tuple gen_single_inst_behavior(virt_addr_t &, unsigned int &, + BasicBlock *) override; - void gen_leave_behavior(llvm::BasicBlock *leave_blk) override; + void gen_leave_behavior(BasicBlock *leave_blk) override; void gen_raise_trap(uint16_t trap_id, uint16_t cause); @@ -107,16 +108,16 @@ protected: void gen_wait(unsigned type); - void gen_trap_behavior(llvm::BasicBlock *) override; + void gen_trap_behavior(BasicBlock *) override; - void gen_trap_check(llvm::BasicBlock *bb); + void gen_trap_check(BasicBlock *bb); - inline llvm::Value *gen_reg_load(unsigned i, unsigned level = 0) { + inline Value *gen_reg_load(unsigned i, unsigned level = 0) { return this->builder.CreateLoad(get_reg_ptr(i), false); } inline void gen_set_pc(virt_addr_t pc, unsigned reg_num) { - llvm::Value *next_pc_v = this->builder.CreateSExtOrTrunc(this->gen_const(traits::XLEN, pc.val), + Value *next_pc_v = this->builder.CreateSExtOrTrunc(this->gen_const(traits::XLEN, pc.val), this->get_type(traits::XLEN)); this->builder.CreateStore(next_pc_v, get_reg_ptr(reg_num), true); } @@ -128,9 +129,9 @@ protected: enum { LUT_SIZE = 1 << util::bit_count(EXTR_MASK32), LUT_SIZE_C = 1 << util::bit_count(EXTR_MASK16) }; using this_class = vm_impl; - using compile_func = std::tuple (this_class::*)(virt_addr_t &pc, + using compile_func = std::tuple (this_class::*)(virt_addr_t &pc, code_word_t instr, - llvm::BasicBlock *bb); + BasicBlock *bb); std::array lut; std::array lut_00, lut_01, lut_10; @@ -366,7 +367,7 @@ private: /* instruction definitions */ /* instruction 0: LWU */ - std::tuple __lwu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lwu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LWU"); this->gen_sync(iss::PRE_SYNC, 0); @@ -378,7 +379,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LWU x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -403,13 +404,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 0); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 1: LD */ - std::tuple __ld(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ld(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LD"); this->gen_sync(iss::PRE_SYNC, 1); @@ -421,7 +422,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LD x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -446,13 +447,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 1); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 2: SD */ - std::tuple __sd(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sd(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SD"); this->gen_sync(iss::PRE_SYNC, 2); @@ -464,7 +465,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SD x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -487,13 +488,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 2); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 3: SLLI */ - std::tuple __slli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slli(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLLI"); this->gen_sync(iss::PRE_SYNC, 3); @@ -505,7 +506,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLLI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -528,13 +529,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 3); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 4: SRLI */ - std::tuple __srli(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srli(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRLI"); this->gen_sync(iss::PRE_SYNC, 4); @@ -546,7 +547,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRLI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -569,13 +570,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 4); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 5: SRAI */ - std::tuple __srai(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srai(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRAI"); this->gen_sync(iss::PRE_SYNC, 5); @@ -587,7 +588,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRAI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -610,13 +611,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 5); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 6: ADDIW */ - std::tuple __addiw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __addiw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ADDIW"); this->gen_sync(iss::PRE_SYNC, 6); @@ -628,7 +629,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ADDIW x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -656,13 +657,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 6); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 7: SLLIW */ - std::tuple __slliw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slliw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLLIW"); this->gen_sync(iss::PRE_SYNC, 7); @@ -674,7 +675,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLLIW x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -700,13 +701,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 7); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 8: SRLIW */ - std::tuple __srliw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srliw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRLIW"); this->gen_sync(iss::PRE_SYNC, 8); @@ -718,7 +719,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRLIW x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -744,13 +745,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 8); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 9: SRAIW */ - std::tuple __sraiw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sraiw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRAIW"); this->gen_sync(iss::PRE_SYNC, 9); @@ -762,7 +763,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRAIW x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_shamt_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -788,13 +789,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 9); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 10: ADDW */ - std::tuple __addw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __addw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ADDW"); this->gen_sync(iss::PRE_SYNC, 10); @@ -804,7 +805,7 @@ private: uint8_t fld_rs2_val = ((bit_sub<20,5>(instr))); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("ADDW"), @@ -833,13 +834,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 10); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 11: SUBW */ - std::tuple __subw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __subw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SUBW"); this->gen_sync(iss::PRE_SYNC, 11); @@ -849,7 +850,7 @@ private: uint8_t fld_rs2_val = ((bit_sub<20,5>(instr))); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("SUBW"), @@ -878,13 +879,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 11); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 12: SLLW */ - std::tuple __sllw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sllw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLLW"); this->gen_sync(iss::PRE_SYNC, 12); @@ -896,7 +897,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLLW x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -929,13 +930,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 12); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 13: SRLW */ - std::tuple __srlw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srlw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRLW"); this->gen_sync(iss::PRE_SYNC, 13); @@ -947,7 +948,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRLW x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -980,13 +981,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 13); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 14: SRAW */ - std::tuple __sraw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sraw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRAW"); this->gen_sync(iss::PRE_SYNC, 14); @@ -998,7 +999,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRAW x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1031,13 +1032,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 14); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 15: LUI */ - std::tuple __lui(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lui(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LUI"); this->gen_sync(iss::PRE_SYNC, 15); @@ -1048,7 +1049,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LUI x%1$d, 0x%2$05x"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1065,13 +1066,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 15); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 16: AUIPC */ - std::tuple __auipc(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __auipc(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AUIPC"); this->gen_sync(iss::PRE_SYNC, 16); @@ -1082,7 +1083,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AUIPC x%1%, 0x%2$08x"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1103,13 +1104,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 16); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 17: JAL */ - std::tuple __jal(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __jal(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("JAL"); this->gen_sync(iss::PRE_SYNC, 17); @@ -1120,7 +1121,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("JAL x%1$d, 0x%2$x"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1147,11 +1148,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 17); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 18: JALR */ - std::tuple __jalr(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __jalr(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("JALR"); this->gen_sync(iss::PRE_SYNC, 18); @@ -1163,7 +1164,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("JALR x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1183,9 +1184,9 @@ private: new_pc_val, this->gen_const(64U, 0x2)); { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -1218,11 +1219,11 @@ private: this->builder.SetInsertPoint(bb); this->gen_sync(iss::POST_SYNC, 18); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 19: BEQ */ - std::tuple __beq(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __beq(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BEQ"); this->gen_sync(iss::PRE_SYNC, 19); @@ -1234,7 +1235,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BEQ x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1264,11 +1265,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 19); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 20: BNE */ - std::tuple __bne(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bne(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BNE"); this->gen_sync(iss::PRE_SYNC, 20); @@ -1280,7 +1281,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BNE x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1310,11 +1311,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 20); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 21: BLT */ - std::tuple __blt(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __blt(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BLT"); this->gen_sync(iss::PRE_SYNC, 21); @@ -1326,7 +1327,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BLT x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1360,11 +1361,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 21); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 22: BGE */ - std::tuple __bge(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bge(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BGE"); this->gen_sync(iss::PRE_SYNC, 22); @@ -1376,7 +1377,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BGE x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1410,11 +1411,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 22); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 23: BLTU */ - std::tuple __bltu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bltu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BLTU"); this->gen_sync(iss::PRE_SYNC, 23); @@ -1426,7 +1427,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BLTU x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1456,11 +1457,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 23); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 24: BGEU */ - std::tuple __bgeu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __bgeu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("BGEU"); this->gen_sync(iss::PRE_SYNC, 24); @@ -1472,7 +1473,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("BGEU x%1$d, x%2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1502,11 +1503,11 @@ private: this->builder.CreateStore(this->gen_ext(is_cont_v, 32U, false), get_reg_ptr(traits::LAST_BRANCH), false); this->gen_sync(iss::POST_SYNC, 24); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 25: LB */ - std::tuple __lb(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lb(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LB"); this->gen_sync(iss::PRE_SYNC, 25); @@ -1518,7 +1519,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LB x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1543,13 +1544,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 25); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 26: LH */ - std::tuple __lh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lh(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LH"); this->gen_sync(iss::PRE_SYNC, 26); @@ -1561,7 +1562,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LH x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1586,13 +1587,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 26); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 27: LW */ - std::tuple __lw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LW"); this->gen_sync(iss::PRE_SYNC, 27); @@ -1604,7 +1605,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LW x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1629,13 +1630,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 27); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 28: LBU */ - std::tuple __lbu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lbu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LBU"); this->gen_sync(iss::PRE_SYNC, 28); @@ -1647,7 +1648,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LBU x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1672,13 +1673,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 28); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 29: LHU */ - std::tuple __lhu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lhu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LHU"); this->gen_sync(iss::PRE_SYNC, 29); @@ -1690,7 +1691,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LHU x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rd_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1715,13 +1716,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 29); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 30: SB */ - std::tuple __sb(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sb(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SB"); this->gen_sync(iss::PRE_SYNC, 30); @@ -1733,7 +1734,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SB x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1756,13 +1757,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(8))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 30); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 31: SH */ - std::tuple __sh(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sh(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SH"); this->gen_sync(iss::PRE_SYNC, 31); @@ -1774,7 +1775,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SH x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1797,13 +1798,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(16))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 31); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 32: SW */ - std::tuple __sw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SW"); this->gen_sync(iss::PRE_SYNC, 32); @@ -1815,7 +1816,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SW x%1$d, %2%(x%3$d)"); ins_fmter % (uint64_t)fld_rs2_val % (int64_t)fld_imm_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1838,13 +1839,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp0_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 32); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 33: ADDI */ - std::tuple __addi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __addi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ADDI"); this->gen_sync(iss::PRE_SYNC, 33); @@ -1856,7 +1857,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ADDI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1877,13 +1878,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 33); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 34: SLTI */ - std::tuple __slti(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slti(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLTI"); this->gen_sync(iss::PRE_SYNC, 34); @@ -1895,7 +1896,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLTI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1921,13 +1922,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 34); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 35: SLTIU */ - std::tuple __sltiu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sltiu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLTIU"); this->gen_sync(iss::PRE_SYNC, 35); @@ -1939,7 +1940,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLTIU x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -1964,13 +1965,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 35); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 36: XORI */ - std::tuple __xori(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __xori(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("XORI"); this->gen_sync(iss::PRE_SYNC, 36); @@ -1982,7 +1983,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("XORI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2001,13 +2002,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 36); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 37: ORI */ - std::tuple __ori(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ori(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ORI"); this->gen_sync(iss::PRE_SYNC, 37); @@ -2019,7 +2020,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ORI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2038,13 +2039,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 37); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 38: ANDI */ - std::tuple __andi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __andi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ANDI"); this->gen_sync(iss::PRE_SYNC, 38); @@ -2056,7 +2057,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ANDI x%1$d, x%2$d, %3%"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (int64_t)fld_imm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2075,13 +2076,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 38); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 39: ADD */ - std::tuple __add(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __add(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ADD"); this->gen_sync(iss::PRE_SYNC, 39); @@ -2093,7 +2094,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("ADD x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2112,13 +2113,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 39); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 40: SUB */ - std::tuple __sub(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sub(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SUB"); this->gen_sync(iss::PRE_SYNC, 40); @@ -2130,7 +2131,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SUB x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2149,13 +2150,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 40); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 41: SLL */ - std::tuple __sll(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sll(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLL"); this->gen_sync(iss::PRE_SYNC, 41); @@ -2167,7 +2168,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLL x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2188,13 +2189,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 41); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 42: SLT */ - std::tuple __slt(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __slt(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLT"); this->gen_sync(iss::PRE_SYNC, 42); @@ -2206,7 +2207,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLT x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2234,13 +2235,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 42); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 43: SLTU */ - std::tuple __sltu(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sltu(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SLTU"); this->gen_sync(iss::PRE_SYNC, 43); @@ -2252,7 +2253,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SLTU x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2282,13 +2283,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 43); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 44: XOR */ - std::tuple __xor(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __xor(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("XOR"); this->gen_sync(iss::PRE_SYNC, 44); @@ -2300,7 +2301,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("XOR x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2319,13 +2320,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 44); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 45: SRL */ - std::tuple __srl(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __srl(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRL"); this->gen_sync(iss::PRE_SYNC, 45); @@ -2337,7 +2338,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRL x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2358,13 +2359,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 45); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 46: SRA */ - std::tuple __sra(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sra(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRA"); this->gen_sync(iss::PRE_SYNC, 46); @@ -2376,7 +2377,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SRA x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2397,13 +2398,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 46); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 47: OR */ - std::tuple __or(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __or(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("OR"); this->gen_sync(iss::PRE_SYNC, 47); @@ -2415,7 +2416,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("OR x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2434,13 +2435,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 47); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 48: AND */ - std::tuple __and(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __and(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AND"); this->gen_sync(iss::PRE_SYNC, 48); @@ -2452,7 +2453,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AND x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2471,13 +2472,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 48); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 49: FENCE */ - std::tuple __fence(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fence(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FENCE"); this->gen_sync(iss::PRE_SYNC, 49); @@ -2488,7 +2489,7 @@ private: uint8_t fld_pred_val = ((bit_sub<24,4>(instr))); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("FENCE"), @@ -2510,13 +2511,13 @@ private: this->builder.CreateZExtOrTrunc(FENCEtmp0_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 49); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 50: FENCE_I */ - std::tuple __fence_i(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __fence_i(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("FENCE_I"); this->gen_sync(iss::PRE_SYNC, 50); @@ -2526,7 +2527,7 @@ private: uint16_t fld_imm_val = ((bit_sub<20,12>(instr))); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("FENCE_I"), @@ -2546,18 +2547,18 @@ private: this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 50); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::FLUSH, nullptr); + return std::make_tuple(FLUSH, nullptr); } /* instruction 51: ECALL */ - std::tuple __ecall(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ecall(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("ECALL"); this->gen_sync(iss::PRE_SYNC, 51); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("ECALL"), @@ -2571,18 +2572,18 @@ private: this->gen_raise_trap(0, 11); this->gen_sync(iss::POST_SYNC, 51); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 52: EBREAK */ - std::tuple __ebreak(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __ebreak(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("EBREAK"); this->gen_sync(iss::PRE_SYNC, 52); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("EBREAK"), @@ -2596,18 +2597,18 @@ private: this->gen_raise_trap(0, 3); this->gen_sync(iss::POST_SYNC, 52); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 53: URET */ - std::tuple __uret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __uret(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("URET"); this->gen_sync(iss::PRE_SYNC, 53); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("URET"), @@ -2621,18 +2622,18 @@ private: this->gen_leave_trap(0); this->gen_sync(iss::POST_SYNC, 53); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 54: SRET */ - std::tuple __sret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sret(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SRET"); this->gen_sync(iss::PRE_SYNC, 54); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("SRET"), @@ -2646,18 +2647,18 @@ private: this->gen_leave_trap(1); this->gen_sync(iss::POST_SYNC, 54); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 55: MRET */ - std::tuple __mret(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __mret(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("MRET"); this->gen_sync(iss::PRE_SYNC, 55); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("MRET"), @@ -2671,18 +2672,18 @@ private: this->gen_leave_trap(3); this->gen_sync(iss::POST_SYNC, 55); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } /* instruction 56: WFI */ - std::tuple __wfi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __wfi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("WFI"); this->gen_sync(iss::PRE_SYNC, 56); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("WFI"), @@ -2696,13 +2697,13 @@ private: this->gen_wait(1); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 56); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 57: SFENCE.VMA */ - std::tuple __sfence_vma(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sfence_vma(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SFENCE.VMA"); this->gen_sync(iss::PRE_SYNC, 57); @@ -2711,7 +2712,7 @@ private: uint8_t fld_rs2_val = ((bit_sub<20,5>(instr))); if(this->disass_enabled){ /* generate console output when executing the command */ - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr("SFENCE.VMA"), @@ -2734,13 +2735,13 @@ private: this->builder.CreateZExtOrTrunc(FENCEtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 57); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 58: CSRRW */ - std::tuple __csrrw(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrw(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRW"); this->gen_sync(iss::PRE_SYNC, 58); @@ -2752,7 +2753,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRW x%1$d, %2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2782,13 +2783,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 58); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 59: CSRRS */ - std::tuple __csrrs(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrs(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRS"); this->gen_sync(iss::PRE_SYNC, 59); @@ -2800,7 +2801,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRS x%1$d, %2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2828,13 +2829,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 59); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 60: CSRRC */ - std::tuple __csrrc(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrc(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRC"); this->gen_sync(iss::PRE_SYNC, 60); @@ -2846,7 +2847,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRC x%1$d, %2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2874,13 +2875,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 60); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 61: CSRRWI */ - std::tuple __csrrwi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrwi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRWI"); this->gen_sync(iss::PRE_SYNC, 61); @@ -2892,7 +2893,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRWI x%1$d, %2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_zimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2917,13 +2918,13 @@ private: this->builder.CreateZExtOrTrunc(CSRtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 61); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 62: CSRRSI */ - std::tuple __csrrsi(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrsi(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRSI"); this->gen_sync(iss::PRE_SYNC, 62); @@ -2935,7 +2936,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRSI x%1$d, %2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_zimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -2965,13 +2966,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 62); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 63: CSRRCI */ - std::tuple __csrrci(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __csrrci(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("CSRRCI"); this->gen_sync(iss::PRE_SYNC, 63); @@ -2983,7 +2984,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("CSRRCI x%1$d, %2$d, 0x%3$x"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_csr_val % (uint64_t)fld_zimm_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3013,13 +3014,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 63); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 64: LR.D */ - std::tuple __lr_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lr_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LR.D"); this->gen_sync(iss::PRE_SYNC, 64); @@ -3032,7 +3033,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LR.D x%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3061,13 +3062,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 64); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 65: SC.D */ - std::tuple __sc_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sc_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SC.D"); this->gen_sync(iss::PRE_SYNC, 65); @@ -3081,7 +3082,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SC.D x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3095,9 +3096,9 @@ private: Value* offs_val = this->gen_reg_load(fld_rs1_val + traits::X0, 0); Value* res_val = this->gen_read_mem(traits::RES, offs_val, 8/8); { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); - llvm::BasicBlock* bb_else = llvm::BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bb_else = BasicBlock::Create(this->mod->getContext(), "elsebr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -3130,13 +3131,13 @@ private: this->builder.SetInsertPoint(bb); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 65); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 66: AMOSWAP.D */ - std::tuple __amoswap_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoswap_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOSWAP.D"); this->gen_sync(iss::PRE_SYNC, 66); @@ -3150,7 +3151,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOSWAP.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3176,13 +3177,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 66); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 67: AMOADD.D */ - std::tuple __amoadd_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoadd_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOADD.D"); this->gen_sync(iss::PRE_SYNC, 67); @@ -3196,7 +3197,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOADD.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3226,13 +3227,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 67); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 68: AMOXOR.D */ - std::tuple __amoxor_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoxor_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOXOR.D"); this->gen_sync(iss::PRE_SYNC, 68); @@ -3246,7 +3247,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOXOR.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3276,13 +3277,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 68); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 69: AMOAND.D */ - std::tuple __amoand_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoand_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOAND.D"); this->gen_sync(iss::PRE_SYNC, 69); @@ -3296,7 +3297,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOAND.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3326,13 +3327,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 69); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 70: AMOOR.D */ - std::tuple __amoor_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoor_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOOR.D"); this->gen_sync(iss::PRE_SYNC, 70); @@ -3346,7 +3347,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOOR.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3376,13 +3377,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 70); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 71: AMOMIN.D */ - std::tuple __amomin_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomin_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMIN.D"); this->gen_sync(iss::PRE_SYNC, 71); @@ -3396,7 +3397,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMIN.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3435,13 +3436,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 71); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 72: AMOMAX.D */ - std::tuple __amomax_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomax_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMAX.D"); this->gen_sync(iss::PRE_SYNC, 72); @@ -3455,7 +3456,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMAX.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3494,13 +3495,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 72); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 73: AMOMINU.D */ - std::tuple __amominu_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amominu_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMINU.D"); this->gen_sync(iss::PRE_SYNC, 73); @@ -3514,7 +3515,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMINU.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3549,13 +3550,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 73); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 74: AMOMAXU.D */ - std::tuple __amomaxu_d(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomaxu_d(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMAXU.D"); this->gen_sync(iss::PRE_SYNC, 74); @@ -3569,7 +3570,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMAXU.D x%1$d, x%2$d, x%3$d (aqu=%a,rel=%rl)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3604,13 +3605,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(64))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 74); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 75: LR.W */ - std::tuple __lr_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __lr_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("LR.W"); this->gen_sync(iss::PRE_SYNC, 75); @@ -3623,7 +3624,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("LR.W x%1$d, x%2$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3652,13 +3653,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 75); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 76: SC.W */ - std::tuple __sc_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __sc_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("SC.W"); this->gen_sync(iss::PRE_SYNC, 76); @@ -3672,7 +3673,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("SC.W x%1$d, x%2$d, x%3$d"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3686,8 +3687,8 @@ private: Value* offs_val = this->gen_reg_load(fld_rs1_val + traits::X0, 0); Value* res1_val = this->gen_read_mem(traits::RES, offs_val, 32/8); { - llvm::BasicBlock* bbnext = llvm::BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); - llvm::BasicBlock* bb_then = llvm::BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); + BasicBlock* bbnext = BasicBlock::Create(this->mod->getContext(), "endif", this->func, this->leave_blk); + BasicBlock* bb_then = BasicBlock::Create(this->mod->getContext(), "thenbr", this->func, bbnext); // this->builder.SetInsertPoint(bb); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_NE, @@ -3720,13 +3721,13 @@ private: } this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 76); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 77: AMOSWAP.W */ - std::tuple __amoswap_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoswap_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOSWAP.W"); this->gen_sync(iss::PRE_SYNC, 77); @@ -3740,7 +3741,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOSWAP.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3766,13 +3767,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 77); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 78: AMOADD.W */ - std::tuple __amoadd_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoadd_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOADD.W"); this->gen_sync(iss::PRE_SYNC, 78); @@ -3786,7 +3787,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOADD.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3816,13 +3817,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 78); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 79: AMOXOR.W */ - std::tuple __amoxor_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoxor_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOXOR.W"); this->gen_sync(iss::PRE_SYNC, 79); @@ -3836,7 +3837,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOXOR.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3866,13 +3867,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 79); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 80: AMOAND.W */ - std::tuple __amoand_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoand_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOAND.W"); this->gen_sync(iss::PRE_SYNC, 80); @@ -3886,7 +3887,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOAND.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3916,13 +3917,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 80); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 81: AMOOR.W */ - std::tuple __amoor_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amoor_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOOR.W"); this->gen_sync(iss::PRE_SYNC, 81); @@ -3936,7 +3937,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOOR.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -3966,13 +3967,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 81); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 82: AMOMIN.W */ - std::tuple __amomin_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomin_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMIN.W"); this->gen_sync(iss::PRE_SYNC, 82); @@ -3986,7 +3987,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMIN.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4025,13 +4026,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 82); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 83: AMOMAX.W */ - std::tuple __amomax_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomax_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMAX.W"); this->gen_sync(iss::PRE_SYNC, 83); @@ -4045,7 +4046,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMAX.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4084,13 +4085,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 83); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 84: AMOMINU.W */ - std::tuple __amominu_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amominu_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMINU.W"); this->gen_sync(iss::PRE_SYNC, 84); @@ -4104,7 +4105,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMINU.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4139,13 +4140,13 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 84); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /* instruction 85: AMOMAXU.W */ - std::tuple __amomaxu_w(virt_addr_t& pc, code_word_t instr, llvm::BasicBlock* bb){ + std::tuple __amomaxu_w(virt_addr_t& pc, code_word_t instr, BasicBlock* bb){ bb->setName("AMOMAXU.W"); this->gen_sync(iss::PRE_SYNC, 85); @@ -4159,7 +4160,7 @@ private: /* generate console output when executing the command */ boost::format ins_fmter("AMOMAXU.W x%1$d, x%2$d, x%3$d (aqu=%4$d,rel=%5$d)"); ins_fmter % (uint64_t)fld_rd_val % (uint64_t)fld_rs1_val % (uint64_t)fld_rs2_val % (uint64_t)fld_aq_val % (uint64_t)fld_rl_val; - std::vector args { + std::vector args { this->core_ptr, this->gen_const(64, pc.val), this->builder.CreateGlobalStringPtr(ins_fmter.str()), @@ -4194,16 +4195,16 @@ private: this->builder.CreateZExtOrTrunc(MEMtmp1_val,this->get_type(32))); this->gen_set_pc(pc, traits::NEXT_PC); this->gen_sync(iss::POST_SYNC, 85); - bb = llvm::BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ + bb = BasicBlock::Create(this->mod->getContext(), "entry", this->func, this->leave_blk); /* create next BasicBlock in chain */ this->gen_trap_check(bb); - return std::make_tuple(vm::CONT, bb); + return std::make_tuple(CONT, bb); } /**************************************************************************** * end opcode definitions ****************************************************************************/ - std::tuple illegal_intruction(virt_addr_t &pc, code_word_t instr, - llvm::BasicBlock *bb) { + std::tuple illegal_intruction(virt_addr_t &pc, code_word_t instr, + BasicBlock *bb) { this->gen_sync(iss::PRE_SYNC, instr_descr.size()); this->builder.CreateStore(this->builder.CreateLoad(get_reg_ptr(traits::NEXT_PC), true), get_reg_ptr(traits::PC), true); @@ -4215,7 +4216,7 @@ private: this->gen_raise_trap(0, 2); // illegal instruction trap this->gen_sync(iss::POST_SYNC, instr_descr.size()); this->gen_trap_check(this->leave_blk); - return std::make_tuple(iss::vm::BRANCH, nullptr); + return std::make_tuple(BRANCH, nullptr); } }; @@ -4228,7 +4229,7 @@ template vm_impl::vm_impl() { this(new ARCH()); } template vm_impl::vm_impl(ARCH &core, unsigned core_id, unsigned cluster_id) -: vm::vm_base(core, core_id, cluster_id) { +: vm_base(core, core_id, cluster_id) { qlut[0] = lut_00.data(); qlut[1] = lut_01.data(); qlut[2] = lut_10.data(); @@ -4240,8 +4241,8 @@ vm_impl::vm_impl(ARCH &core, unsigned core_id, unsigned cluster_id) } template -std::tuple -vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, llvm::BasicBlock *this_block) { +std::tuple +vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, BasicBlock *this_block) { // we fetch at max 4 byte, alignment is 2 code_word_t insn = 0; const typename traits::addr_t upper_bits = ~traits::PGMASK; @@ -4273,7 +4274,7 @@ vm_impl::gen_single_inst_behavior(virt_addr_t &pc, unsigned int &inst_cnt, return (this->*f)(pc, insn, this_block); } -template void vm_impl::gen_leave_behavior(llvm::BasicBlock *leave_blk) { +template void vm_impl::gen_leave_behavior(BasicBlock *leave_blk) { this->builder.SetInsertPoint(leave_blk); this->builder.CreateRet(this->builder.CreateLoad(get_reg_ptr(arch::traits::NEXT_PC), false)); } @@ -4285,8 +4286,8 @@ template void vm_impl::gen_raise_trap(uint16_t trap_id, ui } template void vm_impl::gen_leave_trap(unsigned lvl) { - std::vector args{ - this->core_ptr, llvm::ConstantInt::get(getContext(), llvm::APInt(64, lvl)), + std::vector args{ + this->core_ptr, ConstantInt::get(getContext(), APInt(64, lvl)), }; this->builder.CreateCall(this->mod->getFunction("leave_trap"), args); auto *PC_val = this->gen_read_mem(traits::CSR, (lvl << 8) + 0x41, traits::XLEN / 8); @@ -4295,17 +4296,17 @@ template void vm_impl::gen_leave_trap(unsigned lvl) { } template void vm_impl::gen_wait(unsigned type) { - std::vector args{ - this->core_ptr, llvm::ConstantInt::get(getContext(), llvm::APInt(64, type)), + std::vector args{ + this->core_ptr, ConstantInt::get(getContext(), APInt(64, type)), }; this->builder.CreateCall(this->mod->getFunction("wait"), args); } -template void vm_impl::gen_trap_behavior(llvm::BasicBlock *trap_blk) { +template void vm_impl::gen_trap_behavior(BasicBlock *trap_blk) { this->builder.SetInsertPoint(trap_blk); auto *trap_state_val = this->builder.CreateLoad(get_reg_ptr(traits::TRAP_STATE), true); this->builder.CreateStore(this->gen_const(32U, std::numeric_limits::max()), get_reg_ptr(traits::LAST_BRANCH), false); - std::vector args{ + std::vector args{ this->core_ptr, this->adj_to64(trap_state_val), this->adj_to64(this->builder.CreateLoad(get_reg_ptr(traits::PC), false))}; @@ -4314,11 +4315,11 @@ template void vm_impl::gen_trap_behavior(llvm::BasicBlock this->builder.CreateRet(trap_addr_val); } -template inline void vm_impl::gen_trap_check(llvm::BasicBlock *bb) { +template inline void vm_impl::gen_trap_check(BasicBlock *bb) { auto *v = this->builder.CreateLoad(get_reg_ptr(arch::traits::TRAP_STATE), true); this->gen_cond_branch(this->builder.CreateICmp( ICmpInst::ICMP_EQ, v, - llvm::ConstantInt::get(getContext(), llvm::APInt(v->getType()->getIntegerBitWidth(), 0))), + ConstantInt::get(getContext(), APInt(v->getType()->getIntegerBitWidth(), 0))), bb, this->trap_blk, 1); } diff --git a/riscv/src/main.cpp b/riscv/src/main.cpp index 32c4650..80370ef 100644 --- a/riscv/src/main.cpp +++ b/riscv/src/main.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include