summaryrefslogtreecommitdiffstats
path: root/contrib/mpeg2dec/P00-mingw-disable-sse.patch
blob: ee23632b97e6435193925fe7214cbc39b5ea227a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Index: libmpeg2/cpu_accel.c
===================================================================
--- mpeg2dec/libmpeg2/cpu_accel.c	(revision 1205)
+++ mpeg2dec/libmpeg2/cpu_accel.c	(working copy)
@@ -111,7 +111,13 @@
 
 	cpuid (0x80000000, eax, ebx, ecx, edx);
 	if (eax < 0x80000001)		/* no extended capabilities */
-	    return accel;
+    {
+#if defined(__x86_64__)
+        // SSE code is broken on mingw64, so disable it.
+	    accel &= ~(MPEG2_ACCEL_X86_SSE2|MPEG2_ACCEL_X86_SSE3);
+#endif
+        return accel;
+    }
 
 	cpuid (0x80000001, eax, ebx, ecx, edx);
 
@@ -120,6 +126,10 @@
 
 	if (AMD && (edx & 0x00400000))	/* AMD MMX extensions */
 	    accel |= MPEG2_ACCEL_X86_MMXEXT;
+#if defined(__x86_64__)
+    // SSE code is broken on mingw64, so disable it.
+	accel &= ~(MPEG2_ACCEL_X86_SSE2|MPEG2_ACCEL_X86_SSE3);
+#endif
     }
 #endif /* ACCEL_DETECT */