added more profiles...

merge-requests/11/head
_xeroxz 3 years ago
parent bc0a1d7b5b
commit 89af2c2654

@ -19,7 +19,9 @@ namespace vm::lifters
extern vm::lifters::lifter_t lregq, lregdw;
extern vm::lifters::lifter_t addq, adddw, addw;
extern vm::lifters::lifter_t sregq, sregdw, sregw;
extern vm::lifters::lifter_t lconstq, lconstdw, lconstw;
extern vm::lifters::lifter_t lconstq, lconstdw, lconstw, lconstbzxw, lconstbsxdw, lconstbsxq, lconstdwsxq,
lconstwsxq, lconstwsxdw;
extern vm::lifters::lifter_t nandq, nanddw, nandw;
extern vm::lifters::lifter_t vmexit;
inline std::map< vm::handler::mnemonic_t, lifter_callback_t > all = {
@ -33,7 +35,10 @@ namespace vm::lifters
sregq, sregdw, sregw,
// lconst lifters...
lconstq, lconstdw, lconstw,
lconstq, lconstdw, lconstw, lconstbzxw, lconstbsxdw, lconstbsxq, lconstdwsxq, lconstwsxq, lconstwsxdw,
// nand lifters...
nandq, nanddw, nandw,
// vmexit lifter...
vmexit };

@ -19,4 +19,40 @@ namespace vm::lifters
vm::handler::LCONSTW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 16 ) );
} };
vm::lifters::lifter_t lconstbzxw = {
// push imm<N>
vm::handler::LCONSTBZXW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 16 ) );
} };
vm::lifters::lifter_t lconstbsxdw = {
// push imm<N>
vm::handler::LCONSTBSXDW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 32 ) );
} };
vm::lifters::lifter_t lconstbsxq = {
// push imm<N>
vm::handler::LCONSTBSXQ, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 64 ) );
} };
vm::lifters::lifter_t lconstdwsxq = {
// push imm<N>
vm::handler::LCONSTDWSXQ, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 64 ) );
} };
vm::lifters::lifter_t lconstwsxq = {
// push imm<N>
vm::handler::LCONSTWSXQ, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 64 ) );
} };
vm::lifters::lifter_t lconstwsxdw = {
// push imm<N>
vm::handler::LCONSTWSXDW, []( vtil::basic_block *blk, vm::instrs::virt_instr_t *vinstr ) {
blk->push( vtil::operand( vinstr->operand.imm.u, 32 ) );
} };
} // namespace vm::lifters

@ -0,0 +1,67 @@
#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 ) {
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 ) {
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 ) {
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

@ -170,6 +170,7 @@
<ClCompile Include="src\vmlifters\add.cpp" />
<ClCompile Include="src\vmlifters\lconst.cpp" />
<ClCompile Include="src\vmlifters\lreg.cpp" />
<ClCompile Include="src\vmlifters\nand.cpp" />
<ClCompile Include="src\vmlifters\sreg.cpp" />
<ClCompile Include="src\vmlifters\vmexit.cpp" />
<ClCompile Include="src\vmprofiles\add.cpp" />

@ -273,5 +273,8 @@
<ClCompile Include="src\vmlifters\vmexit.cpp">
<Filter>Source Files\vmlifters</Filter>
</ClCompile>
<ClCompile Include="src\vmlifters\nand.cpp">
<Filter>Source Files\vmlifters</Filter>
</ClCompile>
</ItemGroup>
</Project>
Loading…
Cancel
Save