| OLD | NEW |
| (Empty) | |
| 1 --- crc/crc32c-intel.c 2010-08-27 09:04:13.000000000 +0200 |
| 2 +++ crc/crc32c-intel.c.new2 2010-09-17 15:04:28.000000000 +0200 |
| 3 @@ -74,30 +74,12 @@ |
| 4 return crc; |
| 5 } |
| 6 |
| 7 -static void do_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, |
| 8 - unsigned int *edx) |
| 9 -{ |
| 10 - int id = *eax; |
| 11 - |
| 12 - asm("movl %4, %%eax;" |
| 13 - "cpuid;" |
| 14 - "movl %%eax, %0;" |
| 15 - "movl %%ebx, %1;" |
| 16 - "movl %%ecx, %2;" |
| 17 - "movl %%edx, %3;" |
| 18 - : "=r" (*eax), "=r" (*ebx), "=r" (*ecx), "=r" (*edx) |
| 19 - : "r" (id) |
| 20 - : "eax", "ebx", "ecx", "edx"); |
| 21 -} |
| 22 - |
| 23 -int crc32c_intel_works(void) |
| 24 -{ |
| 25 - unsigned int eax, ebx, ecx, edx; |
| 26 - |
| 27 - eax = 1; |
| 28 - |
| 29 - do_cpuid(&eax, &ebx, &ecx, &edx); |
| 30 - return (ecx & (1 << 20)) != 0; |
| 31 +int crc32c_intel_works(void) { |
| 32 + unsigned int _eax, _ebx, _ecx, _edx; |
| 33 + unsigned int op = 1; |
| 34 + asm ("cpuid" : "=a" (_eax), "=r" (_ebx), "=c" (_ecx), "=d" (_edx) |
| 35 + : "a" (op)); |
| 36 + return (_ecx & (1 << 20)) != 0; |
| 37 } |
| 38 |
| 39 #endif /* ARCH_HAVE_SSE */ |
| OLD | NEW |