changeset 9329:263add3e2616 libavcodec

Add SSE4 detection support
author conrad
date Wed, 01 Apr 2009 09:11:32 +0000
parents 6a1ad1d933cd
children f01741cc9471
files avcodec.h x86/cpuid.c
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Wed Apr 01 08:55:31 2009 +0000
+++ b/avcodec.h	Wed Apr 01 09:11:32 2009 +0000
@@ -1462,6 +1462,8 @@
 #define FF_MM_3DNOWEXT 0x0020 ///< AMD 3DNowExt
 #define FF_MM_SSE3     0x0040 ///< Prescott SSE3 functions
 #define FF_MM_SSSE3    0x0080 ///< Conroe SSSE3 functions
+#define FF_MM_SSE4     0x0100 ///< Penryn SSE4.1 functions
+#define FF_MM_SSE42    0x0200 ///< Nehalem SSE4.2 functions
 #define FF_MM_IWMMXT   0x0100 ///< XScale IWMMXT
 #define FF_MM_ALTIVEC  0x0001 ///< standard AltiVec
 
--- a/x86/cpuid.c	Wed Apr 01 08:55:31 2009 +0000
+++ b/x86/cpuid.c	Wed Apr 01 09:11:32 2009 +0000
@@ -85,7 +85,11 @@
         if (ecx & 1)
             rval |= FF_MM_SSE3;
         if (ecx & 0x00000200 )
-            rval |= FF_MM_SSSE3
+            rval |= FF_MM_SSSE3;
+        if (ecx & 0x00080000 )
+            rval |= FF_MM_SSE4;
+        if (ecx & 0x00100000 )
+            rval |= FF_MM_SSE42;
 #endif
                   ;
     }
@@ -105,13 +109,15 @@
     }
 
 #if 0
-    av_log(NULL, AV_LOG_DEBUG, "%s%s%s%s%s%s%s%s\n",
+    av_log(NULL, AV_LOG_DEBUG, "%s%s%s%s%s%s%s%s%s%s\n",
         (rval&FF_MM_MMX) ? "MMX ":"",
         (rval&FF_MM_MMXEXT) ? "MMX2 ":"",
         (rval&FF_MM_SSE) ? "SSE ":"",
         (rval&FF_MM_SSE2) ? "SSE2 ":"",
         (rval&FF_MM_SSE3) ? "SSE3 ":"",
         (rval&FF_MM_SSSE3) ? "SSSE3 ":"",
+        (rval&FF_MM_SSE4) ? "SSE4.1 ":"",
+        (rval&FF_MM_SSE42) ? "SSE4.2 ":"",
         (rval&FF_MM_3DNOW) ? "3DNow ":"",
         (rval&FF_MM_3DNOWEXT) ? "3DNowExt ":"");
 #endif