Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: client/deps/fio/crc32c-intel.patch

Issue 3412036: Basis for cryptohome+power_SuspendResume stress test. (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: tweaks to test params Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698