From 366f793cf0829ade4e1726a0e10149861c93815c Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 16 Jan 2016 20:23:03 +0100 Subject: [PATCH] core: use xRegisterLong instead of xRegister32 Code needs to work with xAddressReg however the x32 inheritance doesn't exits anymore on 64 bits. Note: it might be possible to uses some kind of autoconversion with xRegister32or64. Could be a future improvement. --- common/include/x86emitter/implement/jmpcall.h | 6 +++--- pcsx2/x86/iCore.h | 4 ++-- pcsx2/x86/iR3000A.cpp | 2 +- pcsx2/x86/iR3000A.h | 2 +- pcsx2/x86/iR5900.h | 2 +- pcsx2/x86/ix86-32/iCore-32.cpp | 6 +++--- pcsx2/x86/ix86-32/iR5900-32.cpp | 2 +- pcsx2/x86/microVU_Misc.h | 2 +- pcsx2/x86/newVif_Dynarec.cpp | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/common/include/x86emitter/implement/jmpcall.h b/common/include/x86emitter/implement/jmpcall.h index 426d4600dc..4a1492f725 100644 --- a/common/include/x86emitter/implement/jmpcall.h +++ b/common/include/x86emitter/implement/jmpcall.h @@ -110,7 +110,7 @@ struct xImpl_FastCall #endif template< typename T > __fi __always_inline_tmpl_fail - void operator()( T* func, const xRegister32& a1 = xEmptyReg, const xRegister32& a2 = xEmptyReg) const + void operator()( T* func, const xRegisterLong& a1 = xEmptyReg, const xRegisterLong& a2 = xEmptyReg) const { #ifdef __x86_64__ if (a1.IsEmpty()) { @@ -132,7 +132,7 @@ struct xImpl_FastCall } template< typename T > __fi __always_inline_tmpl_fail - void operator()( T* func, u32 a1, const xRegister32& a2) const + void operator()( T* func, u32 a1, const xRegisterLong& a2) const { #ifdef __x86_64__ XFASTCALL2; @@ -171,7 +171,7 @@ struct xImpl_FastCall #endif } - void operator()(const xIndirect32& func, const xRegister32& a1 = xEmptyReg, const xRegister32& a2 = xEmptyReg) const + void operator()(const xIndirect32& func, const xRegisterLong& a1 = xEmptyReg, const xRegisterLong& a2 = xEmptyReg) const { #ifdef __x86_64__ if (a1.IsEmpty()) { diff --git a/pcsx2/x86/iCore.h b/pcsx2/x86/iCore.h index a3575423c7..ce3c83ff76 100644 --- a/pcsx2/x86/iCore.h +++ b/pcsx2/x86/iCore.h @@ -121,12 +121,12 @@ extern _x86regs x86regs[iREGCNT_GPR], s_saveX86regs[iREGCNT_GPR]; uptr _x86GetAddr(int type, int reg); void _initX86regs(); int _getFreeX86reg(int mode); -int _allocX86reg(x86Emitter::xRegister32 x86reg, int type, int reg, int mode); +int _allocX86reg(x86Emitter::xRegisterLong x86reg, int type, int reg, int mode); void _deleteX86reg(int type, int reg, int flush); int _checkX86reg(int type, int reg, int mode); void _addNeededX86reg(int type, int reg); void _clearNeededX86regs(); -void _freeX86reg(const x86Emitter::xRegister32& x86reg); +void _freeX86reg(const x86Emitter::xRegisterLong& x86reg); void _freeX86reg(int x86reg); void _freeX86regs(); void _flushCachedRegs(); diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 2ba5e2f1cf..add3f5e05c 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -388,7 +388,7 @@ void _psxDeleteReg(int reg, int flush) _deleteX86reg(X86TYPE_PSX, reg, flush ? 0 : 2); } -void _psxMoveGPRtoR(const xRegister32& to, int fromgpr) +void _psxMoveGPRtoR(const xRegisterLong& to, int fromgpr) { if( PSX_IS_CONST1(fromgpr) ) xMOV(to, g_psxConstRegs[fromgpr] ); diff --git a/pcsx2/x86/iR3000A.h b/pcsx2/x86/iR3000A.h index d85391f4c5..b4f5daf9c9 100644 --- a/pcsx2/x86/iR3000A.h +++ b/pcsx2/x86/iR3000A.h @@ -48,7 +48,7 @@ void _psxFlushCall(int flushtype); void _psxOnWriteReg(int reg); -void _psxMoveGPRtoR(const x86Emitter::xRegister32& to, int fromgpr); +void _psxMoveGPRtoR(const x86Emitter::xRegisterLong& to, int fromgpr); #if 0 void _psxMoveGPRtoM(uptr to, int fromgpr); void _psxMoveGPRtoRm(x86IntRegType to, int fromgpr); diff --git a/pcsx2/x86/iR5900.h b/pcsx2/x86/iR5900.h index bb5c6ed937..f1ee376a5e 100644 --- a/pcsx2/x86/iR5900.h +++ b/pcsx2/x86/iR5900.h @@ -104,7 +104,7 @@ extern u32 g_cpuHasConstReg, g_cpuFlushedConstReg; u32* _eeGetConstReg(int reg); // finds where the GPR is stored and moves lower 32 bits to EAX -void _eeMoveGPRtoR(const x86Emitter::xRegister32& to, int fromgpr); +void _eeMoveGPRtoR(const x86Emitter::xRegisterLong& to, int fromgpr); void _eeMoveGPRtoM(uptr to, int fromgpr); void _eeMoveGPRtoRm(x86IntRegType to, int fromgpr); void eeSignExtendTo(int gpr, bool onlyupper=false); diff --git a/pcsx2/x86/ix86-32/iCore-32.cpp b/pcsx2/x86/ix86-32/iCore-32.cpp index 5711ba8b4f..f98041f69b 100644 --- a/pcsx2/x86/ix86-32/iCore-32.cpp +++ b/pcsx2/x86/ix86-32/iCore-32.cpp @@ -243,7 +243,7 @@ void _flushConstRegs() } } -int _allocX86reg(xRegister32 x86reg, int type, int reg, int mode) +int _allocX86reg(xRegisterLong x86reg, int type, int reg, int mode) { uint i; pxAssertDev( reg >= 0 && reg < 32, "Register index out of bounds." ); @@ -316,7 +316,7 @@ int _allocX86reg(xRegister32 x86reg, int type, int reg, int mode) } if (x86reg.IsEmpty()) - x86reg = xRegister32(_getFreeX86reg(oldmode)); + x86reg = xRegisterLong(_getFreeX86reg(oldmode)); else _freeX86reg(x86reg); @@ -445,7 +445,7 @@ void _deleteX86reg(int type, int reg, int flush) } // Temporary solution to support eax/ebx... type -void _freeX86reg(const x86Emitter::xRegister32& x86reg) +void _freeX86reg(const x86Emitter::xRegisterLong& x86reg) { _freeX86reg(x86reg.GetId()); } diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 402c795d68..2cf6dce183 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -154,7 +154,7 @@ u32* _eeGetConstReg(int reg) return &cpuRegs.GPR.r[ reg ].UL[0]; } -void _eeMoveGPRtoR(const xRegister32& to, int fromgpr) +void _eeMoveGPRtoR(const xRegisterLong& to, int fromgpr) { if( fromgpr == 0 ) xXOR(to, to); // zero register should use xor, thanks --air diff --git a/pcsx2/x86/microVU_Misc.h b/pcsx2/x86/microVU_Misc.h index 30264e093f..c03b4a629b 100644 --- a/pcsx2/x86/microVU_Misc.h +++ b/pcsx2/x86/microVU_Misc.h @@ -18,7 +18,7 @@ using namespace x86Emitter; typedef xRegisterSSE xmm; -typedef xRegister32 x32; +typedef xRegisterLong x32; struct microVU; diff --git a/pcsx2/x86/newVif_Dynarec.cpp b/pcsx2/x86/newVif_Dynarec.cpp index 2bfd5be970..b890045af3 100644 --- a/pcsx2/x86/newVif_Dynarec.cpp +++ b/pcsx2/x86/newVif_Dynarec.cpp @@ -139,7 +139,7 @@ void VifUnpackSSE_Dynarec::writeBackRow() const { // ToDo: Do we need to write back to vifregs.rX too!? :/ } -static void ShiftDisplacementWindow( xAddressVoid& addr, const xRegister32& modReg ) +static void ShiftDisplacementWindow( xAddressVoid& addr, const xRegisterLong& modReg ) { // Shifts the displacement factor of a given indirect address, so that the address // remains in the optimal 0xf0 range (which allows for byte-form displacements when