Dolphin, the GameCube and Wii emulator - Forums

Full Version: Bugfix: Enable SSE4.2 on GCC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
You need to compile it with the flag -msse4.2

Code:
diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h
index 888a206..fd0f730 100644
--- a/Source/Core/Common/Src/Common.h
+++ b/Source/Core/Common/Src/Common.h
@@ -141,6 +141,8 @@ private:
#define _M_SSE 0x300
#elif defined __APPLE__ && defined __x86_64__
#define _M_SSE 0x301
+#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && defined __SSE4_2__
+#define _M_SSE 0x402
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
#define _M_SSE 0x301
#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008
diff --git a/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp
index de85308..6d1e4e4 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp
+++ b/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp
@@ -438,7 +438,7 @@ void VertexLoader_TextCoord::Init(void) {

#if _M_SSE >= 0x401

-    if (cpu_info.bSSE4_1) {
+    if (cpu_info.bSSE4_1 && cpu_info.bSSSE3) {
        tableReadTexCoord[3][3][1] = TexCoord_ReadIndex16_Short2_SSE4;
    }
Don't Linux users compile thier stuff with -march=native which would include -msse4.2 if their CPU has it?
(10-10-2011, 01:09 AM)lamedude Wrote: [ -> ]Don't Linux users compile thier stuff with -march=native which would include -msse4.2 if their CPU has it?

No, it enable other flags even if your system support SSE4.2.
(10-10-2011, 01:44 AM)fbarriga Wrote: [ -> ]
(10-10-2011, 01:09 AM)lamedude Wrote: [ -> ]Don't Linux users compile thier stuff with -march=native which would include -msse4.2 if their CPU has it?

No, it enable other flags even if your system support SSE4.2.

My fault, damn SSE* nomenclature, my CPU doesn't support SSE4.2 (so I suppose thst you can ignore my '-msse4.2' comment).