summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
diff options
context:
space:
mode:
authorjames.jdunne <james.jdunne@gmail.com>2010-12-30 19:17:08 +0000
committerjames.jdunne <james.jdunne@gmail.com>2010-12-30 19:17:08 +0000
commitb038df64bfad478c4e2605985809f58f351ec11c (patch)
treef23fb12f4704f517ccb8d438ac159b1fde544b7d /Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
parent6cf9b3688df632328b1fa223b9ade8d869cfade9 (diff)
TextureDecoder.cpp: new SSE2 optimized GX_TF_I8 decoder. Probably not ultimately optimal SSE2 code, but provably better (on my machine) than the memset version. Tested with __rdtsc counts in an independent project. I get about 6-7 FPS more on average during the intro movie playback in Mario Kart Wii. Hope this compiles for GCC okay.
TextureDecoder.cpp: merged two functionally identical decode5A3RGBA and decode5A3rgba methods. OpcodeDecoding.cpp and DLCache.cpp: optimization for GX_LOAD_XF_REG. The PSUHFB solution sounds better for SSSE3, but this is a small win for the default case. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6692 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/OpcodeDecoding.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/OpcodeDecoding.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
index 4fb9574478..fbb81fb40d 100644
--- a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
@@ -49,6 +49,24 @@
#endif
u8* g_pVideoData = 0;
+DataReadU32xNfunc DataReadU32xFuncs[16] = {
+ DataReadU32xN<1>,
+ DataReadU32xN<2>,
+ DataReadU32xN<3>,
+ DataReadU32xN<4>,
+ DataReadU32xN<5>,
+ DataReadU32xN<6>,
+ DataReadU32xN<7>,
+ DataReadU32xN<8>,
+ DataReadU32xN<9>,
+ DataReadU32xN<10>,
+ DataReadU32xN<11>,
+ DataReadU32xN<12>,
+ DataReadU32xN<13>,
+ DataReadU32xN<14>,
+ DataReadU32xN<15>,
+ DataReadU32xN<16>
+};
extern u8* FAKE_GetFifoStartPtr();
extern u8* FAKE_GetFifoEndPtr();
@@ -233,12 +251,13 @@ static void Decode()
{
u32 Cmd2 = DataReadU32();
int transfer_size = ((Cmd2 >> 16) & 15) + 1;
- u32 xf_address = Cmd2 & 0xFFFF;
+ u32 xf_address = Cmd2 & 0xFFFF;
// TODO - speed this up. pshufb?
- u32 data_buffer[16];
- for (int i = 0; i < transfer_size; i++)
- data_buffer[i] = DataReadU32();
+ u32 data_buffer[16];
+ DataReadU32xFuncs[transfer_size-1](data_buffer);
+
LoadXFReg(transfer_size, xf_address, data_buffer);
+
INCSTAT(stats.thisFrame.numXFLoads);
}
break;
@@ -317,7 +336,7 @@ static void DecodeSemiNop()
u8 sub_cmd = DataReadU8();
u32 value = DataReadU32();
LoadCPReg(sub_cmd, value);
- INCSTAT(stats.thisFrame.numCPLoads);
+ INCSTAT(stats.thisFrame.numCPLoads);
}
break;
@@ -328,10 +347,9 @@ static void DecodeSemiNop()
u32 address = Cmd2 & 0xFFFF;
// TODO - speed this up. pshufb?
u32 data_buffer[16];
- for (int i = 0; i < transfer_size; i++)
- data_buffer[i] = DataReadU32();
+ DataReadU32xFuncs[transfer_size-1](data_buffer);
LoadXFReg(transfer_size, address, data_buffer);
- INCSTAT(stats.thisFrame.numXFLoads);
+ INCSTAT(stats.thisFrame.numXFLoads);
}
break;