comparison src/cpuinfo/SDL_cpuinfo.c @ 3314:8b01b0648f01

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:04:38 +0000
parents cde30895105d
children 714a352c8869
comparison
equal deleted inserted replaced
3313:50848072885e 3314:8b01b0648f01
164 " movl %%edx,%0 \n" 164 " movl %%edx,%0 \n"
165 "1: \n" 165 "1: \n"
166 " movl %%edi,%%ebx\n" 166 " movl %%edi,%%ebx\n"
167 : "=m" (features) 167 : "=m" (features)
168 : 168 :
169 : "%eax", "%ecx", "%edx", "%edi" 169 : "%eax", "%ebx", "%ecx", "%edx", "%edi"
170 ); 170 );
171 #elif defined(__GNUC__) && defined(__x86_64__) 171 #elif defined(__GNUC__) && defined(__x86_64__)
172 __asm__ ( 172 __asm__ (
173 " movq %%rbx,%%rdi\n" 173 " movq %%rbx,%%rdi\n"
174 " xorl %%eax,%%eax # Set up for CPUID instruction \n" 174 " xorl %%eax,%%eax # Set up for CPUID instruction \n"
181 " movl %%edx,%0 \n" 181 " movl %%edx,%0 \n"
182 "1: \n" 182 "1: \n"
183 " movq %%rdi,%%rbx\n" 183 " movq %%rdi,%%rbx\n"
184 : "=m" (features) 184 : "=m" (features)
185 : 185 :
186 : "%rax", "%rcx", "%rdx", "%rdi" 186 : "%rax", "%rbx", "%rcx", "%rdx", "%rdi"
187 ); 187 );
188 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) 188 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
189 __asm { 189 __asm {
190 xor eax, eax ; Set up for CPUID instruction 190 xor eax, eax ; Set up for CPUID instruction
191 cpuid ; Get and save vendor ID 191 cpuid ; Get and save vendor ID
236 " movl %%edx,%0 \n" 236 " movl %%edx,%0 \n"
237 "1: \n" 237 "1: \n"
238 " movl %%edi,%%ebx\n" 238 " movl %%edi,%%ebx\n"
239 : "=m" (features) 239 : "=m" (features)
240 : 240 :
241 : "%eax", "%ecx", "%edx", "%edi" 241 : "%eax", "%ebx", "%ecx", "%edx", "%edi"
242 ); 242 );
243 #elif defined(__GNUC__) && defined (__x86_64__) 243 #elif defined(__GNUC__) && defined (__x86_64__)
244 __asm__ ( 244 __asm__ (
245 " movq %%rbx,%%rdi\n" 245 " movq %%rbx,%%rdi\n"
246 " movl $0x80000000,%%eax # Query for extended functions \n" 246 " movl $0x80000000,%%eax # Query for extended functions \n"
252 " movl %%edx,%0 \n" 252 " movl %%edx,%0 \n"
253 "1: \n" 253 "1: \n"
254 " movq %%rdi,%%rbx\n" 254 " movq %%rdi,%%rbx\n"
255 : "=m" (features) 255 : "=m" (features)
256 : 256 :
257 : "%rax", "%rcx", "%rdx", "%rdi" 257 : "%rax", "%rbx", "%rcx", "%rdx", "%rdi"
258 ); 258 );
259 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) 259 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
260 __asm { 260 __asm {
261 mov eax,80000000h ; Query for extended functions 261 mov eax,80000000h ; Query for extended functions
262 cpuid ; Get extended function limit 262 cpuid ; Get extended function limit