]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/x86/cpu.c
x86/imdct36: don't build imdct36_float_sse on x86_64 targets
[ffmpeg] / libavutil / x86 / cpu.c
index 18049eaead411e10e1714a154af43c72c321c4da..356cd44f0606bef508a8dc4f8ec386e752e33b4d 100644 (file)
@@ -131,19 +131,27 @@ int ff_get_cpu_flags_x86(void)
         if ((ecx & 0x18000000) == 0x18000000) {
             /* Check for OS support */
             xgetbv(0, eax, edx);
-            if ((eax & 0x6) == 0x6)
+            if ((eax & 0x6) == 0x6) {
                 rval |= AV_CPU_FLAG_AVX;
+                if (ecx & 0x00001000)
+                    rval |= AV_CPU_FLAG_FMA3;
+            }
         }
-#if HAVE_AVX2
+#endif /* HAVE_AVX */
+#endif /* HAVE_SSE */
+    }
     if (max_std_level >= 7) {
         cpuid(7, eax, ebx, ecx, edx);
-        if (ebx&0x00000020)
+#if HAVE_AVX2
+        if (ebx & 0x00000020)
             rval |= AV_CPU_FLAG_AVX2;
-        /* TODO: BMI1/2 */
-    }
 #endif /* HAVE_AVX2 */
-#endif /* HAVE_AVX */
-#endif /* HAVE_SSE */
+        /* BMI1/2 don't need OS support */
+        if (ebx & 0x00000008) {
+            rval |= AV_CPU_FLAG_BMI1;
+            if (ebx & 0x00000100)
+                rval |= AV_CPU_FLAG_BMI2;
+        }
     }
 
     cpuid(0x80000000, max_ext_level, ebx, ecx, edx);