Removed "noreturn" declspec from the iR5900-32.cpp Dispatcher functions, which simply supressed the generation of an unreachable "ret" at the end of the naked functions. GCC doesn't support the directive anyway.

Removed some __MINGW32__ specific code, and added a GCC-friendly #define for declaring __naked functions. (another optimization directive in MSVC which GCC doesn't support and/or ignores)

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@616 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
Jake.Stine 2009-01-21 04:55:55 +00:00 committed by Gregory Hainaut
parent 2193adb127
commit 46f5bb51e9
4 changed files with 11 additions and 86 deletions

View File

@ -87,6 +87,8 @@ typedef unsigned int uint;
#define PCSX2_ALIGNED16(x) __declspec(align(16)) x
#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x
#define __naked __declspec(naked)
#else // _MSC_VER
#ifdef __LINUX__
@ -107,7 +109,7 @@ typedef uint64_t u64;
typedef uintptr_t uptr;
typedef intptr_t sptr;
#else // __LINUX__
#else // HAVE_STDINT_H
typedef char s8;
typedef short s16;
@ -119,7 +121,7 @@ typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
#endif // __LINUX__
#endif // HAVE_STDINT_H
typedef unsigned int uint;
@ -133,15 +135,12 @@ typedef union _LARGE_INTEGER
#define __unused __attribute__((unused))
#define _inline __inline__ __attribute__((unused))
#define __forceinline __attribute__((always_inline,unused))
#endif
#define __naked // GCC lacks the naked specifier
#endif // __LINUX__
#if defined(__MINGW32__)
#define PCSX2_ALIGNED(alig,x) __declspec(align(alig)) x
#define PCSX2_ALIGNED16(x) __declspec(align(16)) x
#else
#define PCSX2_ALIGNED(alig,x) x __attribute((aligned(alig)))
#define PCSX2_ALIGNED16(x) x __attribute((aligned(16)))
#endif
#define PCSX2_ALIGNED16_DECL(x) x

View File

@ -67,31 +67,6 @@ using std::string; // we use it enough, so bring it into the global namespace.
# define strnicmp _strnicmp
# define stricmp _stricmp
#elif defined(__MINGW32__)
# include <sys/types.h>
# include <math.h>
# define BOOL int
# include <stdlib.h> // posix_memalign()
# undef TRUE
# undef FALSE
# define TRUE 1
# define FALSE 0
# define __declspec(x)
# define __assume(x) ;
# define strnicmp strncasecmp
# define stricmp strcasecmp
# include <winbase.h>
//# pragma intrinsic (InterlockedAnd)
// Definitions added Feb 16, 2006 by efp
//# define __declspec(x)
# include <malloc.h>
# define __forceinline inline
# define _aligned_malloc(x,y) __mingw_aligned_malloc(x,y)
# define _aligned_free(x) __mingw_aligned_free(x)
# define pthread_mutex__unlock pthread_mutex_unlock
#else // must be GCC...
# include <sys/types.h>

View File

@ -576,34 +576,6 @@ static void recShutdown( void )
#pragma warning(disable:4731) // frame pointer register 'ebp' modified by inline assembly code
/*
static __forceinline __declspec(naked) void execute( void )
{
#ifdef _MSC_VER
__asm pusha;
#else
__asm__("pusha\n");
#endif
BASEBLOCK* pblock = PC_GETBLOCK(cpuRegs.pc);
if ( !pblock->pFnptr || pblock->startpc != cpuRegs.pc )
recRecompile(cpuRegs.pc);
assert( pblock->pFnptr != 0 );
g_EEFreezeRegs = true;
((R5900FNPTR)pblock->pFnptr)();
#ifdef _MSC_VER
__asm popa;
#else
__asm__("popa\n");
#endif
g_EEFreezeRegs = false;
}*/
void recStep( void ) {
}
@ -634,7 +606,7 @@ static u32 g_EEDispatchTemp;
// jumped to when invalid pc address
// EDX contains the jump addr to modify
static __declspec(naked,noreturn) void Dispatcher()
static __naked void Dispatcher()
{
// EDX contains the jump addr to modify
__asm push edx
@ -677,7 +649,7 @@ CheckPtr:
// edx - baseblock->startpc
// stack - x86Ptr
static __declspec(naked,noreturn) void DispatcherClear()
static __naked void DispatcherClear()
{
// EDX contains the current pc
__asm mov cpuRegs.pc, edx
@ -721,7 +693,7 @@ static __declspec(naked,noreturn) void DispatcherClear()
}
// called when jumping to variable pc address
static __declspec(naked,noreturn) void DispatcherReg()
static __naked void DispatcherReg()
{
s_pDispatchBlock = PC_GETBLOCK(cpuRegs.pc);
@ -1524,27 +1496,6 @@ void recompileNextInstruction(int delayslot)
// g_cpuHasConstReg = 1;
}
//__declspec(naked) void iDummyBlock()
//{
//// g_lastpc = cpuRegs.pc;
////
//// do {
//// cpuRegs.cycle = g_nextBranchCycle;
//// cpuBranchTest();
//// } while(g_lastpc == cpuRegs.pc);
////
//// __asm jmp DispatcherReg
// __asm {
//RepDummy:
// add cpuRegs.cycle, 9
// call cpuBranchTest
// cmp cpuRegs.pc, 0x81fc0
// je RepDummy
// jmp DispatcherReg
// }
//}
extern u32 psxdump;
static void printfn()

View File

@ -32,7 +32,7 @@ using namespace std;
#include <windows.h>
#endif
#if !defined(_WIN32) && !defined(__MINGW32__)
#if !defined(_WIN32)
#ifndef strnicmp
#define strnicmp strncasecmp
#endif