diff options
author | 2009-11-09 20:02:43 +0000 | |
---|---|---|
committer | 2009-11-09 20:02:43 +0000 | |
commit | d03337c736d32bd814eae8a62b1284ea0009b816 (patch) | |
tree | 929b77e9be765b90e91a28a7a15a66ca420f0526 /src/opts/SkBlitRow_opts_SSE2.cpp | |
parent | 0db5a7fae596e4914250554402e4874c33fdf0d4 (diff) |
Fix for gcc -fPIC build.
http://codereview.appspot.com/150060
git-svn-id: http://skia.googlecode.com/svn/trunk@421 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/opts/SkBlitRow_opts_SSE2.cpp')
-rw-r--r-- | src/opts/SkBlitRow_opts_SSE2.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/opts/SkBlitRow_opts_SSE2.cpp b/src/opts/SkBlitRow_opts_SSE2.cpp index 68c751923d..772c8ebb27 100644 --- a/src/opts/SkBlitRow_opts_SSE2.cpp +++ b/src/opts/SkBlitRow_opts_SSE2.cpp @@ -37,10 +37,16 @@ static void getcpuid(int info_type, int info[4]) #else static void getcpuid(int info_type, int info[4]) { - asm("cpuid": "=a" (info[0]), "=b" (info[1]), "=c" (info[2]), "=d" (info[3]) - : "a"(info_type) - : - ); + // We save and restore ebx, so this code can be compatible with -fPIC + asm volatile ( + "pushl %%ebx \n\t" + "cpuid \n\t" + "movl %%ebx, %1 \n\t" + "popl %%ebx \n\t" + : "=a"(info[0]), "=r"(info[1]), "=c"(info[2]), "=d"(info[3]) + : "a"(info_type) + : + ); } #endif |