Revision 96f4e513

View differences:

libavcodec/i386/cpuid.s
1
	.file	"cpuid.s"
2
	.version	"01.01"
3
gcc2_compiled.:
4
.text
5
	.align 4
6
        .globl   cpuid
7
	.type	 cpuid,@function
8
cpuid:
9
	pushl %ebp
10
	movl %esp,%ebp
11
	pushl %edi
12
	pushl %esi
13
	pushl %ebx
14
	movl 8(%ebp),%eax
15
	movl 12(%ebp),%edi
16
	movl 24(%ebp),%esi
17
	cpuid
18
	movl %eax,(%edi)
19
	movl 16(%ebp),%eax
20
	movl %ebx,(%eax)
21
	movl 20(%ebp),%eax
22
	movl %ecx,(%eax)
23
	movl %edx,(%esi)
24
	popl %ebx
25
	popl %esi
26
	popl %edi
27
	leave
28
	ret
29
.Lfe1:
30
	.size	 cpuid,.Lfe1-cpuid
31
	.align 4
libavcodec/i386/cputest.c
4 4
#include <stdlib.h>
5 5
#include "../dsputil.h"
6 6

  
7
/* ebx saving is necessary for PIC. gcc seems unable to see it alone */
8
static inline void cpuid(int index, int *eax, int *ebx, int *ecx, int *edx)
9
{
10
    asm ("pushl %%ebx\n\t"
11
         "cpuid\n\t"
12
         "movl %%ebx, %1\n\t"
13
         "popl %%ebx\n\t"
14
         : "=a" (*eax), "=m" (*ebx), 
15
           "=c" (*ecx), "=d" (*edx)
16
         : "a" (index)
17
         : "cc");
18
}
7
/* need this external function to solve -fPIC ebx issues ! */
8
extern void cpuid(int index, int *eax, int *ebx, int *ecx, int *edx);
19 9

  
20 10
/* Function to test if multimedia instructions are supported...  */
21 11
int mm_support(void)

Also available in: Unified diff