updates template

This commit is contained in:
Eyck-Alexander Jentzsch 2024-07-17 15:36:08 +02:00
parent 11a30caae8
commit 6dc17857da
1 changed files with 2 additions and 2 deletions

View File

@ -336,7 +336,7 @@ inline void vm_impl<ARCH>::set_tval(uint64_t tval) {
}
template <typename ARCH>
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>
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()),
get_reg_ptr(traits::LAST_BRANCH), false);
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);
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);