summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-11-23 17:46:14 +0000
committerhrydgard <hrydgard@gmail.com>2008-11-23 17:46:14 +0000
commit5c58227702d1783fe3b67de4c8a69932cea1d82d (patch)
treeaf3f46010f2181fddb4a13bb08a28bd651817300 /Source/Core
parent464185a04e927a887a85f1fdcb9ea33325c3ea0a (diff)
Optimize vertex loader with a mini JIT (only first step, more optimizations may follow). Some various error message and warning fixes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1276 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Src/ABI.cpp38
-rw-r--r--Source/Core/Common/Src/ABI.h5
-rw-r--r--Source/Core/Common/Src/x64Emitter.cpp37
-rw-r--r--Source/Core/Common/Src/x64Emitter.h10
-rw-r--r--Source/Core/Core/Src/HW/PeripheralInterface.cpp9
-rw-r--r--Source/Core/VideoCommon/Src/NativeVertexFormat.h2
-rw-r--r--Source/Core/VideoCommon/Src/Statistics.h10
7 files changed, 51 insertions, 60 deletions
diff --git a/Source/Core/Common/Src/ABI.cpp b/Source/Core/Common/Src/ABI.cpp
index 097d6fc45b..2e29e2bc6c 100644
--- a/Source/Core/Common/Src/ABI.cpp
+++ b/Source/Core/Common/Src/ABI.cpp
@@ -4,6 +4,40 @@
using namespace Gen;
+// Shared code between Win64 and Unix64
+// ====================================
+
+// Sets up a __cdecl function.
+void ABI_EmitPrologue(int maxCallParams)
+{
+#ifdef _M_IX86
+ // Don't really need to do anything
+#elif defined(_M_X64)
+#if _WIN32
+ int stacksize = ((maxCallParams + 1) & ~1)*8 + 8;
+ // Set up a stack frame so that we can call functions
+ // TODO: use maxCallParams
+ SUB(64, R(RSP), Imm8(stacksize));
+#endif
+#else
+#error Arch not supported
+#endif
+}
+void ABI_EmitEpilogue(int maxCallParams)
+{
+#ifdef _M_IX86
+ RET();
+#elif defined(_M_X64)
+#ifdef _WIN32
+ int stacksize = ((maxCallParams+1)&~1)*8 + 8;
+ ADD(64, R(RSP), Imm8(stacksize));
+#endif
+ RET();
+#else
+#error Arch not supported
+#endif
+}
+
#ifdef _M_IX86 // All32
// Shared code between Win32 and Unix32
@@ -76,6 +110,7 @@ unsigned int ABI_GetAlignedFrameSize(unsigned int frameSize) {
return alignedSize;
}
+
void ABI_AlignStack(unsigned int frameSize) {
// Mac OS X requires the stack to be 16-byte aligned before every call.
// Linux requires the stack to be 16-byte aligned before calls that put SSE
@@ -103,9 +138,6 @@ void ABI_RestoreStack(unsigned int frameSize) {
#else
-// Shared code between Win64 and Unix64
-// ====================================
-
void ABI_CallFunctionC(void *func, u32 param1) {
MOV(32, R(ABI_PARAM1), Imm32(param1));
CALL(func);
diff --git a/Source/Core/Common/Src/ABI.h b/Source/Core/Common/Src/ABI.h
index 2bbd169d00..2dfbf5aa19 100644
--- a/Source/Core/Common/Src/ABI.h
+++ b/Source/Core/Common/Src/ABI.h
@@ -107,6 +107,11 @@ unsigned int ABI_GetAlignedFrameSize(unsigned int frameSize);
void ABI_AlignStack(unsigned int frameSize);
void ABI_RestoreStack(unsigned int frameSize);
+// Sets up a __cdecl function.
+// Only x64 really needs the parameter.
+void ABI_EmitPrologue(int maxCallParams);
+void ABI_EmitEpilogue(int maxCallParams);
+
#ifdef _M_IX86
inline int ABI_GetNumXMMRegs() { return 8; }
#else
diff --git a/Source/Core/Common/Src/x64Emitter.cpp b/Source/Core/Common/Src/x64Emitter.cpp
index fe839d8537..e3adb2e54b 100644
--- a/Source/Core/Common/Src/x64Emitter.cpp
+++ b/Source/Core/Common/Src/x64Emitter.cpp
@@ -1316,43 +1316,6 @@ namespace Gen
}
void RTDSC() { Write8(0x0F); Write8(0x31); }
-
- namespace Util
- {
-
- // Sets up a __cdecl function.
- void EmitPrologue(int maxCallParams)
- {
-#ifdef _M_IX86
- // Don't really need to do anything
-#elif defined(_M_X64)
-#if _WIN32
- int stacksize = ((maxCallParams + 1) & ~1)*8 + 8;
- // Set up a stack frame so that we can call functions
- // TODO: use maxCallParams
- SUB(64, R(RSP), Imm8(stacksize));
-#endif
-#else
-#error Arch not supported
-#endif
- }
- void EmitEpilogue(int maxCallParams)
- {
-#ifdef _M_IX86
- RET();
-#elif defined(_M_X64)
-#ifdef _WIN32
- int stacksize = ((maxCallParams+1)&~1)*8 + 8;
- ADD(64, R(RSP), Imm8(stacksize));
-#endif
- RET();
-#else
-#error Arch not supported
-#endif
- }
-
- } // namespace
-
// helper routines for setting pointers
void CallCdeclFunction3(void* fnptr, u32 arg0, u32 arg1, u32 arg2)
diff --git a/Source/Core/Common/Src/x64Emitter.h b/Source/Core/Common/Src/x64Emitter.h
index 995143b91a..0238569a28 100644
--- a/Source/Core/Common/Src/x64Emitter.h
+++ b/Source/Core/Common/Src/x64Emitter.h
@@ -520,16 +520,8 @@ namespace Gen
void PMOVMSKB(X64Reg dest, OpArg arg);
void PSHUFB(X64Reg dest, OpArg arg);
- void RTDSC();
+ void RTDSC();
- namespace Util
- {
- // Sets up a __cdecl function.
- // Only x64 really needs the parameter.
- void EmitPrologue(int maxCallParams);
- void EmitEpilogue(int maxCallParams);
- }
-
void CallCdeclFunction3(void* fnptr, u32 arg0, u32 arg1, u32 arg2);
void CallCdeclFunction4(void* fnptr, u32 arg0, u32 arg1, u32 arg2, u32 arg3);
void CallCdeclFunction5(void* fnptr, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
diff --git a/Source/Core/Core/Src/HW/PeripheralInterface.cpp b/Source/Core/Core/Src/HW/PeripheralInterface.cpp
index 2e30eaa1b8..2d4424d9c5 100644
--- a/Source/Core/Core/Src/HW/PeripheralInterface.cpp
+++ b/Source/Core/Core/Src/HW/PeripheralInterface.cpp
@@ -145,13 +145,12 @@ void CPeripheralInterface::Write32(const u32 _uValue, const u32 _iAddress)
{
switch (_uValue) {
case 3:
- PanicAlert("Game wants to go to memory card manager. Since BIOS is being HLE:d - can't do that.\n"
- "We might pop up a fake memcard manager here and then reset the game in the future :)\n");
+ PanicAlert("The game wants to go to memory card manager. BIOS is being HLE:d - so we can't do that.\n");
break;
default:
{
TCHAR szTemp[256];
- sprintf(szTemp, "Game wants to reset the machine. PI_RESET_CODE: (%08x)", _uValue);
+ sprintf(szTemp, "The game wants to reset the machine. PI_RESET_CODE: (%08x)", _uValue);
PanicAlert(szTemp);
}
break;
@@ -161,8 +160,8 @@ void CPeripheralInterface::Write32(const u32 _uValue, const u32 _iAddress)
break;
default:
- LOG(PERIPHERALINTERFACE,"!!!!Unknown write!!!! 0x%08x", _iAddress);
- PanicAlert("Unknown write to PI");
+ LOG(PERIPHERALINTERFACE,"!!!!Unknown PI write!!!! 0x%08x", _iAddress);
+ PanicAlert("Unknown write to PI: %08x", _iAddress);
break;
}
}
diff --git a/Source/Core/VideoCommon/Src/NativeVertexFormat.h b/Source/Core/VideoCommon/Src/NativeVertexFormat.h
index bb9be45d79..3aee5cd753 100644
--- a/Source/Core/VideoCommon/Src/NativeVertexFormat.h
+++ b/Source/Core/VideoCommon/Src/NativeVertexFormat.h
@@ -55,7 +55,7 @@ enum {
};
#define LOADERDECL __cdecl
-typedef void (LOADERDECL *TPipelineFunction)(const void *);
+typedef void (LOADERDECL *TPipelineFunction)();
enum VarType {
VAR_BYTE,
diff --git a/Source/Core/VideoCommon/Src/Statistics.h b/Source/Core/VideoCommon/Src/Statistics.h
index e618d543ba..fe4a1e201c 100644
--- a/Source/Core/VideoCommon/Src/Statistics.h
+++ b/Source/Core/VideoCommon/Src/Statistics.h
@@ -20,8 +20,6 @@
struct Statistics
{
- int numPrimitives;
-
int numPixelShadersCreated;
int numPixelShadersAlive;
int numVertexShadersCreated;
@@ -37,8 +35,6 @@ struct Statistics
int numDListsCreated;
int numDListsAlive;
- int numJoins;
-
int numVertexLoaders;
struct ThisFrame
@@ -52,10 +48,14 @@ struct Statistics
int numXFLoadsInDL;
int numDLs;
- int numDLPrims;
int numPrims;
+ int numDLPrims;
int numShaderChanges;
+ int numPrimitiveJoins;
+ int numDrawCalls;
+ int numBufferSplits;
+
int numDListsCalled;
};
ThisFrame thisFrame;