summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
diff options
context:
space:
mode:
authorxsacha <xsacha@gmail.com>2011-01-10 13:14:56 +0000
committerxsacha <xsacha@gmail.com>2011-01-10 13:14:56 +0000
commitf9e4e73e428ea0ce594fb2017272fc47d447f2fa (patch)
tree67481fcf2a969871988958e3daae1569b4a543b2 /Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
parentf49efa8868ed7435c01f139b91a69b8538494454 (diff)
Use SSSE3 shuffle for DataReader's DataReadU32xN in VideoCommon. The function is used for reading up to 16 u32's at a time (512-bits) and then converting endianness.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6802 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/OpcodeDecoding.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/OpcodeDecoding.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
index ff4d6d1d97..3555f1fba1 100644
--- a/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/Src/OpcodeDecoding.cpp
@@ -30,6 +30,7 @@
#include "Profiler.h"
#include "OpcodeDecoding.h"
#include "CommandProcessor.h"
+#include "CPUDetect.h"
#include "VertexLoaderManager.h"
@@ -47,6 +48,27 @@
#include "VideoConfig.h"
u8* g_pVideoData = 0;
+#if _M_SSE >= 0x301
+DataReadU32xNfunc DataReadU32xFuncs_SSSE3[16] = {
+ DataReadU32xN_SSSE3<1>,
+ DataReadU32xN_SSSE3<2>,
+ DataReadU32xN_SSSE3<3>,
+ DataReadU32xN_SSSE3<4>,
+ DataReadU32xN_SSSE3<5>,
+ DataReadU32xN_SSSE3<6>,
+ DataReadU32xN_SSSE3<7>,
+ DataReadU32xN_SSSE3<8>,
+ DataReadU32xN_SSSE3<9>,
+ DataReadU32xN_SSSE3<10>,
+ DataReadU32xN_SSSE3<11>,
+ DataReadU32xN_SSSE3<12>,
+ DataReadU32xN_SSSE3<13>,
+ DataReadU32xN_SSSE3<14>,
+ DataReadU32xN_SSSE3<15>,
+ DataReadU32xN_SSSE3<16>
+};
+#endif
+
DataReadU32xNfunc DataReadU32xFuncs[16] = {
DataReadU32xN<1>,
DataReadU32xN<2>,
@@ -250,7 +272,6 @@ static void Decode()
u32 Cmd2 = DataReadU32();
int transfer_size = ((Cmd2 >> 16) & 15) + 1;
u32 xf_address = Cmd2 & 0xFFFF;
- // TODO - speed this up. pshufb?
u32 data_buffer[16];
DataReadU32xFuncs[transfer_size-1](data_buffer);
@@ -401,6 +422,13 @@ void OpcodeDecoder_Init()
{
g_pVideoData = FAKE_GetFifoStartPtr();
+#if _M_SSE >= 0x301
+ if (cpu_info.bSSSE3)
+ {
+ *DataReadU32xFuncs = *DataReadU32xFuncs_SSSE3;
+ }
+#endif
+
if (g_Config.bEnableOpenCL)
{
OpenCL::Initialize();