Mercurial > sdl-ios-xcode
comparison src/cpuinfo/SDL_cpuinfo.c @ 749:06cdd106d61c
Updated Visual C++ support
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 24 Nov 2003 19:58:29 +0000 |
parents | da36f59485da |
children | b8d311d90021 |
comparison
equal
deleted
inserted
replaced
748:c1c09472dc7f | 749:06cdd106d61c |
---|---|
57 : "=r" (has_CPUID) | 57 : "=r" (has_CPUID) |
58 : | 58 : |
59 : "%eax", "%ecx" | 59 : "%eax", "%ecx" |
60 ); | 60 ); |
61 #elif defined(_MSC_VER) | 61 #elif defined(_MSC_VER) |
62 __asm__ { | 62 __asm { |
63 pushfd ; Get original EFLAGS | 63 pushfd ; Get original EFLAGS |
64 pop eax | 64 pop eax |
65 mov ecx, eax | 65 mov ecx, eax |
66 xor eax, 200000h ; Flip ID bit in EFLAGS | 66 xor eax, 200000h ; Flip ID bit in EFLAGS |
67 push eax ; Save new EFLAGS value on stack | 67 push eax ; Save new EFLAGS value on stack |
100 : "=r" (features) | 100 : "=r" (features) |
101 : | 101 : |
102 : "%eax", "%ebx", "%ecx", "%edx" | 102 : "%eax", "%ebx", "%ecx", "%edx" |
103 ); | 103 ); |
104 #elif defined(_MSC_VER) | 104 #elif defined(_MSC_VER) |
105 __asm__ { | 105 __asm { |
106 xor eax, eax ; Set up for CPUID instruction | 106 xor eax, eax ; Set up for CPUID instruction |
107 cpuid ; Get and save vendor ID | 107 cpuid ; Get and save vendor ID |
108 cmp eax, 1 ; Make sure 1 is valid input for CPUID | 108 cmp eax, 1 ; Make sure 1 is valid input for CPUID |
109 jl done ; We dont have the CPUID instruction | 109 jl done ; We dont have the CPUID instruction |
110 xor eax, eax | 110 xor eax, eax |
160 : "=r" (has_3DNow) | 160 : "=r" (has_3DNow) |
161 : | 161 : |
162 : "%eax", "%ebx", "%ecx", "%edx" | 162 : "%eax", "%ebx", "%ecx", "%edx" |
163 ); | 163 ); |
164 #elif defined(_MSC_VER) | 164 #elif defined(_MSC_VER) |
165 __asm__ { | 165 __asm { |
166 mov eax,80000000h ; Query for extended functions | 166 mov eax,80000000h ; Query for extended functions |
167 cpuid ; Get extended function limit | 167 cpuid ; Get extended function limit |
168 cmp eax,80000001h | 168 cmp eax,80000001h |
169 jbe done ; Nope, we dont have function 800000001h | 169 jbe done ; Nope, we dont have function 800000001h |
170 mov eax,80000001h ; Setup extended function 800000001h | 170 mov eax,80000001h ; Setup extended function 800000001h |