[Ffmpeg-cvslog] r6314 - trunk/libavutil/common.h

lorenm subversion
Thu Sep 21 19:48:45 CEST 2006


Author: lorenm
Date: Thu Sep 21 19:48:45 2006
New Revision: 6314

Modified:
   trunk/libavutil/common.h

Log:
simplify asm mid_pred, as suggested by michaelni.


Modified: trunk/libavutil/common.h
==============================================================================
--- trunk/libavutil/common.h	(original)
+++ trunk/libavutil/common.h	Thu Sep 21 19:48:45 2006
@@ -236,18 +236,17 @@
 static inline int mid_pred(int a, int b, int c)
 {
 #if (defined(ARCH_X86) && __CPU__ >= 686 || defined(ARCH_X86_64)) && !defined(RUNTIME_CPUDETECT)
-    int i=a, j=a;
+    int i=b;
     asm volatile(
-        "cmp    %4, %2 \n\t"
-        "cmovg  %4, %0 \n\t"
-        "cmovl  %4, %1 \n\t"
-        "cmp    %4, %3 \n\t"
-        "cmovg  %3, %0 \n\t"
+        "cmp    %2, %1 \n\t"
+        "cmovg  %1, %0 \n\t"
+        "cmovg  %2, %1 \n\t"
+        "cmp    %3, %1 \n\t"
         "cmovl  %3, %1 \n\t"
-        "cmp    %3, %2 \n\t"
-        "cmovl  %1, %0 \n\t"
-        :"+&r"(i), "+&r"(j)
-        :"r"(a), "r"(b), "r"(c)
+        "cmp    %1, %0 \n\t"
+        "cmovg  %1, %0 \n\t"
+        :"+&r"(i), "+&r"(a)
+        :"r"(b), "r"(c)
     );
     return i;
 #elif 0




More information about the ffmpeg-cvslog mailing list