diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index 84c3e977d2..36195bb08d 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -155,24 +155,3 @@ static __forceinline u32 timeGetTime() # define __releaseinline __forceinline #endif -////////////////////////////////////////////////////////////////////////////////////////// -// Emitter Instance Identifiers. If you add a new emitter, do it here also. -// Note: Currently most of the instances map back to 0, since existing dynarec code all -// shares iCore and must therefore all share the same emitter instance. -// (note: these don't really belong here per-se, but it's an easy spot to use for now) -enum -{ - EmitterId_R5900 = 0, - EmitterId_R3000a = EmitterId_R5900, - EmitterId_VU0micro = EmitterId_R5900, - EmitterId_VU1micro = EmitterId_R5900, - - // Cotton's new microVU, which is iCore-free - EmitterId_microVU0, - EmitterId_microVU1, - - // Air's eventual IopRec, which will also be iCore-free - EmitterId_R3000air, - - EmitterId_Count // must always be last! -}; diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index 2618f59630..a77fc861b6 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -2986,10 +2986,6 @@ RelativePath="..\..\x86\ix86\ix86_group1.inl" > - - diff --git a/pcsx2/x86/iMMI.cpp b/pcsx2/x86/iMMI.cpp index a9edfba6c2..8dabe0b5c8 100644 --- a/pcsx2/x86/iMMI.cpp +++ b/pcsx2/x86/iMMI.cpp @@ -1956,14 +1956,14 @@ CPU_SSE_XMMCACHE_END // Both Macros are 16 bytes so we can use a shift instead of a Mul instruction #define QFSRVhelper0() { \ ajmp[0] = JMP32(0); \ - x86Ptr[0] += 11; \ + x86Ptr += 11; \ } #define QFSRVhelper(shift1, shift2) { \ SSE2_PSRLDQ_I8_to_XMM(EEREC_D, shift1); \ SSE2_PSLLDQ_I8_to_XMM(t0reg, shift2); \ ajmp[shift1] = JMP32(0); \ - x86Ptr[0] += 1; \ + x86Ptr += 1; \ } void recQFSRV() @@ -1983,7 +1983,7 @@ void recQFSRV() MOV32MtoR(EAX, (uptr)&cpuRegs.sa); SHL32ItoR(EAX, 4); // Multiply SA bytes by 16 bytes (the amount of bytes in QFSRVhelper() macros) AND32ItoR(EAX, 0xf0); // This can possibly be removed but keeping it incase theres garbage in SA (cottonvibes) - ADD32ItoR(EAX, (uptr)x86Ptr[0] + 7); // ADD32 = 5 bytes, JMPR = 2 bytes + ADD32ItoR(EAX, (uptr)x86Ptr + 7); // ADD32 = 5 bytes, JMPR = 2 bytes JMPR(EAX); // Jumps to a QFSRVhelper() case below (a total of 16 different cases) // Case 0: diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 23d0d45bf0..0309d6eced 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -171,7 +171,7 @@ static void iIopDumpBlock( int startpc, u8 * ptr ) #ifdef __LINUX__ // dump the asm f = fopen( "mydump1", "wb" ); - fwrite( ptr, 1, (uptr)x86Ptr[0] - (uptr)ptr, f ); + fwrite( ptr, 1, (uptr)x86Ptr - (uptr)ptr, f ); fclose( f ); sprintf( command, "objdump -D --target=binary --architecture=i386 -M intel mydump1 | cat %s - > tempdump", filename ); system( command ); @@ -772,7 +772,7 @@ void psxSetBranchReg(u32 reg) _psxFlushCall(FLUSH_EVERYTHING); iPsxBranchTest(0xffffffff, 1); - JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr[0] + 5 )); + JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr + 5 )); } void psxSetBranchImm( u32 imm ) @@ -828,7 +828,7 @@ static void iPsxBranchTest(u32 newpc, u32 cpuBranch) if( newpc != 0xffffffff ) { CMP32ItoM((uptr)&psxRegs.pc, newpc); - JNE32((uptr)iopDispatcherReg - ( (uptr)x86Ptr[0] + 6 )); + JNE32((uptr)iopDispatcherReg - ( (uptr)x86Ptr + 6 )); } // Skip branch jump target here: @@ -864,7 +864,7 @@ void rpsxSYSCALL() ADD32ItoM((uptr)&psxRegs.cycle, psxScaleBlockCycles() ); SUB32ItoM((uptr)&psxCycleEE, psxScaleBlockCycles()*8 ); - JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr[0] + 5 )); + JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr + 5 )); // jump target for skipping blockCycle updates x86SetJ8(j8Ptr[0]); @@ -884,7 +884,7 @@ void rpsxBREAK() j8Ptr[0] = JE8(0); ADD32ItoM((uptr)&psxRegs.cycle, psxScaleBlockCycles() ); SUB32ItoM((uptr)&psxCycleEE, psxScaleBlockCycles()*8 ); - JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr[0] + 5 )); + JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr + 5 )); x86SetJ8(j8Ptr[0]); //if (!psxbranch) psxbranch = 2; @@ -1004,7 +1004,7 @@ void iopRecRecompile(u32 startpc) x86SetPtr( recPtr ); x86Align(16); - recPtr = x86Ptr[_EmitterId_]; + recPtr = x86Ptr; s_pCurBlock = PSX_GETBLOCK(startpc); @@ -1025,7 +1025,7 @@ void iopRecRecompile(u32 startpc) psxbranch = 0; - s_pCurBlock->SetFnptr( (uptr)x86Ptr[0] ); + s_pCurBlock->SetFnptr( (uptr)x86Ptr ); s_psxBlockCycles = 0; // reset recomp state variables @@ -1160,7 +1160,7 @@ StartRecomp: iPsxBranchTest(0xffffffff, 1); - JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr[0] + 5 )); + JMP32((uptr)iopDispatcherReg - ( (uptr)x86Ptr + 5 )); } else { if( psxbranch ) assert( !willbranch3 ); @@ -1180,12 +1180,12 @@ StartRecomp: } } - assert( x86Ptr[0] < recMem+RECMEM_SIZE ); + assert( x86Ptr < recMem+RECMEM_SIZE ); - assert(x86Ptr[_EmitterId_] - recPtr < 0x10000); - s_pCurBlockEx->x86size = x86Ptr[_EmitterId_] - recPtr; + assert(x86Ptr - recPtr < 0x10000); + s_pCurBlockEx->x86size = x86Ptr - recPtr; - recPtr = x86Ptr[0]; + recPtr = x86Ptr; assert( (g_psxHasConstReg&g_psxFlushedConstReg) == g_psxHasConstReg ); diff --git a/pcsx2/x86/iR3000Atables.cpp b/pcsx2/x86/iR3000Atables.cpp index 1b1f4486e6..fddd6f9690 100644 --- a/pcsx2/x86/iR3000Atables.cpp +++ b/pcsx2/x86/iR3000Atables.cpp @@ -1258,7 +1258,7 @@ void rpsxJALR() static void* s_pbranchjmp; static u32 s_do32 = 0; -#define JUMPVALID(pjmp) (( x86Ptr[0] - (u8*)pjmp ) <= 0x80) +#define JUMPVALID(pjmp) (( x86Ptr - (u8*)pjmp ) <= 0x80) void rpsxSetBranchEQ(int info, int process) { @@ -1305,7 +1305,7 @@ void rpsxBEQ_process(int info, int process) else { _psxFlushAllUnused(); - u8* prevx86 = x86Ptr[0]; + u8* prevx86 = x86Ptr; s_do32 = 0; psxSaveBranchState(); @@ -1318,7 +1318,7 @@ void rpsxBEQ_process(int info, int process) x86SetJ8A( (u8*)s_pbranchjmp ); } else { - x86Ptr[0] = prevx86; + x86SetPtr( prevx86 ); s_do32 = 1; psxpc -= 4; psxRegs.code = iopMemRead32( psxpc - 4 ); @@ -1369,7 +1369,7 @@ void rpsxBNE_process(int info, int process) } _psxFlushAllUnused(); - u8* prevx86 = x86Ptr[0]; + u8* prevx86 = x86Ptr; s_do32 = 0; rpsxSetBranchEQ(info, process); @@ -1381,7 +1381,7 @@ void rpsxBNE_process(int info, int process) x86SetJ8A( (u8*)s_pbranchjmp ); } else { - x86Ptr[0] = prevx86; + x86SetPtr( prevx86 ); s_do32 = 1; psxpc -= 4; psxRegs.code = iopMemRead32( psxpc - 4 ); @@ -1423,7 +1423,7 @@ void rpsxBLTZ() } CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0); - u8* prevx86 = x86Ptr[0]; + u8* prevx86 = x86Ptr; u8* pjmp = JL8(0); psxSaveBranchState(); @@ -1435,7 +1435,7 @@ void rpsxBLTZ() x86SetJ8A( pjmp ); } else { - x86Ptr[0] = prevx86; + x86SetPtr( prevx86 ); psxpc -= 4; psxRegs.code = iopMemRead32( psxpc - 4 ); psxLoadBranchState(); @@ -1470,7 +1470,7 @@ void rpsxBGEZ() } CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0); - u8* prevx86 = x86Ptr[0]; + u8* prevx86 = x86Ptr; u8* pjmp = JGE8(0); psxSaveBranchState(); @@ -1482,7 +1482,7 @@ void rpsxBGEZ() x86SetJ8A( pjmp ); } else { - x86Ptr[0] = prevx86; + x86SetPtr( prevx86 ); psxpc -= 4; psxRegs.code = iopMemRead32( psxpc - 4 ); psxLoadBranchState(); @@ -1524,7 +1524,7 @@ void rpsxBLTZAL() } CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0); - u8* prevx86 = x86Ptr[0]; + u8* prevx86 = x86Ptr; u8* pjmp = JL8(0); psxSaveBranchState(); @@ -1538,7 +1538,7 @@ void rpsxBLTZAL() x86SetJ8A( pjmp ); } else { - x86Ptr[0] = prevx86; + x86SetPtr( prevx86 ); psxpc -= 4; psxRegs.code = iopMemRead32( psxpc - 4 ); psxLoadBranchState(); @@ -1577,7 +1577,7 @@ void rpsxBGEZAL() } CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0); - u8* prevx86 = x86Ptr[0]; + u8* prevx86 = x86Ptr; u8* pjmp = JGE8(0); MOV32ItoM((uptr)&psxRegs.GPR.r[31], psxpc+4); @@ -1591,7 +1591,7 @@ void rpsxBGEZAL() x86SetJ8A( pjmp ); } else { - x86Ptr[0] = prevx86; + x86SetPtr( prevx86 ); psxpc -= 4; psxRegs.code = iopMemRead32( psxpc - 4 ); psxLoadBranchState(); @@ -1631,7 +1631,7 @@ void rpsxBLEZ() _clearNeededX86regs(); CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0); - u8* prevx86 = x86Ptr[0]; + u8* prevx86 = x86Ptr; u8* pjmp = JLE8(0); psxSaveBranchState(); @@ -1642,7 +1642,7 @@ void rpsxBLEZ() x86SetJ8A( pjmp ); } else { - x86Ptr[0] = prevx86; + x86SetPtr( prevx86 ); psxpc -= 4; psxRegs.code = iopMemRead32( psxpc - 4 ); psxLoadBranchState(); @@ -1679,7 +1679,7 @@ void rpsxBGTZ() _clearNeededX86regs(); CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0); - u8* prevx86 = x86Ptr[0]; + u8* prevx86 = x86Ptr; u8* pjmp = JG8(0); psxSaveBranchState(); @@ -1690,7 +1690,7 @@ void rpsxBGTZ() x86SetJ8A( pjmp ); } else { - x86Ptr[0] = prevx86; + x86SetPtr( prevx86 ); psxpc -= 4; psxRegs.code = iopMemRead32( psxpc - 4 ); psxLoadBranchState(); diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index 4dea960b87..80fbdc21ec 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -833,7 +833,7 @@ static VuFunctionHeader* SuperVURecompileProgram(u32 startpc, int vuindex) SuperVURecompile(); - s_recVUPtr = x86Ptr[0]; + s_recVUPtr = x86Ptr; // set the function's range VuFunctionHeader::RANGE r; @@ -1889,7 +1889,7 @@ void VuBaseBlock::AssignVFRegs() if( i == XMMREGS ) return; // nothing changed } - u8* oldX86 = x86Ptr[0]; + u8* oldX86 = x86Ptr; FORIT(itinst, insts) { @@ -2078,7 +2078,7 @@ void VuBaseBlock::AssignVFRegs() } } - assert( x86Ptr[0] == oldX86 ); + assert( x86Ptr == oldX86 ); u32 analyzechildren = !(type&BLOCKTYPE_ANALYZED); type |= BLOCKTYPE_ANALYZED; @@ -2466,7 +2466,7 @@ static void SuperVURecompile() AND32ItoM( (uptr)&VU->vifRegs->stat, ~0x4 ); MOV32ItoM((uptr)&VU->VI[REG_TPC], pchild->endpc); - JMP32( (uptr)SuperVUEndProgram - ( (uptr)x86Ptr[0] + 5 )); + JMP32( (uptr)SuperVUEndProgram - ( (uptr)x86Ptr + 5 )); } // only other case is when there are two branches else assert( (*itblock)->insts.back().regs[0].pipe == VUPIPE_BRANCH ); @@ -2606,11 +2606,11 @@ void SuperVUTestVU0Condition(u32 incstack) ADD32ItoR(ESP, incstack); //CALLFunc((u32)timeout); - JMP32( (uptr)SuperVUEndProgram - ( (uptr)x86Ptr[0] + 5 )); + JMP32( (uptr)SuperVUEndProgram - ( (uptr)x86Ptr + 5 )); x86SetJ8(ptr); } - else JAE32( (uptr)SuperVUEndProgram - ( (uptr)x86Ptr[0] + 6 ) ); + else JAE32( (uptr)SuperVUEndProgram - ( (uptr)x86Ptr + 6 ) ); } void VuBaseBlock::Recompile() @@ -2618,7 +2618,7 @@ void VuBaseBlock::Recompile() if( type & BLOCKTYPE_ANALYZED ) return; x86Align(16); - pcode = x86Ptr[0]; + pcode = x86Ptr; #ifdef _DEBUG MOV32ItoM((uptr)&s_vufnheader, s_pFnHeader->startpc); @@ -2726,7 +2726,7 @@ void VuBaseBlock::Recompile() AND32ItoM( (uptr)&VU0.VI[ REG_VPU_STAT ].UL, s_vu?~0x100:~0x001 ); // E flag AND32ItoM( (uptr)&VU->vifRegs->stat, ~0x4 ); if( !branch ) MOV32ItoM((uptr)&VU->VI[REG_TPC], endpc); - JMP32( (uptr)SuperVUEndProgram - ( (uptr)x86Ptr[0] + 5 )); + JMP32( (uptr)SuperVUEndProgram - ( (uptr)x86Ptr + 5 )); } else { @@ -2868,7 +2868,7 @@ void VuBaseBlock::Recompile() } } - pendcode = x86Ptr[0]; + pendcode = x86Ptr; type |= BLOCKTYPE_ANALYZED; LISTBLOCKS::iterator itchild; @@ -3569,7 +3569,7 @@ void recVUMI_BranchHandle() if( (s_pCurBlock->type & BLOCKTYPE_HASEOP) || s_vu == 0 || SUPERVU_CHECKCONDITION) MOV32ItoM(SuperVUGetVIAddr(REG_TPC, 0), bpc); MOV32ItoR(s_JumpX86, 0); - s_pCurBlock->pChildJumps[curjump] = (u32*)x86Ptr[0]-1; + s_pCurBlock->pChildJumps[curjump] = (u32*)x86Ptr-1; if( !(s_pCurInst->type & INST_BRANCH_DELAY) ) { j8Ptr[1] = JMP8(0); @@ -3578,7 +3578,7 @@ void recVUMI_BranchHandle() if( (s_pCurBlock->type & BLOCKTYPE_HASEOP) || s_vu == 0 || SUPERVU_CHECKCONDITION ) MOV32ItoM(SuperVUGetVIAddr(REG_TPC, 0), pc+8); MOV32ItoR(s_JumpX86, 0); - s_pCurBlock->pChildJumps[curjump+1] = (u32*)x86Ptr[0]-1; + s_pCurBlock->pChildJumps[curjump+1] = (u32*)x86Ptr-1; x86SetJ8( j8Ptr[ 1 ] ); } @@ -3815,7 +3815,7 @@ void recVUMI_B( VURegs* vuu, s32 info ) if( s_pCurBlock->blocks.size() > 1 ) { s_JumpX86 = _allocX86reg(-1, X86TYPE_VUJUMP, 0, MODE_WRITE); MOV32ItoR(s_JumpX86, 0); - s_pCurBlock->pChildJumps[(s_pCurInst->type & INST_BRANCH_DELAY)?1:0] = (u32*)x86Ptr[0]-1; + s_pCurBlock->pChildJumps[(s_pCurInst->type & INST_BRANCH_DELAY)?1:0] = (u32*)x86Ptr-1; s_UnconditionalDelay = 1; } @@ -3841,7 +3841,7 @@ void recVUMI_BAL( VURegs* vuu, s32 info ) if( s_pCurBlock->blocks.size() > 1 ) { s_JumpX86 = _allocX86reg(-1, X86TYPE_VUJUMP, 0, MODE_WRITE); MOV32ItoR(s_JumpX86, 0); - s_pCurBlock->pChildJumps[(s_pCurInst->type & INST_BRANCH_DELAY)?1:0] = (u32*)x86Ptr[0]-1; + s_pCurBlock->pChildJumps[(s_pCurInst->type & INST_BRANCH_DELAY)?1:0] = (u32*)x86Ptr-1; s_UnconditionalDelay = 1; } diff --git a/pcsx2/x86/ix86-32/iCore-32.cpp b/pcsx2/x86/ix86-32/iCore-32.cpp index d9a9e75664..05655f66d9 100644 --- a/pcsx2/x86/ix86-32/iCore-32.cpp +++ b/pcsx2/x86/ix86-32/iCore-32.cpp @@ -161,7 +161,7 @@ void _flushConstRegs() zero_cnt++; } - rewindPtr = x86Ptr[_EmitterId_]; + rewindPtr = x86Ptr; for (i = 1, j = 0; i < 32; j++ && ++i, j %= 2) { if (!GPR_IS_CONST1(i) || g_cpuFlushedConstReg & (1< %s", filename ); @@ -579,8 +579,8 @@ void recResetEE( void ) // so a fix will have to wait until later. -_- (air) //x86SetPtr(recMem+REC_CACHEMEM); - //dyna_block_discard_recmem=(u8*)x86Ptr[0]; - //JMP32( (uptr)&dyna_block_discard - ( (u32)x86Ptr[0] + 5 )); + //dyna_block_discard_recmem=(u8*)x86Ptr; + //JMP32( (uptr)&dyna_block_discard - ( (u32)x86Ptr + 5 )); x86SetPtr(recMem); @@ -791,7 +791,7 @@ void recSYSCALL( void ) { CMP32ItoM((uptr)&cpuRegs.pc, pc); j8Ptr[0] = JE8(0); ADD32ItoM((uptr)&cpuRegs.cycle, eeScaleBlockCycles()); - JMP32((uptr)DispatcherReg - ( (uptr)x86Ptr[0] + 5 )); + JMP32((uptr)DispatcherReg - ( (uptr)x86Ptr + 5 )); x86SetJ8(j8Ptr[0]); //branch = 2; } @@ -1148,7 +1148,7 @@ static void iBranchTest(u32 newpc, bool noDispatch) if (!noDispatch) { if (newpc == 0xffffffff) - JS32((uptr)DispatcherReg - ( (uptr)x86Ptr[0] + 6 )); + JS32((uptr)DispatcherReg - ( (uptr)x86Ptr + 6 )); else iBranch(newpc, 1); } @@ -1375,7 +1375,7 @@ void recRecompile( const u32 startpc ) x86SetPtr( recPtr ); x86Align(16); - recPtr = x86Ptr[_EmitterId_]; + recPtr = x86Ptr; s_pCurBlock = PC_GETBLOCK(startpc); @@ -1714,7 +1714,7 @@ StartRecomp: { // was dyna_block_discard_recmem. See note in recResetEE for details. CMP32ItoM((uptr)PSM(lpc),*(u32*)PSM(lpc)); - JNE32(((u32)&dyna_block_discard)- ( (u32)x86Ptr[0] + 6 )); + JNE32(((u32)&dyna_block_discard)- ( (u32)x86Ptr + 6 )); stg-=4; lpc+=4; @@ -1800,14 +1800,14 @@ StartRecomp: } } - assert( x86Ptr[0] < recMem+REC_CACHEMEM ); + assert( x86Ptr < recMem+REC_CACHEMEM ); assert( recStackPtr < recStack+RECSTACK_SIZE ); assert( x86FpuState == 0 ); - assert(x86Ptr[_EmitterId_] - recPtr < 0x10000); - s_pCurBlockEx->x86size = x86Ptr[_EmitterId_] - recPtr; + assert(x86Ptr - recPtr < 0x10000); + s_pCurBlockEx->x86size = x86Ptr - recPtr; - recPtr = x86Ptr[0]; + recPtr = x86Ptr; assert( (g_cpuHasConstReg&g_cpuFlushedConstReg) == g_cpuHasConstReg ); diff --git a/pcsx2/x86/ix86-32/iR5900LoadStore.cpp b/pcsx2/x86/ix86-32/iR5900LoadStore.cpp index 1c39766598..aaf93d1d47 100644 --- a/pcsx2/x86/ix86-32/iR5900LoadStore.cpp +++ b/pcsx2/x86/ix86-32/iR5900LoadStore.cpp @@ -1930,7 +1930,7 @@ void recLQC2( void ) dohw = recSetMemLocation(_Rs_, _Imm_, mmregs, 2, 0); if( _Ft_ ) { - u8* rawreadptr = x86Ptr[0]; + u8* rawreadptr = x86Ptr; if( mmreg >= 0 ) { SSEX_MOVDQARmtoROffset(mmreg, ECX, PS2MEM_BASE_+s_nAddMemOffset); @@ -1945,7 +1945,7 @@ void recLQC2( void ) // check if writing to VUs CMP32ItoR(ECX, 0x11000000); - JAE8(rawreadptr - (x86Ptr[0]+2)); + JAE8(rawreadptr - (x86Ptr+2)); PUSH32I( (int)&VU0.VF[_Ft_].UD[0] ); CALLFunc( (int)recMemRead128 ); @@ -1999,7 +1999,7 @@ void recSQC2( void ) mmregs = _eePrepareReg(_Rs_); dohw = recSetMemLocation(_Rs_, _Imm_, mmregs, 2, 0); - rawreadptr = x86Ptr[0]; + rawreadptr = x86Ptr; if( (mmreg = _checkXMMreg(XMMTYPE_VFREG, _Ft_, MODE_READ)) >= 0) { SSEX_MOVDQARtoRmOffset(ECX, mmreg, PS2MEM_BASE_+s_nAddMemOffset); @@ -2039,7 +2039,7 @@ void recSQC2( void ) // check if writing to VUs CMP32ItoR(ECX, 0x11000000); - JAE8(rawreadptr - (x86Ptr[0]+2)); + JAE8(rawreadptr - (x86Ptr+2)); // some type of hardware write if( (mmreg = _checkXMMreg(XMMTYPE_VFREG, _Ft_, MODE_READ)) >= 0) { diff --git a/pcsx2/x86/ix86/ix86.cpp b/pcsx2/x86/ix86/ix86.cpp index aec35d65bc..3a8e1d2830 100644 --- a/pcsx2/x86/ix86/ix86.cpp +++ b/pcsx2/x86/ix86/ix86.cpp @@ -29,10 +29,9 @@ #include "System.h" #include "ix86.h" -u8 *x86Ptr[EmitterId_Count]; - -u8 *j8Ptr[32]; -u32 *j32Ptr[32]; +__threadlocal u8 *x86Ptr; +__threadlocal u8 *j8Ptr[32]; +__threadlocal u32 *j32Ptr[32]; PCSX2_ALIGNED16(u32 p[4]); PCSX2_ALIGNED16(u32 p2[4]); diff --git a/pcsx2/x86/ix86/ix86.h b/pcsx2/x86/ix86/ix86.h index 34a10fbe59..556405dc09 100644 --- a/pcsx2/x86/ix86/ix86.h +++ b/pcsx2/x86/ix86/ix86.h @@ -32,7 +32,7 @@ //------------------------------------------------------------------ // Helper Macros //------------------------------------------------------------------ -#define emitterT template +#define emitterT static __forceinline #define MEMADDR(addr, oplen) (addr) @@ -46,57 +46,62 @@ // This helps catch programmer errors better than using an auto-truncated s8 parameter. #define assertOffset8(ofs) assert( ofs < 128 && ofs >= -128 ) +#ifdef _MSC_VER +#define __threadlocal __declspec(thread) +#else +#define __threadlocal __thread +#endif //------------------------------------------------------------------ // write functions //------------------------------------------------------------------ -extern u8 *x86Ptr[EmitterId_Count]; -extern u8 *j8Ptr[32]; -extern u32 *j32Ptr[32]; +extern __threadlocal u8 *x86Ptr; +extern __threadlocal u8 *j8Ptr[32]; +extern __threadlocal u32 *j32Ptr[32]; emitterT void write8( u8 val ) { - *x86Ptr[I] = (u8)val; - x86Ptr[I]++; + *x86Ptr = (u8)val; + x86Ptr++; } emitterT void write16( u16 val ) { - *(u16*)x86Ptr[I] = val; - x86Ptr[I] += 2; + *(u16*)x86Ptr = val; + x86Ptr += 2; } emitterT void write24( u32 val ) { - *x86Ptr[I]++ = (u8)(val & 0xff); - *x86Ptr[I]++ = (u8)((val >> 8) & 0xff); - *x86Ptr[I]++ = (u8)((val >> 16) & 0xff); + *x86Ptr++ = (u8)(val & 0xff); + *x86Ptr++ = (u8)((val >> 8) & 0xff); + *x86Ptr++ = (u8)((val >> 16) & 0xff); } emitterT void write32( u32 val ) { - *(u32*)x86Ptr[I] = val; - x86Ptr[I] += 4; + *(u32*)x86Ptr = val; + x86Ptr += 4; } emitterT void write64( u64 val ){ - *(u64*)x86Ptr[I] = val; - x86Ptr[I] += 8; + *(u64*)x86Ptr = val; + x86Ptr += 8; } //------------------------------------------------------------------ //------------------------------------------------------------------ // jump/align functions //------------------------------------------------------------------ -emitterT void ex86SetPtr( u8 *ptr ); -emitterT void ex86SetJ8( u8 *j8 ); -emitterT void ex86SetJ8A( u8 *j8 ); -emitterT void ex86SetJ16( u16 *j16 ); -emitterT void ex86SetJ16A( u16 *j16 ); -emitterT void ex86SetJ32( u32 *j32 ); -emitterT void ex86SetJ32A( u32 *j32 ); -emitterT void ex86Align( int bytes ); -emitterT void ex86AlignExecutable( int align ); +emitterT void x86SetPtr( u8 *ptr ); +emitterT void x86SetJ8( u8 *j8 ); +emitterT void x86SetJ8A( u8 *j8 ); +emitterT void x86SetJ16( u16 *j16 ); +emitterT void x86SetJ16A( u16 *j16 ); +emitterT void x86SetJ32( u32 *j32 ); +emitterT void x86SetJ32A( u32 *j32 ); +emitterT void x86Align( int bytes ); +emitterT void x86AlignExecutable( int align ); //------------------------------------------------------------------ //------------------------------------------------------------------ @@ -113,23 +118,21 @@ emitterT u32* J32Rel( int cc, u32 to ); emitterT u64 GetCPUTick( void ); //------------------------------------------------------------------ -emitterT void eMOV32RtoR( x86IntRegType to, x86IntRegType from ); -emitterT u32* eJMP32( uptr to ); -emitterT u8* eJMP8( u8 to ); -emitterT void eCALL32( u32 to ); -emitterT void eLEA32RtoR(x86IntRegType to, x86IntRegType from, u32 offset); -emitterT void eLEA32RStoR(x86IntRegType to, x86IntRegType from, u32 scale); -emitterT void eNOP( void ); -emitterT void eAND32ItoM( uptr to, u32 from ); -emitterT void eLEA32RRtoR(x86IntRegType to, x86IntRegType from0, x86IntRegType from1); -emitterT void eLEA32RStoR(x86IntRegType to, x86IntRegType from, u32 scale); +emitterT void MOV32RtoR( x86IntRegType to, x86IntRegType from ); +emitterT u32* JMP32( uptr to ); +emitterT u8* JMP8( u8 to ); +emitterT void CALL32( u32 to ); +emitterT void LEA32RStoR(x86IntRegType to, x86IntRegType from, u32 scale); +emitterT void NOP( void ); +emitterT void AND32ItoM( uptr to, u32 from ); +emitterT void LEA32RRtoR(x86IntRegType to, x86IntRegType from0, x86IntRegType from1); +emitterT void LEA32RStoR(x86IntRegType to, x86IntRegType from, u32 scale); #define MMXONLY(code) code #define _MM_MK_INSERTPS_NDX(srcField, dstField, zeroMask) (((srcField)<<6) | ((dstField)<<4) | (zeroMask)) -#include "ix86_macros.h" #include "ix86.inl" #include "ix86_3dnow.inl" #include "ix86_fpu.inl" diff --git a/pcsx2/x86/ix86/ix86.inl b/pcsx2/x86/ix86/ix86.inl index b94bab0e8d..b29427da43 100644 --- a/pcsx2/x86/ix86/ix86.inl +++ b/pcsx2/x86/ix86/ix86.inl @@ -39,141 +39,107 @@ // Note: the 'to' field can either be a register or a special opcode extension specifier // depending on the opcode's encoding. -// I added this back in because it's called once from eMOV8ItoRm and eMOV16ItoRm. -emitterT void WriteRmOffset(x86IntRegType to, s32 offset) -{ - if ((to&7) == ESP) { - if( offset == 0 ) { - ModRM( 0, 0, 4 ); - SibSB( 0, ESP, 4 ); - } - else if( offset <= 127 && offset >= -128 ) { - ModRM( 1, 0, 4 ); - SibSB( 0, ESP, 4 ); - write8(offset); - } - else { - ModRM( 2, 0, 4 ); - SibSB( 0, ESP, 4 ); - write32(offset); - } - } - else { - if( offset == 0 ) { - ModRM( 0, 0, to ); - } - else if( offset <= 127 && offset >= -128 ) { - ModRM( 1, 0, to ); - write8(offset); - } - else { - ModRM( 2, 0, to ); - write32(offset); - } - } -} - emitterT void WriteRmOffsetFrom(x86IntRegType to, x86IntRegType from, int offset) { if ((from&7) == ESP) { if( offset == 0 ) { - ModRM( 0, to, 0x4 ); - SibSB( 0, 0x4, 0x4 ); + ModRM( 0, to, 0x4 ); + SibSB( 0, 0x4, 0x4 ); } else if( offset <= 127 && offset >= -128 ) { - ModRM( 1, to, 0x4 ); - SibSB( 0, 0x4, 0x4 ); - write8(offset); + ModRM( 1, to, 0x4 ); + SibSB( 0, 0x4, 0x4 ); + write8(offset); } else { - ModRM( 2, to, 0x4 ); - SibSB( 0, 0x4, 0x4 ); - write32(offset); + ModRM( 2, to, 0x4 ); + SibSB( 0, 0x4, 0x4 ); + write32(offset); } } else { if( offset == 0 ) { - ModRM( 0, to, from ); + ModRM( 0, to, from ); } else if( offset <= 127 && offset >= -128 ) { - ModRM( 1, to, from ); - write8(offset); + ModRM( 1, to, from ); + write8(offset); } else { - ModRM( 2, to, from ); - write32(offset); + ModRM( 2, to, from ); + write32(offset); } } } emitterT void ModRM( s32 mod, s32 reg, s32 rm ) { - write8( ( mod << 6 ) | ( (reg & 7) << 3 ) | ( rm & 7 ) ); + write8( ( mod << 6 ) | ( (reg & 7) << 3 ) | ( rm & 7 ) ); } emitterT void SibSB( s32 ss, s32 index, s32 base ) { - write8( ( ss << 6 ) | ( (index & 7) << 3 ) | ( base & 7 ) ); + write8( ( ss << 6 ) | ( (index & 7) << 3 ) | ( base & 7 ) ); } emitterT void SET8R( int cc, int to ) { RexB(0, to); - write8( 0x0F ); - write8( cc ); - write8( 0xC0 | ( to ) ); + write8( 0x0F ); + write8( cc ); + write8( 0xC0 | ( to ) ); } emitterT u8* J8Rel( int cc, int to ) { - write8( cc ); - write8( to ); - return (u8*)(x86Ptr[I] - 1); + write8( cc ); + write8( to ); + return (u8*)(x86Ptr - 1); } emitterT u16* J16Rel( int cc, u32 to ) { - write16( 0x0F66 ); - write8( cc ); - write16( to ); - return (u16*)( x86Ptr[I] - 2 ); + write16( 0x0F66 ); + write8( cc ); + write16( to ); + return (u16*)( x86Ptr - 2 ); } emitterT u32* J32Rel( int cc, u32 to ) { - write8( 0x0F ); - write8( cc ); - write32( to ); - return (u32*)( x86Ptr[I] - 4 ); + write8( 0x0F ); + write8( cc ); + write32( to ); + return (u32*)( x86Ptr - 4 ); } emitterT void CMOV32RtoR( int cc, int to, int from ) { RexRB(0, to, from); - write8( 0x0F ); - write8( cc ); - ModRM( 3, to, from ); + write8( 0x0F ); + write8( cc ); + ModRM( 3, to, from ); } emitterT void CMOV32MtoR( int cc, int to, uptr from ) { RexR(0, to); - write8( 0x0F ); - write8( cc ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x0F ); + write8( cc ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } //////////////////////////////////////////////////// -emitterT void ex86SetPtr( u8* ptr ) +emitterT void x86SetPtr( u8* ptr ) { - x86Ptr[I] = ptr; + x86Ptr = ptr; } //////////////////////////////////////////////////// -emitterT void ex86SetJ8( u8* j8 ) +emitterT void x86SetJ8( u8* j8 ) { - u32 jump = ( x86Ptr[I] - j8 ) - 1; + u32 jump = ( x86Ptr - j8 ) - 1; if ( jump > 0x7f ) { Console::Error( "j8 greater than 0x7f!!" ); @@ -182,31 +148,31 @@ emitterT void ex86SetJ8( u8* j8 ) *j8 = (u8)jump; } -emitterT void ex86SetJ8A( u8* j8 ) +emitterT void x86SetJ8A( u8* j8 ) { - u32 jump = ( x86Ptr[I] - j8 ) - 1; + u32 jump = ( x86Ptr - j8 ) - 1; if ( jump > 0x7f ) { Console::Error( "j8 greater than 0x7f!!" ); assert(0); } - if( ((uptr)x86Ptr[I]&0xf) > 4 ) { + if( ((uptr)x86Ptr&0xf) > 4 ) { - uptr newjump = jump + 16-((uptr)x86Ptr[I]&0xf); + uptr newjump = jump + 16-((uptr)x86Ptr&0xf); if( newjump <= 0x7f ) { jump = newjump; - while((uptr)x86Ptr[I]&0xf) *x86Ptr[I]++ = 0x90; + while((uptr)x86Ptr&0xf) *x86Ptr++ = 0x90; } } *j8 = (u8)jump; } -emitterT void ex86SetJ16( u16 *j16 ) +emitterT void x86SetJ16( u16 *j16 ) { // doesn't work - u32 jump = ( x86Ptr[I] - (u8*)j16 ) - 2; + u32 jump = ( x86Ptr - (u8*)j16 ) - 2; if ( jump > 0x7fff ) { Console::Error( "j16 greater than 0x7fff!!" ); @@ -215,84 +181,84 @@ emitterT void ex86SetJ16( u16 *j16 ) *j16 = (u16)jump; } -emitterT void ex86SetJ16A( u16 *j16 ) +emitterT void x86SetJ16A( u16 *j16 ) { - if( ((uptr)x86Ptr[I]&0xf) > 4 ) { - while((uptr)x86Ptr[I]&0xf) *x86Ptr[I]++ = 0x90; + if( ((uptr)x86Ptr&0xf) > 4 ) { + while((uptr)x86Ptr&0xf) *x86Ptr++ = 0x90; } - ex86SetJ16(j16); + x86SetJ16(j16); } //////////////////////////////////////////////////// -emitterT void ex86SetJ32( u32* j32 ) +emitterT void x86SetJ32( u32* j32 ) { - *j32 = ( x86Ptr[I] - (u8*)j32 ) - 4; + *j32 = ( x86Ptr - (u8*)j32 ) - 4; } -emitterT void ex86SetJ32A( u32* j32 ) +emitterT void x86SetJ32A( u32* j32 ) { - while((uptr)x86Ptr[I]&0xf) *x86Ptr[I]++ = 0x90; - ex86SetJ32(j32); + while((uptr)x86Ptr&0xf) *x86Ptr++ = 0x90; + x86SetJ32(j32); } //////////////////////////////////////////////////// -emitterT void ex86Align( int bytes ) +emitterT void x86Align( int bytes ) { // forward align - x86Ptr[I] = (u8*)( ( (uptr)x86Ptr[I] + bytes - 1) & ~( bytes - 1 ) ); + x86Ptr = (u8*)( ( (uptr)x86Ptr + bytes - 1) & ~( bytes - 1 ) ); } //////////////////////////////////////////////////// // Generates executable code to align to the given alignment (could be useful for the second leg // of if/else conditionals, which usually fall through a jump target label). -emitterT void ex86AlignExecutable( int align ) +emitterT void x86AlignExecutable( int align ) { - uptr newx86 = ( (uptr)x86Ptr[I] + align - 1) & ~( align - 1 ); - uptr bytes = ( newx86 - (uptr)x86Ptr[I] ); + uptr newx86 = ( (uptr)x86Ptr + align - 1) & ~( align - 1 ); + uptr bytes = ( newx86 - (uptr)x86Ptr ); switch( bytes ) { case 0: break; - case 1: eNOP(); break; - case 2: eMOV32RtoR( ESI, ESI ); break; - case 3: write8(0x08D); write8(0x024); write8(0x024); break; - case 5: eNOP(); // falls through to 4... - case 4: write8(0x08D); write8(0x064); write8(0x024); write8(0); break; - case 6: write8(0x08D); write8(0x0B6); write32(0); break; - case 8: eNOP(); // falls through to 7... - case 7: write8(0x08D); write8(0x034); write8(0x035); write32(0); break; + case 1: NOP(); break; + case 2: MOV32RtoR( ESI, ESI ); break; + case 3: write8(0x08D); write8(0x024); write8(0x024); break; + case 5: NOP(); // falls through to 4... + case 4: write8(0x08D); write8(0x064); write8(0x024); write8(0); break; + case 6: write8(0x08D); write8(0x0B6); write32(0); break; + case 8: NOP(); // falls through to 7... + case 7: write8(0x08D); write8(0x034); write8(0x035); write32(0); break; default: { // for larger alignments, just use a JMP... - u8* aligned_target = eJMP8(0); - x86Ptr[I] = (u8*)newx86; - ex86SetJ8( aligned_target ); + u8* aligned_target = JMP8(0); + x86Ptr = (u8*)newx86; + x86SetJ8( aligned_target ); } } - jASSUME( x86Ptr[0] == (u8*)newx86 ); + jASSUME( x86Ptr == (u8*)newx86 ); } /********************/ /* IX86 intructions */ /********************/ -emitterT void eSTC( void ) +emitterT void STC( void ) { - write8( 0xF9 ); + write8( 0xF9 ); } -emitterT void eCLC( void ) +emitterT void CLC( void ) { - write8( 0xF8 ); + write8( 0xF8 ); } // NOP 1-byte -emitterT void eNOP( void ) +emitterT void NOP( void ) { - write8(0x90); + write8(0x90); } @@ -301,555 +267,555 @@ emitterT void eNOP( void ) //////////////////////////////////// /* mov r32 to r32 */ -emitterT void eMOV32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void MOV32RtoR( x86IntRegType to, x86IntRegType from ) { RexRB(0, from, to); - write8( 0x89 ); - ModRM( 3, from, to ); + write8( 0x89 ); + ModRM( 3, from, to ); } /* mov r32 to m32 */ -emitterT void eMOV32RtoM( uptr to, x86IntRegType from ) +emitterT void MOV32RtoM( uptr to, x86IntRegType from ) { RexR(0, from); if (from == EAX) { - write8(0xA3); + write8(0xA3); } else { - write8( 0x89 ); - ModRM( 0, from, DISP32 ); + write8( 0x89 ); + ModRM( 0, from, DISP32 ); } - write32( MEMADDR(to, 4) ); + write32( MEMADDR(to, 4) ); } /* mov m32 to r32 */ -emitterT void eMOV32MtoR( x86IntRegType to, uptr from ) +emitterT void MOV32MtoR( x86IntRegType to, uptr from ) { RexR(0, to); if (to == EAX) { - write8(0xA1); + write8(0xA1); } else { - write8( 0x8B ); - ModRM( 0, to, DISP32 ); + write8( 0x8B ); + ModRM( 0, to, DISP32 ); } - write32( MEMADDR(from, 4) ); + write32( MEMADDR(from, 4) ); } -emitterT void eMOV32RmtoR( x86IntRegType to, x86IntRegType from, int offset=0 ) +emitterT void MOV32RmtoR( x86IntRegType to, x86IntRegType from, int offset=0 ) { RexRB(0, to, from); - write8( 0x8B ); - WriteRmOffsetFrom(to, from, offset); + write8( 0x8B ); + WriteRmOffsetFrom(to, from, offset); } /* mov [r32+r32*scale] to r32 */ -emitterT void eMOV32RmStoR( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) +emitterT void MOV32RmStoR( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) { RexRXB(0,to,from2,from); - write8( 0x8B ); - ModRM( 0, to, 0x4 ); - SibSB(scale, from2, from ); + write8( 0x8B ); + ModRM( 0, to, 0x4 ); + SibSB(scale, from2, from ); } // mov r32 to [r32<( 0x8B ); - ModRM( 0, to, 0x4 ); - ModRM( scale, from1, 5); - write32(from2); + write8( 0x8B ); + ModRM( 0, to, 0x4 ); + ModRM( scale, from1, 5); + write32(from2); } /* mov r32 to [r32][r32*scale] */ -emitterT void eMOV32RtoRmS( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) +emitterT void MOV32RtoRmS( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) { RexRXB(0, to, from2, from); - write8( 0x89 ); - ModRM( 0, to, 0x4 ); - SibSB(scale, from2, from ); + write8( 0x89 ); + ModRM( 0, to, 0x4 ); + SibSB(scale, from2, from ); } /* mov imm32 to r32 */ -emitterT void eMOV32ItoR( x86IntRegType to, u32 from ) +emitterT void MOV32ItoR( x86IntRegType to, u32 from ) { RexB(0, to); - write8( 0xB8 | (to & 0x7) ); - write32( from ); + write8( 0xB8 | (to & 0x7) ); + write32( from ); } /* mov imm32 to m32 */ -emitterT void eMOV32ItoM(uptr to, u32 from ) +emitterT void MOV32ItoM(uptr to, u32 from ) { - write8( 0xC7 ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 8) ); - write32( from ); + write8( 0xC7 ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 8) ); + write32( from ); } // mov imm32 to [r32+off] -emitterT void eMOV32ItoRm( x86IntRegType to, u32 from, int offset=0) +emitterT void MOV32ItoRm( x86IntRegType to, u32 from, int offset=0) { RexB(0,to); - write8( 0xC7 ); - WriteRmOffsetFrom(0, to, offset); - write32(from); + write8( 0xC7 ); + WriteRmOffsetFrom(0, to, offset); + write32(from); } // mov r32 to [r32+off] -emitterT void eMOV32RtoRm( x86IntRegType to, x86IntRegType from, int offset=0) +emitterT void MOV32RtoRm( x86IntRegType to, x86IntRegType from, int offset=0) { RexRB(0,from,to); - write8( 0x89 ); - WriteRmOffsetFrom(from, to, offset); + write8( 0x89 ); + WriteRmOffsetFrom(from, to, offset); } /* mov r16 to m16 */ -emitterT void eMOV16RtoM(uptr to, x86IntRegType from ) +emitterT void MOV16RtoM(uptr to, x86IntRegType from ) { - write8( 0x66 ); + write8( 0x66 ); RexR(0,from); - write8( 0x89 ); - ModRM( 0, from, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x89 ); + ModRM( 0, from, DISP32 ); + write32( MEMADDR(to, 4) ); } /* mov m16 to r16 */ -emitterT void eMOV16MtoR( x86IntRegType to, uptr from ) +emitterT void MOV16MtoR( x86IntRegType to, uptr from ) { - write8( 0x66 ); + write8( 0x66 ); RexR(0,to); - write8( 0x8B ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x8B ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void eMOV16RmtoR( x86IntRegType to, x86IntRegType from, int offset=0 ) +emitterT void MOV16RmtoR( x86IntRegType to, x86IntRegType from, int offset=0 ) { - write8( 0x66 ); + write8( 0x66 ); RexRB(0,to,from); - write8( 0x8B ); - WriteRmOffsetFrom(to, from, offset); + write8( 0x8B ); + WriteRmOffsetFrom(to, from, offset); } -emitterT void eMOV16RmSOffsettoR( x86IntRegType to, x86IntRegType from1, u32 from2, int scale=0 ) +emitterT void MOV16RmSOffsettoR( x86IntRegType to, x86IntRegType from1, u32 from2, int scale=0 ) { - write8(0x66); + write8(0x66); RexRXB(0,to,from1,0); - write8( 0x8B ); - ModRM( 0, to, SIB ); - SibSB( scale, from1, SIBDISP); - write32(from2); + write8( 0x8B ); + ModRM( 0, to, SIB ); + SibSB( scale, from1, SIBDISP); + write32(from2); } /* mov imm16 to m16 */ -emitterT void eMOV16ItoM( uptr to, u16 from ) +emitterT void MOV16ItoM( uptr to, u16 from ) { - write8( 0x66 ); - write8( 0xC7 ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 6) ); - write16( from ); + write8( 0x66 ); + write8( 0xC7 ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 6) ); + write16( from ); } /* mov r16 to [r32][r32*scale] */ -emitterT void eMOV16RtoRmS( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) +emitterT void MOV16RtoRmS( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) { - write8( 0x66 ); + write8( 0x66 ); RexRXB(0,to,from2,from); - write8( 0x89 ); - ModRM( 0, to, 0x4 ); - SibSB(scale, from2, from ); + write8( 0x89 ); + ModRM( 0, to, 0x4 ); + SibSB(scale, from2, from ); } -emitterT void eMOV16ItoR( x86IntRegType to, u16 from ) +emitterT void MOV16ItoR( x86IntRegType to, u16 from ) { RexB(0, to); - write16( 0xB866 | ((to & 0x7)<<8) ); - write16( from ); + write16( 0xB866 | ((to & 0x7)<<8) ); + write16( from ); } // mov imm16 to [r16+off] -emitterT void eMOV16ItoRm( x86IntRegType to, u16 from, u32 offset=0 ) +emitterT void MOV16ItoRm( x86IntRegType to, u16 from, u32 offset=0 ) { - write8(0x66); + write8(0x66); RexB(0,to); - write8( 0xC7 ); - WriteRmOffset(to, offset); - write16(from); + write8( 0xC7 ); + WriteRmOffsetFrom(0, to, offset); + write16(from); } // mov r16 to [r16+off] -emitterT void eMOV16RtoRm( x86IntRegType to, x86IntRegType from, int offset=0 ) +emitterT void MOV16RtoRm( x86IntRegType to, x86IntRegType from, int offset=0 ) { - write8(0x66); + write8(0x66); RexRB(0,from,to); - write8( 0x89 ); - WriteRmOffsetFrom(from, to, offset); + write8( 0x89 ); + WriteRmOffsetFrom(from, to, offset); } /* mov r8 to m8 */ -emitterT void eMOV8RtoM( uptr to, x86IntRegType from ) +emitterT void MOV8RtoM( uptr to, x86IntRegType from ) { RexR(0,from); - write8( 0x88 ); - ModRM( 0, from, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x88 ); + ModRM( 0, from, DISP32 ); + write32( MEMADDR(to, 4) ); } /* mov m8 to r8 */ -emitterT void eMOV8MtoR( x86IntRegType to, uptr from ) +emitterT void MOV8MtoR( x86IntRegType to, uptr from ) { RexR(0,to); - write8( 0x8A ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x8A ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void eMOV8RmtoR(x86IntRegType to, x86IntRegType from, int offset=0) +emitterT void MOV8RmtoR(x86IntRegType to, x86IntRegType from, int offset=0) { RexRB(0,to,from); - write8( 0x8A ); - WriteRmOffsetFrom(to, from, offset); + write8( 0x8A ); + WriteRmOffsetFrom(to, from, offset); } -emitterT void eMOV8RmSOffsettoR( x86IntRegType to, x86IntRegType from1, u32 from2, int scale=0 ) +emitterT void MOV8RmSOffsettoR( x86IntRegType to, x86IntRegType from1, u32 from2, int scale=0 ) { RexRXB(0,to,from1,0); - write8( 0x8A ); - ModRM( 0, to, SIB ); - SibSB( scale, from1, SIBDISP); - write32(from2); + write8( 0x8A ); + ModRM( 0, to, SIB ); + SibSB( scale, from1, SIBDISP); + write32(from2); } /* mov imm8 to m8 */ -emitterT void eMOV8ItoM( uptr to, u8 from ) +emitterT void MOV8ItoM( uptr to, u8 from ) { - write8( 0xC6 ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 5) ); - write8( from ); + write8( 0xC6 ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 5) ); + write8( from ); } // mov imm8 to r8 -emitterT void eMOV8ItoR( x86IntRegType to, u8 from ) +emitterT void MOV8ItoR( x86IntRegType to, u8 from ) { RexB(0, to); - write8( 0xB0 | (to & 0x7) ); - write8( from ); + write8( 0xB0 | (to & 0x7) ); + write8( from ); } // mov imm8 to [r8+off] -emitterT void eMOV8ItoRm( x86IntRegType to, u8 from, int offset=0) +emitterT void MOV8ItoRm( x86IntRegType to, u8 from, int offset=0) { assert( to != ESP ); RexB(0,to); - write8( 0xC6 ); - WriteRmOffset(to,offset); - write8(from); + write8( 0xC6 ); + WriteRmOffsetFrom(0, to,offset); + write8(from); } // mov r8 to [r8+off] -emitterT void eMOV8RtoRm( x86IntRegType to, x86IntRegType from, int offset=0) +emitterT void MOV8RtoRm( x86IntRegType to, x86IntRegType from, int offset=0) { assert( to != ESP ); RexRB(0,from,to); - write8( 0x88 ); - WriteRmOffsetFrom(from,to,offset); + write8( 0x88 ); + WriteRmOffsetFrom(from,to,offset); } /* movsx r8 to r32 */ -emitterT void eMOVSX32R8toR( x86IntRegType to, x86IntRegType from ) +emitterT void MOVSX32R8toR( x86IntRegType to, x86IntRegType from ) { RexRB(0,to,from); - write16( 0xBE0F ); - ModRM( 3, to, from ); + write16( 0xBE0F ); + ModRM( 3, to, from ); } -emitterT void eMOVSX32Rm8toR( x86IntRegType to, x86IntRegType from ) +emitterT void MOVSX32Rm8toR( x86IntRegType to, x86IntRegType from ) { RexRB(0,to,from); - write16( 0xBE0F ); - ModRM( 0, to, from ); + write16( 0xBE0F ); + ModRM( 0, to, from ); } -emitterT void eMOVSX32Rm8toROffset( x86IntRegType to, x86IntRegType from, int offset ) +emitterT void MOVSX32Rm8toROffset( x86IntRegType to, x86IntRegType from, int offset ) { RexRB(0,to,from); - write16( 0xBE0F ); - WriteRmOffsetFrom(to,from,offset); + write16( 0xBE0F ); + WriteRmOffsetFrom(to,from,offset); } /* movsx m8 to r32 */ -emitterT void eMOVSX32M8toR( x86IntRegType to, u32 from ) +emitterT void MOVSX32M8toR( x86IntRegType to, u32 from ) { RexR(0,to); - write16( 0xBE0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xBE0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* movsx r16 to r32 */ -emitterT void eMOVSX32R16toR( x86IntRegType to, x86IntRegType from ) +emitterT void MOVSX32R16toR( x86IntRegType to, x86IntRegType from ) { RexRB(0,to,from); - write16( 0xBF0F ); - ModRM( 3, to, from ); + write16( 0xBF0F ); + ModRM( 3, to, from ); } -emitterT void eMOVSX32Rm16toR( x86IntRegType to, x86IntRegType from, int offset=0 ) +emitterT void MOVSX32Rm16toR( x86IntRegType to, x86IntRegType from, int offset=0 ) { RexRB(0,to,from); - write16( 0xBF0F ); - WriteRmOffsetFrom(to,from,offset); + write16( 0xBF0F ); + WriteRmOffsetFrom(to,from,offset); } /* movsx m16 to r32 */ -emitterT void eMOVSX32M16toR( x86IntRegType to, u32 from ) +emitterT void MOVSX32M16toR( x86IntRegType to, u32 from ) { RexR(0,to); - write16( 0xBF0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xBF0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* movzx r8 to r32 */ -emitterT void eMOVZX32R8toR( x86IntRegType to, x86IntRegType from ) +emitterT void MOVZX32R8toR( x86IntRegType to, x86IntRegType from ) { RexRB(0,to,from); - write16( 0xB60F ); - ModRM( 3, to, from ); + write16( 0xB60F ); + ModRM( 3, to, from ); } -emitterT void eMOVZX32Rm8toR( x86IntRegType to, x86IntRegType from, int offset=0 ) +emitterT void MOVZX32Rm8toR( x86IntRegType to, x86IntRegType from, int offset=0 ) { RexRB(0,to,from); - write16( 0xB60F ); - WriteRmOffsetFrom(to,from,offset); + write16( 0xB60F ); + WriteRmOffsetFrom(to,from,offset); } /* movzx m8 to r32 */ -emitterT void eMOVZX32M8toR( x86IntRegType to, u32 from ) +emitterT void MOVZX32M8toR( x86IntRegType to, u32 from ) { RexR(0,to); - write16( 0xB60F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xB60F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* movzx r16 to r32 */ -emitterT void eMOVZX32R16toR( x86IntRegType to, x86IntRegType from ) +emitterT void MOVZX32R16toR( x86IntRegType to, x86IntRegType from ) { RexRB(0,to,from); - write16( 0xB70F ); - ModRM( 3, to, from ); + write16( 0xB70F ); + ModRM( 3, to, from ); } -emitterT void eMOVZX32Rm16toR( x86IntRegType to, x86IntRegType from, int offset=0 ) +emitterT void MOVZX32Rm16toR( x86IntRegType to, x86IntRegType from, int offset=0 ) { RexRB(0,to,from); - write16( 0xB70F ); - WriteRmOffsetFrom(to,from,offset); + write16( 0xB70F ); + WriteRmOffsetFrom(to,from,offset); } /* movzx m16 to r32 */ -emitterT void eMOVZX32M16toR( x86IntRegType to, u32 from ) +emitterT void MOVZX32M16toR( x86IntRegType to, u32 from ) { RexR(0,to); - write16( 0xB70F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xB70F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* cmovbe r32 to r32 */ -emitterT void eCMOVBE32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVBE32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x46, to, from ); + CMOV32RtoR( 0x46, to, from ); } /* cmovbe m32 to r32*/ -emitterT void eCMOVBE32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVBE32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x46, to, from ); + CMOV32MtoR( 0x46, to, from ); } /* cmovb r32 to r32 */ -emitterT void eCMOVB32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVB32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x42, to, from ); + CMOV32RtoR( 0x42, to, from ); } /* cmovb m32 to r32*/ -emitterT void eCMOVB32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVB32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x42, to, from ); + CMOV32MtoR( 0x42, to, from ); } /* cmovae r32 to r32 */ -emitterT void eCMOVAE32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVAE32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x43, to, from ); + CMOV32RtoR( 0x43, to, from ); } /* cmovae m32 to r32*/ -emitterT void eCMOVAE32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVAE32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x43, to, from ); + CMOV32MtoR( 0x43, to, from ); } /* cmova r32 to r32 */ -emitterT void eCMOVA32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVA32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x47, to, from ); + CMOV32RtoR( 0x47, to, from ); } /* cmova m32 to r32*/ -emitterT void eCMOVA32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVA32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x47, to, from ); + CMOV32MtoR( 0x47, to, from ); } /* cmovo r32 to r32 */ -emitterT void eCMOVO32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVO32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x40, to, from ); + CMOV32RtoR( 0x40, to, from ); } /* cmovo m32 to r32 */ -emitterT void eCMOVO32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVO32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x40, to, from ); + CMOV32MtoR( 0x40, to, from ); } /* cmovp r32 to r32 */ -emitterT void eCMOVP32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVP32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x4A, to, from ); + CMOV32RtoR( 0x4A, to, from ); } /* cmovp m32 to r32 */ -emitterT void eCMOVP32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVP32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x4A, to, from ); + CMOV32MtoR( 0x4A, to, from ); } /* cmovs r32 to r32 */ -emitterT void eCMOVS32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVS32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x48, to, from ); + CMOV32RtoR( 0x48, to, from ); } /* cmovs m32 to r32 */ -emitterT void eCMOVS32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVS32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x48, to, from ); + CMOV32MtoR( 0x48, to, from ); } /* cmovno r32 to r32 */ -emitterT void eCMOVNO32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVNO32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x41, to, from ); + CMOV32RtoR( 0x41, to, from ); } /* cmovno m32 to r32 */ -emitterT void eCMOVNO32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVNO32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x41, to, from ); + CMOV32MtoR( 0x41, to, from ); } /* cmovnp r32 to r32 */ -emitterT void eCMOVNP32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVNP32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x4B, to, from ); + CMOV32RtoR( 0x4B, to, from ); } /* cmovnp m32 to r32 */ -emitterT void eCMOVNP32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVNP32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x4B, to, from ); + CMOV32MtoR( 0x4B, to, from ); } /* cmovns r32 to r32 */ -emitterT void eCMOVNS32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVNS32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x49, to, from ); + CMOV32RtoR( 0x49, to, from ); } /* cmovns m32 to r32 */ -emitterT void eCMOVNS32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVNS32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x49, to, from ); + CMOV32MtoR( 0x49, to, from ); } /* cmovne r32 to r32 */ -emitterT void eCMOVNE32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVNE32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x45, to, from ); + CMOV32RtoR( 0x45, to, from ); } /* cmovne m32 to r32*/ -emitterT void eCMOVNE32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVNE32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x45, to, from ); + CMOV32MtoR( 0x45, to, from ); } /* cmove r32 to r32*/ -emitterT void eCMOVE32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVE32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x44, to, from ); + CMOV32RtoR( 0x44, to, from ); } /* cmove m32 to r32*/ -emitterT void eCMOVE32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVE32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x44, to, from ); + CMOV32MtoR( 0x44, to, from ); } /* cmovg r32 to r32*/ -emitterT void eCMOVG32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVG32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x4F, to, from ); + CMOV32RtoR( 0x4F, to, from ); } /* cmovg m32 to r32*/ -emitterT void eCMOVG32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVG32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x4F, to, from ); + CMOV32MtoR( 0x4F, to, from ); } /* cmovge r32 to r32*/ -emitterT void eCMOVGE32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVGE32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x4D, to, from ); + CMOV32RtoR( 0x4D, to, from ); } /* cmovge m32 to r32*/ -emitterT void eCMOVGE32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVGE32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x4D, to, from ); + CMOV32MtoR( 0x4D, to, from ); } /* cmovl r32 to r32*/ -emitterT void eCMOVL32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVL32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x4C, to, from ); + CMOV32RtoR( 0x4C, to, from ); } /* cmovl m32 to r32*/ -emitterT void eCMOVL32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVL32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x4C, to, from ); + CMOV32MtoR( 0x4C, to, from ); } /* cmovle r32 to r32*/ -emitterT void eCMOVLE32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMOVLE32RtoR( x86IntRegType to, x86IntRegType from ) { - CMOV32RtoR( 0x4E, to, from ); + CMOV32RtoR( 0x4E, to, from ); } /* cmovle m32 to r32*/ -emitterT void eCMOVLE32MtoR( x86IntRegType to, uptr from ) +emitterT void CMOVLE32MtoR( x86IntRegType to, uptr from ) { - CMOV32MtoR( 0x4E, to, from ); + CMOV32MtoR( 0x4E, to, from ); } //////////////////////////////////// @@ -857,261 +823,261 @@ emitterT void eCMOVLE32MtoR( x86IntRegType to, uptr from ) //////////////////////////////////// // add r16 to r16 -emitterT void eADD16RtoR( x86IntRegType to , x86IntRegType from ) +emitterT void ADD16RtoR( x86IntRegType to , x86IntRegType from ) { - write8(0x66); + write8(0x66); RexRB(0,to,from); - write8( 0x03 ); - ModRM( 3, to, from ); + write8( 0x03 ); + ModRM( 3, to, from ); } /* add imm16 to r16 */ -emitterT void eADD16ItoR( x86IntRegType to, s16 imm ) +emitterT void ADD16ItoR( x86IntRegType to, s16 imm ) { - write8( 0x66 ); + write8( 0x66 ); RexB(0,to); if ( to == EAX) { - write8( 0x05 ); - write16( imm ); + write8( 0x05 ); + write16( imm ); } else if(imm <= 127 && imm >= -128) { - write8( 0x83 ); - ModRM( 3, 0, to ); - write8((u8)imm ); + write8( 0x83 ); + ModRM( 3, 0, to ); + write8((u8)imm ); } else { - write8( 0x81 ); - ModRM( 3, 0, to ); - write16( imm ); + write8( 0x81 ); + ModRM( 3, 0, to ); + write16( imm ); } } /* add imm16 to m16 */ -emitterT void eADD16ItoM( uptr to, s16 imm ) +emitterT void ADD16ItoM( uptr to, s16 imm ) { - write8( 0x66 ); + write8( 0x66 ); if(imm <= 127 && imm >= -128) { - write8( 0x83 ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 6) ); - write8((u8)imm ); + write8( 0x83 ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 6) ); + write8((u8)imm ); } else { - write8( 0x81 ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 6) ); - write16( imm ); + write8( 0x81 ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 6) ); + write16( imm ); } } /* add r16 to m16 */ -emitterT void eADD16RtoM(uptr to, x86IntRegType from ) +emitterT void ADD16RtoM(uptr to, x86IntRegType from ) { - write8( 0x66 ); + write8( 0x66 ); RexR(0,from); - write8( 0x01 ); - ModRM( 0, from, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x01 ); + ModRM( 0, from, DISP32 ); + write32( MEMADDR(to, 4) ); } /* add m16 to r16 */ -emitterT void eADD16MtoR( x86IntRegType to, uptr from ) +emitterT void ADD16MtoR( x86IntRegType to, uptr from ) { - write8( 0x66 ); + write8( 0x66 ); RexR(0,to); - write8( 0x03 ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x03 ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } // add m8 to r8 -emitterT void eADD8MtoR( x86IntRegType to, uptr from ) +emitterT void ADD8MtoR( x86IntRegType to, uptr from ) { RexR(0,to); - write8( 0x02 ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x02 ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* inc r32 */ -emitterT void eINC32R( x86IntRegType to ) +emitterT void INC32R( x86IntRegType to ) { - write8( 0x40 + to ); + write8( 0x40 + to ); } /* inc m32 */ -emitterT void eINC32M( u32 to ) +emitterT void INC32M( u32 to ) { - write8( 0xFF ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0xFF ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 4) ); } /* inc r16 */ -emitterT void eINC16R( x86IntRegType to ) +emitterT void INC16R( x86IntRegType to ) { - write8( 0x66 ); - write8( 0x40 + to ); + write8( 0x66 ); + write8( 0x40 + to ); } /* inc m16 */ -emitterT void eINC16M( u32 to ) +emitterT void INC16M( u32 to ) { - write8( 0x66 ); - write8( 0xFF ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x66 ); + write8( 0xFF ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 4) ); } // sub r16 to r16 -emitterT void eSUB16RtoR( x86IntRegType to, u16 from ) +emitterT void SUB16RtoR( x86IntRegType to, u16 from ) { - write8(0x66); + write8(0x66); RexRB(0,to,from); - write8( 0x2b ); - ModRM( 3, to, from ); + write8( 0x2b ); + ModRM( 3, to, from ); } /* sub imm16 to r16 */ -emitterT void eSUB16ItoR( x86IntRegType to, u16 from ) { - write8( 0x66 ); +emitterT void SUB16ItoR( x86IntRegType to, u16 from ) { + write8( 0x66 ); RexB(0,to); if ( to == EAX ) { - write8( 0x2D ); + write8( 0x2D ); } else { - write8( 0x81 ); - ModRM( 3, 5, to ); + write8( 0x81 ); + ModRM( 3, 5, to ); } - write16( from ); + write16( from ); } /* sub imm16 to m16 */ -emitterT void eSUB16ItoM( uptr to, u16 from ) { - write8( 0x66 ); - write8( 0x81 ); - ModRM( 0, 5, DISP32 ); - write32( MEMADDR(to, 6) ); - write16( from ); +emitterT void SUB16ItoM( uptr to, u16 from ) { + write8( 0x66 ); + write8( 0x81 ); + ModRM( 0, 5, DISP32 ); + write32( MEMADDR(to, 6) ); + write16( from ); } /* sub m16 to r16 */ -emitterT void eSUB16MtoR( x86IntRegType to, uptr from ) { - write8( 0x66 ); +emitterT void SUB16MtoR( x86IntRegType to, uptr from ) { + write8( 0x66 ); RexR(0,to); - write8( 0x2B ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x2B ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* dec r32 */ -emitterT void eDEC32R( x86IntRegType to ) +emitterT void DEC32R( x86IntRegType to ) { - write8( 0x48 + to ); + write8( 0x48 + to ); } /* dec m32 */ -emitterT void eDEC32M( u32 to ) +emitterT void DEC32M( u32 to ) { - write8( 0xFF ); - ModRM( 0, 1, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0xFF ); + ModRM( 0, 1, DISP32 ); + write32( MEMADDR(to, 4) ); } /* dec r16 */ -emitterT void eDEC16R( x86IntRegType to ) +emitterT void DEC16R( x86IntRegType to ) { - write8( 0x66 ); - write8( 0x48 + to ); + write8( 0x66 ); + write8( 0x48 + to ); } /* dec m16 */ -emitterT void eDEC16M( u32 to ) +emitterT void DEC16M( u32 to ) { - write8( 0x66 ); - write8( 0xFF ); - ModRM( 0, 1, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x66 ); + write8( 0xFF ); + ModRM( 0, 1, DISP32 ); + write32( MEMADDR(to, 4) ); } /* mul eax by r32 to edx:eax */ -emitterT void eMUL32R( x86IntRegType from ) +emitterT void MUL32R( x86IntRegType from ) { RexB(0,from); - write8( 0xF7 ); - ModRM( 3, 4, from ); + write8( 0xF7 ); + ModRM( 3, 4, from ); } /* imul eax by r32 to edx:eax */ -emitterT void eIMUL32R( x86IntRegType from ) +emitterT void IMUL32R( x86IntRegType from ) { RexB(0,from); - write8( 0xF7 ); - ModRM( 3, 5, from ); + write8( 0xF7 ); + ModRM( 3, 5, from ); } /* mul eax by m32 to edx:eax */ -emitterT void eMUL32M( u32 from ) +emitterT void MUL32M( u32 from ) { - write8( 0xF7 ); - ModRM( 0, 4, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xF7 ); + ModRM( 0, 4, DISP32 ); + write32( MEMADDR(from, 4) ); } /* imul eax by m32 to edx:eax */ -emitterT void eIMUL32M( u32 from ) +emitterT void IMUL32M( u32 from ) { - write8( 0xF7 ); - ModRM( 0, 5, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xF7 ); + ModRM( 0, 5, DISP32 ); + write32( MEMADDR(from, 4) ); } /* imul r32 by r32 to r32 */ -emitterT void eIMUL32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void IMUL32RtoR( x86IntRegType to, x86IntRegType from ) { RexRB(0,to,from); - write16( 0xAF0F ); - ModRM( 3, to, from ); + write16( 0xAF0F ); + ModRM( 3, to, from ); } /* div eax by r32 to edx:eax */ -emitterT void eDIV32R( x86IntRegType from ) +emitterT void DIV32R( x86IntRegType from ) { RexB(0,from); - write8( 0xF7 ); - ModRM( 3, 6, from ); + write8( 0xF7 ); + ModRM( 3, 6, from ); } /* idiv eax by r32 to edx:eax */ -emitterT void eIDIV32R( x86IntRegType from ) +emitterT void IDIV32R( x86IntRegType from ) { RexB(0,from); - write8( 0xF7 ); - ModRM( 3, 7, from ); + write8( 0xF7 ); + ModRM( 3, 7, from ); } /* div eax by m32 to edx:eax */ -emitterT void eDIV32M( u32 from ) +emitterT void DIV32M( u32 from ) { - write8( 0xF7 ); - ModRM( 0, 6, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xF7 ); + ModRM( 0, 6, DISP32 ); + write32( MEMADDR(from, 4) ); } /* idiv eax by m32 to edx:eax */ -emitterT void eIDIV32M( u32 from ) +emitterT void IDIV32M( u32 from ) { - write8( 0xF7 ); - ModRM( 0, 7, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xF7 ); + ModRM( 0, 7, DISP32 ); + write32( MEMADDR(from, 4) ); } //////////////////////////////////// @@ -1119,266 +1085,266 @@ emitterT void eIDIV32M( u32 from ) //////////////////////////////////// /* shl imm8 to r32 */ -emitterT void eSHL32ItoR( x86IntRegType to, u8 from ) +emitterT void SHL32ItoR( x86IntRegType to, u8 from ) { RexB(0, to); if ( from == 1 ) { - write8( 0xD1 ); - write8( 0xE0 | (to & 0x7) ); + write8( 0xD1 ); + write8( 0xE0 | (to & 0x7) ); return; } - write8( 0xC1 ); - ModRM( 3, 4, to ); - write8( from ); + write8( 0xC1 ); + ModRM( 3, 4, to ); + write8( from ); } /* shl imm8 to m32 */ -emitterT void eSHL32ItoM( uptr to, u8 from ) +emitterT void SHL32ItoM( uptr to, u8 from ) { if ( from == 1 ) { - write8( 0xD1 ); - ModRM( 0, 4, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0xD1 ); + ModRM( 0, 4, DISP32 ); + write32( MEMADDR(to, 4) ); } else { - write8( 0xC1 ); - ModRM( 0, 4, DISP32 ); - write32( MEMADDR(to, 5) ); - write8( from ); + write8( 0xC1 ); + ModRM( 0, 4, DISP32 ); + write32( MEMADDR(to, 5) ); + write8( from ); } } /* shl cl to r32 */ -emitterT void eSHL32CLtoR( x86IntRegType to ) +emitterT void SHL32CLtoR( x86IntRegType to ) { RexB(0,to); - write8( 0xD3 ); - ModRM( 3, 4, to ); + write8( 0xD3 ); + ModRM( 3, 4, to ); } // shl imm8 to r16 -emitterT void eSHL16ItoR( x86IntRegType to, u8 from ) +emitterT void SHL16ItoR( x86IntRegType to, u8 from ) { - write8(0x66); + write8(0x66); RexB(0,to); if ( from == 1 ) { - write8( 0xD1 ); - write8( 0xE0 | (to & 0x7) ); + write8( 0xD1 ); + write8( 0xE0 | (to & 0x7) ); return; } - write8( 0xC1 ); - ModRM( 3, 4, to ); - write8( from ); + write8( 0xC1 ); + ModRM( 3, 4, to ); + write8( from ); } // shl imm8 to r8 -emitterT void eSHL8ItoR( x86IntRegType to, u8 from ) +emitterT void SHL8ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( from == 1 ) { - write8( 0xD0 ); - write8( 0xE0 | (to & 0x7) ); + write8( 0xD0 ); + write8( 0xE0 | (to & 0x7) ); return; } - write8( 0xC0 ); - ModRM( 3, 4, to ); - write8( from ); + write8( 0xC0 ); + ModRM( 3, 4, to ); + write8( from ); } /* shr imm8 to r32 */ -emitterT void eSHR32ItoR( x86IntRegType to, u8 from ) { +emitterT void SHR32ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( from == 1 ) { - write8( 0xD1 ); - write8( 0xE8 | (to & 0x7) ); + write8( 0xD1 ); + write8( 0xE8 | (to & 0x7) ); } else { - write8( 0xC1 ); - ModRM( 3, 5, to ); - write8( from ); + write8( 0xC1 ); + ModRM( 3, 5, to ); + write8( from ); } } /* shr imm8 to m32 */ -emitterT void eSHR32ItoM( uptr to, u8 from ) +emitterT void SHR32ItoM( uptr to, u8 from ) { if ( from == 1 ) { - write8( 0xD1 ); - ModRM( 0, 5, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0xD1 ); + ModRM( 0, 5, DISP32 ); + write32( MEMADDR(to, 4) ); } else { - write8( 0xC1 ); - ModRM( 0, 5, DISP32 ); - write32( MEMADDR(to, 5) ); - write8( from ); + write8( 0xC1 ); + ModRM( 0, 5, DISP32 ); + write32( MEMADDR(to, 5) ); + write8( from ); } } /* shr cl to r32 */ -emitterT void eSHR32CLtoR( x86IntRegType to ) +emitterT void SHR32CLtoR( x86IntRegType to ) { RexB(0,to); - write8( 0xD3 ); - ModRM( 3, 5, to ); + write8( 0xD3 ); + ModRM( 3, 5, to ); } // shr imm8 to r16 -emitterT void eSHR16ItoR( x86IntRegType to, u8 from ) +emitterT void SHR16ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( from == 1 ) { - write8( 0xD1 ); - ModRM( 3, 5, to ); + write8( 0xD1 ); + ModRM( 3, 5, to ); } else { - write8( 0xC1 ); - ModRM( 3, 5, to ); - write8( from ); + write8( 0xC1 ); + ModRM( 3, 5, to ); + write8( from ); } } // shr imm8 to r8 -emitterT void eSHR8ItoR( x86IntRegType to, u8 from ) +emitterT void SHR8ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( from == 1 ) { - write8( 0xD0 ); - write8( 0xE8 | (to & 0x7) ); + write8( 0xD0 ); + write8( 0xE8 | (to & 0x7) ); } else { - write8( 0xC0 ); - ModRM( 3, 5, to ); - write8( from ); + write8( 0xC0 ); + ModRM( 3, 5, to ); + write8( from ); } } /* sar imm8 to r32 */ -emitterT void eSAR32ItoR( x86IntRegType to, u8 from ) +emitterT void SAR32ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( from == 1 ) { - write8( 0xD1 ); - ModRM( 3, 7, to ); + write8( 0xD1 ); + ModRM( 3, 7, to ); return; } - write8( 0xC1 ); - ModRM( 3, 7, to ); - write8( from ); + write8( 0xC1 ); + ModRM( 3, 7, to ); + write8( from ); } /* sar imm8 to m32 */ -emitterT void eSAR32ItoM( uptr to, u8 from ) +emitterT void SAR32ItoM( uptr to, u8 from ) { - write8( 0xC1 ); - ModRM( 0, 7, DISP32 ); - write32( MEMADDR(to, 5) ); - write8( from ); + write8( 0xC1 ); + ModRM( 0, 7, DISP32 ); + write32( MEMADDR(to, 5) ); + write8( from ); } /* sar cl to r32 */ -emitterT void eSAR32CLtoR( x86IntRegType to ) +emitterT void SAR32CLtoR( x86IntRegType to ) { RexB(0,to); - write8( 0xD3 ); - ModRM( 3, 7, to ); + write8( 0xD3 ); + ModRM( 3, 7, to ); } // sar imm8 to r16 -emitterT void eSAR16ItoR( x86IntRegType to, u8 from ) +emitterT void SAR16ItoR( x86IntRegType to, u8 from ) { - write8(0x66); + write8(0x66); RexB(0,to); if ( from == 1 ) { - write8( 0xD1 ); - ModRM( 3, 7, to ); + write8( 0xD1 ); + ModRM( 3, 7, to ); return; } - write8( 0xC1 ); - ModRM( 3, 7, to ); - write8( from ); + write8( 0xC1 ); + ModRM( 3, 7, to ); + write8( from ); } -/*emitterT void eROR32ItoR( x86IntRegType to,u8 from ) +/*emitterT void ROR32ItoR( x86IntRegType to,u8 from ) { RexB(0,to); if ( from == 1 ) { - write8( 0xd1 ); - write8( 0xc8 | to ); + write8( 0xd1 ); + write8( 0xc8 | to ); } else { - write8( 0xc1 ); - write8( 0xc8 | to ); - write8( from ); + write8( 0xc1 ); + write8( 0xc8 | to ); + write8( from ); } }*/ -emitterT void eRCR32ItoR( x86IntRegType to, u8 from ) +emitterT void RCR32ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( from == 1 ) { - write8( 0xd1 ); - ModRM(3, 3, to); + write8( 0xd1 ); + ModRM(3, 3, to); } else { - write8( 0xc1 ); - ModRM(3, 3, to); - write8( from ); + write8( 0xc1 ); + ModRM(3, 3, to); + write8( from ); } } -emitterT void eRCR32ItoM( uptr to, u8 from ) +emitterT void RCR32ItoM( uptr to, u8 from ) { RexB(0,to); if ( from == 1 ) { - write8( 0xd1 ); - ModRM( 0, 3, DISP32 ); - write32( MEMADDR(to, 8) ); + write8( 0xd1 ); + ModRM( 0, 3, DISP32 ); + write32( MEMADDR(to, 8) ); } else { - write8( 0xc1 ); - ModRM( 0, 3, DISP32 ); - write32( MEMADDR(to, 8) ); - write8( from ); + write8( 0xc1 ); + ModRM( 0, 3, DISP32 ); + write32( MEMADDR(to, 8) ); + write8( from ); } } // shld imm8 to r32 -emitterT void eSHLD32ItoR( x86IntRegType to, x86IntRegType from, u8 shift ) +emitterT void SHLD32ItoR( x86IntRegType to, x86IntRegType from, u8 shift ) { RexRB(0,from,to); - write8( 0x0F ); - write8( 0xA4 ); - ModRM( 3, from, to ); - write8( shift ); + write8( 0x0F ); + write8( 0xA4 ); + ModRM( 3, from, to ); + write8( shift ); } // shrd imm8 to r32 -emitterT void eSHRD32ItoR( x86IntRegType to, x86IntRegType from, u8 shift ) +emitterT void SHRD32ItoR( x86IntRegType to, x86IntRegType from, u8 shift ) { RexRB(0,from,to); - write8( 0x0F ); - write8( 0xAC ); - ModRM( 3, from, to ); - write8( shift ); + write8( 0x0F ); + write8( 0xAC ); + ModRM( 3, from, to ); + write8( shift ); } //////////////////////////////////// @@ -1386,252 +1352,252 @@ emitterT void eSHRD32ItoR( x86IntRegType to, x86IntRegType from, u8 shift ) //////////////////////////////////// // or r16 to r16 -emitterT void eOR16RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void OR16RtoR( x86IntRegType to, x86IntRegType from ) { - write8(0x66); + write8(0x66); RexRB(0,from,to); - write8( 0x09 ); - ModRM( 3, from, to ); + write8( 0x09 ); + ModRM( 3, from, to ); } // or imm16 to r16 -emitterT void eOR16ItoR( x86IntRegType to, u16 from ) +emitterT void OR16ItoR( x86IntRegType to, u16 from ) { - write8(0x66); + write8(0x66); RexB(0,to); if ( to == EAX ) { - write8( 0x0D ); + write8( 0x0D ); } else { - write8( 0x81 ); - ModRM( 3, 1, to ); + write8( 0x81 ); + ModRM( 3, 1, to ); } - write16( from ); + write16( from ); } // or imm16 to m316 -emitterT void eOR16ItoM( uptr to, u16 from ) +emitterT void OR16ItoM( uptr to, u16 from ) { - write8(0x66); - write8( 0x81 ); - ModRM( 0, 1, DISP32 ); - write32( MEMADDR(to, 6) ); - write16( from ); + write8(0x66); + write8( 0x81 ); + ModRM( 0, 1, DISP32 ); + write32( MEMADDR(to, 6) ); + write16( from ); } /* or m16 to r16 */ -emitterT void eOR16MtoR( x86IntRegType to, uptr from ) +emitterT void OR16MtoR( x86IntRegType to, uptr from ) { - write8(0x66); + write8(0x66); RexR(0,to); - write8( 0x0B ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x0B ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } // or r16 to m16 -emitterT void eOR16RtoM( uptr to, x86IntRegType from ) +emitterT void OR16RtoM( uptr to, x86IntRegType from ) { - write8(0x66); + write8(0x66); RexR(0,from); - write8( 0x09 ); - ModRM( 0, from, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x09 ); + ModRM( 0, from, DISP32 ); + write32( MEMADDR(to, 4) ); } // or r8 to r8 -emitterT void eOR8RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void OR8RtoR( x86IntRegType to, x86IntRegType from ) { RexRB(0,from,to); - write8( 0x08 ); - ModRM( 3, from, to ); + write8( 0x08 ); + ModRM( 3, from, to ); } // or r8 to m8 -emitterT void eOR8RtoM( uptr to, x86IntRegType from ) +emitterT void OR8RtoM( uptr to, x86IntRegType from ) { RexR(0,from); - write8( 0x08 ); - ModRM( 0, from, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x08 ); + ModRM( 0, from, DISP32 ); + write32( MEMADDR(to, 4) ); } // or imm8 to m8 -emitterT void eOR8ItoM( uptr to, u8 from ) +emitterT void OR8ItoM( uptr to, u8 from ) { - write8( 0x80 ); - ModRM( 0, 1, DISP32 ); - write32( MEMADDR(to, 5) ); - write8( from ); + write8( 0x80 ); + ModRM( 0, 1, DISP32 ); + write32( MEMADDR(to, 5) ); + write8( from ); } // or m8 to r8 -emitterT void eOR8MtoR( x86IntRegType to, uptr from ) +emitterT void OR8MtoR( x86IntRegType to, uptr from ) { RexR(0,to); - write8( 0x0A ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x0A ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } // and r16 to r16 -emitterT void eAND16RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void AND16RtoR( x86IntRegType to, x86IntRegType from ) { - write8(0x66); + write8(0x66); RexRB(0,to,from); - write8( 0x23 ); - ModRM( 3, to, from ); + write8( 0x23 ); + ModRM( 3, to, from ); } /* and imm16 to r16 */ -emitterT void eAND16ItoR( x86IntRegType to, u16 from ) +emitterT void AND16ItoR( x86IntRegType to, u16 from ) { - write8(0x66); + write8(0x66); RexB(0,to); if ( to == EAX ) { - write8( 0x25 ); - write16( from ); + write8( 0x25 ); + write16( from ); } else if ( from < 0x80 ) { - write8( 0x83 ); - ModRM( 3, 0x4, to ); - write8((u8)from ); + write8( 0x83 ); + ModRM( 3, 0x4, to ); + write8((u8)from ); } else { - write8( 0x81 ); - ModRM( 3, 0x4, to ); - write16( from ); + write8( 0x81 ); + ModRM( 3, 0x4, to ); + write16( from ); } } /* and imm16 to m16 */ -emitterT void eAND16ItoM( uptr to, u16 from ) +emitterT void AND16ItoM( uptr to, u16 from ) { - write8(0x66); + write8(0x66); if ( from < 0x80 ) { - write8( 0x83 ); - ModRM( 0, 0x4, DISP32 ); - write32( MEMADDR(to, 6) ); - write8((u8)from ); + write8( 0x83 ); + ModRM( 0, 0x4, DISP32 ); + write32( MEMADDR(to, 6) ); + write8((u8)from ); } else { - write8( 0x81 ); - ModRM( 0, 0x4, DISP32 ); - write32( MEMADDR(to, 6) ); - write16( from ); + write8( 0x81 ); + ModRM( 0, 0x4, DISP32 ); + write32( MEMADDR(to, 6) ); + write16( from ); } } /* and r16 to m16 */ -emitterT void eAND16RtoM( uptr to, x86IntRegType from ) +emitterT void AND16RtoM( uptr to, x86IntRegType from ) { - write8( 0x66 ); + write8( 0x66 ); RexR(0,from); - write8( 0x21 ); - ModRM( 0, from, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x21 ); + ModRM( 0, from, DISP32 ); + write32( MEMADDR(to, 4) ); } /* and m16 to r16 */ -emitterT void eAND16MtoR( x86IntRegType to, uptr from ) +emitterT void AND16MtoR( x86IntRegType to, uptr from ) { - write8( 0x66 ); + write8( 0x66 ); RexR(0,to); - write8( 0x23 ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4)); + write8( 0x23 ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4)); } /* and imm8 to r8 */ -emitterT void eAND8ItoR( x86IntRegType to, u8 from ) +emitterT void AND8ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( to == EAX ) { - write8( 0x24 ); + write8( 0x24 ); } else { - write8( 0x80 ); - ModRM( 3, 0x4, to ); + write8( 0x80 ); + ModRM( 3, 0x4, to ); } - write8( from ); + write8( from ); } /* and imm8 to m8 */ -emitterT void eAND8ItoM( uptr to, u8 from ) +emitterT void AND8ItoM( uptr to, u8 from ) { - write8( 0x80 ); - ModRM( 0, 0x4, DISP32 ); - write32( MEMADDR(to, 5) ); - write8( from ); + write8( 0x80 ); + ModRM( 0, 0x4, DISP32 ); + write32( MEMADDR(to, 5) ); + write8( from ); } // and r8 to r8 -emitterT void eAND8RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void AND8RtoR( x86IntRegType to, x86IntRegType from ) { RexRB(0,to,from); - write8( 0x22 ); - ModRM( 3, to, from ); + write8( 0x22 ); + ModRM( 3, to, from ); } /* and r8 to m8 */ -emitterT void eAND8RtoM( uptr to, x86IntRegType from ) +emitterT void AND8RtoM( uptr to, x86IntRegType from ) { RexR(0,from); - write8( 0x20 ); - ModRM( 0, from, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0x20 ); + ModRM( 0, from, DISP32 ); + write32( MEMADDR(to, 4) ); } /* and m8 to r8 */ -emitterT void eAND8MtoR( x86IntRegType to, uptr from ) +emitterT void AND8MtoR( x86IntRegType to, uptr from ) { RexR(0,to); - write8( 0x22 ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4)); + write8( 0x22 ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4)); } /* not r32 */ -emitterT void eNOT32R( x86IntRegType from ) +emitterT void NOT32R( x86IntRegType from ) { RexB(0,from); - write8( 0xF7 ); - ModRM( 3, 2, from ); + write8( 0xF7 ); + ModRM( 3, 2, from ); } // not m32 -emitterT void eNOT32M( u32 from ) +emitterT void NOT32M( u32 from ) { - write8( 0xF7 ); - ModRM( 0, 2, DISP32 ); - write32( MEMADDR(from, 4)); + write8( 0xF7 ); + ModRM( 0, 2, DISP32 ); + write32( MEMADDR(from, 4)); } /* neg r32 */ -emitterT void eNEG32R( x86IntRegType from ) +emitterT void NEG32R( x86IntRegType from ) { RexB(0,from); - write8( 0xF7 ); - ModRM( 3, 3, from ); + write8( 0xF7 ); + ModRM( 3, 3, from ); } -emitterT void eNEG32M( u32 from ) +emitterT void NEG32M( u32 from ) { - write8( 0xF7 ); - ModRM( 0, 3, DISP32 ); - write32( MEMADDR(from, 4)); + write8( 0xF7 ); + ModRM( 0, 3, DISP32 ); + write32( MEMADDR(from, 4)); } /* neg r16 */ -emitterT void eNEG16R( x86IntRegType from ) +emitterT void NEG16R( x86IntRegType from ) { - write8( 0x66 ); + write8( 0x66 ); RexB(0,from); - write8( 0xF7 ); - ModRM( 3, 3, from ); + write8( 0xF7 ); + ModRM( 3, 3, from ); } //////////////////////////////////// @@ -1639,346 +1605,346 @@ emitterT void eNEG16R( x86IntRegType from ) //////////////////////////////////// emitterT u8* JMP( uptr to ) { - uptr jump = ( x86Ptr[0] - (u8*)to ) - 1; + uptr jump = ( x86Ptr - (u8*)to ) - 1; if ( jump > 0x7f ) { assert( to <= 0xffffffff ); - return (u8*)eJMP32( to ); + return (u8*)JMP32( to ); } else { - return (u8*)eJMP8( to ); + return (u8*)JMP8( to ); } } /* jmp rel8 */ -emitterT u8* eJMP8( u8 to ) +emitterT u8* JMP8( u8 to ) { - write8( 0xEB ); - write8( to ); - return x86Ptr[I] - 1; + write8( 0xEB ); + write8( to ); + return x86Ptr - 1; } /* jmp rel32 */ -emitterT u32* eJMP32( uptr to ) +emitterT u32* JMP32( uptr to ) { assert( (sptr)to <= 0x7fffffff && (sptr)to >= -0x7fffffff ); - write8( 0xE9 ); - write32( to ); - return (u32*)(x86Ptr[I] - 4 ); + write8( 0xE9 ); + write32( to ); + return (u32*)(x86Ptr - 4 ); } /* jmp r32/r64 */ -emitterT void eJMPR( x86IntRegType to ) +emitterT void JMPR( x86IntRegType to ) { RexB(0, to); - write8( 0xFF ); - ModRM( 3, 4, to ); + write8( 0xFF ); + ModRM( 3, 4, to ); } // jmp m32 -emitterT void eJMP32M( uptr to ) +emitterT void JMP32M( uptr to ) { - write8( 0xFF ); - ModRM( 0, 4, DISP32 ); - write32( MEMADDR(to, 4)); + write8( 0xFF ); + ModRM( 0, 4, DISP32 ); + write32( MEMADDR(to, 4)); } /* jp rel8 */ -emitterT u8* eJP8( u8 to ) { - return J8Rel( 0x7A, to ); +emitterT u8* JP8( u8 to ) { + return J8Rel( 0x7A, to ); } /* jnp rel8 */ -emitterT u8* eJNP8( u8 to ) { - return J8Rel( 0x7B, to ); +emitterT u8* JNP8( u8 to ) { + return J8Rel( 0x7B, to ); } /* je rel8 */ -emitterT u8* eJE8( u8 to ) { - return J8Rel( 0x74, to ); +emitterT u8* JE8( u8 to ) { + return J8Rel( 0x74, to ); } /* jz rel8 */ -emitterT u8* eJZ8( u8 to ) +emitterT u8* JZ8( u8 to ) { - return J8Rel( 0x74, to ); + return J8Rel( 0x74, to ); } /* js rel8 */ -emitterT u8* eJS8( u8 to ) +emitterT u8* JS8( u8 to ) { - return J8Rel( 0x78, to ); + return J8Rel( 0x78, to ); } /* jns rel8 */ -emitterT u8* eJNS8( u8 to ) +emitterT u8* JNS8( u8 to ) { - return J8Rel( 0x79, to ); + return J8Rel( 0x79, to ); } /* jg rel8 */ -emitterT u8* eJG8( u8 to ) +emitterT u8* JG8( u8 to ) { - return J8Rel( 0x7F, to ); + return J8Rel( 0x7F, to ); } /* jge rel8 */ -emitterT u8* eJGE8( u8 to ) +emitterT u8* JGE8( u8 to ) { - return J8Rel( 0x7D, to ); + return J8Rel( 0x7D, to ); } /* jl rel8 */ -emitterT u8* eJL8( u8 to ) +emitterT u8* JL8( u8 to ) { - return J8Rel( 0x7C, to ); + return J8Rel( 0x7C, to ); } /* ja rel8 */ -emitterT u8* eJA8( u8 to ) +emitterT u8* JA8( u8 to ) { - return J8Rel( 0x77, to ); + return J8Rel( 0x77, to ); } -emitterT u8* eJAE8( u8 to ) +emitterT u8* JAE8( u8 to ) { - return J8Rel( 0x73, to ); + return J8Rel( 0x73, to ); } /* jb rel8 */ -emitterT u8* eJB8( u8 to ) +emitterT u8* JB8( u8 to ) { - return J8Rel( 0x72, to ); + return J8Rel( 0x72, to ); } /* jbe rel8 */ -emitterT u8* eJBE8( u8 to ) +emitterT u8* JBE8( u8 to ) { - return J8Rel( 0x76, to ); + return J8Rel( 0x76, to ); } /* jle rel8 */ -emitterT u8* eJLE8( u8 to ) +emitterT u8* JLE8( u8 to ) { - return J8Rel( 0x7E, to ); + return J8Rel( 0x7E, to ); } /* jne rel8 */ -emitterT u8* eJNE8( u8 to ) +emitterT u8* JNE8( u8 to ) { - return J8Rel( 0x75, to ); + return J8Rel( 0x75, to ); } /* jnz rel8 */ -emitterT u8* eJNZ8( u8 to ) +emitterT u8* JNZ8( u8 to ) { - return J8Rel( 0x75, to ); + return J8Rel( 0x75, to ); } /* jng rel8 */ -emitterT u8* eJNG8( u8 to ) +emitterT u8* JNG8( u8 to ) { - return J8Rel( 0x7E, to ); + return J8Rel( 0x7E, to ); } /* jnge rel8 */ -emitterT u8* eJNGE8( u8 to ) +emitterT u8* JNGE8( u8 to ) { - return J8Rel( 0x7C, to ); + return J8Rel( 0x7C, to ); } /* jnl rel8 */ -emitterT u8* eJNL8( u8 to ) +emitterT u8* JNL8( u8 to ) { - return J8Rel( 0x7D, to ); + return J8Rel( 0x7D, to ); } /* jnle rel8 */ -emitterT u8* eJNLE8( u8 to ) +emitterT u8* JNLE8( u8 to ) { - return J8Rel( 0x7F, to ); + return J8Rel( 0x7F, to ); } /* jo rel8 */ -emitterT u8* eJO8( u8 to ) +emitterT u8* JO8( u8 to ) { - return J8Rel( 0x70, to ); + return J8Rel( 0x70, to ); } /* jno rel8 */ -emitterT u8* eJNO8( u8 to ) +emitterT u8* JNO8( u8 to ) { - return J8Rel( 0x71, to ); + return J8Rel( 0x71, to ); } /* Untested and slower, use 32bit versions instead // ja rel16 emitterT u16* eJA16( u16 to ) { -return J16Rel( 0x87, to ); +return J16Rel( 0x87, to ); } // jb rel16 emitterT u16* eJB16( u16 to ) { -return J16Rel( 0x82, to ); +return J16Rel( 0x82, to ); } // je rel16 emitterT u16* eJE16( u16 to ) { -return J16Rel( 0x84, to ); +return J16Rel( 0x84, to ); } // jz rel16 emitterT u16* eJZ16( u16 to ) { -return J16Rel( 0x84, to ); +return J16Rel( 0x84, to ); } */ // jb rel32 -emitterT u32* eJB32( u32 to ) +emitterT u32* JB32( u32 to ) { - return J32Rel( 0x82, to ); + return J32Rel( 0x82, to ); } /* je rel32 */ -emitterT u32* eJE32( u32 to ) +emitterT u32* JE32( u32 to ) { - return J32Rel( 0x84, to ); + return J32Rel( 0x84, to ); } /* jz rel32 */ -emitterT u32* eJZ32( u32 to ) +emitterT u32* JZ32( u32 to ) { - return J32Rel( 0x84, to ); + return J32Rel( 0x84, to ); } /* js rel32 */ -emitterT u32* eJS32( u32 to ) +emitterT u32* JS32( u32 to ) { - return J32Rel( 0x88, to ); + return J32Rel( 0x88, to ); } /* jns rel32 */ -emitterT u32* eJNS32( u32 to ) +emitterT u32* JNS32( u32 to ) { - return J32Rel( 0x89, to ); + return J32Rel( 0x89, to ); } /* jg rel32 */ -emitterT u32* eJG32( u32 to ) +emitterT u32* JG32( u32 to ) { - return J32Rel( 0x8F, to ); + return J32Rel( 0x8F, to ); } /* jge rel32 */ -emitterT u32* eJGE32( u32 to ) +emitterT u32* JGE32( u32 to ) { - return J32Rel( 0x8D, to ); + return J32Rel( 0x8D, to ); } /* jl rel32 */ -emitterT u32* eJL32( u32 to ) +emitterT u32* JL32( u32 to ) { - return J32Rel( 0x8C, to ); + return J32Rel( 0x8C, to ); } /* jle rel32 */ -emitterT u32* eJLE32( u32 to ) +emitterT u32* JLE32( u32 to ) { - return J32Rel( 0x8E, to ); + return J32Rel( 0x8E, to ); } /* ja rel32 */ -emitterT u32* eJA32( u32 to ) +emitterT u32* JA32( u32 to ) { - return J32Rel( 0x87, to ); + return J32Rel( 0x87, to ); } /* jae rel32 */ -emitterT u32* eJAE32( u32 to ) +emitterT u32* JAE32( u32 to ) { - return J32Rel( 0x83, to ); + return J32Rel( 0x83, to ); } /* jne rel32 */ -emitterT u32* eJNE32( u32 to ) +emitterT u32* JNE32( u32 to ) { - return J32Rel( 0x85, to ); + return J32Rel( 0x85, to ); } /* jnz rel32 */ -emitterT u32* eJNZ32( u32 to ) +emitterT u32* JNZ32( u32 to ) { - return J32Rel( 0x85, to ); + return J32Rel( 0x85, to ); } /* jng rel32 */ -emitterT u32* eJNG32( u32 to ) +emitterT u32* JNG32( u32 to ) { - return J32Rel( 0x8E, to ); + return J32Rel( 0x8E, to ); } /* jnge rel32 */ -emitterT u32* eJNGE32( u32 to ) +emitterT u32* JNGE32( u32 to ) { - return J32Rel( 0x8C, to ); + return J32Rel( 0x8C, to ); } /* jnl rel32 */ -emitterT u32* eJNL32( u32 to ) +emitterT u32* JNL32( u32 to ) { - return J32Rel( 0x8D, to ); + return J32Rel( 0x8D, to ); } /* jnle rel32 */ -emitterT u32* eJNLE32( u32 to ) +emitterT u32* JNLE32( u32 to ) { - return J32Rel( 0x8F, to ); + return J32Rel( 0x8F, to ); } /* jo rel32 */ -emitterT u32* eJO32( u32 to ) +emitterT u32* JO32( u32 to ) { - return J32Rel( 0x80, to ); + return J32Rel( 0x80, to ); } /* jno rel32 */ -emitterT u32* eJNO32( u32 to ) +emitterT u32* JNO32( u32 to ) { - return J32Rel( 0x81, to ); + return J32Rel( 0x81, to ); } /* call func */ -emitterT void eCALLFunc( uptr func ) +emitterT void CALLFunc( uptr func ) { - func -= ( (uptr)x86Ptr[0] + 5 ); + func -= ( (uptr)x86Ptr + 5 ); assert( (sptr)func <= 0x7fffffff && (sptr)func >= -0x7fffffff ); - eCALL32(func); + CALL32(func); } /* call rel32 */ -emitterT void eCALL32( u32 to ) +emitterT void CALL32( u32 to ) { - write8( 0xE8 ); - write32( to ); + write8( 0xE8 ); + write32( to ); } /* call r32 */ -emitterT void eCALL32R( x86IntRegType to ) +emitterT void CALL32R( x86IntRegType to ) { - write8( 0xFF ); - ModRM( 3, 2, to ); + write8( 0xFF ); + ModRM( 3, 2, to ); } /* call m32 */ -emitterT void eCALL32M( u32 to ) +emitterT void CALL32M( u32 to ) { - write8( 0xFF ); - ModRM( 0, 2, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0xFF ); + ModRM( 0, 2, DISP32 ); + write32( MEMADDR(to, 4) ); } //////////////////////////////////// @@ -1986,410 +1952,406 @@ emitterT void eCALL32M( u32 to ) //////////////////////////////////// // cmp imm8 to [r32] (byte ptr) -emitterT void eCMP8I8toRm( x86IntRegType to, s8 from, s8 off=0 ) +emitterT void CMP8I8toRm( x86IntRegType to, s8 from, s8 off=0 ) { RexB(0,to); - write8( 0x80 ); - ModRM( (off != 0), 7, to ); - if( off != 0 ) write8(off); - write8(from); + write8( 0x80 ); + ModRM( (off != 0), 7, to ); + if( off != 0 ) write8(off); + write8(from); } // cmp imm8 to [r32] -emitterT void eCMP32I8toRm( x86IntRegType to, u8 from, s8 off=0 ) +emitterT void CMP32I8toRm( x86IntRegType to, u8 from, s8 off=0 ) { RexB(0,to); - write8( 0x83 ); - ModRM( (off!=0), 7, to ); - if( off != 0 ) write8(off); - write8(from); + write8( 0x83 ); + ModRM( (off!=0), 7, to ); + if( off != 0 ) write8(off); + write8(from); } // cmp imm32 to [r32] -emitterT void eCMP32ItoRm( x86IntRegType to, u32 from, s8 off=0 ) +emitterT void CMP32ItoRm( x86IntRegType to, u32 from, s8 off=0 ) { // fixme : This should use the imm8 form if 'from' is between 127 and -128. RexB(0,to); - write8( 0x81 ); - ModRM( (off != 0), 7, to ); - if( off != 0 ) write8(off); - write32(from); + write8( 0x81 ); + ModRM( (off != 0), 7, to ); + if( off != 0 ) write8(off); + write32(from); } // cmp imm8 to [mem] (dword ptr) -emitterT void eCMP32I8toM( uptr to, u8 from ) +emitterT void CMP32I8toM( uptr to, u8 from ) { - write8( 0x83 ); - ModRM( 0, 7, DISP32 ); - write32( MEMADDR(to, 5) ); - write8( from ); + write8( 0x83 ); + ModRM( 0, 7, DISP32 ); + write32( MEMADDR(to, 5) ); + write8( from ); } /* cmp imm16 to r16 */ -emitterT void eCMP16ItoR( x86IntRegType to, u16 from ) +emitterT void CMP16ItoR( x86IntRegType to, u16 from ) { - write8( 0x66 ); + write8( 0x66 ); RexB(0,to); if ( to == EAX ) { - write8( 0x3D ); + write8( 0x3D ); } else { - write8( 0x81 ); - ModRM( 3, 7, to ); + write8( 0x81 ); + ModRM( 3, 7, to ); } - write16( from ); + write16( from ); } /* cmp imm16 to m16 */ -emitterT void eCMP16ItoM( uptr to, u16 from ) +emitterT void CMP16ItoM( uptr to, u16 from ) { - write8( 0x66 ); - write8( 0x81 ); - ModRM( 0, 7, DISP32 ); - write32( MEMADDR(to, 6) ); - write16( from ); + write8( 0x66 ); + write8( 0x81 ); + ModRM( 0, 7, DISP32 ); + write32( MEMADDR(to, 6) ); + write16( from ); } /* cmp r16 to r16 */ -emitterT void eCMP16RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void CMP16RtoR( x86IntRegType to, x86IntRegType from ) { - write8( 0x66 ); + write8( 0x66 ); RexRB(0,from,to); - write8( 0x39 ); - ModRM( 3, from, to ); + write8( 0x39 ); + ModRM( 3, from, to ); } /* cmp m16 to r16 */ -emitterT void eCMP16MtoR( x86IntRegType to, uptr from ) +emitterT void CMP16MtoR( x86IntRegType to, uptr from ) { - write8( 0x66 ); + write8( 0x66 ); RexR(0,to); - write8( 0x3B ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x3B ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } // cmp imm8 to r8 -emitterT void eCMP8ItoR( x86IntRegType to, u8 from ) +emitterT void CMP8ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( to == EAX ) { - write8( 0x3C ); + write8( 0x3C ); } else { - write8( 0x80 ); - ModRM( 3, 7, to ); + write8( 0x80 ); + ModRM( 3, 7, to ); } - write8( from ); + write8( from ); } // cmp m8 to r8 -emitterT void eCMP8MtoR( x86IntRegType to, uptr from ) +emitterT void CMP8MtoR( x86IntRegType to, uptr from ) { RexR(0,to); - write8( 0x3A ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0x3A ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* test imm32 to r32 */ -emitterT void eTEST32ItoR( x86IntRegType to, u32 from ) +emitterT void TEST32ItoR( x86IntRegType to, u32 from ) { RexB(0,to); if ( to == EAX ) { - write8( 0xA9 ); + write8( 0xA9 ); } else { - write8( 0xF7 ); - ModRM( 3, 0, to ); + write8( 0xF7 ); + ModRM( 3, 0, to ); } - write32( from ); + write32( from ); } -emitterT void eTEST32ItoM( uptr to, u32 from ) +emitterT void TEST32ItoM( uptr to, u32 from ) { - write8( 0xF7 ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 8) ); - write32( from ); + write8( 0xF7 ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 8) ); + write32( from ); } /* test r32 to r32 */ -emitterT void eTEST32RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void TEST32RtoR( x86IntRegType to, x86IntRegType from ) { RexRB(0,from,to); - write8( 0x85 ); - ModRM( 3, from, to ); + write8( 0x85 ); + ModRM( 3, from, to ); } // test imm32 to [r32] -emitterT void eTEST32ItoRm( x86IntRegType to, u32 from ) +emitterT void TEST32ItoRm( x86IntRegType to, u32 from ) { RexB(0,to); - write8( 0xF7 ); - ModRM( 0, 0, to ); - write32(from); + write8( 0xF7 ); + ModRM( 0, 0, to ); + write32(from); } // test imm16 to r16 -emitterT void eTEST16ItoR( x86IntRegType to, u16 from ) +emitterT void TEST16ItoR( x86IntRegType to, u16 from ) { - write8(0x66); + write8(0x66); RexB(0,to); if ( to == EAX ) { - write8( 0xA9 ); + write8( 0xA9 ); } else { - write8( 0xF7 ); - ModRM( 3, 0, to ); + write8( 0xF7 ); + ModRM( 3, 0, to ); } - write16( from ); + write16( from ); } // test r16 to r16 -emitterT void eTEST16RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void TEST16RtoR( x86IntRegType to, x86IntRegType from ) { - write8(0x66); + write8(0x66); RexRB(0,from,to); - write8( 0x85 ); - ModRM( 3, from, to ); + write8( 0x85 ); + ModRM( 3, from, to ); } // test r8 to r8 -emitterT void eTEST8RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void TEST8RtoR( x86IntRegType to, x86IntRegType from ) { RexRB(0, from, to); - write8( 0x84 ); - ModRM( 3, from, to ); + write8( 0x84 ); + ModRM( 3, from, to ); } // test imm8 to r8 -emitterT void eTEST8ItoR( x86IntRegType to, u8 from ) +emitterT void TEST8ItoR( x86IntRegType to, u8 from ) { RexB(0,to); if ( to == EAX ) { - write8( 0xA8 ); + write8( 0xA8 ); } else { - write8( 0xF6 ); - ModRM( 3, 0, to ); + write8( 0xF6 ); + ModRM( 3, 0, to ); } - write8( from ); + write8( from ); } // test imm8 to r8 -emitterT void eTEST8ItoM( uptr to, u8 from ) +emitterT void TEST8ItoM( uptr to, u8 from ) { - write8( 0xF6 ); - ModRM( 0, 0, DISP32 ); - write32( MEMADDR(to, 5) ); - write8( from ); + write8( 0xF6 ); + ModRM( 0, 0, DISP32 ); + write32( MEMADDR(to, 5) ); + write8( from ); } /* sets r8 */ -emitterT void eSETS8R( x86IntRegType to ) +emitterT void SETS8R( x86IntRegType to ) { - SET8R( 0x98, to ); + SET8R( 0x98, to ); } /* setl r8 */ -emitterT void eSETL8R( x86IntRegType to ) +emitterT void SETL8R( x86IntRegType to ) { - SET8R( 0x9C, to ); + SET8R( 0x9C, to ); } // setge r8 -emitterT void eSETGE8R( x86IntRegType to ) { SET8R(0x9d, to); } +emitterT void SETGE8R( x86IntRegType to ) { SET8R(0x9d, to); } // setg r8 -emitterT void eSETG8R( x86IntRegType to ) { SET8R(0x9f, to); } +emitterT void SETG8R( x86IntRegType to ) { SET8R(0x9f, to); } // seta r8 -emitterT void eSETA8R( x86IntRegType to ) { SET8R(0x97, to); } +emitterT void SETA8R( x86IntRegType to ) { SET8R(0x97, to); } // setae r8 -emitterT void eSETAE8R( x86IntRegType to ) { SET8R(0x99, to); } +emitterT void SETAE8R( x86IntRegType to ) { SET8R(0x99, to); } /* setb r8 */ -emitterT void eSETB8R( x86IntRegType to ) { SET8R( 0x92, to ); } +emitterT void SETB8R( x86IntRegType to ) { SET8R( 0x92, to ); } /* setb r8 */ -emitterT void eSETNZ8R( x86IntRegType to ) { SET8R( 0x95, to ); } +emitterT void SETNZ8R( x86IntRegType to ) { SET8R( 0x95, to ); } // setz r8 -emitterT void eSETZ8R( x86IntRegType to ) { SET8R(0x94, to); } +emitterT void SETZ8R( x86IntRegType to ) { SET8R(0x94, to); } // sete r8 -emitterT void eSETE8R( x86IntRegType to ) { SET8R(0x94, to); } +emitterT void SETE8R( x86IntRegType to ) { SET8R(0x94, to); } /* push imm32 */ -emitterT void ePUSH32I( u32 from ) +emitterT void PUSH32I( u32 from ) {; -write8( 0x68 ); -write32( from ); +write8( 0x68 ); +write32( from ); } /* push r32 */ -emitterT void ePUSH32R( x86IntRegType from ) { write8( 0x50 | from ); } +emitterT void PUSH32R( x86IntRegType from ) { write8( 0x50 | from ); } /* push m32 */ -emitterT void ePUSH32M( u32 from ) +emitterT void PUSH32M( u32 from ) { - write8( 0xFF ); - ModRM( 0, 6, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xFF ); + ModRM( 0, 6, DISP32 ); + write32( MEMADDR(from, 4) ); } /* pop r32 */ -emitterT void ePOP32R( x86IntRegType from ) { write8( 0x58 | from ); } +emitterT void POP32R( x86IntRegType from ) { write8( 0x58 | from ); } /* pushad */ -emitterT void ePUSHA32( void ) { write8( 0x60 ); } +emitterT void PUSHA32( void ) { write8( 0x60 ); } /* popad */ -emitterT void ePOPA32( void ) { write8( 0x61 ); } - -emitterT void ePUSHR(x86IntRegType from) { ePUSH32R(from); } -emitterT void ePOPR(x86IntRegType from) { ePOP32R(from); } - +emitterT void POPA32( void ) { write8( 0x61 ); } /* pushfd */ -emitterT void ePUSHFD( void ) { write8( 0x9C ); } +emitterT void PUSHFD( void ) { write8( 0x9C ); } /* popfd */ -emitterT void ePOPFD( void ) { write8( 0x9D ); } +emitterT void POPFD( void ) { write8( 0x9D ); } -emitterT void eRET( void ) { /*write8( 0xf3 ); <-- K8 opt?*/ write8( 0xC3 ); } +emitterT void RET( void ) { /*write8( 0xf3 ); <-- K8 opt?*/ write8( 0xC3 ); } -emitterT void eCBW( void ) { write16( 0x9866 ); } -emitterT void eCWD( void ) { write8( 0x98 ); } -emitterT void eCDQ( void ) { write8( 0x99 ); } -emitterT void eCWDE() { write8(0x98); } +emitterT void CBW( void ) { write16( 0x9866 ); } +emitterT void CWD( void ) { write8( 0x98 ); } +emitterT void CDQ( void ) { write8( 0x99 ); } +emitterT void CWDE() { write8(0x98); } -emitterT void eLAHF() { write8(0x9f); } -emitterT void eSAHF() { write8(0x9e); } +emitterT void LAHF() { write8(0x9f); } +emitterT void SAHF() { write8(0x9e); } -emitterT void eBT32ItoR( x86IntRegType to, u8 from ) +emitterT void BT32ItoR( x86IntRegType to, u8 from ) { - write16( 0xBA0F ); - ModRM(3, 4, to); - write8( from ); + write16( 0xBA0F ); + ModRM(3, 4, to); + write8( from ); } -emitterT void eBTR32ItoR( x86IntRegType to, u8 from ) +emitterT void BTR32ItoR( x86IntRegType to, u8 from ) { - write16( 0xBA0F ); - ModRM(3, 6, to); - write8( from ); + write16( 0xBA0F ); + ModRM(3, 6, to); + write8( from ); } -emitterT void eBSRRtoR(x86IntRegType to, x86IntRegType from) +emitterT void BSRRtoR(x86IntRegType to, x86IntRegType from) { - write16( 0xBD0F ); - ModRM( 3, from, to ); + write16( 0xBD0F ); + ModRM( 3, from, to ); } -emitterT void eBSWAP32R( x86IntRegType to ) +emitterT void BSWAP32R( x86IntRegType to ) { - write8( 0x0F ); - write8( 0xC8 + to ); + write8( 0x0F ); + write8( 0xC8 + to ); } -// to = from + offset -emitterT void eLEA16RtoR(x86IntRegType to, x86IntRegType from, u16 offset) -{ - write8(0x66); - eLEA32RtoR(to, from, offset); -} - -emitterT void eLEA32RtoR(x86IntRegType to, x86IntRegType from, s32 offset) +emitterT void LEA32RtoR(x86IntRegType to, x86IntRegType from, s32 offset) { RexRB(0,to,from); - write8(0x8d); + write8(0x8d); if( (from&7) == ESP ) { if( offset == 0 ) { - ModRM(1, to, from); - write8(0x24); + ModRM(1, to, from); + write8(0x24); } else if( offset <= 127 && offset >= -128 ) { - ModRM(1, to, from); - write8(0x24); - write8(offset); + ModRM(1, to, from); + write8(0x24); + write8(offset); } else { - ModRM(2, to, from); - write8(0x24); - write32(offset); + ModRM(2, to, from); + write8(0x24); + write32(offset); } } else { if( offset == 0 && from != EBP && from!=ESP ) { - ModRM(0, to, from); + ModRM(0, to, from); } else if( offset <= 127 && offset >= -128 ) { - ModRM(1, to, from); - write8(offset); + ModRM(1, to, from); + write8(offset); } else { - ModRM(2, to, from); - write32(offset); + ModRM(2, to, from); + write32(offset); } } } +// to = from + offset +emitterT void LEA16RtoR(x86IntRegType to, x86IntRegType from, u16 offset) +{ + write8(0x66); + LEA32RtoR(to, from, offset); +} + // to = from0 + from1 -emitterT void eLEA16RRtoR(x86IntRegType to, x86IntRegType from0, x86IntRegType from1) +emitterT void LEA16RRtoR(x86IntRegType to, x86IntRegType from0, x86IntRegType from1) { - write8(0x66); - eLEA32RRtoR(to, from0, from1); + write8(0x66); + LEA32RRtoR(to, from0, from1); } -emitterT void eLEA32RRtoR(x86IntRegType to, x86IntRegType from0, x86IntRegType from1) +emitterT void LEA32RRtoR(x86IntRegType to, x86IntRegType from0, x86IntRegType from1) { RexRXB(0, to, from0, from1); - write8(0x8d); + write8(0x8d); if( (from1&7) == EBP ) { - ModRM(1, to, 4); - ModRM(0, from0, from1); - write8(0); + ModRM(1, to, 4); + ModRM(0, from0, from1); + write8(0); } else { - ModRM(0, to, 4); - ModRM(0, from0, from1); + ModRM(0, to, 4); + ModRM(0, from0, from1); } } // to = from << scale (max is 3) -emitterT void eLEA16RStoR(x86IntRegType to, x86IntRegType from, u32 scale) +emitterT void LEA16RStoR(x86IntRegType to, x86IntRegType from, u32 scale) { - write8(0x66); - eLEA32RStoR(to, from, scale); + write8(0x66); + LEA32RStoR(to, from, scale); } // Don't inline recursive functions -emitterT void eLEA32RStoR(x86IntRegType to, x86IntRegType from, u32 scale) +emitterT void LEA32RStoR(x86IntRegType to, x86IntRegType from, u32 scale) { if( to == from ) { - eSHL32ItoR(to, scale); + SHL32ItoR(to, scale); return; } if( from != ESP ) { RexRXB(0,to,from,0); - write8(0x8d); - ModRM(0, to, 4); - ModRM(scale, from, 5); - write32(0); + write8(0x8d); + ModRM(0, to, 4); + ModRM(scale, from, 5); + write32(0); } else { assert( to != ESP ); - eMOV32RtoR(to, from); - eLEA32RStoR(to, to, scale); + MOV32RtoR(to, from); + LEA32RStoR(to, to, scale); } } diff --git a/pcsx2/x86/ix86/ix86_3dnow.inl b/pcsx2/x86/ix86/ix86_3dnow.inl index 5fdcce2347..e7a667f409 100644 --- a/pcsx2/x86/ix86/ix86_3dnow.inl +++ b/pcsx2/x86/ix86/ix86_3dnow.inl @@ -23,179 +23,179 @@ //------------------------------------------------------------------ /* femms */ -emitterT void eFEMMS( void ) +emitterT void FEMMS( void ) { - write16( 0x0E0F ); + write16( 0x0E0F ); } -emitterT void ePFCMPEQMtoR( x86IntRegType to, uptr from ) +emitterT void PFCMPEQMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0xB0 ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0xB0 ); } -emitterT void ePFCMPGTMtoR( x86IntRegType to, uptr from ) +emitterT void PFCMPGTMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0xA0 ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0xA0 ); } -emitterT void ePFCMPGEMtoR( x86IntRegType to, uptr from ) +emitterT void PFCMPGEMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0x90 ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0x90 ); } -emitterT void ePFADDMtoR( x86IntRegType to, uptr from ) +emitterT void PFADDMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0x9E ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0x9E ); } -emitterT void ePFADDRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFADDRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0x9E ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0x9E ); } -emitterT void ePFSUBMtoR( x86IntRegType to, uptr from ) +emitterT void PFSUBMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0x9A ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0x9A ); } -emitterT void ePFSUBRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFSUBRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0x9A ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0x9A ); } -emitterT void ePFMULMtoR( x86IntRegType to, uptr from ) +emitterT void PFMULMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0xB4 ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0xB4 ); } -emitterT void ePFMULRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFMULRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0xB4 ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0xB4 ); } -emitterT void ePFRCPMtoR( x86IntRegType to, uptr from ) +emitterT void PFRCPMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0x96 ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0x96 ); } -emitterT void ePFRCPRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFRCPRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0x96 ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0x96 ); } -emitterT void ePFRCPIT1RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFRCPIT1RtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0xA6 ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0xA6 ); } -emitterT void ePFRCPIT2RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFRCPIT2RtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0xB6 ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0xB6 ); } -emitterT void ePFRSQRTRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFRSQRTRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0x97 ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0x97 ); } -emitterT void ePFRSQIT1RtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFRSQIT1RtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0xA7 ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0xA7 ); } -emitterT void ePF2IDMtoR( x86IntRegType to, uptr from ) +emitterT void PF2IDMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0x1D ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0x1D ); } -emitterT void ePF2IDRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PF2IDRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0x1D ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0x1D ); } -emitterT void ePI2FDMtoR( x86IntRegType to, uptr from ) +emitterT void PI2FDMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0x0D ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0x0D ); } -emitterT void ePI2FDRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PI2FDRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0x0D ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0x0D ); } -emitterT void ePFMAXMtoR( x86IntRegType to, uptr from ) +emitterT void PFMAXMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0xA4 ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0xA4 ); } -emitterT void ePFMAXRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFMAXRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0xA4 ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0xA4 ); } -emitterT void ePFMINMtoR( x86IntRegType to, uptr from ) +emitterT void PFMINMtoR( x86IntRegType to, uptr from ) { - write16( 0x0F0F ); - ModRM( 0, to, DISP32 ); - write32( from ); - write8( 0x94 ); + write16( 0x0F0F ); + ModRM( 0, to, DISP32 ); + write32( from ); + write8( 0x94 ); } -emitterT void ePFMINRtoR( x86IntRegType to, x86IntRegType from ) +emitterT void PFMINRtoR( x86IntRegType to, x86IntRegType from ) { - write16( 0x0F0F ); - ModRM( 3, to, from ); - write8( 0x94 ); + write16( 0x0F0F ); + ModRM( 3, to, from ); + write8( 0x94 ); } diff --git a/pcsx2/x86/ix86/ix86_fpu.inl b/pcsx2/x86/ix86/ix86_fpu.inl index ae20b6c4ec..7ed607f30c 100644 --- a/pcsx2/x86/ix86/ix86_fpu.inl +++ b/pcsx2/x86/ix86/ix86_fpu.inl @@ -24,253 +24,253 @@ //------------------------------------------------------------------ /* fild m32 to fpu reg stack */ -emitterT void eFILD32( u32 from ) +emitterT void FILD32( u32 from ) { - write8( 0xDB ); - ModRM( 0, 0x0, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xDB ); + ModRM( 0, 0x0, DISP32 ); + write32( MEMADDR(from, 4) ); } /* fistp m32 from fpu reg stack */ -emitterT void eFISTP32( u32 from ) +emitterT void FISTP32( u32 from ) { - write8( 0xDB ); - ModRM( 0, 0x3, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xDB ); + ModRM( 0, 0x3, DISP32 ); + write32( MEMADDR(from, 4) ); } /* fld m32 to fpu reg stack */ -emitterT void eFLD32( u32 from ) +emitterT void FLD32( u32 from ) { - write8( 0xD9 ); - ModRM( 0, 0x0, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xD9 ); + ModRM( 0, 0x0, DISP32 ); + write32( MEMADDR(from, 4) ); } // fld st(i) -emitterT void eFLD(int st) { write16(0xc0d9+(st<<8)); } -emitterT void eFLD1() { write16(0xe8d9); } -emitterT void eFLDL2E() { write16(0xead9); } +emitterT void FLD(int st) { write16(0xc0d9+(st<<8)); } +emitterT void FLD1() { write16(0xe8d9); } +emitterT void FLDL2E() { write16(0xead9); } /* fst m32 from fpu reg stack */ -emitterT void eFST32( u32 to ) +emitterT void FST32( u32 to ) { - write8( 0xD9 ); - ModRM( 0, 0x2, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0xD9 ); + ModRM( 0, 0x2, DISP32 ); + write32( MEMADDR(to, 4) ); } /* fstp m32 from fpu reg stack */ -emitterT void eFSTP32( u32 to ) +emitterT void FSTP32( u32 to ) { - write8( 0xD9 ); - ModRM( 0, 0x3, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0xD9 ); + ModRM( 0, 0x3, DISP32 ); + write32( MEMADDR(to, 4) ); } // fstp st(i) -emitterT void eFSTP(int st) { write16(0xd8dd+(st<<8)); } +emitterT void FSTP(int st) { write16(0xd8dd+(st<<8)); } /* fldcw fpu control word from m16 */ -emitterT void eFLDCW( u32 from ) +emitterT void FLDCW( u32 from ) { - write8( 0xD9 ); - ModRM( 0, 0x5, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xD9 ); + ModRM( 0, 0x5, DISP32 ); + write32( MEMADDR(from, 4) ); } /* fnstcw fpu control word to m16 */ -emitterT void eFNSTCW( u32 to ) +emitterT void FNSTCW( u32 to ) { - write8( 0xD9 ); - ModRM( 0, 0x7, DISP32 ); - write32( MEMADDR(to, 4) ); + write8( 0xD9 ); + ModRM( 0, 0x7, DISP32 ); + write32( MEMADDR(to, 4) ); } -emitterT void eFNSTSWtoAX() { write16(0xE0DF); } -emitterT void eFXAM() { write16(0xe5d9); } -emitterT void eFDECSTP() { write16(0xf6d9); } -emitterT void eFRNDINT() { write16(0xfcd9); } -emitterT void eFXCH(int st) { write16(0xc8d9+(st<<8)); } -emitterT void eF2XM1() { write16(0xf0d9); } -emitterT void eFSCALE() { write16(0xfdd9); } -emitterT void eFPATAN(void) { write16(0xf3d9); } -emitterT void eFSIN(void) { write16(0xfed9); } +emitterT void FNSTSWtoAX() { write16(0xE0DF); } +emitterT void FXAM() { write16(0xe5d9); } +emitterT void FDECSTP() { write16(0xf6d9); } +emitterT void FRNDINT() { write16(0xfcd9); } +emitterT void FXCH(int st) { write16(0xc8d9+(st<<8)); } +emitterT void F2XM1() { write16(0xf0d9); } +emitterT void FSCALE() { write16(0xfdd9); } +emitterT void FPATAN(void) { write16(0xf3d9); } +emitterT void FSIN(void) { write16(0xfed9); } /* fadd ST(src) to fpu reg stack ST(0) */ -emitterT void eFADD32Rto0( x86IntRegType src ) +emitterT void FADD32Rto0( x86IntRegType src ) { - write8( 0xD8 ); - write8( 0xC0 + src ); + write8( 0xD8 ); + write8( 0xC0 + src ); } /* fadd ST(0) to fpu reg stack ST(src) */ -emitterT void eFADD320toR( x86IntRegType src ) +emitterT void FADD320toR( x86IntRegType src ) { - write8( 0xDC ); - write8( 0xC0 + src ); + write8( 0xDC ); + write8( 0xC0 + src ); } /* fsub ST(src) to fpu reg stack ST(0) */ -emitterT void eFSUB32Rto0( x86IntRegType src ) +emitterT void FSUB32Rto0( x86IntRegType src ) { - write8( 0xD8 ); - write8( 0xE0 + src ); + write8( 0xD8 ); + write8( 0xE0 + src ); } /* fsub ST(0) to fpu reg stack ST(src) */ -emitterT void eFSUB320toR( x86IntRegType src ) +emitterT void FSUB320toR( x86IntRegType src ) { - write8( 0xDC ); - write8( 0xE8 + src ); + write8( 0xDC ); + write8( 0xE8 + src ); } /* fsubp -> substract ST(0) from ST(1), store in ST(1) and POP stack */ -emitterT void eFSUBP( void ) +emitterT void FSUBP( void ) { - write8( 0xDE ); - write8( 0xE9 ); + write8( 0xDE ); + write8( 0xE9 ); } /* fmul ST(src) to fpu reg stack ST(0) */ -emitterT void eFMUL32Rto0( x86IntRegType src ) +emitterT void FMUL32Rto0( x86IntRegType src ) { - write8( 0xD8 ); - write8( 0xC8 + src ); + write8( 0xD8 ); + write8( 0xC8 + src ); } /* fmul ST(0) to fpu reg stack ST(src) */ -emitterT void eFMUL320toR( x86IntRegType src ) +emitterT void FMUL320toR( x86IntRegType src ) { - write8( 0xDC ); - write8( 0xC8 + src ); + write8( 0xDC ); + write8( 0xC8 + src ); } /* fdiv ST(src) to fpu reg stack ST(0) */ -emitterT void eFDIV32Rto0( x86IntRegType src ) +emitterT void FDIV32Rto0( x86IntRegType src ) { - write8( 0xD8 ); - write8( 0xF0 + src ); + write8( 0xD8 ); + write8( 0xF0 + src ); } /* fdiv ST(0) to fpu reg stack ST(src) */ -emitterT void eFDIV320toR( x86IntRegType src ) +emitterT void FDIV320toR( x86IntRegType src ) { - write8( 0xDC ); - write8( 0xF8 + src ); + write8( 0xDC ); + write8( 0xF8 + src ); } -emitterT void eFDIV320toRP( x86IntRegType src ) +emitterT void FDIV320toRP( x86IntRegType src ) { - write8( 0xDE ); - write8( 0xF8 + src ); + write8( 0xDE ); + write8( 0xF8 + src ); } /* fadd m32 to fpu reg stack */ -emitterT void eFADD32( u32 from ) +emitterT void FADD32( u32 from ) { - write8( 0xD8 ); - ModRM( 0, 0x0, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xD8 ); + ModRM( 0, 0x0, DISP32 ); + write32( MEMADDR(from, 4) ); } /* fsub m32 to fpu reg stack */ -emitterT void eFSUB32( u32 from ) +emitterT void FSUB32( u32 from ) { - write8( 0xD8 ); - ModRM( 0, 0x4, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xD8 ); + ModRM( 0, 0x4, DISP32 ); + write32( MEMADDR(from, 4) ); } /* fmul m32 to fpu reg stack */ -emitterT void eFMUL32( u32 from ) +emitterT void FMUL32( u32 from ) { - write8( 0xD8 ); - ModRM( 0, 0x1, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xD8 ); + ModRM( 0, 0x1, DISP32 ); + write32( MEMADDR(from, 4) ); } /* fdiv m32 to fpu reg stack */ -emitterT void eFDIV32( u32 from ) +emitterT void FDIV32( u32 from ) { - write8( 0xD8 ); - ModRM( 0, 0x6, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xD8 ); + ModRM( 0, 0x6, DISP32 ); + write32( MEMADDR(from, 4) ); } /* fabs fpu reg stack */ -emitterT void eFABS( void ) +emitterT void FABS( void ) { - write16( 0xE1D9 ); + write16( 0xE1D9 ); } /* fsqrt fpu reg stack */ -emitterT void eFSQRT( void ) +emitterT void FSQRT( void ) { - write16( 0xFAD9 ); + write16( 0xFAD9 ); } /* fchs fpu reg stack */ -emitterT void eFCHS( void ) +emitterT void FCHS( void ) { - write16( 0xE0D9 ); + write16( 0xE0D9 ); } /* fcomi st, st(i) */ -emitterT void eFCOMI( x86IntRegType src ) +emitterT void FCOMI( x86IntRegType src ) { - write8( 0xDB ); - write8( 0xF0 + src ); + write8( 0xDB ); + write8( 0xF0 + src ); } /* fcomip st, st(i) */ -emitterT void eFCOMIP( x86IntRegType src ) +emitterT void FCOMIP( x86IntRegType src ) { - write8( 0xDF ); - write8( 0xF0 + src ); + write8( 0xDF ); + write8( 0xF0 + src ); } /* fucomi st, st(i) */ -emitterT void eFUCOMI( x86IntRegType src ) +emitterT void FUCOMI( x86IntRegType src ) { - write8( 0xDB ); - write8( 0xE8 + src ); + write8( 0xDB ); + write8( 0xE8 + src ); } /* fucomip st, st(i) */ -emitterT void eFUCOMIP( x86IntRegType src ) +emitterT void FUCOMIP( x86IntRegType src ) { - write8( 0xDF ); - write8( 0xE8 + src ); + write8( 0xDF ); + write8( 0xE8 + src ); } /* fcom m32 to fpu reg stack */ -emitterT void eFCOM32( u32 from ) +emitterT void FCOM32( u32 from ) { - write8( 0xD8 ); - ModRM( 0, 0x2, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xD8 ); + ModRM( 0, 0x2, DISP32 ); + write32( MEMADDR(from, 4) ); } /* fcomp m32 to fpu reg stack */ -emitterT void eFCOMP32( u32 from ) +emitterT void FCOMP32( u32 from ) { - write8( 0xD8 ); - ModRM( 0, 0x3, DISP32 ); - write32( MEMADDR(from, 4) ); + write8( 0xD8 ); + ModRM( 0, 0x3, DISP32 ); + write32( MEMADDR(from, 4) ); } #define FCMOV32( low, high ) \ { \ - write8( low ); \ - write8( high + from ); \ + write8( low ); \ + write8( high + from ); \ } -emitterT void eFCMOVB32( x86IntRegType from ) { FCMOV32( 0xDA, 0xC0 ); } -emitterT void eFCMOVE32( x86IntRegType from ) { FCMOV32( 0xDA, 0xC8 ); } -emitterT void eFCMOVBE32( x86IntRegType from ) { FCMOV32( 0xDA, 0xD0 ); } -emitterT void eFCMOVU32( x86IntRegType from ) { FCMOV32( 0xDA, 0xD8 ); } -emitterT void eFCMOVNB32( x86IntRegType from ) { FCMOV32( 0xDB, 0xC0 ); } -emitterT void eFCMOVNE32( x86IntRegType from ) { FCMOV32( 0xDB, 0xC8 ); } -emitterT void eFCMOVNBE32( x86IntRegType from ) { FCMOV32( 0xDB, 0xD0 ); } -emitterT void eFCMOVNU32( x86IntRegType from ) { FCMOV32( 0xDB, 0xD8 ); } +emitterT void FCMOVB32( x86IntRegType from ) { FCMOV32( 0xDA, 0xC0 ); } +emitterT void FCMOVE32( x86IntRegType from ) { FCMOV32( 0xDA, 0xC8 ); } +emitterT void FCMOVBE32( x86IntRegType from ) { FCMOV32( 0xDA, 0xD0 ); } +emitterT void FCMOVU32( x86IntRegType from ) { FCMOV32( 0xDA, 0xD8 ); } +emitterT void FCMOVNB32( x86IntRegType from ) { FCMOV32( 0xDB, 0xC0 ); } +emitterT void FCMOVNE32( x86IntRegType from ) { FCMOV32( 0xDB, 0xC8 ); } +emitterT void FCMOVNBE32( x86IntRegType from ) { FCMOV32( 0xDB, 0xD0 ); } +emitterT void FCMOVNU32( x86IntRegType from ) { FCMOV32( 0xDB, 0xD8 ); } diff --git a/pcsx2/x86/ix86/ix86_group1.inl b/pcsx2/x86/ix86/ix86_group1.inl index ccc98726d8..99e1d6d4ff 100644 --- a/pcsx2/x86/ix86/ix86_group1.inl +++ b/pcsx2/x86/ix86/ix86_group1.inl @@ -66,7 +66,7 @@ emitterT void EmitSibMagic( int regfield, const ModSib& info ) int displacement_size = (info.Displacement == 0) ? 0 : ( ( info.IsByteSizeDisp() ) ? 1 : 2 ); - if( !NeedsSibMagic( info ) ) + if( !NeedsSibMagic( info ) ) { // Use ModRm-only encoding, with the rm field holding an index/base register, if // one has been specified. If neither register is specified then use Disp32 form, @@ -76,26 +76,26 @@ emitterT void EmitSibMagic( int regfield, const ModSib& info ) x86Register basereg = info.GetEitherReg(); if( basereg.IsEmpty() ) - ModRM( 0, regfield, ModRm_UseDisp32 ); + ModRM( 0, regfield, ModRm_UseDisp32 ); else { if( basereg == ebp && displacement_size == 0 ) displacement_size = 1; // forces [ebp] to be encoded as [ebp+0]! - ModRM( displacement_size, regfield, basereg.Id ); + ModRM( displacement_size, regfield, basereg.Id ); } } else { - ModRM( displacement_size, regfield, ModRm_UseSib ); - SibSB( info.Index.Id, info.Scale, info.Base.Id ); + ModRM( displacement_size, regfield, ModRm_UseSib ); + SibSB( info.Index.Id, info.Scale, info.Base.Id ); } switch( displacement_size ) { case 0: break; - case 1: write8( info.Displacement ); break; - case 2: write32( info.Displacement ); break; + case 1: write8( info.Displacement ); break; + case 2: write32( info.Displacement ); break; jNO_DEFAULT } } @@ -108,7 +108,7 @@ emitterT void EmitSibMagic( int regfield, const ModSib& info ) // emitterT void EmitSibMagic( x86Register regfield, const ModSib& info ) { - EmitSibMagic( regfield.Id, info ); + EmitSibMagic( regfield.Id, info ); } enum Group1InstructionType @@ -126,82 +126,93 @@ enum Group1InstructionType emitterT void Group1_32( Group1InstructionType inst, x86Register to, x86Register from ) { - write8( 0x01 | (inst<<3) ); - ModRM( 3, from.Id, to.Id ); + write8( 0x01 | (inst<<3) ); + ModRM( 3, from.Id, to.Id ); } emitterT void Group1_32( Group1InstructionType inst, x86Register to, u32 imm ) { if( is_s8( imm ) ) { - write8( 0x83 ); - ModRM( 3, inst, to.Id ); - write8( (s8)imm ); + write8( 0x83 ); + ModRM( 3, inst, to.Id ); + write8( (s8)imm ); } else { if( to == eax ) - write8( 0x05 | (inst<<3) ); + write8( 0x05 | (inst<<3) ); else { - write8( 0x81 ); - ModRM( 3, inst, to.Id ); + write8( 0x81 ); + ModRM( 3, inst, to.Id ); } - write32( imm ); + write32( imm ); } } emitterT void Group1_32( Group1InstructionType inst, const ModSib& sibdest, u32 imm ) { - write8( is_s8( imm ) ? 0x83 : 0x81 ); + write8( is_s8( imm ) ? 0x83 : 0x81 ); - EmitSibMagic( inst, sibdest ); + EmitSibMagic( inst, sibdest ); if( is_s8( imm ) ) - write8( (s8)imm ); + write8( (s8)imm ); else - write32( imm ); + write32( imm ); } emitterT void Group1_32( Group1InstructionType inst, const ModSib& sibdest, x86Register from ) { - write8( 0x01 | (inst<<3) ); - EmitSibMagic( from, sibdest ); + write8( 0x01 | (inst<<3) ); + EmitSibMagic( from, sibdest ); } /* add m32 to r32 */ emitterT void Group1_32( Group1InstructionType inst, x86Register to, const ModSib& sibsrc ) { - write8( 0x03 | (inst<<3) ); - EmitSibMagic( to, sibsrc ); + write8( 0x03 | (inst<<3) ); + EmitSibMagic( to, sibsrc ); } emitterT void Group1_8( Group1InstructionType inst, x86Register to, s8 imm ) { if( to == eax ) { - write8( 0x04 | (inst<<3) ); - write8( imm ); + write8( 0x04 | (inst<<3) ); + write8( imm ); } else { - write8( 0x80 ); - ModRM( 3, inst, to.Id ); - write8( imm ); + write8( 0x80 ); + ModRM( 3, inst, to.Id ); + write8( imm ); } } ////////////////////////////////////////////////////////////////////////////////////////// // #define DEFINE_GROUP1_OPCODE( lwr, cod ) \ - emitterT void lwr##32( x86Register to, x86Register from ) { Group1_32( G1Type_##cod, to, from ); } \ - emitterT void lwr##32( x86Register to, u32 imm ) { Group1_32( G1Type_##cod, to, imm ); } \ - emitterT void lwr##32( x86Register to, void* from ) { Group1_32( G1Type_##cod, to, ptr[from] ); } \ - emitterT void lwr##32( void* to, x86Register from ) { Group1_32( G1Type_##cod, ptr[to], from ); } \ - emitterT void lwr##32( void* to, u32 imm ) { Group1_32( G1Type_##cod, ptr[to], imm ); } \ - emitterT void lwr##32( x86Register to, const x86ModRm& from ) { Group1_32( G1Type_##cod, to, ptr[from] ); } \ - emitterT void lwr##32( const x86ModRm& to, x86Register from ) { Group1_32( G1Type_##cod, ptr[to], from ); } \ - emitterT void lwr##32( const x86ModRm& to, u32 imm ) { Group1_32( G1Type_##cod, ptr[to], imm ); } + emitterT void lwr##32( x86Register to, x86Register from ) { Group1_32( G1Type_##cod, to, from ); } \ + emitterT void lwr##32( x86Register to, u32 imm ) { Group1_32( G1Type_##cod, to, imm ); } \ + emitterT void lwr##32( x86Register to, void* from ) { Group1_32( G1Type_##cod, to, ptr[from] ); } \ + emitterT void lwr##32( void* to, x86Register from ) { Group1_32( G1Type_##cod, ptr[to], from ); } \ + emitterT void lwr##32( void* to, u32 imm ) { Group1_32( G1Type_##cod, ptr[to], imm ); } \ + emitterT void lwr##32( x86Register to, const x86ModRm& from ) { Group1_32( G1Type_##cod, to, ptr[from] ); } \ + emitterT void lwr##32( const x86ModRm& to, x86Register from ) { Group1_32( G1Type_##cod, ptr[to], from ); } \ + emitterT void lwr##32( const x86ModRm& to, u32 imm ) { Group1_32( G1Type_##cod, ptr[to], imm ); } + +/* + emitterT void lwr##16( x86Register16 to, x86Register16 from ) { Group1_32( G1Type_##cod, to, from ); } \ + emitterT void lwr##16( x86Register16 to, u16 imm ) { Group1_32( G1Type_##cod, to, imm ); } \ + emitterT void lwr##16( x86Register16 to, void* from ) { Group1_32( G1Type_##cod, to, ptr[from] ); } \ + emitterT void lwr##16( void* to, x86Register16 from ) { Group1_32( G1Type_##cod, ptr[to], from ); } \ + emitterT void lwr##16( void* to, u16 imm ) { Group1_32( G1Type_##cod, ptr[to], imm ); } \ + emitterT void lwr##16( x86Register16 to, const x86ModRm& from ){ Group1_32( G1Type_##cod, to, ptr[from] ); } \ + emitterT void lwr##16( const x86ModRm& to, x86Register16 from ){ Group1_32( G1Type_##cod, ptr[to], from ); } \ + emitterT void lwr##16( const x86ModRm& to, u32 imm ) { Group1_32( G1Type_##cod, ptr[to], imm ); } +*/ DEFINE_GROUP1_OPCODE( add, ADD ); DEFINE_GROUP1_OPCODE( cmp, CMP ); @@ -229,14 +240,14 @@ static __forceinline x86Emitter::x86ModRm _mrmhlp( x86IntRegType src ) ////////////////////////////////////////////////////////////////////////////////////////// // #define DEFINE_GROUP1_OPCODE_LEGACY( lwr, cod ) \ - emitterT void e##cod##32RtoR( x86IntRegType to, x86IntRegType from ) { x86Emitter::lwr##32( _reghlp(to), _reghlp(from) ); } \ - emitterT void e##cod##32ItoR( x86IntRegType to, u32 imm ) { x86Emitter::lwr##32( _reghlp(to), imm ); } \ - emitterT void e##cod##32MtoR( x86IntRegType to, uptr from ) { x86Emitter::lwr##32( _reghlp(to), (void*)from ); } \ - emitterT void e##cod##32RtoM( uptr to, x86IntRegType from ) { x86Emitter::lwr##32( (void*)to, _reghlp(from) ); } \ - emitterT void e##cod##32ItoM( uptr to, u32 imm ) { x86Emitter::lwr##32( (void*)to, imm ); } \ - emitterT void e##cod##32ItoRm( x86IntRegType to, u32 imm, int offset=0 ){ x86Emitter::lwr##32( _mrmhlp(to) + offset, imm ); } \ - emitterT void e##cod##32RmtoR( x86IntRegType to, x86IntRegType from, int offset=0 ) { x86Emitter::lwr##32( _reghlp(to), _mrmhlp(from) + offset ); } \ - emitterT void e##cod##32RtoRm( x86IntRegType to, x86IntRegType from, int offset=0 ) { x86Emitter::lwr##32( _mrmhlp(to) + offset, _reghlp(from) ); } + emitterT void cod##32RtoR( x86IntRegType to, x86IntRegType from ) { x86Emitter::lwr##32( _reghlp(to), _reghlp(from) ); } \ + emitterT void cod##32ItoR( x86IntRegType to, u32 imm ) { x86Emitter::lwr##32( _reghlp(to), imm ); } \ + emitterT void cod##32MtoR( x86IntRegType to, uptr from ) { x86Emitter::lwr##32( _reghlp(to), (void*)from ); } \ + emitterT void cod##32RtoM( uptr to, x86IntRegType from ) { x86Emitter::lwr##32( (void*)to, _reghlp(from) ); } \ + emitterT void cod##32ItoM( uptr to, u32 imm ) { x86Emitter::lwr##32( (void*)to, imm ); } \ + emitterT void cod##32ItoRm( x86IntRegType to, u32 imm, int offset=0 ){ x86Emitter::lwr##32( _mrmhlp(to) + offset, imm ); } \ + emitterT void cod##32RmtoR( x86IntRegType to, x86IntRegType from, int offset=0 ) { x86Emitter::lwr##32( _reghlp(to), _mrmhlp(from) + offset ); } \ + emitterT void cod##32RtoRm( x86IntRegType to, x86IntRegType from, int offset=0 ) { x86Emitter::lwr##32( _mrmhlp(to) + offset, _reghlp(from) ); } DEFINE_GROUP1_OPCODE_LEGACY( add, ADD ); DEFINE_GROUP1_OPCODE_LEGACY( cmp, CMP ); @@ -247,12 +258,12 @@ DEFINE_GROUP1_OPCODE_LEGACY( and, AND ); DEFINE_GROUP1_OPCODE_LEGACY( sub, SUB ); DEFINE_GROUP1_OPCODE_LEGACY( xor, XOR ); -emitterT void eAND32I8toR( x86IntRegType to, s8 from ) +emitterT void AND32I8toR( x86IntRegType to, s8 from ) { - x86Emitter::and32( _reghlp(to), from ); + x86Emitter::and32( _reghlp(to), from ); } -emitterT void eAND32I8toM( uptr to, s8 from ) +emitterT void AND32I8toM( uptr to, s8 from ) { - x86Emitter::and32( (void*)to, from ); + x86Emitter::and32( (void*)to, from ); } diff --git a/pcsx2/x86/ix86/ix86_mmx.inl b/pcsx2/x86/ix86/ix86_mmx.inl index bc7d183319..f63686e700 100644 --- a/pcsx2/x86/ix86/ix86_mmx.inl +++ b/pcsx2/x86/ix86/ix86_mmx.inl @@ -25,623 +25,623 @@ //------------------------------------------------------------------ /* movq m64 to r64 */ -emitterT void eMOVQMtoR( x86MMXRegType to, uptr from ) +emitterT void MOVQMtoR( x86MMXRegType to, uptr from ) { - write16( 0x6F0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0x6F0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* movq r64 to m64 */ -emitterT void eMOVQRtoM( uptr to, x86MMXRegType from ) +emitterT void MOVQRtoM( uptr to, x86MMXRegType from ) { - write16( 0x7F0F ); - ModRM( 0, from, DISP32 ); - write32(MEMADDR(to, 4)); + write16( 0x7F0F ); + ModRM( 0, from, DISP32 ); + write32(MEMADDR(to, 4)); } /* pand r64 to r64 */ -emitterT void ePANDRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PANDRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xDB0F ); - ModRM( 3, to, from ); + write16( 0xDB0F ); + ModRM( 3, to, from ); } -emitterT void ePANDNRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PANDNRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xDF0F ); - ModRM( 3, to, from ); + write16( 0xDF0F ); + ModRM( 3, to, from ); } /* por r64 to r64 */ -emitterT void ePORRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PORRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xEB0F ); - ModRM( 3, to, from ); + write16( 0xEB0F ); + ModRM( 3, to, from ); } /* pxor r64 to r64 */ -emitterT void ePXORRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PXORRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xEF0F ); - ModRM( 3, to, from ); + write16( 0xEF0F ); + ModRM( 3, to, from ); } /* psllq r64 to r64 */ -emitterT void ePSLLQRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSLLQRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xF30F ); - ModRM( 3, to, from ); + write16( 0xF30F ); + ModRM( 3, to, from ); } /* psllq m64 to r64 */ -emitterT void ePSLLQMtoR( x86MMXRegType to, uptr from ) +emitterT void PSLLQMtoR( x86MMXRegType to, uptr from ) { - write16( 0xF30F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xF30F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* psllq imm8 to r64 */ -emitterT void ePSLLQItoR( x86MMXRegType to, u8 from ) +emitterT void PSLLQItoR( x86MMXRegType to, u8 from ) { - write16( 0x730F ); - ModRM( 3, 6, to); - write8( from ); + write16( 0x730F ); + ModRM( 3, 6, to); + write8( from ); } /* psrlq r64 to r64 */ -emitterT void ePSRLQRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSRLQRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xD30F ); - ModRM( 3, to, from ); + write16( 0xD30F ); + ModRM( 3, to, from ); } /* psrlq m64 to r64 */ -emitterT void ePSRLQMtoR( x86MMXRegType to, uptr from ) +emitterT void PSRLQMtoR( x86MMXRegType to, uptr from ) { - write16( 0xD30F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xD30F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* psrlq imm8 to r64 */ -emitterT void ePSRLQItoR( x86MMXRegType to, u8 from ) +emitterT void PSRLQItoR( x86MMXRegType to, u8 from ) { - write16( 0x730F ); - ModRM( 3, 2, to); - write8( from ); + write16( 0x730F ); + ModRM( 3, 2, to); + write8( from ); } /* paddusb r64 to r64 */ -emitterT void ePADDUSBRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PADDUSBRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xDC0F ); - ModRM( 3, to, from ); + write16( 0xDC0F ); + ModRM( 3, to, from ); } /* paddusb m64 to r64 */ -emitterT void ePADDUSBMtoR( x86MMXRegType to, uptr from ) +emitterT void PADDUSBMtoR( x86MMXRegType to, uptr from ) { - write16( 0xDC0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xDC0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* paddusw r64 to r64 */ -emitterT void ePADDUSWRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PADDUSWRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xDD0F ); - ModRM( 3, to, from ); + write16( 0xDD0F ); + ModRM( 3, to, from ); } /* paddusw m64 to r64 */ -emitterT void ePADDUSWMtoR( x86MMXRegType to, uptr from ) +emitterT void PADDUSWMtoR( x86MMXRegType to, uptr from ) { - write16( 0xDD0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xDD0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* paddb r64 to r64 */ -emitterT void ePADDBRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PADDBRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xFC0F ); - ModRM( 3, to, from ); + write16( 0xFC0F ); + ModRM( 3, to, from ); } /* paddb m64 to r64 */ -emitterT void ePADDBMtoR( x86MMXRegType to, uptr from ) +emitterT void PADDBMtoR( x86MMXRegType to, uptr from ) { - write16( 0xFC0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xFC0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* paddw r64 to r64 */ -emitterT void ePADDWRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PADDWRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xFD0F ); - ModRM( 3, to, from ); + write16( 0xFD0F ); + ModRM( 3, to, from ); } /* paddw m64 to r64 */ -emitterT void ePADDWMtoR( x86MMXRegType to, uptr from ) +emitterT void PADDWMtoR( x86MMXRegType to, uptr from ) { - write16( 0xFD0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xFD0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* paddd r64 to r64 */ -emitterT void ePADDDRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PADDDRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xFE0F ); - ModRM( 3, to, from ); + write16( 0xFE0F ); + ModRM( 3, to, from ); } /* paddd m64 to r64 */ -emitterT void ePADDDMtoR( x86MMXRegType to, uptr from ) +emitterT void PADDDMtoR( x86MMXRegType to, uptr from ) { - write16( 0xFE0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xFE0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* emms */ -emitterT void eEMMS() +emitterT void EMMS() { - write16( 0x770F ); + write16( 0x770F ); } -emitterT void ePADDSBRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PADDSBRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xEC0F ); - ModRM( 3, to, from ); + write16( 0xEC0F ); + ModRM( 3, to, from ); } -emitterT void ePADDSWRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PADDSWRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xED0F ); - ModRM( 3, to, from ); + write16( 0xED0F ); + ModRM( 3, to, from ); } // paddq m64 to r64 (sse2 only?) -emitterT void ePADDQMtoR( x86MMXRegType to, uptr from ) +emitterT void PADDQMtoR( x86MMXRegType to, uptr from ) { - write16( 0xD40F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xD40F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } // paddq r64 to r64 (sse2 only?) -emitterT void ePADDQRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PADDQRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xD40F ); - ModRM( 3, to, from ); + write16( 0xD40F ); + ModRM( 3, to, from ); } -emitterT void ePSUBSBRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSUBSBRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xE80F ); - ModRM( 3, to, from ); + write16( 0xE80F ); + ModRM( 3, to, from ); } -emitterT void ePSUBSWRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSUBSWRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xE90F ); - ModRM( 3, to, from ); + write16( 0xE90F ); + ModRM( 3, to, from ); } -emitterT void ePSUBBRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSUBBRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xF80F ); - ModRM( 3, to, from ); + write16( 0xF80F ); + ModRM( 3, to, from ); } -emitterT void ePSUBWRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSUBWRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xF90F ); - ModRM( 3, to, from ); + write16( 0xF90F ); + ModRM( 3, to, from ); } -emitterT void ePSUBDRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSUBDRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xFA0F ); - ModRM( 3, to, from ); + write16( 0xFA0F ); + ModRM( 3, to, from ); } -emitterT void ePSUBDMtoR( x86MMXRegType to, uptr from ) +emitterT void PSUBDMtoR( x86MMXRegType to, uptr from ) { - write16( 0xFA0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xFA0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void ePSUBUSBRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSUBUSBRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xD80F ); - ModRM( 3, to, from ); + write16( 0xD80F ); + ModRM( 3, to, from ); } -emitterT void ePSUBUSWRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSUBUSWRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xD90F ); - ModRM( 3, to, from ); + write16( 0xD90F ); + ModRM( 3, to, from ); } // psubq m64 to r64 (sse2 only?) -emitterT void ePSUBQMtoR( x86MMXRegType to, uptr from ) +emitterT void PSUBQMtoR( x86MMXRegType to, uptr from ) { - write16( 0xFB0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xFB0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } // psubq r64 to r64 (sse2 only?) -emitterT void ePSUBQRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSUBQRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xFB0F ); - ModRM( 3, to, from ); + write16( 0xFB0F ); + ModRM( 3, to, from ); } // pmuludq m64 to r64 (sse2 only?) -emitterT void ePMULUDQMtoR( x86MMXRegType to, uptr from ) +emitterT void PMULUDQMtoR( x86MMXRegType to, uptr from ) { - write16( 0xF40F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xF40F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } // pmuludq r64 to r64 (sse2 only?) -emitterT void ePMULUDQRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PMULUDQRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xF40F ); - ModRM( 3, to, from ); + write16( 0xF40F ); + ModRM( 3, to, from ); } -emitterT void ePCMPEQBRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PCMPEQBRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x740F ); - ModRM( 3, to, from ); + write16( 0x740F ); + ModRM( 3, to, from ); } -emitterT void ePCMPEQWRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PCMPEQWRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x750F ); - ModRM( 3, to, from ); + write16( 0x750F ); + ModRM( 3, to, from ); } -emitterT void ePCMPEQDRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PCMPEQDRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x760F ); - ModRM( 3, to, from ); + write16( 0x760F ); + ModRM( 3, to, from ); } -emitterT void ePCMPEQDMtoR( x86MMXRegType to, uptr from ) +emitterT void PCMPEQDMtoR( x86MMXRegType to, uptr from ) { - write16( 0x760F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0x760F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void ePCMPGTBRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PCMPGTBRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x640F ); - ModRM( 3, to, from ); + write16( 0x640F ); + ModRM( 3, to, from ); } -emitterT void ePCMPGTWRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PCMPGTWRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x650F ); - ModRM( 3, to, from ); + write16( 0x650F ); + ModRM( 3, to, from ); } -emitterT void ePCMPGTDRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PCMPGTDRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x660F ); - ModRM( 3, to, from ); + write16( 0x660F ); + ModRM( 3, to, from ); } -emitterT void ePCMPGTDMtoR( x86MMXRegType to, uptr from ) +emitterT void PCMPGTDMtoR( x86MMXRegType to, uptr from ) { - write16( 0x660F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0x660F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void ePSRLWItoR( x86MMXRegType to, u8 from ) +emitterT void PSRLWItoR( x86MMXRegType to, u8 from ) { - write16( 0x710F ); - ModRM( 3, 2 , to ); - write8( from ); + write16( 0x710F ); + ModRM( 3, 2 , to ); + write8( from ); } -emitterT void ePSRLDItoR( x86MMXRegType to, u8 from ) +emitterT void PSRLDItoR( x86MMXRegType to, u8 from ) { - write16( 0x720F ); - ModRM( 3, 2 , to ); - write8( from ); + write16( 0x720F ); + ModRM( 3, 2 , to ); + write8( from ); } -emitterT void ePSRLDRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSRLDRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xD20F ); - ModRM( 3, to, from ); + write16( 0xD20F ); + ModRM( 3, to, from ); } -emitterT void ePSLLWItoR( x86MMXRegType to, u8 from ) +emitterT void PSLLWItoR( x86MMXRegType to, u8 from ) { - write16( 0x710F ); - ModRM( 3, 6 , to ); - write8( from ); + write16( 0x710F ); + ModRM( 3, 6 , to ); + write8( from ); } -emitterT void ePSLLDItoR( x86MMXRegType to, u8 from ) +emitterT void PSLLDItoR( x86MMXRegType to, u8 from ) { - write16( 0x720F ); - ModRM( 3, 6 , to ); - write8( from ); + write16( 0x720F ); + ModRM( 3, 6 , to ); + write8( from ); } -emitterT void ePSLLDRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSLLDRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xF20F ); - ModRM( 3, to, from ); + write16( 0xF20F ); + ModRM( 3, to, from ); } -emitterT void ePSRAWItoR( x86MMXRegType to, u8 from ) +emitterT void PSRAWItoR( x86MMXRegType to, u8 from ) { - write16( 0x710F ); - ModRM( 3, 4 , to ); - write8( from ); + write16( 0x710F ); + ModRM( 3, 4 , to ); + write8( from ); } -emitterT void ePSRADItoR( x86MMXRegType to, u8 from ) +emitterT void PSRADItoR( x86MMXRegType to, u8 from ) { - write16( 0x720F ); - ModRM( 3, 4 , to ); - write8( from ); + write16( 0x720F ); + ModRM( 3, 4 , to ); + write8( from ); } -emitterT void ePSRADRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PSRADRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0xE20F ); - ModRM( 3, to, from ); + write16( 0xE20F ); + ModRM( 3, to, from ); } /* por m64 to r64 */ -emitterT void ePORMtoR( x86MMXRegType to, uptr from ) +emitterT void PORMtoR( x86MMXRegType to, uptr from ) { - write16( 0xEB0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xEB0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* pxor m64 to r64 */ -emitterT void ePXORMtoR( x86MMXRegType to, uptr from ) +emitterT void PXORMtoR( x86MMXRegType to, uptr from ) { - write16( 0xEF0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xEF0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* pand m64 to r64 */ -emitterT void ePANDMtoR( x86MMXRegType to, uptr from ) +emitterT void PANDMtoR( x86MMXRegType to, uptr from ) { - //u64 rip = (u64)x86Ptr[0] + 7; - write16( 0xDB0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + //u64 rip = (u64)x86Ptr + 7; + write16( 0xDB0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void ePANDNMtoR( x86MMXRegType to, uptr from ) +emitterT void PANDNMtoR( x86MMXRegType to, uptr from ) { - write16( 0xDF0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0xDF0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void ePUNPCKHDQRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PUNPCKHDQRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x6A0F ); - ModRM( 3, to, from ); + write16( 0x6A0F ); + ModRM( 3, to, from ); } -emitterT void ePUNPCKHDQMtoR( x86MMXRegType to, uptr from ) +emitterT void PUNPCKHDQMtoR( x86MMXRegType to, uptr from ) { - write16( 0x6A0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0x6A0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void ePUNPCKLDQRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void PUNPCKLDQRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x620F ); - ModRM( 3, to, from ); + write16( 0x620F ); + ModRM( 3, to, from ); } -emitterT void ePUNPCKLDQMtoR( x86MMXRegType to, uptr from ) +emitterT void PUNPCKLDQMtoR( x86MMXRegType to, uptr from ) { - write16( 0x620F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0x620F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void eMOVQ64ItoR( x86MMXRegType reg, u64 i ) +emitterT void MOVQ64ItoR( x86MMXRegType reg, u64 i ) { - eMOVQMtoR( reg, ( uptr )(x86Ptr[0]) + 2 + 7 ); - eJMP8( 8 ); - write64( i ); + MOVQMtoR( reg, ( uptr )(x86Ptr) + 2 + 7 ); + JMP8( 8 ); + write64( i ); } -emitterT void eMOVQRtoR( x86MMXRegType to, x86MMXRegType from ) +emitterT void MOVQRtoR( x86MMXRegType to, x86MMXRegType from ) { - write16( 0x6F0F ); - ModRM( 3, to, from ); + write16( 0x6F0F ); + ModRM( 3, to, from ); } -emitterT void eMOVQRmtoR( x86MMXRegType to, x86IntRegType from, int offset=0 ) +emitterT void MOVQRmtoR( x86MMXRegType to, x86IntRegType from, int offset=0 ) { - write16( 0x6F0F ); + write16( 0x6F0F ); if( offset < 128 && offset >= -128) { - ModRM( 1, to, from ); - write8(offset); + ModRM( 1, to, from ); + write8(offset); } else { - ModRM( 2, to, from ); - write32(offset); + ModRM( 2, to, from ); + write32(offset); } } -emitterT void eMOVQRtoRm( x86IntRegType to, x86MMXRegType from, int offset=0 ) +emitterT void MOVQRtoRm( x86IntRegType to, x86MMXRegType from, int offset=0 ) { - write16( 0x7F0F ); + write16( 0x7F0F ); if( offset < 128 && offset >= -128) { - ModRM( 1, from , to ); - write8(offset); + ModRM( 1, from , to ); + write8(offset); } else { - ModRM( 2, from, to ); - write32(offset); + ModRM( 2, from, to ); + write32(offset); } } /* movd m32 to r64 */ -emitterT void eMOVDMtoMMX( x86MMXRegType to, uptr from ) +emitterT void MOVDMtoMMX( x86MMXRegType to, uptr from ) { - write16( 0x6E0F ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0x6E0F ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } /* movd r64 to m32 */ -emitterT void eMOVDMMXtoM( uptr to, x86MMXRegType from ) +emitterT void MOVDMMXtoM( uptr to, x86MMXRegType from ) { - write16( 0x7E0F ); - ModRM( 0, from, DISP32 ); - write32( MEMADDR(to, 4) ); + write16( 0x7E0F ); + ModRM( 0, from, DISP32 ); + write32( MEMADDR(to, 4) ); } -emitterT void eMOVD32RtoMMX( x86MMXRegType to, x86IntRegType from ) +emitterT void MOVD32RtoMMX( x86MMXRegType to, x86IntRegType from ) { - write16( 0x6E0F ); - ModRM( 3, to, from ); + write16( 0x6E0F ); + ModRM( 3, to, from ); } -emitterT void eMOVD32RmtoMMX( x86MMXRegType to, x86IntRegType from ) +emitterT void MOVD32RmtoMMX( x86MMXRegType to, x86IntRegType from ) { - write16( 0x6E0F ); - ModRM( 0, to, from ); + write16( 0x6E0F ); + ModRM( 0, to, from ); } -emitterT void eMOVD32RmOffsettoMMX( x86MMXRegType to, x86IntRegType from, u32 offset ) +emitterT void MOVD32RmOffsettoMMX( x86MMXRegType to, x86IntRegType from, u32 offset ) { - write16( 0x6E0F ); + write16( 0x6E0F ); if( offset < 128 ) { - ModRM( 1, to, from ); - write8(offset); + ModRM( 1, to, from ); + write8(offset); } else { - ModRM( 2, to, from ); - write32(offset); + ModRM( 2, to, from ); + write32(offset); } } -emitterT void eMOVD32MMXtoR( x86IntRegType to, x86MMXRegType from ) +emitterT void MOVD32MMXtoR( x86IntRegType to, x86MMXRegType from ) { - write16( 0x7E0F ); - ModRM( 3, from, to ); + write16( 0x7E0F ); + ModRM( 3, from, to ); } -emitterT void eMOVD32MMXtoRm( x86IntRegType to, x86MMXRegType from ) +emitterT void MOVD32MMXtoRm( x86IntRegType to, x86MMXRegType from ) { - write16( 0x7E0F ); - ModRM( 0, from, to ); + write16( 0x7E0F ); + ModRM( 0, from, to ); if( to >= 4 ) { // no idea why assert( to == ESP ); - write8(0x24); + write8(0x24); } } -emitterT void eMOVD32MMXtoRmOffset( x86IntRegType to, x86MMXRegType from, u32 offset ) +emitterT void MOVD32MMXtoRmOffset( x86IntRegType to, x86MMXRegType from, u32 offset ) { - write16( 0x7E0F ); + write16( 0x7E0F ); if( offset < 128 ) { - ModRM( 1, from, to ); - write8(offset); + ModRM( 1, from, to ); + write8(offset); } else { - ModRM( 2, from, to ); - write32(offset); + ModRM( 2, from, to ); + write32(offset); } } ///* movd r32 to r64 */ -//emitterT void eMOVD32MMXtoMMX( x86MMXRegType to, x86MMXRegType from ) +//emitterT void MOVD32MMXtoMMX( x86MMXRegType to, x86MMXRegType from ) //{ -// write16( 0x6E0F ); -// ModRM( 3, to, from ); +// write16( 0x6E0F ); +// ModRM( 3, to, from ); //} // ///* movq r64 to r32 */ -//emitterT void eMOVD64MMXtoMMX( x86MMXRegType to, x86MMXRegType from ) +//emitterT void MOVD64MMXtoMMX( x86MMXRegType to, x86MMXRegType from ) //{ -// write16( 0x7E0F ); -// ModRM( 3, from, to ); +// write16( 0x7E0F ); +// ModRM( 3, from, to ); //} // untested -emitterT void ePACKSSWBMMXtoMMX(x86MMXRegType to, x86MMXRegType from) +emitterT void PACKSSWBMMXtoMMX(x86MMXRegType to, x86MMXRegType from) { - write16( 0x630F ); - ModRM( 3, to, from ); + write16( 0x630F ); + ModRM( 3, to, from ); } -emitterT void ePACKSSDWMMXtoMMX(x86MMXRegType to, x86MMXRegType from) +emitterT void PACKSSDWMMXtoMMX(x86MMXRegType to, x86MMXRegType from) { - write16( 0x6B0F ); - ModRM( 3, to, from ); + write16( 0x6B0F ); + ModRM( 3, to, from ); } -emitterT void ePMOVMSKBMMXtoR(x86IntRegType to, x86MMXRegType from) +emitterT void PMOVMSKBMMXtoR(x86IntRegType to, x86MMXRegType from) { - write16( 0xD70F ); - ModRM( 3, to, from ); + write16( 0xD70F ); + ModRM( 3, to, from ); } -emitterT void ePINSRWRtoMMX( x86MMXRegType to, x86SSERegType from, u8 imm8 ) +emitterT void PINSRWRtoMMX( x86MMXRegType to, x86SSERegType from, u8 imm8 ) { if (to > 7 || from > 7) Rex(1, to >> 3, 0, from >> 3); - write16( 0xc40f ); - ModRM( 3, to, from ); - write8( imm8 ); + write16( 0xc40f ); + ModRM( 3, to, from ); + write8( imm8 ); } -emitterT void ePSHUFWRtoR(x86MMXRegType to, x86MMXRegType from, u8 imm8) +emitterT void PSHUFWRtoR(x86MMXRegType to, x86MMXRegType from, u8 imm8) { - write16(0x700f); - ModRM( 3, to, from ); - write8(imm8); + write16(0x700f); + ModRM( 3, to, from ); + write8(imm8); } -emitterT void ePSHUFWMtoR(x86MMXRegType to, uptr from, u8 imm8) +emitterT void PSHUFWMtoR(x86MMXRegType to, uptr from, u8 imm8) { - write16( 0x700f ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); - write8(imm8); + write16( 0x700f ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); + write8(imm8); } -emitterT void eMASKMOVQRtoR(x86MMXRegType to, x86MMXRegType from) +emitterT void MASKMOVQRtoR(x86MMXRegType to, x86MMXRegType from) { - write16(0xf70f); - ModRM( 3, to, from ); + write16(0xf70f); + ModRM( 3, to, from ); } diff --git a/pcsx2/x86/ix86/ix86_sse.inl b/pcsx2/x86/ix86/ix86_sse.inl index a52ba6ccd7..af25c1cbaa 100644 --- a/pcsx2/x86/ix86/ix86_sse.inl +++ b/pcsx2/x86/ix86/ix86_sse.inl @@ -37,474 +37,474 @@ static const bool AlwaysUseMovaps = true; #define SSEMtoR( code, overb ) \ assert( to < XMMREGS ), \ RexR(0, to), \ - write16( code ), \ - ModRM( 0, to, DISP32 ), \ - write32( MEMADDR(from, 4 + overb) ) + write16( code ), \ + ModRM( 0, to, DISP32 ), \ + write32( MEMADDR(from, 4 + overb) ) #define SSERtoM( code, overb ) \ assert( from < XMMREGS), \ RexR(0, from), \ - write16( code ), \ - ModRM( 0, from, DISP32 ), \ - write32( MEMADDR(to, 4 + overb) ) + write16( code ), \ + ModRM( 0, from, DISP32 ), \ + write32( MEMADDR(to, 4 + overb) ) #define SSE_SS_MtoR( code, overb ) \ assert( to < XMMREGS ), \ - write8( 0xf3 ), \ + write8( 0xf3 ), \ RexR(0, to), \ - write16( code ), \ - ModRM( 0, to, DISP32 ), \ - write32( MEMADDR(from, 4 + overb) ) + write16( code ), \ + ModRM( 0, to, DISP32 ), \ + write32( MEMADDR(from, 4 + overb) ) #define SSE_SS_RtoM( code, overb ) \ assert( from < XMMREGS), \ - write8( 0xf3 ), \ + write8( 0xf3 ), \ RexR(0, from), \ - write16( code ), \ - ModRM( 0, from, DISP32 ), \ - write32( MEMADDR(to, 4 + overb) ) + write16( code ), \ + ModRM( 0, from, DISP32 ), \ + write32( MEMADDR(to, 4 + overb) ) #define SSERtoR( code ) \ assert( to < XMMREGS && from < XMMREGS), \ RexRB(0, to, from), \ - write16( code ), \ - ModRM( 3, to, from ) + write16( code ), \ + ModRM( 3, to, from ) #define SSEMtoR66( code ) \ - write8( 0x66 ), \ + write8( 0x66 ), \ SSEMtoR( code, 0 ) #define SSERtoM66( code ) \ - write8( 0x66 ), \ + write8( 0x66 ), \ SSERtoM( code, 0 ) #define SSERtoR66( code ) \ - write8( 0x66 ), \ + write8( 0x66 ), \ SSERtoR( code ) #define _SSERtoR66( code ) \ assert( to < XMMREGS && from < XMMREGS), \ - write8( 0x66 ), \ + write8( 0x66 ), \ RexRB(0, from, to), \ - write16( code ), \ - ModRM( 3, from, to ) + write16( code ), \ + ModRM( 3, from, to ) #define SSE_SS_RtoR( code ) \ assert( to < XMMREGS && from < XMMREGS), \ - write8( 0xf3 ), \ + write8( 0xf3 ), \ RexRB(0, to, from), \ - write16( code ), \ - ModRM( 3, to, from ) + write16( code ), \ + ModRM( 3, to, from ) #define SSE_SD_MtoR( code, overb ) \ assert( to < XMMREGS ) , \ - write8( 0xf2 ), \ + write8( 0xf2 ), \ RexR(0, to), \ - write16( code ), \ - ModRM( 0, to, DISP32 ), \ - write32( MEMADDR(from, 4 + overb) ) \ + write16( code ), \ + ModRM( 0, to, DISP32 ), \ + write32( MEMADDR(from, 4 + overb) ) \ #define SSE_SD_RtoM( code, overb ) \ assert( from < XMMREGS) , \ - write8( 0xf2 ), \ + write8( 0xf2 ), \ RexR(0, from), \ - write16( code ), \ - ModRM( 0, from, DISP32 ), \ - write32( MEMADDR(to, 4 + overb) ) \ + write16( code ), \ + ModRM( 0, from, DISP32 ), \ + write32( MEMADDR(to, 4 + overb) ) \ #define SSE_SD_RtoR( code ) \ assert( to < XMMREGS && from < XMMREGS) , \ - write8( 0xf2 ), \ + write8( 0xf2 ), \ RexRB(0, to, from), \ - write16( code ), \ - ModRM( 3, to, from ) + write16( code ), \ + ModRM( 3, to, from ) #define CMPPSMtoR( op ) \ SSEMtoR( 0xc20f, 1 ), \ - write8( op ) + write8( op ) #define CMPPSRtoR( op ) \ SSERtoR( 0xc20f ), \ - write8( op ) + write8( op ) #define CMPSSMtoR( op ) \ SSE_SS_MtoR( 0xc20f, 1 ), \ - write8( op ) + write8( op ) #define CMPSSRtoR( op ) \ SSE_SS_RtoR( 0xc20f ), \ - write8( op ) + write8( op ) #define CMPSDMtoR( op ) \ SSE_SD_MtoR( 0xc20f, 1 ), \ - write8( op ) + write8( op ) #define CMPSDRtoR( op ) \ SSE_SD_RtoR( 0xc20f ), \ - write8( op ) + write8( op ) /* movups [r32][r32*scale] to xmm1 */ -emitterT void eSSE_MOVUPSRmStoR( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) +emitterT void SSE_MOVUPSRmStoR( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) { RexRXB(0, to, from2, from); - write16( 0x100f ); - ModRM( 0, to, 0x4 ); - SibSB( scale, from2, from ); + write16( 0x100f ); + ModRM( 0, to, 0x4 ); + SibSB( scale, from2, from ); } /* movups xmm1 to [r32][r32*scale] */ -emitterT void eSSE_MOVUPSRtoRmS( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) +emitterT void SSE_MOVUPSRtoRmS( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) { RexRXB(1, to, from2, from); - write16( 0x110f ); - ModRM( 0, to, 0x4 ); - SibSB( scale, from2, from ); + write16( 0x110f ); + ModRM( 0, to, 0x4 ); + SibSB( scale, from2, from ); } /* movups [r32] to r32 */ -emitterT void eSSE_MOVUPSRmtoR( x86IntRegType to, x86IntRegType from ) +emitterT void SSE_MOVUPSRmtoR( x86IntRegType to, x86IntRegType from ) { RexRB(0, to, from); - write16( 0x100f ); - ModRM( 0, to, from ); + write16( 0x100f ); + ModRM( 0, to, from ); } /* movups r32 to [r32] */ -emitterT void eSSE_MOVUPSRtoRm( x86IntRegType to, x86IntRegType from ) +emitterT void SSE_MOVUPSRtoRm( x86IntRegType to, x86IntRegType from ) { RexRB(0, from, to); - write16( 0x110f ); - ModRM( 0, from, to ); + write16( 0x110f ); + ModRM( 0, from, to ); } /* movlps [r32] to r32 */ -emitterT void eSSE_MOVLPSRmtoR( x86SSERegType to, x86IntRegType from ) +emitterT void SSE_MOVLPSRmtoR( x86SSERegType to, x86IntRegType from ) { RexRB(1, to, from); - write16( 0x120f ); - ModRM( 0, to, from ); + write16( 0x120f ); + ModRM( 0, to, from ); } -emitterT void eSSE_MOVLPSRmtoR( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE_MOVLPSRmtoR( x86SSERegType to, x86IntRegType from, int offset=0 ) { RexRB(0, to, from); - write16( 0x120f ); - WriteRmOffsetFrom(to, from, offset); + write16( 0x120f ); + WriteRmOffsetFrom(to, from, offset); } /* movaps r32 to [r32] */ -emitterT void eSSE_MOVLPSRtoRm( x86IntRegType to, x86IntRegType from ) +emitterT void SSE_MOVLPSRtoRm( x86IntRegType to, x86IntRegType from ) { RexRB(0, from, to); - write16( 0x130f ); - ModRM( 0, from, to ); + write16( 0x130f ); + ModRM( 0, from, to ); } -emitterT void eSSE_MOVLPSRtoRm( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE_MOVLPSRtoRm( x86SSERegType to, x86IntRegType from, int offset=0 ) { RexRB(0, from, to); - write16( 0x130f ); - WriteRmOffsetFrom(from, to, offset); + write16( 0x130f ); + WriteRmOffsetFrom(from, to, offset); } /* movaps [r32][r32*scale] to xmm1 */ -emitterT void eSSE_MOVAPSRmStoR( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) +emitterT void SSE_MOVAPSRmStoR( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) { assert( from != EBP ); RexRXB(0, to, from2, from); - write16( 0x280f ); - ModRM( 0, to, 0x4 ); - SibSB( scale, from2, from ); + write16( 0x280f ); + ModRM( 0, to, 0x4 ); + SibSB( scale, from2, from ); } /* movaps xmm1 to [r32][r32*scale] */ -emitterT void eSSE_MOVAPSRtoRmS( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) +emitterT void SSE_MOVAPSRtoRmS( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale=0 ) { assert( from != EBP ); RexRXB(0, to, from2, from); - write16( 0x290f ); - ModRM( 0, to, 0x4 ); - SibSB( scale, from2, from ); + write16( 0x290f ); + ModRM( 0, to, 0x4 ); + SibSB( scale, from2, from ); } // movaps [r32+offset] to r32 -emitterT void eSSE_MOVAPSRmtoR( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE_MOVAPSRmtoR( x86SSERegType to, x86IntRegType from, int offset=0 ) { RexRB(0, to, from); - write16( 0x280f ); - WriteRmOffsetFrom(to, from, offset); + write16( 0x280f ); + WriteRmOffsetFrom(to, from, offset); } // movaps r32 to [r32+offset] -emitterT void eSSE_MOVAPSRtoRm( x86IntRegType to, x86SSERegType from, int offset=0 ) +emitterT void SSE_MOVAPSRtoRm( x86IntRegType to, x86SSERegType from, int offset=0 ) { RexRB(0, from, to); - write16( 0x290f ); - WriteRmOffsetFrom(from, to, offset); + write16( 0x290f ); + WriteRmOffsetFrom(from, to, offset); } // movdqa [r32+offset] to r32 -emitterT void eSSE2_MOVDQARmtoR( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE2_MOVDQARmtoR( x86SSERegType to, x86IntRegType from, int offset=0 ) { if( AlwaysUseMovaps ) - eSSE_MOVAPSRmtoR( to, from, offset ); + SSE_MOVAPSRmtoR( to, from, offset ); else { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write16( 0x6f0f ); - WriteRmOffsetFrom(to, from, offset); + write16( 0x6f0f ); + WriteRmOffsetFrom(to, from, offset); } } // movdqa r32 to [r32+offset] -emitterT void eSSE2_MOVDQARtoRm( x86IntRegType to, x86SSERegType from, int offset=0 ) +emitterT void SSE2_MOVDQARtoRm( x86IntRegType to, x86SSERegType from, int offset=0 ) { if( AlwaysUseMovaps ) - eSSE_MOVAPSRtoRm( to, from, offset ); + SSE_MOVAPSRtoRm( to, from, offset ); else { - write8(0x66); + write8(0x66); RexRB(0, from, to); - write16( 0x7f0f ); - WriteRmOffsetFrom(from, to, offset); + write16( 0x7f0f ); + WriteRmOffsetFrom(from, to, offset); } } // movups [r32+offset] to r32 -emitterT void eSSE_MOVUPSRmtoR( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE_MOVUPSRmtoR( x86SSERegType to, x86IntRegType from, int offset=0 ) { RexRB(0, to, from); - write16( 0x100f ); - WriteRmOffsetFrom(to, from, offset); + write16( 0x100f ); + WriteRmOffsetFrom(to, from, offset); } // movups r32 to [r32+offset] -emitterT void eSSE_MOVUPSRtoRm( x86IntRegType to, x86SSERegType from, int offset=0 ) +emitterT void SSE_MOVUPSRtoRm( x86IntRegType to, x86SSERegType from, int offset=0 ) { RexRB(0, from, to); - write16( 0x110f ); - WriteRmOffsetFrom(from, to, offset); + write16( 0x110f ); + WriteRmOffsetFrom(from, to, offset); } //**********************************************************************************/ //MOVAPS: Move aligned Packed Single Precision FP values * //********************************************************************************** -emitterT void eSSE_MOVAPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x280f, 0 ); } -emitterT void eSSE_MOVAPS_XMM_to_M128( uptr to, x86SSERegType from ) { SSERtoM( 0x290f, 0 ); } -emitterT void eSSE_MOVAPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { if (to != from) { SSERtoR( 0x280f ); } } +emitterT void SSE_MOVAPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x280f, 0 ); } +emitterT void SSE_MOVAPS_XMM_to_M128( uptr to, x86SSERegType from ) { SSERtoM( 0x290f, 0 ); } +emitterT void SSE_MOVAPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { if (to != from) { SSERtoR( 0x280f ); } } -emitterT void eSSE_MOVUPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x100f, 0 ); } -emitterT void eSSE_MOVUPS_XMM_to_M128( uptr to, x86SSERegType from ) { SSERtoM( 0x110f, 0 ); } +emitterT void SSE_MOVUPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x100f, 0 ); } +emitterT void SSE_MOVUPS_XMM_to_M128( uptr to, x86SSERegType from ) { SSERtoM( 0x110f, 0 ); } -emitterT void eSSE2_MOVSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x100f); } -emitterT void eSSE2_MOVSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x100f, 0); } -emitterT void eSSE2_MOVSD_XMM_to_M64( uptr to, x86SSERegType from ) { SSE_SD_RtoM( 0x110f, 0); } +emitterT void SSE2_MOVSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x100f); } +emitterT void SSE2_MOVSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x100f, 0); } +emitterT void SSE2_MOVSD_XMM_to_M64( uptr to, x86SSERegType from ) { SSE_SD_RtoM( 0x110f, 0); } -emitterT void eSSE2_MOVQ_M64_to_XMM( x86SSERegType to, uptr from ) +emitterT void SSE2_MOVQ_M64_to_XMM( x86SSERegType to, uptr from ) { - write8(0xf3); SSEMtoR( 0x7e0f, 0); + write8(0xf3); SSEMtoR( 0x7e0f, 0); } -emitterT void eSSE2_MOVQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) +emitterT void SSE2_MOVQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { - write8(0xf3); SSERtoR( 0x7e0f); + write8(0xf3); SSERtoR( 0x7e0f); } -emitterT void eSSE2_MOVQ_XMM_to_M64( u32 to, x86SSERegType from ) +emitterT void SSE2_MOVQ_XMM_to_M64( u32 to, x86SSERegType from ) { SSERtoM66(0xd60f); } -emitterT void eSSE2_MOVDQ2Q_XMM_to_MM( x86MMXRegType to, x86SSERegType from) +emitterT void SSE2_MOVDQ2Q_XMM_to_MM( x86MMXRegType to, x86SSERegType from) { - write8(0xf2); + write8(0xf2); SSERtoR( 0xd60f); } -emitterT void eSSE2_MOVQ2DQ_MM_to_XMM( x86SSERegType to, x86MMXRegType from) +emitterT void SSE2_MOVQ2DQ_MM_to_XMM( x86SSERegType to, x86MMXRegType from) { - write8(0xf3); + write8(0xf3); SSERtoR( 0xd60f); } //**********************************************************************************/ //MOVSS: Move Scalar Single-Precision FP value * //********************************************************************************** -emitterT void eSSE_MOVSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x100f, 0 ); } -emitterT void eSSE_MOVSS_XMM_to_M32( u32 to, x86SSERegType from ) { SSE_SS_RtoM( 0x110f, 0 ); } +emitterT void SSE_MOVSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x100f, 0 ); } +emitterT void SSE_MOVSS_XMM_to_M32( u32 to, x86SSERegType from ) { SSE_SS_RtoM( 0x110f, 0 ); } -emitterT void eSSE_MOVSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { if (to != from) { SSE_SS_RtoR( 0x100f ); } } +emitterT void SSE_MOVSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { if (to != from) { SSE_SS_RtoR( 0x100f ); } } -emitterT void eSSE_MOVSS_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE_MOVSS_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset=0 ) { - write8(0xf3); + write8(0xf3); RexRB(0, to, from); - write16( 0x100f ); - WriteRmOffsetFrom(to, from, offset); + write16( 0x100f ); + WriteRmOffsetFrom(to, from, offset); } -emitterT void eSSE_MOVSS_XMM_to_Rm( x86IntRegType to, x86SSERegType from, int offset=0 ) +emitterT void SSE_MOVSS_XMM_to_Rm( x86IntRegType to, x86SSERegType from, int offset=0 ) { - write8(0xf3); + write8(0xf3); RexRB(0, from, to); - write16(0x110f); - WriteRmOffsetFrom(from, to, offset); + write16(0x110f); + WriteRmOffsetFrom(from, to, offset); } -emitterT void eSSE_MASKMOVDQU_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xf70f ); } +emitterT void SSE_MASKMOVDQU_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xf70f ); } //**********************************************************************************/ //MOVLPS: Move low Packed Single-Precision FP * //********************************************************************************** -emitterT void eSSE_MOVLPS_M64_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x120f, 0 ); } -emitterT void eSSE_MOVLPS_XMM_to_M64( u32 to, x86SSERegType from ) { SSERtoM( 0x130f, 0 ); } +emitterT void SSE_MOVLPS_M64_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x120f, 0 ); } +emitterT void SSE_MOVLPS_XMM_to_M64( u32 to, x86SSERegType from ) { SSERtoM( 0x130f, 0 ); } -emitterT void eSSE_MOVLPS_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE_MOVLPS_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset=0 ) { RexRB(0, to, from); - write16( 0x120f ); - WriteRmOffsetFrom(to, from, offset); + write16( 0x120f ); + WriteRmOffsetFrom(to, from, offset); } -emitterT void eSSE_MOVLPS_XMM_to_Rm( x86IntRegType to, x86SSERegType from, int offset=0 ) +emitterT void SSE_MOVLPS_XMM_to_Rm( x86IntRegType to, x86SSERegType from, int offset=0 ) { RexRB(0, from, to); - write16(0x130f); - WriteRmOffsetFrom(from, to, offset); + write16(0x130f); + WriteRmOffsetFrom(from, to, offset); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MOVHPS: Move High Packed Single-Precision FP * //********************************************************************************** -emitterT void eSSE_MOVHPS_M64_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x160f, 0 ); } -emitterT void eSSE_MOVHPS_XMM_to_M64( u32 to, x86SSERegType from ) { SSERtoM( 0x170f, 0 ); } +emitterT void SSE_MOVHPS_M64_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x160f, 0 ); } +emitterT void SSE_MOVHPS_XMM_to_M64( u32 to, x86SSERegType from ) { SSERtoM( 0x170f, 0 ); } -emitterT void eSSE_MOVHPS_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE_MOVHPS_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset=0 ) { RexRB(0, to, from); - write16( 0x160f ); - WriteRmOffsetFrom(to, from, offset); + write16( 0x160f ); + WriteRmOffsetFrom(to, from, offset); } -emitterT void eSSE_MOVHPS_XMM_to_Rm( x86IntRegType to, x86SSERegType from, int offset=0 ) +emitterT void SSE_MOVHPS_XMM_to_Rm( x86IntRegType to, x86SSERegType from, int offset=0 ) { RexRB(0, from, to); - write16(0x170f); - WriteRmOffsetFrom(from, to, offset); + write16(0x170f); + WriteRmOffsetFrom(from, to, offset); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MOVLHPS: Moved packed Single-Precision FP low to high * //********************************************************************************** -emitterT void eSSE_MOVLHPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x160f ); } +emitterT void SSE_MOVLHPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x160f ); } ////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MOVHLPS: Moved packed Single-Precision FP High to Low * //********************************************************************************** -emitterT void eSSE_MOVHLPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x120f ); } +emitterT void SSE_MOVHLPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x120f ); } /////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //ANDPS: Logical Bit-wise AND for Single FP * //********************************************************************************** -emitterT void eSSE_ANDPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x540f, 0 ); } -emitterT void eSSE_ANDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x540f ); } +emitterT void SSE_ANDPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x540f, 0 ); } +emitterT void SSE_ANDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x540f ); } -emitterT void eSSE2_ANDPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x540f ); } -emitterT void eSSE2_ANDPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x540f ); } +emitterT void SSE2_ANDPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x540f ); } +emitterT void SSE2_ANDPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x540f ); } /////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //ANDNPS : Logical Bit-wise AND NOT of Single-precision FP values * //********************************************************************************** -emitterT void eSSE_ANDNPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x550f, 0 ); } -emitterT void eSSE_ANDNPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ){ SSERtoR( 0x550f ); } +emitterT void SSE_ANDNPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x550f, 0 ); } +emitterT void SSE_ANDNPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ){ SSERtoR( 0x550f ); } -emitterT void eSSE2_ANDNPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x550f ); } -emitterT void eSSE2_ANDNPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x550f ); } +emitterT void SSE2_ANDNPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x550f ); } +emitterT void SSE2_ANDNPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x550f ); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //RCPPS : Packed Single-Precision FP Reciprocal * //********************************************************************************** -emitterT void eSSE_RCPPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x530f ); } -emitterT void eSSE_RCPPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x530f, 0 ); } +emitterT void SSE_RCPPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x530f ); } +emitterT void SSE_RCPPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x530f, 0 ); } -emitterT void eSSE_RCPSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR(0x530f); } -emitterT void eSSE_RCPSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR(0x530f, 0); } +emitterT void SSE_RCPSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR(0x530f); } +emitterT void SSE_RCPSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR(0x530f, 0); } ////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //ORPS : Bit-wise Logical OR of Single-Precision FP Data * //********************************************************************************** -emitterT void eSSE_ORPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x560f, 0 ); } -emitterT void eSSE_ORPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x560f ); } +emitterT void SSE_ORPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x560f, 0 ); } +emitterT void SSE_ORPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x560f ); } -emitterT void eSSE2_ORPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x560f ); } -emitterT void eSSE2_ORPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x560f ); } +emitterT void SSE2_ORPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x560f ); } +emitterT void SSE2_ORPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x560f ); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //XORPS : Bitwise Logical XOR of Single-Precision FP Values * //********************************************************************************** -emitterT void eSSE_XORPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x570f, 0 ); } -emitterT void eSSE_XORPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x570f ); } +emitterT void SSE_XORPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x570f, 0 ); } +emitterT void SSE_XORPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x570f ); } -emitterT void eSSE2_XORPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x570f ); } -emitterT void eSSE2_XORPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x570f ); } +emitterT void SSE2_XORPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x570f ); } +emitterT void SSE2_XORPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x570f ); } /////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //ADDPS : ADD Packed Single-Precision FP Values * //********************************************************************************** -emitterT void eSSE_ADDPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x580f, 0 ); } -emitterT void eSSE_ADDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x580f ); } +emitterT void SSE_ADDPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x580f, 0 ); } +emitterT void SSE_ADDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x580f ); } //////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //ADDSS : ADD Scalar Single-Precision FP Values * //********************************************************************************** -emitterT void eSSE_ADDSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x580f, 0 ); } -emitterT void eSSE_ADDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x580f ); } +emitterT void SSE_ADDSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x580f, 0 ); } +emitterT void SSE_ADDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x580f ); } -emitterT void eSSE2_ADDSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x580f, 0 ); } -emitterT void eSSE2_ADDSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x580f ); } +emitterT void SSE2_ADDSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x580f, 0 ); } +emitterT void SSE2_ADDSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x580f ); } ///////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //SUBPS: Packed Single-Precision FP Subtract * //********************************************************************************** -emitterT void eSSE_SUBPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5c0f, 0 ); } -emitterT void eSSE_SUBPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5c0f ); } +emitterT void SSE_SUBPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5c0f, 0 ); } +emitterT void SSE_SUBPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5c0f ); } /////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //SUBSS : Scalar Single-Precision FP Subtract * //********************************************************************************** -emitterT void eSSE_SUBSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x5c0f, 0 ); } -emitterT void eSSE_SUBSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x5c0f ); } +emitterT void SSE_SUBSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x5c0f, 0 ); } +emitterT void SSE_SUBSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x5c0f ); } -emitterT void eSSE2_SUBSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x5c0f, 0 ); } -emitterT void eSSE2_SUBSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x5c0f ); } +emitterT void SSE2_SUBSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x5c0f, 0 ); } +emitterT void SSE2_SUBSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x5c0f ); } ///////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MULPS : Packed Single-Precision FP Multiply * //********************************************************************************** -emitterT void eSSE_MULPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x590f, 0 ); } -emitterT void eSSE_MULPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x590f ); } +emitterT void SSE_MULPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x590f, 0 ); } +emitterT void SSE_MULPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x590f ); } //////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MULSS : Scalar Single-Precision FP Multiply * //********************************************************************************** -emitterT void eSSE_MULSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x590f, 0 ); } -emitterT void eSSE_MULSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x590f ); } +emitterT void SSE_MULSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x590f, 0 ); } +emitterT void SSE_MULSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x590f ); } -emitterT void eSSE2_MULSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x590f, 0 ); } -emitterT void eSSE2_MULSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x590f ); } +emitterT void SSE2_MULSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x590f, 0 ); } +emitterT void SSE2_MULSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x590f ); } //////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ @@ -513,22 +513,22 @@ emitterT void eSSE2_MULSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { S //missing SSE_CMPPS_I8_to_XMM // SSE_CMPPS_M32_to_XMM // SSE_CMPPS_XMM_to_XMM -emitterT void eSSE_CMPEQPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 0 ); } -emitterT void eSSE_CMPEQPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 0 ); } -emitterT void eSSE_CMPLTPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 1 ); } -emitterT void eSSE_CMPLTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 1 ); } -emitterT void eSSE_CMPLEPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 2 ); } -emitterT void eSSE_CMPLEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 2 ); } -emitterT void eSSE_CMPUNORDPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 3 ); } -emitterT void eSSE_CMPUNORDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 3 ); } -emitterT void eSSE_CMPNEPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 4 ); } -emitterT void eSSE_CMPNEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 4 ); } -emitterT void eSSE_CMPNLTPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 5 ); } -emitterT void eSSE_CMPNLTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 5 ); } -emitterT void eSSE_CMPNLEPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 6 ); } -emitterT void eSSE_CMPNLEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 6 ); } -emitterT void eSSE_CMPORDPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 7 ); } -emitterT void eSSE_CMPORDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 7 ); } +emitterT void SSE_CMPEQPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 0 ); } +emitterT void SSE_CMPEQPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 0 ); } +emitterT void SSE_CMPLTPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 1 ); } +emitterT void SSE_CMPLTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 1 ); } +emitterT void SSE_CMPLEPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 2 ); } +emitterT void SSE_CMPLEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 2 ); } +emitterT void SSE_CMPUNORDPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 3 ); } +emitterT void SSE_CMPUNORDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 3 ); } +emitterT void SSE_CMPNEPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 4 ); } +emitterT void SSE_CMPNEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 4 ); } +emitterT void SSE_CMPNLTPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 5 ); } +emitterT void SSE_CMPNLTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 5 ); } +emitterT void SSE_CMPNLEPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 6 ); } +emitterT void SSE_CMPNLEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 6 ); } +emitterT void SSE_CMPORDPS_M128_to_XMM( x86SSERegType to, uptr from ) { CMPPSMtoR( 7 ); } +emitterT void SSE_CMPORDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPPSRtoR( 7 ); } /////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ @@ -537,194 +537,194 @@ emitterT void eSSE_CMPORDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) //missing SSE_CMPSS_I8_to_XMM // SSE_CMPSS_M32_to_XMM // SSE_CMPSS_XMM_to_XMM -emitterT void eSSE_CMPEQSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 0 ); } -emitterT void eSSE_CMPEQSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 0 ); } -emitterT void eSSE_CMPLTSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 1 ); } -emitterT void eSSE_CMPLTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 1 ); } -emitterT void eSSE_CMPLESS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 2 ); } -emitterT void eSSE_CMPLESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 2 ); } -emitterT void eSSE_CMPUNORDSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 3 ); } -emitterT void eSSE_CMPUNORDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 3 ); } -emitterT void eSSE_CMPNESS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 4 ); } -emitterT void eSSE_CMPNESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 4 ); } -emitterT void eSSE_CMPNLTSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 5 ); } -emitterT void eSSE_CMPNLTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 5 ); } -emitterT void eSSE_CMPNLESS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 6 ); } -emitterT void eSSE_CMPNLESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 6 ); } -emitterT void eSSE_CMPORDSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 7 ); } -emitterT void eSSE_CMPORDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 7 ); } +emitterT void SSE_CMPEQSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 0 ); } +emitterT void SSE_CMPEQSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 0 ); } +emitterT void SSE_CMPLTSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 1 ); } +emitterT void SSE_CMPLTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 1 ); } +emitterT void SSE_CMPLESS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 2 ); } +emitterT void SSE_CMPLESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 2 ); } +emitterT void SSE_CMPUNORDSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 3 ); } +emitterT void SSE_CMPUNORDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 3 ); } +emitterT void SSE_CMPNESS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 4 ); } +emitterT void SSE_CMPNESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 4 ); } +emitterT void SSE_CMPNLTSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 5 ); } +emitterT void SSE_CMPNLTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 5 ); } +emitterT void SSE_CMPNLESS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 6 ); } +emitterT void SSE_CMPNLESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 6 ); } +emitterT void SSE_CMPORDSS_M32_to_XMM( x86SSERegType to, uptr from ) { CMPSSMtoR( 7 ); } +emitterT void SSE_CMPORDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSSRtoR( 7 ); } -emitterT void eSSE2_CMPEQSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 0 ); } -emitterT void eSSE2_CMPEQSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 0 ); } -emitterT void eSSE2_CMPLTSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 1 ); } -emitterT void eSSE2_CMPLTSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 1 ); } -emitterT void eSSE2_CMPLESD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 2 ); } -emitterT void eSSE2_CMPLESD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 2 ); } -emitterT void eSSE2_CMPUNORDSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 3 ); } -emitterT void eSSE2_CMPUNORDSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 3 ); } -emitterT void eSSE2_CMPNESD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 4 ); } -emitterT void eSSE2_CMPNESD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 4 ); } -emitterT void eSSE2_CMPNLTSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 5 ); } -emitterT void eSSE2_CMPNLTSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 5 ); } -emitterT void eSSE2_CMPNLESD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 6 ); } -emitterT void eSSE2_CMPNLESD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 6 ); } -emitterT void eSSE2_CMPORDSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 7 ); } -emitterT void eSSE2_CMPORDSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 7 ); } +emitterT void SSE2_CMPEQSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 0 ); } +emitterT void SSE2_CMPEQSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 0 ); } +emitterT void SSE2_CMPLTSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 1 ); } +emitterT void SSE2_CMPLTSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 1 ); } +emitterT void SSE2_CMPLESD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 2 ); } +emitterT void SSE2_CMPLESD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 2 ); } +emitterT void SSE2_CMPUNORDSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 3 ); } +emitterT void SSE2_CMPUNORDSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 3 ); } +emitterT void SSE2_CMPNESD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 4 ); } +emitterT void SSE2_CMPNESD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 4 ); } +emitterT void SSE2_CMPNLTSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 5 ); } +emitterT void SSE2_CMPNLTSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 5 ); } +emitterT void SSE2_CMPNLESD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 6 ); } +emitterT void SSE2_CMPNLESD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 6 ); } +emitterT void SSE2_CMPORDSD_M64_to_XMM( x86SSERegType to, uptr from ) { CMPSDMtoR( 7 ); } +emitterT void SSE2_CMPORDSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { CMPSDRtoR( 7 ); } -emitterT void eSSE_UCOMISS_M32_to_XMM( x86SSERegType to, uptr from ) +emitterT void SSE_UCOMISS_M32_to_XMM( x86SSERegType to, uptr from ) { RexR(0, to); - write16( 0x2e0f ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0x2e0f ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void eSSE_UCOMISS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) +emitterT void SSE_UCOMISS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { RexRB(0, to, from); - write16( 0x2e0f ); - ModRM( 3, to, from ); + write16( 0x2e0f ); + ModRM( 3, to, from ); } -emitterT void eSSE2_UCOMISD_M64_to_XMM( x86SSERegType to, uptr from ) +emitterT void SSE2_UCOMISD_M64_to_XMM( x86SSERegType to, uptr from ) { - write8(0x66); + write8(0x66); RexR(0, to); - write16( 0x2e0f ); - ModRM( 0, to, DISP32 ); - write32( MEMADDR(from, 4) ); + write16( 0x2e0f ); + ModRM( 0, to, DISP32 ); + write32( MEMADDR(from, 4) ); } -emitterT void eSSE2_UCOMISD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) +emitterT void SSE2_UCOMISD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write16( 0x2e0f ); - ModRM( 3, to, from ); + write16( 0x2e0f ); + ModRM( 3, to, from ); } ////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //RSQRTPS : Packed Single-Precision FP Square Root Reciprocal * //********************************************************************************** -emitterT void eSSE_RSQRTPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x520f, 0 ); } -emitterT void eSSE_RSQRTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x520f ); } +emitterT void SSE_RSQRTPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x520f, 0 ); } +emitterT void SSE_RSQRTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x520f ); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //RSQRTSS : Scalar Single-Precision FP Square Root Reciprocal * //********************************************************************************** -emitterT void eSSE_RSQRTSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x520f, 0 ); } -emitterT void eSSE_RSQRTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x520f ); } +emitterT void SSE_RSQRTSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x520f, 0 ); } +emitterT void SSE_RSQRTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x520f ); } //////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //SQRTPS : Packed Single-Precision FP Square Root * //********************************************************************************** -emitterT void eSSE_SQRTPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x510f, 0 ); } -emitterT void eSSE_SQRTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x510f ); } +emitterT void SSE_SQRTPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x510f, 0 ); } +emitterT void SSE_SQRTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x510f ); } ////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //SQRTSS : Scalar Single-Precision FP Square Root * //********************************************************************************** -emitterT void eSSE_SQRTSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x510f, 0 ); } -emitterT void eSSE_SQRTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x510f ); } +emitterT void SSE_SQRTSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x510f, 0 ); } +emitterT void SSE_SQRTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x510f ); } -emitterT void eSSE2_SQRTSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x510f, 0 ); } -emitterT void eSSE2_SQRTSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ){ SSE_SD_RtoR( 0x510f ); } +emitterT void SSE2_SQRTSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x510f, 0 ); } +emitterT void SSE2_SQRTSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ){ SSE_SD_RtoR( 0x510f ); } //////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MAXPS: Return Packed Single-Precision FP Maximum * //********************************************************************************** -emitterT void eSSE_MAXPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5f0f, 0 ); } -emitterT void eSSE_MAXPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5f0f ); } +emitterT void SSE_MAXPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5f0f, 0 ); } +emitterT void SSE_MAXPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5f0f ); } -emitterT void eSSE2_MAXPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x5f0f ); } -emitterT void eSSE2_MAXPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x5f0f ); } +emitterT void SSE2_MAXPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x5f0f ); } +emitterT void SSE2_MAXPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x5f0f ); } ///////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MAXSS: Return Scalar Single-Precision FP Maximum * //********************************************************************************** -emitterT void eSSE_MAXSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x5f0f, 0 ); } -emitterT void eSSE_MAXSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x5f0f ); } +emitterT void SSE_MAXSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x5f0f, 0 ); } +emitterT void SSE_MAXSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x5f0f ); } -emitterT void eSSE2_MAXSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x5f0f, 0 ); } -emitterT void eSSE2_MAXSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x5f0f ); } +emitterT void SSE2_MAXSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x5f0f, 0 ); } +emitterT void SSE2_MAXSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x5f0f ); } ///////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //CVTPI2PS: Packed Signed INT32 to Packed Single FP Conversion * //********************************************************************************** -emitterT void eSSE_CVTPI2PS_M64_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x2a0f, 0 ); } -emitterT void eSSE_CVTPI2PS_MM_to_XMM( x86SSERegType to, x86MMXRegType from ) { SSERtoR( 0x2a0f ); } +emitterT void SSE_CVTPI2PS_M64_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x2a0f, 0 ); } +emitterT void SSE_CVTPI2PS_MM_to_XMM( x86SSERegType to, x86MMXRegType from ) { SSERtoR( 0x2a0f ); } /////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //CVTPS2PI: Packed Single FP to Packed Signed INT32 Conversion * //********************************************************************************** -emitterT void eSSE_CVTPS2PI_M64_to_MM( x86MMXRegType to, uptr from ) { SSEMtoR( 0x2d0f, 0 ); } -emitterT void eSSE_CVTPS2PI_XMM_to_MM( x86MMXRegType to, x86SSERegType from ) { SSERtoR( 0x2d0f ); } +emitterT void SSE_CVTPS2PI_M64_to_MM( x86MMXRegType to, uptr from ) { SSEMtoR( 0x2d0f, 0 ); } +emitterT void SSE_CVTPS2PI_XMM_to_MM( x86MMXRegType to, x86SSERegType from ) { SSERtoR( 0x2d0f ); } -emitterT void eSSE_CVTTSS2SI_M32_to_R32(x86IntRegType to, uptr from) { write8(0xf3); SSEMtoR(0x2c0f, 0); } -emitterT void eSSE_CVTTSS2SI_XMM_to_R32(x86IntRegType to, x86SSERegType from) +emitterT void SSE_CVTTSS2SI_M32_to_R32(x86IntRegType to, uptr from) { write8(0xf3); SSEMtoR(0x2c0f, 0); } +emitterT void SSE_CVTTSS2SI_XMM_to_R32(x86IntRegType to, x86SSERegType from) { - write8(0xf3); + write8(0xf3); RexRB(0, to, from); - write16(0x2c0f); - ModRM(3, to, from); + write16(0x2c0f); + ModRM(3, to, from); } -emitterT void eSSE_CVTSI2SS_M32_to_XMM(x86SSERegType to, uptr from) { write8(0xf3); SSEMtoR(0x2a0f, 0); } -emitterT void eSSE_CVTSI2SS_R_to_XMM(x86SSERegType to, x86IntRegType from) +emitterT void SSE_CVTSI2SS_M32_to_XMM(x86SSERegType to, uptr from) { write8(0xf3); SSEMtoR(0x2a0f, 0); } +emitterT void SSE_CVTSI2SS_R_to_XMM(x86SSERegType to, x86IntRegType from) { - write8(0xf3); + write8(0xf3); RexRB(0, to, from); - write16(0x2a0f); - ModRM(3, to, from); + write16(0x2a0f); + ModRM(3, to, from); } -emitterT void eSSE2_CVTSS2SD_M32_to_XMM( x86SSERegType to, uptr from) { SSE_SS_MtoR(0x5a0f, 0); } -emitterT void eSSE2_CVTSS2SD_XMM_to_XMM( x86SSERegType to, x86SSERegType from) { SSE_SS_RtoR(0x5a0f); } +emitterT void SSE2_CVTSS2SD_M32_to_XMM( x86SSERegType to, uptr from) { SSE_SS_MtoR(0x5a0f, 0); } +emitterT void SSE2_CVTSS2SD_XMM_to_XMM( x86SSERegType to, x86SSERegType from) { SSE_SS_RtoR(0x5a0f); } -emitterT void eSSE2_CVTSD2SS_M64_to_XMM( x86SSERegType to, uptr from) { SSE_SD_MtoR(0x5a0f, 0); } -emitterT void eSSE2_CVTSD2SS_XMM_to_XMM( x86SSERegType to, x86SSERegType from) { SSE_SD_RtoR(0x5a0f); } +emitterT void SSE2_CVTSD2SS_M64_to_XMM( x86SSERegType to, uptr from) { SSE_SD_MtoR(0x5a0f, 0); } +emitterT void SSE2_CVTSD2SS_XMM_to_XMM( x86SSERegType to, x86SSERegType from) { SSE_SD_RtoR(0x5a0f); } /////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //CVTDQ2PS: Packed Signed INT32 to Packed Single Precision FP Conversion * //********************************************************************************** -emitterT void eSSE2_CVTDQ2PS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5b0f, 0 ); } -emitterT void eSSE2_CVTDQ2PS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5b0f ); } +emitterT void SSE2_CVTDQ2PS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5b0f, 0 ); } +emitterT void SSE2_CVTDQ2PS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5b0f ); } //**********************************************************************************/ //CVTPS2DQ: Packed Single Precision FP to Packed Signed INT32 Conversion * //********************************************************************************** -emitterT void eSSE2_CVTPS2DQ_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x5b0f ); } -emitterT void eSSE2_CVTPS2DQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x5b0f ); } +emitterT void SSE2_CVTPS2DQ_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x5b0f ); } +emitterT void SSE2_CVTPS2DQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x5b0f ); } -emitterT void eSSE2_CVTTPS2DQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from ){ write8(0xf3); SSERtoR(0x5b0f); } +emitterT void SSE2_CVTTPS2DQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from ){ write8(0xf3); SSERtoR(0x5b0f); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MINPS: Return Packed Single-Precision FP Minimum * //********************************************************************************** -emitterT void eSSE_MINPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5d0f, 0 ); } -emitterT void eSSE_MINPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5d0f ); } +emitterT void SSE_MINPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5d0f, 0 ); } +emitterT void SSE_MINPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5d0f ); } -emitterT void eSSE2_MINPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x5d0f ); } -emitterT void eSSE2_MINPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x5d0f ); } +emitterT void SSE2_MINPD_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0x5d0f ); } +emitterT void SSE2_MINPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0x5d0f ); } ////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MINSS: Return Scalar Single-Precision FP Minimum * //********************************************************************************** -emitterT void eSSE_MINSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x5d0f, 0 ); } -emitterT void eSSE_MINSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x5d0f ); } +emitterT void SSE_MINSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x5d0f, 0 ); } +emitterT void SSE_MINSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x5d0f ); } -emitterT void eSSE2_MINSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x5d0f, 0 ); } -emitterT void eSSE2_MINSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x5d0f ); } +emitterT void SSE2_MINSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x5d0f, 0 ); } +emitterT void SSE2_MINSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x5d0f ); } /////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ @@ -734,7 +734,7 @@ emitterT void eSSE2_MINSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { S // SSE_PMAXSW_M64_to_MM // SSE2_PMAXSW_M128_to_XMM // SSE2_PMAXSW_XMM_to_XMM -emitterT void eSSE_PMAXSW_MM_to_MM( x86MMXRegType to, x86MMXRegType from ){ SSERtoR( 0xEE0F ); } +emitterT void SSE_PMAXSW_MM_to_MM( x86MMXRegType to, x86MMXRegType from ){ SSERtoR( 0xEE0F ); } /////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ @@ -744,659 +744,659 @@ emitterT void eSSE_PMAXSW_MM_to_MM( x86MMXRegType to, x86MMXRegType from ){ SSER // SSE_PMINSW_M64_to_MM // SSE2_PMINSW_M128_to_XMM // SSE2_PMINSW_XMM_to_XMM -emitterT void eSSE_PMINSW_MM_to_MM( x86MMXRegType to, x86MMXRegType from ){ SSERtoR( 0xEA0F ); } +emitterT void SSE_PMINSW_MM_to_MM( x86MMXRegType to, x86MMXRegType from ){ SSERtoR( 0xEA0F ); } ////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //SHUFPS: Shuffle Packed Single-Precision FP Values * //********************************************************************************** -emitterT void eSSE_SHUFPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { SSERtoR( 0xC60F ); write8( imm8 ); } -emitterT void eSSE_SHUFPS_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { SSEMtoR( 0xC60F, 1 ); write8( imm8 ); } +emitterT void SSE_SHUFPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { SSERtoR( 0xC60F ); write8( imm8 ); } +emitterT void SSE_SHUFPS_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { SSEMtoR( 0xC60F, 1 ); write8( imm8 ); } -emitterT void eSSE_SHUFPS_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset, u8 imm8 ) +emitterT void SSE_SHUFPS_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset, u8 imm8 ) { RexRB(0, to, from); - write16(0xc60f); - WriteRmOffsetFrom(to, from, offset); - write8(imm8); + write16(0xc60f); + WriteRmOffsetFrom(to, from, offset); + write8(imm8); } ////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //SHUFPD: Shuffle Packed Double-Precision FP Values * //********************************************************************************** -emitterT void eSSE2_SHUFPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { SSERtoR66( 0xC60F ); write8( imm8 ); } -emitterT void eSSE2_SHUFPD_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { SSEMtoR66( 0xC60F ); write8( imm8 ); } +emitterT void SSE2_SHUFPD_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { SSERtoR66( 0xC60F ); write8( imm8 ); } +emitterT void SSE2_SHUFPD_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { SSEMtoR66( 0xC60F ); write8( imm8 ); } //////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //PSHUFD: Shuffle Packed DoubleWords * //********************************************************************************** -emitterT void eSSE2_PSHUFD_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) +emitterT void SSE2_PSHUFD_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { SSERtoR66( 0x700F ); - write8( imm8 ); + write8( imm8 ); } -emitterT void eSSE2_PSHUFD_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { SSEMtoR66( 0x700F ); write8( imm8 ); } +emitterT void SSE2_PSHUFD_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { SSEMtoR66( 0x700F ); write8( imm8 ); } -emitterT void eSSE2_PSHUFLW_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { write8(0xF2); SSERtoR(0x700F); write8(imm8); } -emitterT void eSSE2_PSHUFLW_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { write8(0xF2); SSEMtoR(0x700F, 1); write8(imm8); } -emitterT void eSSE2_PSHUFHW_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { write8(0xF3); SSERtoR(0x700F); write8(imm8); } -emitterT void eSSE2_PSHUFHW_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { write8(0xF3); SSEMtoR(0x700F, 1); write8(imm8); } +emitterT void SSE2_PSHUFLW_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { write8(0xF2); SSERtoR(0x700F); write8(imm8); } +emitterT void SSE2_PSHUFLW_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { write8(0xF2); SSEMtoR(0x700F, 1); write8(imm8); } +emitterT void SSE2_PSHUFHW_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 ) { write8(0xF3); SSERtoR(0x700F); write8(imm8); } +emitterT void SSE2_PSHUFHW_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 ) { write8(0xF3); SSEMtoR(0x700F, 1); write8(imm8); } /////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //UNPCKLPS: Unpack and Interleave low Packed Single-Precision FP Data * //********************************************************************************** -emitterT void eSSE_UNPCKLPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR(0x140f, 0); } -emitterT void eSSE_UNPCKLPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x140F ); } +emitterT void SSE_UNPCKLPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR(0x140f, 0); } +emitterT void SSE_UNPCKLPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x140F ); } //////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //UNPCKHPS: Unpack and Interleave High Packed Single-Precision FP Data * //********************************************************************************** -emitterT void eSSE_UNPCKHPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR(0x150f, 0); } -emitterT void eSSE_UNPCKHPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x150F ); } +emitterT void SSE_UNPCKHPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR(0x150f, 0); } +emitterT void SSE_UNPCKHPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x150F ); } //////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //DIVPS : Packed Single-Precision FP Divide * //********************************************************************************** -emitterT void eSSE_DIVPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5e0F, 0 ); } -emitterT void eSSE_DIVPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5e0F ); } +emitterT void SSE_DIVPS_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR( 0x5e0F, 0 ); } +emitterT void SSE_DIVPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR( 0x5e0F ); } ////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //DIVSS : Scalar Single-Precision FP Divide * //********************************************************************************** -emitterT void eSSE_DIVSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x5e0F, 0 ); } -emitterT void eSSE_DIVSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x5e0F ); } +emitterT void SSE_DIVSS_M32_to_XMM( x86SSERegType to, uptr from ) { SSE_SS_MtoR( 0x5e0F, 0 ); } +emitterT void SSE_DIVSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SS_RtoR( 0x5e0F ); } -emitterT void eSSE2_DIVSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x5e0F, 0 ); } -emitterT void eSSE2_DIVSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x5e0F ); } +emitterT void SSE2_DIVSD_M64_to_XMM( x86SSERegType to, uptr from ) { SSE_SD_MtoR( 0x5e0F, 0 ); } +emitterT void SSE2_DIVSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSE_SD_RtoR( 0x5e0F ); } ///////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //STMXCSR : Store Streaming SIMD Extension Control/Status * //********************************************************************************** -emitterT void eSSE_STMXCSR( uptr from ) { - write16( 0xAE0F ); - ModRM( 0, 0x3, DISP32 ); - write32( MEMADDR(from, 4) ); +emitterT void SSE_STMXCSR( uptr from ) { + write16( 0xAE0F ); + ModRM( 0, 0x3, DISP32 ); + write32( MEMADDR(from, 4) ); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //LDMXCSR : Load Streaming SIMD Extension Control/Status * //********************************************************************************** -emitterT void eSSE_LDMXCSR( uptr from ) { - write16( 0xAE0F ); - ModRM( 0, 0x2, DISP32 ); - write32( MEMADDR(from, 4) ); +emitterT void SSE_LDMXCSR( uptr from ) { + write16( 0xAE0F ); + ModRM( 0, 0x2, DISP32 ); + write32( MEMADDR(from, 4) ); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //PADDB,PADDW,PADDD : Add Packed Integers * //********************************************************************************** -emitterT void eSSE2_PADDB_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFC0F ); } -emitterT void eSSE2_PADDB_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFC0F ); } -emitterT void eSSE2_PADDW_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFD0F ); } -emitterT void eSSE2_PADDW_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFD0F ); } -emitterT void eSSE2_PADDD_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFE0F ); } -emitterT void eSSE2_PADDD_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFE0F ); } -emitterT void eSSE2_PADDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xD40F ); } -emitterT void eSSE2_PADDQ_M128_to_XMM(x86SSERegType to, uptr from ) { SSEMtoR66( 0xD40F ); } +emitterT void SSE2_PADDB_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFC0F ); } +emitterT void SSE2_PADDB_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFC0F ); } +emitterT void SSE2_PADDW_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFD0F ); } +emitterT void SSE2_PADDW_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFD0F ); } +emitterT void SSE2_PADDD_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFE0F ); } +emitterT void SSE2_PADDD_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFE0F ); } +emitterT void SSE2_PADDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xD40F ); } +emitterT void SSE2_PADDQ_M128_to_XMM(x86SSERegType to, uptr from ) { SSEMtoR66( 0xD40F ); } /////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //PCMPxx: Compare Packed Integers * //********************************************************************************** -emitterT void eSSE2_PCMPGTB_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x640F ); } -emitterT void eSSE2_PCMPGTB_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x640F ); } -emitterT void eSSE2_PCMPGTW_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x650F ); } -emitterT void eSSE2_PCMPGTW_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x650F ); } -emitterT void eSSE2_PCMPGTD_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x660F ); } -emitterT void eSSE2_PCMPGTD_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x660F ); } -emitterT void eSSE2_PCMPEQB_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x740F ); } -emitterT void eSSE2_PCMPEQB_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x740F ); } -emitterT void eSSE2_PCMPEQW_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x750F ); } -emitterT void eSSE2_PCMPEQW_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x750F ); } -emitterT void eSSE2_PCMPEQD_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x760F ); } -emitterT void eSSE2_PCMPEQD_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x760F ); } +emitterT void SSE2_PCMPGTB_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x640F ); } +emitterT void SSE2_PCMPGTB_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x640F ); } +emitterT void SSE2_PCMPGTW_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x650F ); } +emitterT void SSE2_PCMPGTW_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x650F ); } +emitterT void SSE2_PCMPGTD_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x660F ); } +emitterT void SSE2_PCMPGTD_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x660F ); } +emitterT void SSE2_PCMPEQB_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x740F ); } +emitterT void SSE2_PCMPEQB_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x740F ); } +emitterT void SSE2_PCMPEQW_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x750F ); } +emitterT void SSE2_PCMPEQW_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x750F ); } +emitterT void SSE2_PCMPEQD_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0x760F ); } +emitterT void SSE2_PCMPEQD_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0x760F ); } //////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //PEXTRW,PINSRW: Packed Extract/Insert Word * //********************************************************************************** -emitterT void eSSE_PEXTRW_XMM_to_R32(x86IntRegType to, x86SSERegType from, u8 imm8 ){ SSERtoR66(0xC50F); write8( imm8 ); } -emitterT void eSSE_PINSRW_R32_to_XMM(x86SSERegType to, x86IntRegType from, u8 imm8 ){ SSERtoR66(0xC40F); write8( imm8 ); } +emitterT void SSE_PEXTRW_XMM_to_R32(x86IntRegType to, x86SSERegType from, u8 imm8 ){ SSERtoR66(0xC50F); write8( imm8 ); } +emitterT void SSE_PINSRW_R32_to_XMM(x86SSERegType to, x86IntRegType from, u8 imm8 ){ SSERtoR66(0xC40F); write8( imm8 ); } //////////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //PSUBx: Subtract Packed Integers * //********************************************************************************** -emitterT void eSSE2_PSUBB_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xF80F ); } -emitterT void eSSE2_PSUBB_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xF80F ); } -emitterT void eSSE2_PSUBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xF90F ); } -emitterT void eSSE2_PSUBW_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xF90F ); } -emitterT void eSSE2_PSUBD_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFA0F ); } -emitterT void eSSE2_PSUBD_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFA0F ); } -emitterT void eSSE2_PSUBQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFB0F ); } -emitterT void eSSE2_PSUBQ_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFB0F ); } +emitterT void SSE2_PSUBB_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xF80F ); } +emitterT void SSE2_PSUBB_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xF80F ); } +emitterT void SSE2_PSUBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xF90F ); } +emitterT void SSE2_PSUBW_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xF90F ); } +emitterT void SSE2_PSUBD_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFA0F ); } +emitterT void SSE2_PSUBD_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFA0F ); } +emitterT void SSE2_PSUBQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from ){ SSERtoR66( 0xFB0F ); } +emitterT void SSE2_PSUBQ_M128_to_XMM(x86SSERegType to, uptr from ){ SSEMtoR66( 0xFB0F ); } /////////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //MOVD: Move Dword(32bit) to /from XMM reg * //********************************************************************************** -emitterT void eSSE2_MOVD_M32_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66(0x6E0F); } -emitterT void eSSE2_MOVD_R_to_XMM( x86SSERegType to, x86IntRegType from ) { SSERtoR66(0x6E0F); } +emitterT void SSE2_MOVD_M32_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66(0x6E0F); } +emitterT void SSE2_MOVD_R_to_XMM( x86SSERegType to, x86IntRegType from ) { SSERtoR66(0x6E0F); } -emitterT void eSSE2_MOVD_Rm_to_XMM( x86SSERegType to, x86IntRegType from ) +emitterT void SSE2_MOVD_Rm_to_XMM( x86SSERegType to, x86IntRegType from ) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write16( 0x6e0f ); - ModRM( 0, to, from); + write16( 0x6e0f ); + ModRM( 0, to, from); } -emitterT void eSSE2_MOVD_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset=0 ) +emitterT void SSE2_MOVD_Rm_to_XMM( x86SSERegType to, x86IntRegType from, int offset=0 ) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write16( 0x6e0f ); - WriteRmOffsetFrom(to, from, offset); + write16( 0x6e0f ); + WriteRmOffsetFrom(to, from, offset); } -emitterT void eSSE2_MOVD_XMM_to_M32( u32 to, x86SSERegType from ) { SSERtoM66(0x7E0F); } -emitterT void eSSE2_MOVD_XMM_to_R( x86IntRegType to, x86SSERegType from ) { _SSERtoR66(0x7E0F); } +emitterT void SSE2_MOVD_XMM_to_M32( u32 to, x86SSERegType from ) { SSERtoM66(0x7E0F); } +emitterT void SSE2_MOVD_XMM_to_R( x86IntRegType to, x86SSERegType from ) { _SSERtoR66(0x7E0F); } -emitterT void eSSE2_MOVD_XMM_to_Rm( x86IntRegType to, x86SSERegType from, int offset=0 ) +emitterT void SSE2_MOVD_XMM_to_Rm( x86IntRegType to, x86SSERegType from, int offset=0 ) { - write8(0x66); + write8(0x66); RexRB(0, from, to); - write16( 0x7e0f ); - WriteRmOffsetFrom(from, to, offset); + write16( 0x7e0f ); + WriteRmOffsetFrom(from, to, offset); } //////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //POR : SSE Bitwise OR * //********************************************************************************** -emitterT void eSSE2_POR_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEB0F ); } -emitterT void eSSE2_POR_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEB0F ); } +emitterT void SSE2_POR_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEB0F ); } +emitterT void SSE2_POR_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEB0F ); } // logical and to &= from -emitterT void eSSE2_PAND_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDB0F ); } -emitterT void eSSE2_PAND_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDB0F ); } +emitterT void SSE2_PAND_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDB0F ); } +emitterT void SSE2_PAND_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDB0F ); } // to = (~to) & from -emitterT void eSSE2_PANDN_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDF0F ); } -emitterT void eSSE2_PANDN_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDF0F ); } +emitterT void SSE2_PANDN_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDF0F ); } +emitterT void SSE2_PANDN_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDF0F ); } ///////////////////////////////////////////////////////////////////////////////////// //**********************************************************************************/ //PXOR : SSE Bitwise XOR * //********************************************************************************** -emitterT void eSSE2_PXOR_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEF0F ); } -emitterT void eSSE2_PXOR_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEF0F ); } +emitterT void SSE2_PXOR_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEF0F ); } +emitterT void SSE2_PXOR_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEF0F ); } /////////////////////////////////////////////////////////////////////////////////////// -emitterT void eSSE2_MOVDQA_M128_to_XMM(x86SSERegType to, uptr from) { if( AlwaysUseMovaps ) eSSE_MOVAPS_M128_to_XMM( to, from ); else SSEMtoR66(0x6F0F); } -emitterT void eSSE2_MOVDQA_XMM_to_M128( uptr to, x86SSERegType from ) { if( AlwaysUseMovaps ) eSSE_MOVAPS_XMM_to_M128( to, from ); else SSERtoM66(0x7F0F); } -emitterT void eSSE2_MOVDQA_XMM_to_XMM( x86SSERegType to, x86SSERegType from) { if( AlwaysUseMovaps ) eSSE_MOVAPS_XMM_to_XMM( to, from ); else if( to != from ) SSERtoR66(0x6F0F); } +emitterT void SSE2_MOVDQA_M128_to_XMM(x86SSERegType to, uptr from) { if( AlwaysUseMovaps ) SSE_MOVAPS_M128_to_XMM( to, from ); else SSEMtoR66(0x6F0F); } +emitterT void SSE2_MOVDQA_XMM_to_M128( uptr to, x86SSERegType from ) { if( AlwaysUseMovaps ) SSE_MOVAPS_XMM_to_M128( to, from ); else SSERtoM66(0x7F0F); } +emitterT void SSE2_MOVDQA_XMM_to_XMM( x86SSERegType to, x86SSERegType from) { if( AlwaysUseMovaps ) SSE_MOVAPS_XMM_to_XMM( to, from ); else if( to != from ) SSERtoR66(0x6F0F); } -emitterT void eSSE2_MOVDQU_M128_to_XMM(x86SSERegType to, uptr from) +emitterT void SSE2_MOVDQU_M128_to_XMM(x86SSERegType to, uptr from) { if( AlwaysUseMovaps ) - eSSE_MOVUPS_M128_to_XMM( to, from ); + SSE_MOVUPS_M128_to_XMM( to, from ); else { - write8(0xF3); + write8(0xF3); SSEMtoR(0x6F0F, 0); } } -emitterT void eSSE2_MOVDQU_XMM_to_M128( uptr to, x86SSERegType from) +emitterT void SSE2_MOVDQU_XMM_to_M128( uptr to, x86SSERegType from) { if( AlwaysUseMovaps ) - eSSE_MOVUPS_XMM_to_M128( to, from ); + SSE_MOVUPS_XMM_to_M128( to, from ); else { - write8(0xF3); + write8(0xF3); SSERtoM(0x7F0F, 0); } } // shift right logical -emitterT void eSSE2_PSRLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xD10F); } -emitterT void eSSE2_PSRLW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xD10F); } -emitterT void eSSE2_PSRLW_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSRLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xD10F); } +emitterT void SSE2_PSRLW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xD10F); } +emitterT void SSE2_PSRLW_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x710F ); - ModRM( 3, 2 , to ); - write8( imm8 ); + write16( 0x710F ); + ModRM( 3, 2 , to ); + write8( imm8 ); } -emitterT void eSSE2_PSRLD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xD20F); } -emitterT void eSSE2_PSRLD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xD20F); } -emitterT void eSSE2_PSRLD_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSRLD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xD20F); } +emitterT void SSE2_PSRLD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xD20F); } +emitterT void SSE2_PSRLD_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x720F ); - ModRM( 3, 2 , to ); - write8( imm8 ); + write16( 0x720F ); + ModRM( 3, 2 , to ); + write8( imm8 ); } -emitterT void eSSE2_PSRLQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xD30F); } -emitterT void eSSE2_PSRLQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xD30F); } -emitterT void eSSE2_PSRLQ_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSRLQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xD30F); } +emitterT void SSE2_PSRLQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xD30F); } +emitterT void SSE2_PSRLQ_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x730F ); - ModRM( 3, 2 , to ); - write8( imm8 ); + write16( 0x730F ); + ModRM( 3, 2 , to ); + write8( imm8 ); } -emitterT void eSSE2_PSRLDQ_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSRLDQ_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x730F ); - ModRM( 3, 3 , to ); - write8( imm8 ); + write16( 0x730F ); + ModRM( 3, 3 , to ); + write8( imm8 ); } // shift right arithmetic -emitterT void eSSE2_PSRAW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xE10F); } -emitterT void eSSE2_PSRAW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xE10F); } -emitterT void eSSE2_PSRAW_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSRAW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xE10F); } +emitterT void SSE2_PSRAW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xE10F); } +emitterT void SSE2_PSRAW_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x710F ); - ModRM( 3, 4 , to ); - write8( imm8 ); + write16( 0x710F ); + ModRM( 3, 4 , to ); + write8( imm8 ); } -emitterT void eSSE2_PSRAD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xE20F); } -emitterT void eSSE2_PSRAD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xE20F); } -emitterT void eSSE2_PSRAD_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSRAD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xE20F); } +emitterT void SSE2_PSRAD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xE20F); } +emitterT void SSE2_PSRAD_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x720F ); - ModRM( 3, 4 , to ); - write8( imm8 ); + write16( 0x720F ); + ModRM( 3, 4 , to ); + write8( imm8 ); } // shift left logical -emitterT void eSSE2_PSLLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xF10F); } -emitterT void eSSE2_PSLLW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xF10F); } -emitterT void eSSE2_PSLLW_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSLLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xF10F); } +emitterT void SSE2_PSLLW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xF10F); } +emitterT void SSE2_PSLLW_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x710F ); - ModRM( 3, 6 , to ); - write8( imm8 ); + write16( 0x710F ); + ModRM( 3, 6 , to ); + write8( imm8 ); } -emitterT void eSSE2_PSLLD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xF20F); } -emitterT void eSSE2_PSLLD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xF20F); } -emitterT void eSSE2_PSLLD_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSLLD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xF20F); } +emitterT void SSE2_PSLLD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xF20F); } +emitterT void SSE2_PSLLD_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x720F ); - ModRM( 3, 6 , to ); - write8( imm8 ); + write16( 0x720F ); + ModRM( 3, 6 , to ); + write8( imm8 ); } -emitterT void eSSE2_PSLLQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xF30F); } -emitterT void eSSE2_PSLLQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xF30F); } -emitterT void eSSE2_PSLLQ_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSLLQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xF30F); } +emitterT void SSE2_PSLLQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66(0xF30F); } +emitterT void SSE2_PSLLQ_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x730F ); - ModRM( 3, 6 , to ); - write8( imm8 ); + write16( 0x730F ); + ModRM( 3, 6 , to ); + write8( imm8 ); } -emitterT void eSSE2_PSLLDQ_I8_to_XMM(x86SSERegType to, u8 imm8) +emitterT void SSE2_PSLLDQ_I8_to_XMM(x86SSERegType to, u8 imm8) { - write8( 0x66 ); + write8( 0x66 ); RexB(0, to); - write16( 0x730F ); - ModRM( 3, 7 , to ); - write8( imm8 ); + write16( 0x730F ); + ModRM( 3, 7 , to ); + write8( imm8 ); } -emitterT void eSSE2_PMAXSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEE0F ); } -emitterT void eSSE2_PMAXSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEE0F ); } +emitterT void SSE2_PMAXSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEE0F ); } +emitterT void SSE2_PMAXSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEE0F ); } -emitterT void eSSE2_PMAXUB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDE0F ); } -emitterT void eSSE2_PMAXUB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDE0F ); } +emitterT void SSE2_PMAXUB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDE0F ); } +emitterT void SSE2_PMAXUB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDE0F ); } -emitterT void eSSE2_PMINSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEA0F ); } -emitterT void eSSE2_PMINSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEA0F ); } +emitterT void SSE2_PMINSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEA0F ); } +emitterT void SSE2_PMINSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEA0F ); } -emitterT void eSSE2_PMINUB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDA0F ); } -emitterT void eSSE2_PMINUB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDA0F ); } +emitterT void SSE2_PMINUB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDA0F ); } +emitterT void SSE2_PMINUB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDA0F ); } -emitterT void eSSE2_PADDSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEC0F ); } -emitterT void eSSE2_PADDSB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEC0F ); } +emitterT void SSE2_PADDSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xEC0F ); } +emitterT void SSE2_PADDSB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xEC0F ); } -emitterT void eSSE2_PADDSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xED0F ); } -emitterT void eSSE2_PADDSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xED0F ); } +emitterT void SSE2_PADDSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xED0F ); } +emitterT void SSE2_PADDSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xED0F ); } -emitterT void eSSE2_PSUBSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xE80F ); } -emitterT void eSSE2_PSUBSB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xE80F ); } +emitterT void SSE2_PSUBSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xE80F ); } +emitterT void SSE2_PSUBSB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xE80F ); } -emitterT void eSSE2_PSUBSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xE90F ); } -emitterT void eSSE2_PSUBSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xE90F ); } +emitterT void SSE2_PSUBSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xE90F ); } +emitterT void SSE2_PSUBSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xE90F ); } -emitterT void eSSE2_PSUBUSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xD80F ); } -emitterT void eSSE2_PSUBUSB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xD80F ); } -emitterT void eSSE2_PSUBUSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xD90F ); } -emitterT void eSSE2_PSUBUSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xD90F ); } +emitterT void SSE2_PSUBUSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xD80F ); } +emitterT void SSE2_PSUBUSB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xD80F ); } +emitterT void SSE2_PSUBUSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xD90F ); } +emitterT void SSE2_PSUBUSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xD90F ); } -emitterT void eSSE2_PADDUSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDC0F ); } -emitterT void eSSE2_PADDUSB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDC0F ); } -emitterT void eSSE2_PADDUSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDD0F ); } -emitterT void eSSE2_PADDUSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDD0F ); } +emitterT void SSE2_PADDUSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDC0F ); } +emitterT void SSE2_PADDUSB_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDC0F ); } +emitterT void SSE2_PADDUSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from ) { SSERtoR66( 0xDD0F ); } +emitterT void SSE2_PADDUSW_M128_to_XMM( x86SSERegType to, uptr from ) { SSEMtoR66( 0xDD0F ); } //**********************************************************************************/ //PACKSSWB,PACKSSDW: Pack Saturate Signed Word //********************************************************************************** -emitterT void eSSE2_PACKSSWB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x630F ); } -emitterT void eSSE2_PACKSSWB_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x630F ); } -emitterT void eSSE2_PACKSSDW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x6B0F ); } -emitterT void eSSE2_PACKSSDW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x6B0F ); } +emitterT void SSE2_PACKSSWB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x630F ); } +emitterT void SSE2_PACKSSWB_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x630F ); } +emitterT void SSE2_PACKSSDW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x6B0F ); } +emitterT void SSE2_PACKSSDW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x6B0F ); } -emitterT void eSSE2_PACKUSWB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x670F ); } -emitterT void eSSE2_PACKUSWB_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x670F ); } +emitterT void SSE2_PACKUSWB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x670F ); } +emitterT void SSE2_PACKUSWB_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x670F ); } //**********************************************************************************/ //PUNPCKHWD: Unpack 16bit high //********************************************************************************** -emitterT void eSSE2_PUNPCKLBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x600F ); } -emitterT void eSSE2_PUNPCKLBW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x600F ); } +emitterT void SSE2_PUNPCKLBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x600F ); } +emitterT void SSE2_PUNPCKLBW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x600F ); } -emitterT void eSSE2_PUNPCKHBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x680F ); } -emitterT void eSSE2_PUNPCKHBW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x680F ); } +emitterT void SSE2_PUNPCKHBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x680F ); } +emitterT void SSE2_PUNPCKHBW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x680F ); } -emitterT void eSSE2_PUNPCKLWD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x610F ); } -emitterT void eSSE2_PUNPCKLWD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x610F ); } -emitterT void eSSE2_PUNPCKHWD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x690F ); } -emitterT void eSSE2_PUNPCKHWD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x690F ); } +emitterT void SSE2_PUNPCKLWD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x610F ); } +emitterT void SSE2_PUNPCKLWD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x610F ); } +emitterT void SSE2_PUNPCKHWD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x690F ); } +emitterT void SSE2_PUNPCKHWD_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x690F ); } -emitterT void eSSE2_PUNPCKLDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x620F ); } -emitterT void eSSE2_PUNPCKLDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x620F ); } -emitterT void eSSE2_PUNPCKHDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x6A0F ); } -emitterT void eSSE2_PUNPCKHDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x6A0F ); } +emitterT void SSE2_PUNPCKLDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x620F ); } +emitterT void SSE2_PUNPCKLDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x620F ); } +emitterT void SSE2_PUNPCKHDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x6A0F ); } +emitterT void SSE2_PUNPCKHDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x6A0F ); } -emitterT void eSSE2_PUNPCKLQDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x6C0F ); } -emitterT void eSSE2_PUNPCKLQDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x6C0F ); } +emitterT void SSE2_PUNPCKLQDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x6C0F ); } +emitterT void SSE2_PUNPCKLQDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x6C0F ); } -emitterT void eSSE2_PUNPCKHQDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x6D0F ); } -emitterT void eSSE2_PUNPCKHQDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x6D0F ); } +emitterT void SSE2_PUNPCKHQDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0x6D0F ); } +emitterT void SSE2_PUNPCKHQDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0x6D0F ); } -emitterT void eSSE2_PMULLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0xD50F ); } -emitterT void eSSE2_PMULLW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0xD50F ); } -emitterT void eSSE2_PMULHW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0xE50F ); } -emitterT void eSSE2_PMULHW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0xE50F ); } +emitterT void SSE2_PMULLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0xD50F ); } +emitterT void SSE2_PMULLW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0xD50F ); } +emitterT void SSE2_PMULHW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0xE50F ); } +emitterT void SSE2_PMULHW_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0xE50F ); } -emitterT void eSSE2_PMULUDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0xF40F ); } -emitterT void eSSE2_PMULUDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0xF40F ); } +emitterT void SSE2_PMULUDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66( 0xF40F ); } +emitterT void SSE2_PMULUDQ_M128_to_XMM(x86SSERegType to, uptr from) { SSEMtoR66( 0xF40F ); } -emitterT void eSSE2_PMOVMSKB_XMM_to_R32(x86IntRegType to, x86SSERegType from) { SSERtoR66(0xD70F); } +emitterT void SSE2_PMOVMSKB_XMM_to_R32(x86IntRegType to, x86SSERegType from) { SSERtoR66(0xD70F); } -emitterT void eSSE_MOVMSKPS_XMM_to_R32(x86IntRegType to, x86SSERegType from) { SSERtoR(0x500F); } -emitterT void eSSE2_MOVMSKPD_XMM_to_R32(x86IntRegType to, x86SSERegType from) { SSERtoR66(0x500F); } +emitterT void SSE_MOVMSKPS_XMM_to_R32(x86IntRegType to, x86SSERegType from) { SSERtoR(0x500F); } +emitterT void SSE2_MOVMSKPD_XMM_to_R32(x86IntRegType to, x86SSERegType from) { SSERtoR66(0x500F); } -emitterT void eSSE2_PMADDWD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xF50F); } +emitterT void SSE2_PMADDWD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { SSERtoR66(0xF50F); } -emitterT void eSSE3_HADDPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { write8(0xf2); SSERtoR( 0x7c0f ); } -emitterT void eSSE3_HADDPS_M128_to_XMM(x86SSERegType to, uptr from) { write8(0xf2); SSEMtoR( 0x7c0f, 0 ); } +emitterT void SSE3_HADDPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { write8(0xf2); SSERtoR( 0x7c0f ); } +emitterT void SSE3_HADDPS_M128_to_XMM(x86SSERegType to, uptr from) { write8(0xf2); SSEMtoR( 0x7c0f, 0 ); } -emitterT void eSSE3_MOVSLDUP_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0xf3); +emitterT void SSE3_MOVSLDUP_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { + write8(0xf3); RexRB(0, to, from); - write16( 0x120f); - ModRM( 3, to, from ); + write16( 0x120f); + ModRM( 3, to, from ); } -emitterT void eSSE3_MOVSLDUP_M128_to_XMM(x86SSERegType to, uptr from) { write8(0xf3); SSEMtoR(0x120f, 0); } -emitterT void eSSE3_MOVSHDUP_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { write8(0xf3); SSERtoR(0x160f); } -emitterT void eSSE3_MOVSHDUP_M128_to_XMM(x86SSERegType to, uptr from) { write8(0xf3); SSEMtoR(0x160f, 0); } +emitterT void SSE3_MOVSLDUP_M128_to_XMM(x86SSERegType to, uptr from) { write8(0xf3); SSEMtoR(0x120f, 0); } +emitterT void SSE3_MOVSHDUP_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { write8(0xf3); SSERtoR(0x160f); } +emitterT void SSE3_MOVSHDUP_M128_to_XMM(x86SSERegType to, uptr from) { write8(0xf3); SSEMtoR(0x160f, 0); } // SSSE3 -emitterT void eSSSE3_PABSB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSSE3_PABSB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x1C380F); - ModRM(3, to, from); + write24(0x1C380F); + ModRM(3, to, from); } -emitterT void eSSSE3_PABSW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSSE3_PABSW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x1D380F); - ModRM(3, to, from); + write24(0x1D380F); + ModRM(3, to, from); } -emitterT void eSSSE3_PABSD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSSE3_PABSD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x1E380F); - ModRM(3, to, from); + write24(0x1E380F); + ModRM(3, to, from); } -emitterT void eSSSE3_PALIGNR_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8 imm8) +emitterT void SSSE3_PALIGNR_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8 imm8) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x0F3A0F); - ModRM(3, to, from); - write8(imm8); + write24(0x0F3A0F); + ModRM(3, to, from); + write8(imm8); } -emitterT void eSSSE3_PSIGNB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSSE3_PSIGNB_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x08380F); - ModRM(3, to, from); + write24(0x08380F); + ModRM(3, to, from); } -emitterT void eSSSE3_PSIGNW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSSE3_PSIGNW_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x09380F); - ModRM(3, to, from); + write24(0x09380F); + ModRM(3, to, from); } -emitterT void eSSSE3_PSIGND_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSSE3_PSIGND_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x0A380F); - ModRM(3, to, from); + write24(0x0A380F); + ModRM(3, to, from); } // SSE4.1 -emitterT void eSSE4_DPPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8 imm8) +emitterT void SSE4_DPPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8 imm8) { - write8(0x66); - write24(0x403A0F); - ModRM(3, to, from); - write8(imm8); + write8(0x66); + write24(0x403A0F); + ModRM(3, to, from); + write8(imm8); } -emitterT void eSSE4_DPPS_M128_to_XMM(x86SSERegType to, uptr from, u8 imm8) +emitterT void SSE4_DPPS_M128_to_XMM(x86SSERegType to, uptr from, u8 imm8) { - write8(0x66); - write24(0x403A0F); - ModRM(0, to, DISP32); - write32(MEMADDR(from, 4)); - write8(imm8); + write8(0x66); + write24(0x403A0F); + ModRM(0, to, DISP32); + write32(MEMADDR(from, 4)); + write8(imm8); } -emitterT void eSSE4_INSERTPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8 imm8) +emitterT void SSE4_INSERTPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8 imm8) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x213A0F); - ModRM(3, to, from); - write8(imm8); + write24(0x213A0F); + ModRM(3, to, from); + write8(imm8); } -emitterT void eSSE4_EXTRACTPS_XMM_to_R32(x86IntRegType to, x86SSERegType from, u8 imm8) +emitterT void SSE4_EXTRACTPS_XMM_to_R32(x86IntRegType to, x86SSERegType from, u8 imm8) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x173A0F); - ModRM(3, to, from); - write8(imm8); + write24(0x173A0F); + ModRM(3, to, from); + write8(imm8); } -emitterT void eSSE4_BLENDPS_XMM_to_XMM(x86IntRegType to, x86SSERegType from, u8 imm8) +emitterT void SSE4_BLENDPS_XMM_to_XMM(x86IntRegType to, x86SSERegType from, u8 imm8) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x0C3A0F); - ModRM(3, to, from); - write8(imm8); + write24(0x0C3A0F); + ModRM(3, to, from); + write8(imm8); } -emitterT void eSSE4_BLENDVPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSE4_BLENDVPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x14380F); - ModRM(3, to, from); + write24(0x14380F); + ModRM(3, to, from); } -emitterT void eSSE4_BLENDVPS_M128_to_XMM(x86SSERegType to, uptr from) +emitterT void SSE4_BLENDVPS_M128_to_XMM(x86SSERegType to, uptr from) { - write8(0x66); + write8(0x66); RexR(0, to); - write24(0x14380F); - ModRM(0, to, DISP32); - write32(MEMADDR(from, 4)); + write24(0x14380F); + ModRM(0, to, DISP32); + write32(MEMADDR(from, 4)); } -emitterT void eSSE4_PMOVSXDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSE4_PMOVSXDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x25380F); - ModRM(3, to, from); + write24(0x25380F); + ModRM(3, to, from); } -emitterT void eSSE4_PMOVZXDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSE4_PMOVZXDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x35380F); - ModRM(3, to, from); + write24(0x35380F); + ModRM(3, to, from); } -emitterT void eSSE4_PINSRD_R32_to_XMM(x86SSERegType to, x86IntRegType from, u8 imm8) +emitterT void SSE4_PINSRD_R32_to_XMM(x86SSERegType to, x86IntRegType from, u8 imm8) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x223A0F); - ModRM(3, to, from); - write8(imm8); + write24(0x223A0F); + ModRM(3, to, from); + write8(imm8); } -emitterT void eSSE4_PMAXSD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSE4_PMAXSD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x3D380F); - ModRM(3, to, from); + write24(0x3D380F); + ModRM(3, to, from); } -emitterT void eSSE4_PMINSD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSE4_PMINSD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x39380F); - ModRM(3, to, from); + write24(0x39380F); + ModRM(3, to, from); } -emitterT void eSSE4_PMAXUD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSE4_PMAXUD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x3F380F); - ModRM(3, to, from); + write24(0x3F380F); + ModRM(3, to, from); } -emitterT void eSSE4_PMINUD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSE4_PMINUD_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x3B380F); - ModRM(3, to, from); + write24(0x3B380F); + ModRM(3, to, from); } -emitterT void eSSE4_PMAXSD_M128_to_XMM(x86SSERegType to, uptr from) +emitterT void SSE4_PMAXSD_M128_to_XMM(x86SSERegType to, uptr from) { - write8(0x66); + write8(0x66); RexR(0, to); - write24(0x3D380F); - ModRM( 0, to, DISP32 ); - write32(MEMADDR(from, 4)); + write24(0x3D380F); + ModRM( 0, to, DISP32 ); + write32(MEMADDR(from, 4)); } -emitterT void eSSE4_PMINSD_M128_to_XMM(x86SSERegType to, uptr from) +emitterT void SSE4_PMINSD_M128_to_XMM(x86SSERegType to, uptr from) { - write8(0x66); + write8(0x66); RexR(0, to); - write24(0x39380F); - ModRM( 0, to, DISP32 ); - write32(MEMADDR(from, 4)); + write24(0x39380F); + ModRM( 0, to, DISP32 ); + write32(MEMADDR(from, 4)); } -emitterT void eSSE4_PMAXUD_M128_to_XMM(x86SSERegType to, uptr from) +emitterT void SSE4_PMAXUD_M128_to_XMM(x86SSERegType to, uptr from) { - write8(0x66); + write8(0x66); RexR(0, to); - write24(0x3F380F); - ModRM( 0, to, DISP32 ); - write32(MEMADDR(from, 4)); + write24(0x3F380F); + ModRM( 0, to, DISP32 ); + write32(MEMADDR(from, 4)); } -emitterT void eSSE4_PMINUD_M128_to_XMM(x86SSERegType to, uptr from) +emitterT void SSE4_PMINUD_M128_to_XMM(x86SSERegType to, uptr from) { - write8(0x66); + write8(0x66); RexR(0, to); - write24(0x3B380F); - ModRM( 0, to, DISP32 ); - write32(MEMADDR(from, 4)); + write24(0x3B380F); + ModRM( 0, to, DISP32 ); + write32(MEMADDR(from, 4)); } -emitterT void eSSE4_PMULDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) +emitterT void SSE4_PMULDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) { - write8(0x66); + write8(0x66); RexRB(0, to, from); - write24(0x28380F); - ModRM(3, to, from); + write24(0x28380F); + ModRM(3, to, from); }