updates template
This commit is contained in:
parent
11a30caae8
commit
6dc17857da
|
@ -336,7 +336,7 @@ inline void vm_impl<ARCH>::set_tval(uint64_t tval) {
|
||||||
}
|
}
|
||||||
template <typename ARCH>
|
template <typename ARCH>
|
||||||
inline void vm_impl<ARCH>::set_tval(Value* new_tval) {
|
inline void vm_impl<ARCH>::set_tval(Value* new_tval) {
|
||||||
this->builder.CreateStore(new_tval, this->tval);
|
this->builder.CreateStore(this->gen_ext(new_tval, 64, false), this->tval);
|
||||||
}
|
}
|
||||||
template <typename ARCH>
|
template <typename ARCH>
|
||||||
void vm_impl<ARCH>::gen_trap_behavior(BasicBlock *trap_blk) {
|
void vm_impl<ARCH>::gen_trap_behavior(BasicBlock *trap_blk) {
|
||||||
|
@ -346,7 +346,7 @@ void vm_impl<ARCH>::gen_trap_behavior(BasicBlock *trap_blk) {
|
||||||
this->builder.CreateStore(this->gen_const(32U, std::numeric_limits<uint32_t>::max()),
|
this->builder.CreateStore(this->gen_const(32U, std::numeric_limits<uint32_t>::max()),
|
||||||
get_reg_ptr(traits::LAST_BRANCH), false);
|
get_reg_ptr(traits::LAST_BRANCH), false);
|
||||||
std::vector<Value *> args{this->core_ptr, this->adj_to64(trap_state_val),
|
std::vector<Value *> args{this->core_ptr, this->adj_to64(trap_state_val),
|
||||||
this->adj_to64(this->builder.CreateLoad(this->builder.getInt64Ty(),this->tval))};
|
this->adj_to64(this->builder.CreateLoad(this->get_type(64),this->tval))};
|
||||||
this->builder.CreateCall(this->mod->getFunction("enter_trap"), args);
|
this->builder.CreateCall(this->mod->getFunction("enter_trap"), args);
|
||||||
auto *trap_addr_val = this->builder.CreateLoad(this->get_typeptr(traits::NEXT_PC), get_reg_ptr(traits::NEXT_PC), false);
|
auto *trap_addr_val = this->builder.CreateLoad(this->get_typeptr(traits::NEXT_PC), get_reg_ptr(traits::NEXT_PC), false);
|
||||||
this->builder.CreateRet(trap_addr_val);
|
this->builder.CreateRet(trap_addr_val);
|
||||||
|
|
Loading…
Reference in New Issue