|
|
|
@ -30,16 +30,17 @@ namespace vm
|
|
|
|
|
std::function< void( 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 ) >;
|
|
|
|
|
|
|
|
|
|
static lifter_callback_t lconstq, lconstdwsxq, lconstwsxq, lconstbzxw, lconstbsxq, lconstdw;
|
|
|
|
|
static lifter_callback_t lconstq, lconstdwsxq, lconstwsxq, lconstbzxw, lconstbsxq, lconstwsxdw, lconstdw;
|
|
|
|
|
static lifter_callback_t addq, adddw, addw;
|
|
|
|
|
static lifter_callback_t sregq, sregdw;
|
|
|
|
|
static lifter_callback_t lregq, lregdw;
|
|
|
|
|
|
|
|
|
|
static lifter_callback_t pushvsp;
|
|
|
|
|
static lifter_callback_t readq;
|
|
|
|
|
static lifter_callback_t readq, readdw;
|
|
|
|
|
static lifter_callback_t nandq, nanddw;
|
|
|
|
|
static lifter_callback_t shrq;
|
|
|
|
|
static lifter_callback_t jmp;
|
|
|
|
|
static lifter_callback_t lflagsq;
|
|
|
|
|
|
|
|
|
|
std::map< vm::handler::mnemonic_t, lifter_callback_t * > lifters = { { vm::handler::LCONSTQ, &lconstq },
|
|
|
|
|
{ vm::handler::LCONSTDW, &lconstdw },
|
|
|
|
@ -47,6 +48,7 @@ namespace vm
|
|
|
|
|
{ vm::handler::LCONSTWSXQ, &lconstwsxq },
|
|
|
|
|
{ vm::handler::LCONSTBZXW, &lconstbzxw },
|
|
|
|
|
{ vm::handler::LCONSTBSXQ, &lconstbsxq },
|
|
|
|
|
{ vm::handler::LCONSTWSXDW, &lconstwsxdw },
|
|
|
|
|
{ vm::handler::ADDQ, &addq },
|
|
|
|
|
{ vm::handler::ADDDW, &adddw },
|
|
|
|
|
{ vm::handler::ADDW, &addw },
|
|
|
|
@ -57,8 +59,10 @@ namespace vm
|
|
|
|
|
{ vm::handler::LREGQ, &lregq },
|
|
|
|
|
{ vm::handler::LREGDW, &lregdw },
|
|
|
|
|
{ vm::handler::READQ, &readq },
|
|
|
|
|
{ vm::handler::READDW, &readdw },
|
|
|
|
|
{ vm::handler::NANDQ, &nandq },
|
|
|
|
|
{ vm::handler::NANDDW, &nanddw },
|
|
|
|
|
{ vm::handler::LFLAGSQ, &lflagsq },
|
|
|
|
|
{ vm::handler::JMP, &jmp } };
|
|
|
|
|
|
|
|
|
|
static vm::llvm_value_t *add_flags( vm::vmp_rtn_t *rtn, std::uint8_t byte_size, vm::llvm_value_t *lhs,
|
|
|
|
|