Mercurial > libavcodec.hg
comparison x86/cpuid.c @ 9015:a50419dcda53 libavcodec
Remove CPUID availability check on AMD64 as it's architectural.
author | zuxy |
---|---|
date | Mon, 23 Feb 2009 15:53:39 +0000 |
parents | 7a463923ecd1 |
children | 263add3e2616 |
comparison
equal
deleted
inserted
replaced
9014:1de11a984fc6 | 9015:a50419dcda53 |
---|---|
40 int mm_support(void) | 40 int mm_support(void) |
41 { | 41 { |
42 int rval = 0; | 42 int rval = 0; |
43 int eax, ebx, ecx, edx; | 43 int eax, ebx, ecx, edx; |
44 int max_std_level, max_ext_level, std_caps=0, ext_caps=0; | 44 int max_std_level, max_ext_level, std_caps=0, ext_caps=0; |
45 | |
46 #if ARCH_X86_32 | |
45 x86_reg a, c; | 47 x86_reg a, c; |
46 | |
47 #if ARCH_X86_64 | |
48 #define PUSHF "pushfq\n\t" | |
49 #define POPF "popfq\n\t" | |
50 #else | |
51 #define PUSHF "pushfl\n\t" | |
52 #define POPF "popfl\n\t" | |
53 #endif | |
54 __asm__ volatile ( | 48 __asm__ volatile ( |
55 /* See if CPUID instruction is supported ... */ | 49 /* See if CPUID instruction is supported ... */ |
56 /* ... Get copies of EFLAGS into eax and ecx */ | 50 /* ... Get copies of EFLAGS into eax and ecx */ |
57 PUSHF | 51 "pushfl\n\t" |
58 "pop %0\n\t" | 52 "pop %0\n\t" |
59 "mov %0, %1\n\t" | 53 "mov %0, %1\n\t" |
60 | 54 |
61 /* ... Toggle the ID bit in one copy and store */ | 55 /* ... Toggle the ID bit in one copy and store */ |
62 /* to the EFLAGS reg */ | 56 /* to the EFLAGS reg */ |
63 "xor $0x200000, %0\n\t" | 57 "xor $0x200000, %0\n\t" |
64 "push %0\n\t" | 58 "push %0\n\t" |
65 POPF | 59 "popfl\n\t" |
66 | 60 |
67 /* ... Get the (hopefully modified) EFLAGS */ | 61 /* ... Get the (hopefully modified) EFLAGS */ |
68 PUSHF | 62 "pushfl\n\t" |
69 "pop %0\n\t" | 63 "pop %0\n\t" |
70 : "=a" (a), "=c" (c) | 64 : "=a" (a), "=c" (c) |
71 : | 65 : |
72 : "cc" | 66 : "cc" |
73 ); | 67 ); |
74 | 68 |
75 if (a == c) | 69 if (a == c) |
76 return 0; /* CPUID not supported */ | 70 return 0; /* CPUID not supported */ |
71 #endif | |
77 | 72 |
78 cpuid(0, max_std_level, ebx, ecx, edx); | 73 cpuid(0, max_std_level, ebx, ecx, edx); |
79 | 74 |
80 if(max_std_level >= 1){ | 75 if(max_std_level >= 1){ |
81 cpuid(1, eax, ebx, ecx, std_caps); | 76 cpuid(1, eax, ebx, ecx, std_caps); |