parent
89af2c2654
commit
eb13c85f48
@ -0,0 +1,9 @@
|
||||
#include <vmlifters.hpp>
|
||||
|
||||
namespace vm::lifters
|
||||
{
|
||||
vm::lifters::lifter_t pushvsp = {
|
||||
// push vsp
|
||||
vm::handler::PUSHVSP,
|
||||
[]( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) { blk->push( vtil::REG_SP ); } };
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
#include <vmlifters.hpp>
|
||||
|
||||
namespace vm::lifters
|
||||
{
|
||||
vm::lifters::lifter_t readq = {
|
||||
// pop vregX
|
||||
// ldd vregX, vregX, 0
|
||||
// push vregX
|
||||
vm::handler::READQ, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
|
||||
auto t0 = blk->tmp( 64 );
|
||||
blk->pop( t0 );
|
||||
blk->ldd( t0, t0, 0 );
|
||||
blk->push( t0 );
|
||||
} };
|
||||
|
||||
vm::lifters::lifter_t readdw = {
|
||||
// pop vregX
|
||||
// ldd vregX, vregX, 0
|
||||
// push vregX
|
||||
vm::handler::READDW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
|
||||
auto t0 = blk->tmp( 32 );
|
||||
blk->pop( t0 );
|
||||
blk->ldd( t0, t0, 0 );
|
||||
blk->push( t0 );
|
||||
} };
|
||||
|
||||
vm::lifters::lifter_t readw = {
|
||||
// pop vregX
|
||||
// ldd vregX, vregX, 0
|
||||
// push vregX
|
||||
vm::handler::READW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
|
||||
auto t0 = blk->tmp( 16 );
|
||||
blk->pop( t0 );
|
||||
blk->ldd( t0, t0, 0 );
|
||||
blk->push( t0 );
|
||||
} };
|
||||
} // namespace vm::lifters
|
@ -0,0 +1,34 @@
|
||||
#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 ) {
|
||||
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 ) {
|
||||
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
|
Loading…
Reference in new issue