comparison i386/cputest.c @ 16:89bc3bf1a031 libavcodec

added external cpuid code to solve -fPIC and gcc unclear constraints problems
author glantau
date Mon, 30 Jul 2001 23:51:20 +0000
parents b8374040680d
children c31fb57d17a6
comparison
equal deleted inserted replaced
15:076bcac8d059 16:89bc3bf1a031
2 and R. Fisher). Converted to C and improved by Gerard Lantau */ 2 and R. Fisher). Converted to C and improved by Gerard Lantau */
3 3
4 #include <stdlib.h> 4 #include <stdlib.h>
5 #include "../dsputil.h" 5 #include "../dsputil.h"
6 6
7 /* ebx saving is necessary for PIC. gcc seems unable to see it alone */ 7 /* need this external function to solve -fPIC ebx issues ! */
8 static inline void cpuid(int index, int *eax, int *ebx, int *ecx, int *edx) 8 extern 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 }
19 9
20 /* Function to test if multimedia instructions are supported... */ 10 /* Function to test if multimedia instructions are supported... */
21 int mm_support(void) 11 int mm_support(void)
22 { 12 {
23 int rval; 13 int rval;