comparison src/cpuinfo/SDL_cpuinfo.c @ 4242:fa62bede8038 SDL-1.2

Fixed bug #734 Nicholas Phillips 2009-04-26 21:34:05 PDT I am using x64 Linux (using Intel Core 2 DUO), and I have noticed that there is an error in SDL_cpuinfo.c, function CPU_getCPUIDFeaturesExt for my platform.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 26 Sep 2009 10:05:07 +0000
parents 0a9a29fc00c2
children 0319c84d274d
comparison
equal deleted inserted replaced
4241:d3a210342761 4242:fa62bede8038
159 " movl %%edx,%0 \n" 159 " movl %%edx,%0 \n"
160 "1: \n" 160 "1: \n"
161 " movl %%edi,%%ebx\n" 161 " movl %%edi,%%ebx\n"
162 : "=m" (features) 162 : "=m" (features)
163 : 163 :
164 : "%eax", "%ecx", "%edx", "%edi" 164 : "%eax", "%ebx", "%ecx", "%edx", "%edi"
165 ); 165 );
166 #elif defined(__GNUC__) && defined(__x86_64__) 166 #elif defined(__GNUC__) && defined(__x86_64__)
167 __asm__ ( 167 __asm__ (
168 " movq %%rbx,%%rdi\n" 168 " movq %%rbx,%%rdi\n"
169 " xorl %%eax,%%eax # Set up for CPUID instruction \n" 169 " xorl %%eax,%%eax # Set up for CPUID instruction \n"
176 " movl %%edx,%0 \n" 176 " movl %%edx,%0 \n"
177 "1: \n" 177 "1: \n"
178 " movq %%rdi,%%rbx\n" 178 " movq %%rdi,%%rbx\n"
179 : "=m" (features) 179 : "=m" (features)
180 : 180 :
181 : "%rax", "%rcx", "%rdx", "%rdi" 181 : "%rax", "%rbx", "%rcx", "%rdx", "%rdi"
182 ); 182 );
183 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) 183 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
184 __asm { 184 __asm {
185 xor eax, eax ; Set up for CPUID instruction 185 xor eax, eax ; Set up for CPUID instruction
186 cpuid ; Get and save vendor ID 186 cpuid ; Get and save vendor ID
228 " movl %%edx,%0 \n" 228 " movl %%edx,%0 \n"
229 "1: \n" 229 "1: \n"
230 " movl %%edi,%%ebx\n" 230 " movl %%edi,%%ebx\n"
231 : "=m" (features) 231 : "=m" (features)
232 : 232 :
233 : "%eax", "%ecx", "%edx", "%edi" 233 : "%eax", "%ebx", "%ecx", "%edx", "%edi"
234 ); 234 );
235 #elif defined(__GNUC__) && defined (__x86_64__) 235 #elif defined(__GNUC__) && defined (__x86_64__)
236 __asm__ ( 236 __asm__ (
237 " movq %%rbx,%%rdi\n" 237 " movq %%rbx,%%rdi\n"
238 " movl $0x80000000,%%eax # Query for extended functions \n" 238 " movl $0x80000000,%%eax # Query for extended functions \n"
244 " movl %%edx,%0 \n" 244 " movl %%edx,%0 \n"
245 "1: \n" 245 "1: \n"
246 " movq %%rdi,%%rbx\n" 246 " movq %%rdi,%%rbx\n"
247 : "=m" (features) 247 : "=m" (features)
248 : 248 :
249 : "%rax", "%rcx", "%rdx", "%rdi" 249 : "%rax", "%rbx", "%rcx", "%rdx", "%rdi"
250 ); 250 );
251 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) 251 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
252 __asm { 252 __asm {
253 mov eax,80000000h ; Query for extended functions 253 mov eax,80000000h ; Query for extended functions
254 cpuid ; Get extended function limit 254 cpuid ; Get extended function limit