diff libmpeg2/cpu_accel.c @ 21526:60a39d71e247

sync to libmpeg2-0.4.1
author henry
date Sat, 09 Dec 2006 10:34:27 +0000
parents 0783dd397f74
children 11181df06389
line wrap: on
line diff
--- a/libmpeg2/cpu_accel.c	Sat Dec 09 09:27:35 2006 +0000
+++ b/libmpeg2/cpu_accel.c	Sat Dec 09 10:34:27 2006 +0000
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * Modified for use with MPlayer, see libmpeg-0.4.0.diff for the exact changes.
+ * Modified for use with MPlayer, see libmpeg-0.4.1.diff for the exact changes.
  * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/
  * $Id$
  */
@@ -50,7 +50,7 @@
     int AMD;
     uint32_t caps;
 
-#if !defined(PIC) && !defined(__PIC__)
+#if defined(__x86_64__) || (!defined(PIC) && !defined(__PIC__))
 #define cpuid(op,eax,ebx,ecx,edx)	\
     __asm__ ("cpuid"			\
 	     : "=a" (eax),		\
@@ -59,12 +59,12 @@
 	       "=d" (edx)		\
 	     : "a" (op)			\
 	     : "cc")
-#else	/* PIC version : save ebx */
+#else  /* PIC version : save ebx (not needed on x86_64) */
 #define cpuid(op,eax,ebx,ecx,edx)	\
-    __asm__ ("push %%ebx\n\t"		\
+    __asm__ ("pushl %%ebx\n\t"		\
 	     "cpuid\n\t"		\
 	     "movl %%ebx,%1\n\t"	\
-	     "pop %%ebx"		\
+	     "popl %%ebx"		\
 	     : "=a" (eax),		\
 	       "=r" (ebx),		\
 	       "=c" (ecx),		\
@@ -73,6 +73,7 @@
 	     : "cc")
 #endif
 
+#ifndef __x86_64__ /* x86_64 supports the cpuid op */
     __asm__ ("pushf\n\t"
 	     "pushf\n\t"
 	     "pop %0\n\t"
@@ -90,6 +91,7 @@
 
     if (eax == ebx)		/* no cpuid */
 	return 0;
+#endif
 
     cpuid (0x00000000, eax, ebx, ecx, edx);
     if (!eax)			/* vendor string only */
@@ -154,7 +156,7 @@
 }
 
 #ifdef ARCH_PPC
-static inline uint32_t arch_accel (void)
+static uint32_t arch_accel (void)
 {
     static RETSIGTYPE (* oldsig) (int);
 
@@ -184,7 +186,7 @@
 #endif /* ARCH_PPC */
 
 #ifdef ARCH_SPARC
-static inline uint32_t arch_accel (void)
+static uint32_t arch_accel (void)
 {
     static RETSIGTYPE (* oldsig) (int);
 
@@ -220,7 +222,7 @@
 #endif /* ARCH_PPC || ARCH_SPARC */
 
 #ifdef ARCH_ALPHA
-static inline uint32_t arch_accel (void)
+static uint32_t arch_accel (void)
 {
 #ifdef CAN_COMPILE_ALPHA_MVI
     uint64_t no_mvi;