You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
675 B
20 lines
675 B
3 years ago
|
#include <vm_lifters.hpp>
|
||
|
|
||
|
namespace vm
|
||
|
{
|
||
|
lifters_t::lifter_callback_t lifters_t::shrq =
|
||
|
[ & ]( vm::vmp_rtn_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( 2 );
|
||
|
auto t3 = ir_builder->CreateIntCast( t2, llvm::IntegerType::get( *rtn->llvm_ctx, 64 ), false );
|
||
|
auto t4 = ir_builder->CreateLShr( t1, t3 );
|
||
|
|
||
|
// TODO: Compute flags
|
||
|
//
|
||
|
//
|
||
|
|
||
|
rtn->push( 8, t4 );
|
||
|
rtn->push( 8, rtn->load_value( 8, rtn->flags ) );
|
||
|
};
|
||
|
}
|