[SCM] libav/experimental: added external cpuid code to solve -fPIC and gcc unclear constraints problems

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:29:43 UTC 2013


The following commit has been merged in the experimental branch:
commit 96f4e5135c8fa1361c8e54dfcab4d4132bd68efd
Author: Fabrice Bellard <fabrice at bellard.org>
Date:   Mon Jul 30 23:51:20 2001 +0000

    added external cpuid code to solve -fPIC and gcc unclear constraints problems
    
    
    Originally committed as revision 25 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/i386/cpuid.s b/libavcodec/i386/cpuid.s
new file mode 100644
index 0000000..c25367e
--- /dev/null
+++ b/libavcodec/i386/cpuid.s
@@ -0,0 +1,31 @@
+	.file	"cpuid.s"
+	.version	"01.01"
+gcc2_compiled.:
+.text
+	.align 4
+        .globl   cpuid
+	.type	 cpuid, at function
+cpuid:
+	pushl %ebp
+	movl %esp,%ebp
+	pushl %edi
+	pushl %esi
+	pushl %ebx
+	movl 8(%ebp),%eax
+	movl 12(%ebp),%edi
+	movl 24(%ebp),%esi
+	cpuid
+	movl %eax,(%edi)
+	movl 16(%ebp),%eax
+	movl %ebx,(%eax)
+	movl 20(%ebp),%eax
+	movl %ecx,(%eax)
+	movl %edx,(%esi)
+	popl %ebx
+	popl %esi
+	popl %edi
+	leave
+	ret
+.Lfe1:
+	.size	 cpuid,.Lfe1-cpuid
+	.align 4
diff --git a/libavcodec/i386/cputest.c b/libavcodec/i386/cputest.c
index 78f3644..3de21a7 100644
--- a/libavcodec/i386/cputest.c
+++ b/libavcodec/i386/cputest.c
@@ -4,18 +4,8 @@
 #include <stdlib.h>
 #include "../dsputil.h"
 
-/* ebx saving is necessary for PIC. gcc seems unable to see it alone */
-static inline void cpuid(int index, int *eax, int *ebx, int *ecx, int *edx)
-{
-    asm ("pushl %%ebx\n\t"
-         "cpuid\n\t"
-         "movl %%ebx, %1\n\t"
-         "popl %%ebx\n\t"
-         : "=a" (*eax), "=m" (*ebx), 
-           "=c" (*ecx), "=d" (*edx)
-         : "a" (index)
-         : "cc");
-}
+/* need this external function to solve -fPIC ebx issues ! */
+extern void cpuid(int index, int *eax, int *ebx, int *ecx, int *edx);
 
 /* Function to test if multimedia instructions are supported...  */
 int mm_support(void)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list