From 00e02bf5656af608632bc31eeec04470d27e3a52 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 8 Aug 2022 06:30:37 +0200 Subject: [PATCH] adds support for different branch types in tracing --- gen_input/templates/interp/CORENAME.cpp.gtl | 41 ++------------------- src/vm/interp/vm_tgc_c.cpp | 41 ++------------------- 2 files changed, 6 insertions(+), 76 deletions(-) diff --git a/gen_input/templates/interp/CORENAME.cpp.gtl b/gen_input/templates/interp/CORENAME.cpp.gtl index f3873b4..930a818 100644 --- a/gen_input/templates/interp/CORENAME.cpp.gtl +++ b/gen_input/templates/interp/CORENAME.cpp.gtl @@ -137,44 +137,6 @@ protected: using coro_t = boost::coroutines2::coroutine::pull_type; std::vector spawn_blocks; - template - T& pc_assign(T& val){super::ex_info.branch_taken=true; return val;} - inline uint8_t readSpace1(typename super::mem_type_e space, uint64_t addr){ - auto ret = super::template read_mem(space, addr); - if(this->core.trap_state) throw 0; - return ret; - } - inline uint16_t readSpace2(typename super::mem_type_e space, uint64_t addr){ - auto ret = super::template read_mem(space, addr); - if(this->core.trap_state) throw 0; - return ret; - } - inline uint32_t readSpace4(typename super::mem_type_e space, uint64_t addr){ - auto ret = super::template read_mem(space, addr); - if(this->core.trap_state) throw 0; - return ret; - } - inline uint64_t readSpace8(typename super::mem_type_e space, uint64_t addr){ - auto ret = super::template read_mem(space, addr); - if(this->core.trap_state) throw 0; - return ret; - } - inline void writeSpace1(typename super::mem_type_e space, uint64_t addr, uint8_t data){ - super::write_mem(space, addr, data); - if(this->core.trap_state) throw 0; - } - inline void writeSpace2(typename super::mem_type_e space, uint64_t addr, uint16_t data){ - super::write_mem(space, addr, data); - if(this->core.trap_state) throw 0; - } - inline void writeSpace4(typename super::mem_type_e space, uint64_t addr, uint32_t data){ - super::write_mem(space, addr, data); - if(this->core.trap_state) throw 0; - } - inline void writeSpace8(typename super::mem_type_e space, uint64_t addr, uint64_t data){ - super::write_mem(space, addr, data); - if(this->core.trap_state) throw 0; - } template::type> inline S sext(U from) { auto mask = (1ULL< ${it}<%}%> diff --git a/src/vm/interp/vm_tgc_c.cpp b/src/vm/interp/vm_tgc_c.cpp index c51b1b1..291eea8 100644 --- a/src/vm/interp/vm_tgc_c.cpp +++ b/src/vm/interp/vm_tgc_c.cpp @@ -131,44 +131,6 @@ protected: using coro_t = boost::coroutines2::coroutine::pull_type; std::vector spawn_blocks; - template - T& pc_assign(T& val){super::ex_info.branch_taken=true; return val;} - inline uint8_t readSpace1(typename super::mem_type_e space, uint64_t addr){ - auto ret = super::template read_mem(space, addr); - if(this->core.trap_state) throw 0; - return ret; - } - inline uint16_t readSpace2(typename super::mem_type_e space, uint64_t addr){ - auto ret = super::template read_mem(space, addr); - if(this->core.trap_state) throw 0; - return ret; - } - inline uint32_t readSpace4(typename super::mem_type_e space, uint64_t addr){ - auto ret = super::template read_mem(space, addr); - if(this->core.trap_state) throw 0; - return ret; - } - inline uint64_t readSpace8(typename super::mem_type_e space, uint64_t addr){ - auto ret = super::template read_mem(space, addr); - if(this->core.trap_state) throw 0; - return ret; - } - inline void writeSpace1(typename super::mem_type_e space, uint64_t addr, uint8_t data){ - super::write_mem(space, addr, data); - if(this->core.trap_state) throw 0; - } - inline void writeSpace2(typename super::mem_type_e space, uint64_t addr, uint16_t data){ - super::write_mem(space, addr, data); - if(this->core.trap_state) throw 0; - } - inline void writeSpace4(typename super::mem_type_e space, uint64_t addr, uint32_t data){ - super::write_mem(space, addr, data); - if(this->core.trap_state) throw 0; - } - inline void writeSpace8(typename super::mem_type_e space, uint64_t addr, uint64_t data){ - super::write_mem(space, addr, data); - if(this->core.trap_state) throw 0; - } template::type> inline S sext(U from) { auto mask = (1ULL<