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