diff --git a/pcsx2/x86/ix86/implement/jmpcall.h b/pcsx2/x86/ix86/implement/jmpcall.h index 59cae03538..4c9d266c87 100644 --- a/pcsx2/x86/ix86/implement/jmpcall.h +++ b/pcsx2/x86/ix86/implement/jmpcall.h @@ -40,7 +40,7 @@ public: __forceinline void operator()( const T* func ) const { if( isJmp ) - iJcc( Jcc_Unconditional, (void*)(uptr)func ); // double cast to/from (uptr) needed to appease GCC + xJccKnownTarget( Jcc_Unconditional, (void*)(uptr)func, false ); // double cast to/from (uptr) needed to appease GCC else { // calls are relative to the instruction after this one, and length is diff --git a/pcsx2/x86/ix86/implement/xmm/arithmetic.h b/pcsx2/x86/ix86/implement/xmm/arithmetic.h index 6afd1d27a9..328070ce2d 100644 --- a/pcsx2/x86/ix86/implement/xmm/arithmetic.h +++ b/pcsx2/x86/ix86/implement/xmm/arithmetic.h @@ -74,12 +74,7 @@ class SimdImpl_Shift : public SimdImpl_ShiftWithoutQ public: const _SimdShiftHelper Q; - void DQ( const xRegisterSSE& to, u8 imm8 ) const - { - SimdPrefix( 0x66, 0x73 ); - ModRM( 3, (int)Modcode+1, to.Id ); - xWrite8( imm8 ); - } + __forceinline void DQ( const xRegisterSSE& to, u8 imm8 ) const { xOpWrite0F( 0x66, 0x73, (int)Modcode+1, to, imm8 ); } SimdImpl_Shift() {} }; diff --git a/pcsx2/x86/ix86/ix86_instructions.h b/pcsx2/x86/ix86/ix86_instructions.h index f02d006e4d..f69af460e7 100644 --- a/pcsx2/x86/ix86/ix86_instructions.h +++ b/pcsx2/x86/ix86/ix86_instructions.h @@ -208,7 +208,7 @@ namespace x86Emitter ////////////////////////////////////////////////////////////////////////////////////////// // JMP / Jcc Instructions! - extern void iJcc( JccComparisonType comparison, void* target ); + extern void xJcc( JccComparisonType comparison, void* target ); // ------------------------------------------------------------------------ // Conditional jumps to fixed targets. @@ -217,30 +217,30 @@ namespace x86Emitter // the target (efficient!) // - template< typename T > __forceinline void xJE( const T* func ) { iJcc( Jcc_Equal, (void*)(uptr)func ); } - template< typename T > __forceinline void xJZ( const T* func ) { iJcc( Jcc_Zero, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNE( const T* func ) { iJcc( Jcc_NotEqual, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNZ( const T* func ) { iJcc( Jcc_NotZero, (void*)(uptr)func ); } + template< typename T > __forceinline void xJE( const T* func ) { xJcc( Jcc_Equal, (void*)(uptr)func ); } + template< typename T > __forceinline void xJZ( const T* func ) { xJcc( Jcc_Zero, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNE( const T* func ) { xJcc( Jcc_NotEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNZ( const T* func ) { xJcc( Jcc_NotZero, (void*)(uptr)func ); } - template< typename T > __forceinline void xJO( const T* func ) { iJcc( Jcc_Overflow, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNO( const T* func ) { iJcc( Jcc_NotOverflow, (void*)(uptr)func ); } - template< typename T > __forceinline void xJC( const T* func ) { iJcc( Jcc_Carry, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNC( const T* func ) { iJcc( Jcc_NotCarry, (void*)(uptr)func ); } - template< typename T > __forceinline void xJS( const T* func ) { iJcc( Jcc_Signed, (void*)(uptr)func ); } - template< typename T > __forceinline void xJNS( const T* func ) { iJcc( Jcc_Unsigned, (void*)(uptr)func ); } + template< typename T > __forceinline void xJO( const T* func ) { xJcc( Jcc_Overflow, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNO( const T* func ) { xJcc( Jcc_NotOverflow, (void*)(uptr)func ); } + template< typename T > __forceinline void xJC( const T* func ) { xJcc( Jcc_Carry, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNC( const T* func ) { xJcc( Jcc_NotCarry, (void*)(uptr)func ); } + template< typename T > __forceinline void xJS( const T* func ) { xJcc( Jcc_Signed, (void*)(uptr)func ); } + template< typename T > __forceinline void xJNS( const T* func ) { xJcc( Jcc_Unsigned, (void*)(uptr)func ); } - template< typename T > __forceinline void xJPE( const T* func ) { iJcc( Jcc_ParityEven, (void*)(uptr)func ); } - template< typename T > __forceinline void xJPO( const T* func ) { iJcc( Jcc_ParityOdd, (void*)(uptr)func ); } + template< typename T > __forceinline void xJPE( const T* func ) { xJcc( Jcc_ParityEven, (void*)(uptr)func ); } + template< typename T > __forceinline void xJPO( const T* func ) { xJcc( Jcc_ParityOdd, (void*)(uptr)func ); } - template< typename T > __forceinline void xJL( const T* func ) { iJcc( Jcc_Less, (void*)(uptr)func ); } - template< typename T > __forceinline void xJLE( const T* func ) { iJcc( Jcc_LessOrEqual, (void*)(uptr)func ); } - template< typename T > __forceinline void xJG( const T* func ) { iJcc( Jcc_Greater, (void*)(uptr)func ); } - template< typename T > __forceinline void xJGE( const T* func ) { iJcc( Jcc_GreaterOrEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJL( const T* func ) { xJcc( Jcc_Less, (void*)(uptr)func ); } + template< typename T > __forceinline void xJLE( const T* func ) { xJcc( Jcc_LessOrEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJG( const T* func ) { xJcc( Jcc_Greater, (void*)(uptr)func ); } + template< typename T > __forceinline void xJGE( const T* func ) { xJcc( Jcc_GreaterOrEqual, (void*)(uptr)func ); } - template< typename T > __forceinline void xJB( const T* func ) { iJcc( Jcc_Below, (void*)(uptr)func ); } - template< typename T > __forceinline void xJBE( const T* func ) { iJcc( Jcc_BelowOrEqual, (void*)(uptr)func ); } - template< typename T > __forceinline void xJA( const T* func ) { iJcc( Jcc_Above, (void*)(uptr)func ); } - template< typename T > __forceinline void xJAE( const T* func ) { iJcc( Jcc_AboveOrEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJB( const T* func ) { xJcc( Jcc_Below, (void*)(uptr)func ); } + template< typename T > __forceinline void xJBE( const T* func ) { xJcc( Jcc_BelowOrEqual, (void*)(uptr)func ); } + template< typename T > __forceinline void xJA( const T* func ) { xJcc( Jcc_Above, (void*)(uptr)func ); } + template< typename T > __forceinline void xJAE( const T* func ) { xJcc( Jcc_AboveOrEqual, (void*)(uptr)func ); } // ------------------------------------------------------------------------ // Forward Jump Helpers (act as labels!) diff --git a/pcsx2/x86/ix86/ix86_jmp.cpp b/pcsx2/x86/ix86/ix86_jmp.cpp index b9ea2efde1..0954794f8b 100644 --- a/pcsx2/x86/ix86/ix86_jmp.cpp +++ b/pcsx2/x86/ix86/ix86_jmp.cpp @@ -51,7 +51,7 @@ void xSmartJump::SetTarget() xSetPtr( m_baseptr ); u8* const saveme = m_baseptr + GetMaxInstructionSize(); - iJccKnownTarget( m_cc, target, true ); + xJccKnownTarget( m_cc, target, true ); // Copy recompiled data inward if the jump instruction didn't fill the // alloted buffer (means that we optimized things to a j8!) @@ -81,7 +81,7 @@ xSmartJump::~xSmartJump() // slideForward - used internally by xSmartJump to indicate that the jump target is going // to slide forward in the event of an 8 bit displacement. // -__emitinline void Internal::iJccKnownTarget( JccComparisonType comparison, void* target, bool slideForward ) +__emitinline void Internal::xJccKnownTarget( JccComparisonType comparison, void* target, bool slideForward ) { // Calculate the potential j8 displacement first, assuming an instruction length of 2: sptr displacement8 = (sptr)target - ((sptr)xGetPtr() + 2); @@ -115,9 +115,9 @@ __emitinline void Internal::iJccKnownTarget( JccComparisonType comparison, void* // Low-level jump instruction! Specify a comparison type and a target in void* form, and // a jump (either 8 or 32 bit) is generated. -__emitinline void iJcc( JccComparisonType comparison, void* target ) +__emitinline void xJcc( JccComparisonType comparison, void* target ) { - iJccKnownTarget( comparison, target, false ); + xJccKnownTarget( comparison, target, false ); } } \ No newline at end of file diff --git a/pcsx2/x86/ix86/ix86_types.h b/pcsx2/x86/ix86/ix86_types.h index 39aa9b0839..53b664ceb2 100644 --- a/pcsx2/x86/ix86/ix86_types.h +++ b/pcsx2/x86/ix86/ix86_types.h @@ -239,12 +239,12 @@ __forceinline void xWrite( T val ) explicit xRegister( const xRegisterBase& src ) : xRegisterBase( src ) {} explicit xRegister( int regId ) : xRegisterBase( regId ) {} - bool operator==( const xRegister& src ) const { return Id == src.Id; } - bool operator!=( const xRegister& src ) const { return Id != src.Id; } + bool operator==( const xRegister& src ) const { return this->Id == src.Id; } + bool operator!=( const xRegister& src ) const { return this->Id != src.Id; } xRegister& operator=( const xRegister& src ) { - xRegisterBase::Id = src.Id; + this->Id = src.Id; return *this; } }; @@ -263,12 +263,12 @@ __forceinline void xWrite( T val ) explicit xRegisterSIMD( const xRegisterBase& src ) : xRegisterBase( src ) {} explicit xRegisterSIMD( int regId ) : xRegisterBase( regId ) {} - bool operator==( const xRegisterSIMD& src ) const { return Id == src.Id; } - bool operator!=( const xRegisterSIMD& src ) const { return Id != src.Id; } + bool operator==( const xRegisterSIMD& src ) const { return this->Id == src.Id; } + bool operator!=( const xRegisterSIMD& src ) const { return this->Id != src.Id; } xRegisterSIMD& operator=( const xRegisterSIMD& src ) { - xRegisterBase::Id = src.Id; + this->Id = src.Id; return *this; } }; @@ -686,7 +686,7 @@ __forceinline void xWrite( T val ) extern void SimdPrefix( u8 prefix, u16 opcode ); extern void EmitSibMagic( uint regfield, const void* address ); extern void EmitSibMagic( uint regfield, const ModSibBase& info ); - extern void iJccKnownTarget( JccComparisonType comparison, void* target, bool slideForward ); + extern void xJccKnownTarget( JccComparisonType comparison, void* target, bool slideForward ); // Writes a ModRM byte for "Direct" register access forms, which is used for all