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.
36 lines
1.0 KiB
36 lines
1.0 KiB
#include <vmlifters.hpp>
|
|
|
|
namespace vm::lifters
|
|
{
|
|
vm::lifters::lifter_t shrq = {
|
|
// pop vregX
|
|
// pop vregY
|
|
// shr vregX, vregY
|
|
// push vregX
|
|
// pushf
|
|
vm::handler::SHRQ,
|
|
[]( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr, vmp2::v3::code_block_t *code_blk ) {
|
|
auto [ t0, t1 ] = blk->tmp( 64, 8 );
|
|
blk->pop( t0 );
|
|
blk->pop( t1 );
|
|
blk->bshr( t0, t1 );
|
|
blk->push( t0 );
|
|
blk->pushf();
|
|
} };
|
|
|
|
vm::lifters::lifter_t shrw = {
|
|
// pop vregX
|
|
// pop vregY
|
|
// shr vregX, vregY
|
|
// push vregX
|
|
// pushf
|
|
vm::handler::SHRW,
|
|
[]( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr, vmp2::v3::code_block_t *code_blk ) {
|
|
auto [ t0, t1 ] = blk->tmp( 16, 8 );
|
|
blk->pop( t0 );
|
|
blk->pop( t1 );
|
|
blk->bshr( t0, t1 );
|
|
blk->push( t0 );
|
|
blk->pushf();
|
|
} };
|
|
} // namespace vm::lifters
|