parent
661bc3bc16
commit
4fe8c63f49
@ -1 +1 @@
|
|||||||
Subproject commit 7b1f815a73096ac33f41133b63d991019622de49
|
Subproject commit 1b6875d18825529907289bc87990fed5d99e7f96
|
@ -0,0 +1,22 @@
|
|||||||
|
#include <vm_lifters.hpp>
|
||||||
|
|
||||||
|
// https://lists.llvm.org/pipermail/llvm-dev/2014-July/074685.html
|
||||||
|
// credit to James Courtier-Dutton for asking this question in 2014...
|
||||||
|
namespace vm
|
||||||
|
{
|
||||||
|
lifters_t::lifter_callback_t lifters_t::imulq =
|
||||||
|
[ & ]( vm::devirt_t *rtn, const vm::instrs::code_block_t &vm_code_block, const vm::instrs::virt_instr_t &vinstr,
|
||||||
|
llvm::IRBuilder<> *ir_builder ) {
|
||||||
|
auto t1 = rtn->pop( 8 );
|
||||||
|
auto t2 = rtn->pop( 8 );
|
||||||
|
auto t3 = ir_builder->CreateMul( t1, t2 );
|
||||||
|
auto t4 = ir_builder->CreateAShr( t3, llvm::APInt( 64, 32 ) );
|
||||||
|
auto t5 = ir_builder->CreateAnd( t3, 0xFFFFFFFF00000000 );
|
||||||
|
rtn->push( 8, t4 );
|
||||||
|
rtn->push( 8, t5 );
|
||||||
|
|
||||||
|
// TODO: compute flags for IMULQ
|
||||||
|
auto &vmp_rtn = rtn->vmp_rtns.back();
|
||||||
|
rtn->push( 8, rtn->load_value( 8, vmp_rtn->flags ) );
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
#include <vm_lifters.hpp>
|
||||||
|
|
||||||
|
namespace vm
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue