added code for sign extending imm's

merge-requests/16/merge
_xeroxz 3 years ago
parent a4b3817336
commit 0cbc83be3f

@ -194,6 +194,16 @@ namespace vm::instrs
vm::instrs::decrypt_operand( vm_handler.transforms, imm_val.value(), entry.decrypt_key ).first;
}
if ( profile && vm_handler.imm_size && profile->extention == vm::handler::extention_t::sign_extend )
{
if ( result.operand.imm.u >> ( vm_handler.imm_size - 1 ) )
{
result.operand.imm.u =
( ( std::numeric_limits< std::uint64_t >::max() >> vm_handler.imm_size ) << vm_handler.imm_size ) +
result.operand.imm.u;
}
}
return result;
}

Loading…
Cancel
Save