EE: remove unused MMX path

All commented and disabled code
This commit is contained in:
Gregory Hainaut 2016-02-07 11:43:21 +01:00
parent ea1a9943fc
commit 15390cd966
7 changed files with 16 additions and 480 deletions

View File

@ -314,7 +314,6 @@ struct _mmxregs {
void _initMMXregs();
int _getFreeMMXreg();
int _allocMMXreg(int MMXreg, int reg, int mode);
void _addNeededMMXreg(int reg);
int _checkMMXreg(int reg, int mode);
void _clearNeededMMXregs();
void _deleteMMXreg(int reg, int flush);
@ -325,8 +324,6 @@ u8 _hasFreeMMXreg();
void _freeMMXregs();
int _getNumMMXwrite();
int _signExtendMtoMMX(x86MMXRegType to, uptr mem);
int _signExtendGPRMMXtoMMX(x86MMXRegType to, u32 gprreg, x86MMXRegType from, u32 gprfromreg);
int _allocCheckGPRtoMMX(EEINST* pinst, int reg, int mode);
// returns new index of reg, lower 32 bits already in mmx

View File

@ -244,47 +244,6 @@ void recPMTHL()
_clearNeededXMMregs();
}
// MMX helper routines
/*#define MMX_ALLOC_TEMP1(code) { \
int t0reg; \
t0reg = _allocMMXreg(-1, MMX_TEMP, 0); \
code; \
_freeMMXreg(t0reg); \
} \
#define MMX_ALLOC_TEMP2(code) { \
int t0reg, t1reg; \
t0reg = _allocMMXreg(-1, MMX_TEMP, 0); \
t1reg = _allocMMXreg(-1, MMX_TEMP, 0); \
code; \
_freeMMXreg(t0reg); \
_freeMMXreg(t1reg); \
} \
#define MMX_ALLOC_TEMP3(code) { \
int t0reg, t1reg, t2reg; \
t0reg = _allocMMXreg(-1, MMX_TEMP, 0); \
t1reg = _allocMMXreg(-1, MMX_TEMP, 0); \
t2reg = _allocMMXreg(-1, MMX_TEMP, 0); \
code; \
_freeMMXreg(t0reg); \
_freeMMXreg(t1reg); \
_freeMMXreg(t2reg); \
} \
#define MMX_ALLOC_TEMP4(code) { \
int t0reg, t1reg, t2reg, t3reg; \
t0reg = _allocMMXreg(-1, MMX_TEMP, 0); \
t1reg = _allocMMXreg(-1, MMX_TEMP, 0); \
t2reg = _allocMMXreg(-1, MMX_TEMP, 0); \
t3reg = _allocMMXreg(-1, MMX_TEMP, 0); \
code; \
_freeMMXreg(t0reg); \
_freeMMXreg(t1reg); \
_freeMMXreg(t2reg); \
_freeMMXreg(t3reg); \
} \*/
////////////////////////////////////////////////////
void recPSRLH()
{

View File

@ -676,19 +676,6 @@ int _checkMMXreg(int reg, int mode)
return -1;
}
void _addNeededMMXreg(int reg)
{
uint i;
for (i=0; i<iREGCNT_MMX; i++) {
if (mmxregs[i].inuse == 0) continue;
if (mmxregs[i].reg != reg) continue;
mmxregs[i].counter = g_mmxAllocCounter++;
mmxregs[i].needed = 1;
}
}
void _clearNeededMMXregs()
{
uint i;
@ -880,43 +867,6 @@ void _signExtendSFtoM(uptr mem)
xMOV(ptr[(void*)(mem)], eax);
}
int _signExtendMtoMMX(x86MMXRegType to, uptr mem)
{
int t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
xMOVDZX(xRegisterMMX(t0reg), ptr[(void*)(mem)]);
xMOVQ(xRegisterMMX(to), xRegisterMMX(t0reg));
xPSRA.D(xRegisterMMX(t0reg), 31);
xPUNPCK.LDQ(xRegisterMMX(to), xRegisterMMX(t0reg));
_freeMMXreg(t0reg);
return to;
}
int _signExtendGPRMMXtoMMX(x86MMXRegType to, u32 gprreg, x86MMXRegType from, u32 gprfromreg)
{
pxAssert( to >= 0 && from >= 0 );
if( to == from ) return _signExtendGPRtoMMX(to, gprreg, 0);
if( !(g_pCurInstInfo->regs[gprfromreg]&EEINST_LASTUSE) ) {
if( EEINST_ISLIVE64(gprfromreg) ) {
xMOVQ(xRegisterMMX(to), xRegisterMMX(from));
return _signExtendGPRtoMMX(to, gprreg, 0);
}
}
// from is free for use
SetMMXstate();
xMOVQ(xRegisterMMX(to), xRegisterMMX(from));
xMOVD(ptr[&cpuRegs.GPR.r[gprreg].UL[0]], xRegisterMMX(from));
xPSRA.D(xRegisterMMX(from), 31);
xMOVD(ptr[&cpuRegs.GPR.r[gprreg].UL[1]], xRegisterMMX(from));
mmxregs[to].inuse = 0;
return -1;
}
int _signExtendGPRtoMMX(x86MMXRegType to, u32 gprreg, int shift)
{
pxAssert( to >= 0 && shift >= 0 );

View File

@ -456,47 +456,24 @@ void recMOVZtemp_consts(int info)
void recMOVZtemp_constt(int info)
{
// Fixme: MMX problem
if(0/* _hasFreeXMMreg() */) {
int t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
xMOVQ(xRegisterMMX(t0reg), ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOVQ(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], xRegisterMMX(t0reg));
_freeMMXreg(t0reg);
}
else {
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], eax);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ]], edx);
}
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], eax);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ]], edx);
}
void recMOVZtemp_(int info)
{
int t0reg = -1;
// Fixme: MMX problem
if(0/* _hasFreeXMMreg() */)
t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ] ]);
xOR(eax, ptr[&cpuRegs.GPR.r[ _Rt_ ].UL[ 1 ] ]);
j8Ptr[ 0 ] = JNZ8( 0 );
if( t0reg >= 0 ) {
xMOVQ(xRegisterMMX(t0reg), ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOVQ(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], xRegisterMMX(t0reg));
_freeMMXreg(t0reg);
}
else {
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], eax);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ]], edx);
}
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], eax);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ]], edx);
x86SetJ8( j8Ptr[ 0 ] );
SetMMXstate();
}
EERECOMPILE_CODE0(MOVZtemp, XMMINFO_READS|XMMINFO_READD|XMMINFO_READD|XMMINFO_WRITED);
@ -535,48 +512,24 @@ void recMOVNtemp_consts(int info)
void recMOVNtemp_constt(int info)
{
// Fixme: MMX problem
if(0/* _hasFreeXMMreg() */) {
int t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
xMOVQ(xRegisterMMX(t0reg), ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOVQ(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], xRegisterMMX(t0reg));
_freeMMXreg(t0reg);
}
else {
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], eax);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ]], edx);
}
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], eax);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ]], edx);
}
void recMOVNtemp_(int info)
{
int t0reg=-1;
// Fixme: MMX problem
if(0/* _hasFreeXMMreg() */)
t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rt_ ].UL[ 0 ] ]);
xOR(eax, ptr[&cpuRegs.GPR.r[ _Rt_ ].UL[ 1 ] ]);
j8Ptr[ 0 ] = JZ8( 0 );
if( t0reg >= 0 ) {
xMOVQ(xRegisterMMX(t0reg), ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOVQ(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], xRegisterMMX(t0reg));
_freeMMXreg(t0reg);
}
else {
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], eax);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ]], edx);
}
xMOV(eax, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 0 ]]);
xMOV(edx, ptr[&cpuRegs.GPR.r[ _Rs_ ].UL[ 1 ]]);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], eax);
xMOV(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 1 ]], edx);
x86SetJ8( j8Ptr[ 0 ] );
SetMMXstate();
}
EERECOMPILE_CODE0(MOVNtemp, XMMINFO_READS|XMMINFO_READD|XMMINFO_READD|XMMINFO_WRITED);

View File

@ -125,126 +125,6 @@ void recWritebackHILO(int info, int writed, int upper)
}
}
void recWritebackHILOMMX(int info, int regsource, int writed, int upper)
{
int regd, t0reg, t1reg = -1;
uptr loaddr = (uptr)&cpuRegs.LO.UL[ upper ? 2 : 0 ];
uptr hiaddr = (uptr)&cpuRegs.HI.UL[ upper ? 2 : 0 ];
u8 testlive = upper?EEINST_LIVE2:EEINST_LIVE0;
SetMMXstate();
t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
xMOVQ(xRegisterMMX(t0reg), xRegisterMMX(regsource));
xPSRA.D(xRegisterMMX(t0reg), 31); // shift in 0s
if( (g_pCurInstInfo->regs[XMMGPR_LO] & testlive) || (writed && _Rd_) ) {
if( (g_pCurInstInfo->regs[XMMGPR_HI] & testlive) )
{
if( !_hasFreeMMXreg() ) {
if( g_pCurInstInfo->regs[XMMGPR_HI] & testlive )
_deleteMMXreg(MMX_GPR+MMX_HI, 2);
}
t1reg = _allocMMXreg(-1, MMX_TEMP, 0);
xMOVQ(xRegisterMMX(t1reg), xRegisterMMX(regsource));
}
xPUNPCK.LDQ(xRegisterMMX(regsource), xRegisterMMX(t0reg));
}
if( g_pCurInstInfo->regs[XMMGPR_LO] & testlive ) {
int reglo;
if( !upper && (reglo = _allocCheckGPRtoMMX(g_pCurInstInfo, XMMGPR_LO, MODE_WRITE)) >= 0 ) {
xMOVQ(xRegisterMMX(reglo), xRegisterMMX(regsource));
}
else {
reglo = _checkXMMreg(XMMTYPE_GPRREG, XMMGPR_LO, MODE_READ);
xMOVQ(ptr[(void*)(loaddr)], xRegisterMMX(regsource));
if( reglo >= 0 ) {
if( xmmregs[reglo].mode & MODE_WRITE ) {
if( upper ) xMOVQ(ptr[(void*)(loaddr-8)], xRegisterSSE(reglo));
else xMOVH.PS(ptr[(void*)(loaddr+8)], xRegisterSSE(reglo));
}
xmmregs[reglo].inuse = 0;
reglo = -1;
}
}
}
if ( writed && _Rd_ )
{
regd = _allocCheckGPRtoMMX(g_pCurInstInfo, _Rd_, MODE_WRITE);
if( regd >= 0 ) {
if( regd != regsource ) xMOVQ(xRegisterMMX(regd), xRegisterMMX(regsource));
}
else {
regd = _checkXMMreg(XMMTYPE_GPRREG, _Rd_, MODE_READ);
if( regd >= 0 ) {
if( g_pCurInstInfo->regs[XMMGPR_LO] & testlive ) {
// lo written
xMOVL.PS(xRegisterSSE(regd), ptr[(void*)(loaddr)]);
xmmregs[regd].mode |= MODE_WRITE;
}
else {
xMOVQ(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], xRegisterMMX(regsource));
if( xmmregs[regd].mode & MODE_WRITE ) {
xMOVH.PS(ptr[&cpuRegs.GPR.r[_Rd_].UL[2]], xRegisterSSE(regd));
}
xmmregs[regd].inuse = 0;
}
}
else {
xMOVQ(ptr[&cpuRegs.GPR.r[ _Rd_ ].UL[ 0 ]], xRegisterMMX(regsource));
}
}
}
if( g_pCurInstInfo->regs[XMMGPR_HI] & testlive ) {
int mmreg = -1, reghi;
if( t1reg >= 0 ) {
xPUNPCK.HDQ(xRegisterMMX(t1reg), xRegisterMMX(t0reg));
mmreg = t1reg;
}
else {
// can't modify regsource
xPUNPCK.HDQ(xRegisterMMX(t0reg), xRegisterMMX(regsource));
mmreg = t0reg;
xPSHUF.W(xRegisterMMX(t0reg), xRegisterMMX(t0reg), 0x4e);
}
if( upper ) {
reghi = _checkXMMreg(XMMTYPE_GPRREG, XMMGPR_HI, MODE_READ);
if( reghi >= 0 ) {
if( xmmregs[reghi].mode & MODE_WRITE ) xMOVQ(ptr[(void*)(hiaddr-8)], xRegisterSSE(reghi));
xmmregs[reghi].inuse = 0;
}
xMOVQ(ptr[(void*)(hiaddr)], xRegisterMMX(mmreg));
}
else {
_deleteGPRtoXMMreg(XMMGPR_HI, 2);
_deleteMMXreg(MMX_GPR+MMX_HI, 2);
mmxregs[mmreg].mode = MODE_WRITE;
mmxregs[mmreg].reg = MMX_GPR+MMX_HI;
if( t1reg >= 0 ) t1reg = -1;
else t0reg = -1;
}
}
if( t0reg >= 0 ) _freeMMXreg(t0reg&0xf);
if( t1reg >= 0 ) _freeMMXreg(t1reg&0xf);
}
void recWritebackConstHILO(u64 res, int writed, int upper)
{
int reglo, reghi;
@ -323,63 +203,18 @@ void recMULTsuper(int info, int upper, int process)
recWritebackHILO(info, 1, upper);
}
//void recMULT_process(int info, int process)
//{
// if( EEINST_ISLIVE64(XMMGPR_HI) ) {
// recMULTsuper(info, 0, process);
// }
// else {
// // EEREC_D isn't set
// int mmregd;
//
// if( _Rd_ ) {
// assert(EEREC_D == 0);
// mmregd = _checkMMXreg(MMX_GPR+_Rd_, MODE_WRITE);
//
// if( mmregd < 0 ) {
// if( !(process&PROCESS_CONSTS) && ((g_pCurInstInfo->regs[_Rs_]&EEINST_LASTUSE)||!EEINST_ISLIVE64(_Rs_)) ) {
// _freeMMXreg(EEREC_S);
// _deleteGPRtoXMMreg(_Rd_, 2);
// mmxregs[EEREC_S].inuse = 1;
// mmxregs[EEREC_S].reg = _Rd_;
// mmxregs[EEREC_S].mode = MODE_WRITE;
// mmregd = EEREC_S;
// }
// else if( !(process&PROCESS_CONSTT) && ((g_pCurInstInfo->regs[_Rt_]&EEINST_LASTUSE)||!EEINST_ISLIVE64(_Rt_)) ) {
// _freeMMXreg(EEREC_T);
// _deleteGPRtoXMMreg(_Rd_, 2);
// mmxregs[EEREC_T].inuse = 1;
// mmxregs[EEREC_T].reg = _Rd_;
// mmxregs[EEREC_T].mode = MODE_WRITE;
// mmregd = EEREC_T;
// }
// else mmregd = _allocMMXreg(-1, MMX_GPR+_Rd_, MODE_WRITE);
// }
//
// info |= PROCESS_EE_SET_D(mmregd);
// }
// recMULTUsuper(info, 0, process);
// }
//
// // sometimes _Rd_ can be const
// if( _Rd_ ) _eeOnWriteReg(_Rd_, 1);
//}
void recMULT_(int info)
{
//recMULT_process(info, 0);
recMULTsuper(info, 0, 0);
}
void recMULT_consts(int info)
{
//recMULT_process(info, PROCESS_CONSTS);
recMULTsuper(info, 0, PROCESS_CONSTS);
}
void recMULT_constt(int info)
{
//recMULT_process(info, PROCESS_CONSTT);
recMULTsuper(info, 0, PROCESS_CONSTT);
}

View File

@ -20,8 +20,6 @@
#include "R5900OpcodeTables.h"
#include "iR5900.h"
#define NO_MMX 1
using namespace x86Emitter;
namespace R5900 {
@ -145,7 +143,6 @@ void recDSLLs_(int info, int sa)
int rtreg, rdreg;
pxAssert( !(info & PROCESS_EE_XMM) );
#if NO_MMX
_addNeededGPRtoXMMreg(_Rt_);
_addNeededGPRtoXMMreg(_Rd_);
rtreg = _allocGPRtoXMMreg(-1, _Rt_, MODE_READ);
@ -160,16 +157,6 @@ void recDSLLs_(int info, int sa)
xMOVL.PD(ptr64[&cpuRegs.GPR.r[ _Rd_ ].UD[ 0 ]] , xRegisterSSE(rdreg));
_deleteGPRtoXMMreg(_Rt_, 3);
_deleteGPRtoXMMreg(_Rd_, 3);
#else
_addNeededMMXreg(MMX_GPR+_Rt_);
_addNeededMMXreg(MMX_GPR+_Rd_);
rtreg = _allocMMXreg(-1, MMX_GPR+_Rt_, MODE_READ);
rdreg = _allocMMXreg(-1, MMX_GPR+_Rd_, MODE_WRITE);
SetMMXstate();
if( rtreg != rdreg ) xMOVQ(xRegisterMMX(rdreg), xRegisterMMX(rtreg));
xPSLL.Q(xRegisterMMX(rdreg), sa);
#endif
}
void recDSLL_(int info)
@ -190,7 +177,6 @@ void recDSRLs_(int info, int sa)
int rtreg, rdreg;
pxAssert( !(info & PROCESS_EE_XMM) );
#if NO_MMX
_addNeededGPRtoXMMreg(_Rt_);
_addNeededGPRtoXMMreg(_Rd_);
rtreg = _allocGPRtoXMMreg(-1, _Rt_, MODE_READ);
@ -205,16 +191,6 @@ void recDSRLs_(int info, int sa)
xMOVL.PD(ptr64[&cpuRegs.GPR.r[ _Rd_ ].UD[ 0 ]] , xRegisterSSE(rdreg));
_deleteGPRtoXMMreg(_Rt_, 3);
_deleteGPRtoXMMreg(_Rd_, 3);
#else
_addNeededMMXreg(MMX_GPR+_Rt_);
_addNeededMMXreg(MMX_GPR+_Rd_);
rtreg = _allocMMXreg(-1, MMX_GPR+_Rt_, MODE_READ);
rdreg = _allocMMXreg(-1, MMX_GPR+_Rd_, MODE_WRITE);
SetMMXstate();
if( rtreg != rdreg ) xMOVQ(xRegisterMMX(rdreg), xRegisterMMX(rtreg));
xPSRL.Q(xRegisterMMX(rdreg), sa);
#endif
}
void recDSRL_(int info)
@ -235,7 +211,6 @@ void recDSRAs_(int info, int sa)
int rtreg, rdreg, t0reg;
pxAssert( !(info & PROCESS_EE_XMM) );
#if NO_MMX
_addNeededGPRtoXMMreg(_Rt_);
_addNeededGPRtoXMMreg(_Rd_);
rtreg = _allocGPRtoXMMreg(-1, _Rt_, MODE_READ);
@ -270,30 +245,6 @@ void recDSRAs_(int info, int sa)
xMOVL.PD(ptr64[&cpuRegs.GPR.r[ _Rd_ ].UD[ 0 ]] , xRegisterSSE(rdreg));
_deleteGPRtoXMMreg(_Rt_, 3);
_deleteGPRtoXMMreg(_Rd_, 3);
#else
_addNeededMMXreg(MMX_GPR+_Rt_);
_addNeededMMXreg(MMX_GPR+_Rd_);
rtreg = _allocMMXreg(-1, MMX_GPR+_Rt_, MODE_READ);
rdreg = _allocMMXreg(-1, MMX_GPR+_Rd_, MODE_WRITE);
SetMMXstate();
if( rtreg != rdreg ) xMOVQ(xRegisterMMX(rdreg), xRegisterMMX(rtreg));
if ( sa != 0 ) {
t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
xMOVQ(xRegisterMMX(t0reg), xRegisterMMX(rtreg));
// it is a signed shift
xPSRA.D(xRegisterMMX(t0reg), sa);
xPSRL.Q(xRegisterMMX(rdreg), sa);
xPUNPCK.HDQ(xRegisterMMX(t0reg), xRegisterMMX(t0reg)); // shift to lower
// take lower dword of rdreg and lower dword of t0reg
xPUNPCK.LDQ(xRegisterMMX(rdreg), xRegisterMMX(t0reg));
_freeMMXreg(t0reg);
}
#endif
}
void recDSRA_(int info)
@ -391,7 +342,6 @@ void recSetShiftV(int info, int* rsreg, int* rtreg, int* rdreg, int* rstemp)
{
pxAssert( !(info & PROCESS_EE_XMM) );
#if NO_MMX
_addNeededGPRtoXMMreg(_Rt_);
_addNeededGPRtoXMMreg(_Rd_);
*rtreg = _allocGPRtoXMMreg(-1, _Rt_, MODE_READ);
@ -405,21 +355,6 @@ void recSetShiftV(int info, int* rsreg, int* rtreg, int* rdreg, int* rstemp)
*rsreg = *rstemp;
if( *rtreg != *rdreg ) xMOVDQA(xRegisterSSE(*rdreg), xRegisterSSE(*rtreg));
#else
_addNeededMMXreg(MMX_GPR+_Rt_);
_addNeededMMXreg(MMX_GPR+_Rd_);
*rtreg = _allocMMXreg(-1, MMX_GPR+_Rt_, MODE_READ);
*rdreg = _allocMMXreg(-1, MMX_GPR+_Rd_, MODE_WRITE);
SetMMXstate();
*rstemp = _allocMMXreg(-1, MMX_TEMP, 0);
xMOV(eax, ptr[&cpuRegs.GPR.r[_Rs_].UL[0]]);
xAND(eax, 0x3f);
xMOVDZX(xRegisterMMX(*rstemp), eax);
*rsreg = *rstemp;
if( *rtreg != *rdreg ) xMOVQ(xRegisterMMX(*rdreg), xRegisterMMX(*rtreg));
#endif
}
void recSetConstShiftV(int info, int* rsreg, int* rdreg, int* rstemp)
@ -430,7 +365,6 @@ void recSetConstShiftV(int info, int* rsreg, int* rdreg, int* rstemp)
// 2/ CPU has minimum cycle delay between read/write
_flushConstReg(_Rt_);
#if NO_MMX
_addNeededGPRtoXMMreg(_Rd_);
*rdreg = _allocGPRtoXMMreg(-1, _Rd_, MODE_WRITE);
@ -439,16 +373,6 @@ void recSetConstShiftV(int info, int* rsreg, int* rdreg, int* rstemp)
xMOV(eax, ptr[&cpuRegs.GPR.r[_Rs_].UL[0]]);
xAND(eax, 0x3f);
xMOVDZX(xRegisterSSE(*rstemp), eax);
#else
_addNeededMMXreg(MMX_GPR+_Rd_);
*rdreg = _allocMMXreg(-1, MMX_GPR+_Rd_, MODE_WRITE);
SetMMXstate();
*rstemp = _allocMMXreg(-1, MMX_TEMP, 0);
xMOV(eax, ptr[&cpuRegs.GPR.r[_Rs_].UL[0]]);
xAND(eax, 0x3f);
xMOVDZX(xRegisterMMX(*rstemp), eax);
#endif
*rsreg = *rstemp;
}
@ -583,7 +507,6 @@ void recDSLLV_constt(int info)
{
int rsreg, rdreg, rstemp = -1;
recSetConstShiftV(info, &rsreg, &rdreg, &rstemp);
#if NO_MMX
xMOVDQA(xRegisterSSE(rdreg), ptr[&cpuRegs.GPR.r[_Rt_]]);
xPSLL.Q(xRegisterSSE(rdreg), xRegisterSSE(rsreg));
if( rstemp != -1 ) _freeXMMreg(rstemp);
@ -594,12 +517,6 @@ void recDSLLV_constt(int info)
xMOVL.PD(ptr64[&cpuRegs.GPR.r[ _Rd_ ].UD[ 0 ]] , xRegisterSSE(rdreg));
//_deleteGPRtoXMMreg(_Rt_, 3);
_deleteGPRtoXMMreg(_Rd_, 3);
#else
xMOVQ(xRegisterMMX(rdreg), ptr[&cpuRegs.GPR.r[_Rt_]]);
xPSLL.Q(xRegisterMMX(rdreg), xRegisterMMX(rsreg));
if( rstemp != -1 ) _freeMMXreg(rstemp);
#endif
}
void recDSLLV_(int info)
@ -607,7 +524,6 @@ void recDSLLV_(int info)
int rsreg, rtreg, rdreg, rstemp = -1;
recSetShiftV(info, &rsreg, &rtreg, &rdreg, &rstemp);
#if NO_MMX
xPSLL.Q(xRegisterSSE(rdreg), xRegisterSSE(rsreg));
if( rstemp != -1 ) _freeXMMreg(rstemp);
@ -617,10 +533,6 @@ void recDSLLV_(int info)
xMOVL.PD(ptr64[&cpuRegs.GPR.r[ _Rd_ ].UD[ 0 ]] , xRegisterSSE(rdreg));
_deleteGPRtoXMMreg(_Rt_, 3);
_deleteGPRtoXMMreg(_Rd_, 3);
#else
xPSLL.Q(xRegisterMMX(rdreg), xRegisterMMX(rsreg));
if( rstemp != -1 ) _freeMMXreg(rstemp);
#endif
}
EERECOMPILE_CODE0(DSLLV, XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED);
@ -643,7 +555,6 @@ void recDSRLV_constt(int info)
int rsreg, rdreg, rstemp = -1;
recSetConstShiftV(info, &rsreg, &rdreg, &rstemp);
#if NO_MMX
xMOVDQA(xRegisterSSE(rdreg), ptr[&cpuRegs.GPR.r[_Rt_]]);
xPSRL.Q(xRegisterSSE(rdreg), xRegisterSSE(rsreg));
if( rstemp != -1 ) _freeXMMreg(rstemp);
@ -654,11 +565,6 @@ void recDSRLV_constt(int info)
xMOVL.PD(ptr64[&cpuRegs.GPR.r[ _Rd_ ].UD[ 0 ]] , xRegisterSSE(rdreg));
//_deleteGPRtoXMMreg(_Rt_, 3);
_deleteGPRtoXMMreg(_Rd_, 3);
#else
xMOVQ(xRegisterMMX(rdreg), ptr[&cpuRegs.GPR.r[_Rt_]]);
xPSRL.Q(xRegisterMMX(rdreg), xRegisterMMX(rsreg));
if( rstemp != -1 ) _freeMMXreg(rstemp);
#endif
}
void recDSRLV_(int info)
@ -666,7 +572,6 @@ void recDSRLV_(int info)
int rsreg, rtreg, rdreg, rstemp = -1;
recSetShiftV(info, &rsreg, &rtreg, &rdreg, &rstemp);
#if NO_MMX
xPSRL.Q(xRegisterSSE(rdreg), xRegisterSSE(rsreg));
if( rstemp != -1 ) _freeXMMreg(rstemp);
@ -676,10 +581,6 @@ void recDSRLV_(int info)
xMOVL.PD(ptr64[&cpuRegs.GPR.r[ _Rd_ ].UD[ 0 ]] , xRegisterSSE(rdreg));
_deleteGPRtoXMMreg(_Rt_, 3);
_deleteGPRtoXMMreg(_Rd_, 3);
#else
xPSRL.Q(xRegisterMMX(rdreg), xRegisterMMX(rsreg));
if( rstemp != -1 ) _freeMMXreg(rstemp);
#endif
}
EERECOMPILE_CODE0(DSRLV, XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED);
@ -700,7 +601,6 @@ void recDSRAV_consts(int info)
void recDSRAV_constt(int info)
{
int rsreg, rdreg, rstemp = -1, t0reg, t1reg;
#if NO_MMX
t0reg = _allocTempXMMreg(XMMT_INT, -1);
t1reg = _allocTempXMMreg(XMMT_INT, -1);
@ -734,41 +634,11 @@ void recDSRAV_constt(int info)
_freeXMMreg(t0reg);
_freeXMMreg(t1reg);
if( rstemp != -1 ) _freeXMMreg(rstemp);
#else
t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
t1reg = _allocMMXreg(-1, MMX_TEMP, 0);
recSetConstShiftV(info, &rsreg, &rdreg, &rstemp);
xMOVQ(xRegisterMMX(rdreg), ptr[&cpuRegs.GPR.r[_Rt_]]);
xPXOR(xRegisterMMX(t0reg), xRegisterMMX(t0reg));
// calc high bit
xMOVQ(xRegisterMMX(t1reg), xRegisterMMX(rdreg));
xPCMP.GTD(xRegisterMMX(t0reg), xRegisterMMX(rdreg));
xPUNPCK.HDQ(xRegisterMMX(t0reg), xRegisterMMX(t0reg)); // shift to lower
// shift highest bit, 64 - eax
xMOV(eax, 64);
xMOVDZX(xRegisterMMX(t1reg), eax);
xPSUB.D(xRegisterMMX(t1reg), xRegisterMMX(rsreg));
// right logical shift
xPSRL.Q(xRegisterMMX(rdreg), xRegisterMMX(rsreg));
xPSLL.Q(xRegisterMMX(t0reg), xRegisterMMX(t1reg)); // highest bits
xPOR(xRegisterMMX(rdreg), xRegisterMMX(t0reg));
_freeMMXreg(t0reg);
_freeMMXreg(t1reg);
if( rstemp != -1 ) _freeMMXreg(rstemp);
#endif
}
void recDSRAV_(int info)
{
int rsreg, rtreg, rdreg, rstemp = -1, t0reg, t1reg;
#if NO_MMX
t0reg = _allocTempXMMreg(XMMT_INT, -1);
t1reg = _allocTempXMMreg(XMMT_INT, -1);
recSetShiftV(info, &rsreg, &rtreg, &rdreg, &rstemp);
@ -801,33 +671,6 @@ void recDSRAV_(int info)
_freeXMMreg(t0reg);
_freeXMMreg(t1reg);
if( rstemp != -1 ) _freeXMMreg(rstemp);
#else
t0reg = _allocMMXreg(-1, MMX_TEMP, 0);
t1reg = _allocMMXreg(-1, MMX_TEMP, 0);
recSetShiftV(info, &rsreg, &rtreg, &rdreg, &rstemp);
xPXOR(xRegisterMMX(t0reg), xRegisterMMX(t0reg));
// calc high bit
xMOVQ(xRegisterMMX(t1reg), xRegisterMMX(rdreg));
xPCMP.GTD(xRegisterMMX(t0reg), xRegisterMMX(rdreg));
xPUNPCK.HDQ(xRegisterMMX(t0reg), xRegisterMMX(t0reg)); // shift to lower
// shift highest bit, 64 - eax
xMOV(eax, 64);
xMOVDZX(xRegisterMMX(t1reg), eax);
xPSUB.D(xRegisterMMX(t1reg), xRegisterMMX(rsreg));
// right logical shift
xPSRL.Q(xRegisterMMX(rdreg), xRegisterMMX(rsreg));
xPSLL.Q(xRegisterMMX(t0reg), xRegisterMMX(t1reg)); // highest bits
xPOR(xRegisterMMX(rdreg), xRegisterMMX(t0reg));
_freeMMXreg(t0reg);
_freeMMXreg(t1reg);
if( rstemp != -1 ) _freeMMXreg(rstemp);
#endif
}
EERECOMPILE_CODE0(DSRAV, XMMINFO_READS|XMMINFO_READT|XMMINFO_WRITED);

View File

@ -71,7 +71,6 @@ int eeProcessHILO(int reg, int mode, int mmx)
// Fixme: MMX problem
int usemmx = 0/*mmx && _hasFreeMMXreg()*/;
if( (usemmx || _hasFreeXMMreg()) || !(g_pCurInstInfo->regs[reg]&EEINST_LASTUSE) ) {
//if( usemmx ) return _allocMMXreg(-1, MMX_GPR+reg, mode);
return _allocGPRtoXMMreg(-1, reg, mode);
}