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.
70 lines
1.8 KiB
70 lines
1.8 KiB
#include <vmlifters.hpp>
|
|
|
|
namespace vm::lifters
|
|
{
|
|
vm::lifters::lifter_t nandq = {
|
|
// pop vregX
|
|
// pop vregY
|
|
// not vregX
|
|
// not vregY
|
|
// and vregX, vregY
|
|
// push vregX
|
|
// pushf
|
|
vm::handler::NANDQ,
|
|
[]( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr, vmp2::v3::code_block_t *code_blk ) {
|
|
auto [ t1, t2 ] = blk->tmp( 64, 64 );
|
|
blk->pop( t1 );
|
|
blk->pop( t2 );
|
|
|
|
blk->bnot( t1 );
|
|
blk->bnot( t2 );
|
|
|
|
blk->band( t1, t2 );
|
|
blk->push( t1 );
|
|
blk->pushf();
|
|
} };
|
|
|
|
vm::lifters::lifter_t nanddw = {
|
|
// pop vregX
|
|
// pop vregY
|
|
// not vregX
|
|
// not vregY
|
|
// and vregX, vregY
|
|
// push vregX
|
|
// pushf
|
|
vm::handler::NANDDW,
|
|
[]( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr, vmp2::v3::code_block_t *code_blk ) {
|
|
auto [ t1, t2 ] = blk->tmp( 32, 32 );
|
|
blk->pop( t1 );
|
|
blk->pop( t2 );
|
|
|
|
blk->bnot( t1 );
|
|
blk->bnot( t2 );
|
|
|
|
blk->band( t1, t2 );
|
|
blk->push( t1 );
|
|
blk->pushf();
|
|
} };
|
|
|
|
vm::lifters::lifter_t nandw = {
|
|
// pop vregX
|
|
// pop vregY
|
|
// not vregX
|
|
// not vregY
|
|
// and vregX, vregY
|
|
// push vregX
|
|
// pushf
|
|
vm::handler::NANDW,
|
|
[]( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr, vmp2::v3::code_block_t *code_blk ) {
|
|
auto [ t1, t2 ] = blk->tmp( 16, 16 );
|
|
blk->pop( t1 );
|
|
blk->pop( t2 );
|
|
|
|
blk->bnot( t1 );
|
|
blk->bnot( t2 );
|
|
|
|
blk->band( t1, t2 );
|
|
blk->push( t1 );
|
|
blk->pushf();
|
|
} };
|
|
} // namespace vm::lifters
|