diff options
Diffstat (limited to 'media-gfx/gimp/files/gimp-2.0_pre2-cpuaccel-pic.patch')
-rw-r--r-- | media-gfx/gimp/files/gimp-2.0_pre2-cpuaccel-pic.patch | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/media-gfx/gimp/files/gimp-2.0_pre2-cpuaccel-pic.patch b/media-gfx/gimp/files/gimp-2.0_pre2-cpuaccel-pic.patch new file mode 100644 index 000000000000..3aa96bd839ed --- /dev/null +++ b/media-gfx/gimp/files/gimp-2.0_pre2-cpuaccel-pic.patch @@ -0,0 +1,103 @@ +--- gimp-2.0pre2/app/base/cpu-accel.c 2003-09-07 15:56:51.000000000 -0400 ++++ gimp-cvs/app/base/cpu-accel.c 2004-01-31 04:01:34.000000000 -0500 +@@ -40,11 +40,6 @@ + + #ifdef ARCH_X86 + +-#if GLIB_SIZEOF_LONG == 8 +-#define ARCH_X86_64 1 +-#endif +- +- + typedef enum + { + ARCH_X86_VENDOR_NONE, +@@ -78,14 +73,25 @@ + ARCH_X86_CYRIX_FEATURE_MMXEXT = 1 << 24 + }; + +-/* FIXME: This should save off ebx/rbx if compiled for PIC */ +-#define cpuid(op,eax,ebx,ecx,edx) \ +- asm ("cpuid\n\t" \ +- : "=a" (eax), \ +- "=b" (ebx), \ +- "=c" (ecx), \ +- "=d" (edx) \ +- : "0" (op)) ++#if !defined(ARCH_X86_64) && defined(PIC) ++#define cpuid(op,eax,ebx,ecx,edx) \ ++ __asm__ ("movl %%ebx, %%esi\n\t" \ ++ "cpuid\n\t" \ ++ "xchgl %%ebx,%%esi" \ ++ : "=a" (eax), \ ++ "=S" (ebx), \ ++ "=c" (ecx), \ ++ "=d" (edx) \ ++ : "0" (op)) ++#else ++#define cpuid(op,eax,ebx,ecx,edx) \ ++ __asm__ ("cpuid" \ ++ : "=a" (eax), \ ++ "=b" (ebx), \ ++ "=c" (ecx), \ ++ "=d" (edx) \ ++ : "0" (op)) ++#endif + + + static X86Vendor +@@ -96,22 +102,22 @@ + + #ifndef ARCH_X86_64 + /* Only need to check this on ia32 */ +- asm ("pushfl\n\t" +- "pushfl\n\t" +- "popl %0\n\t" +- "movl %0,%1\n\t" +- "xorl $0x200000,%0\n\t" +- "push %0\n\t" +- "popfl\n\t" +- "pushfl\n\t" +- "popl %0\n\t" +- "popfl\n\t" +- : "=a" (eax), +- "=b" (ebx) +- : +- : "cc"); ++ __asm__ ("pushfl\n\t" ++ "pushfl\n\t" ++ "popl %0\n\t" ++ "movl %0,%1\n\t" ++ "xorl $0x200000,%0\n\t" ++ "pushl %0\n\t" ++ "popfl\n\t" ++ "pushfl\n\t" ++ "popl %0\n\t" ++ "popfl" ++ : "=a" (eax), ++ "=c" (ecx) ++ : ++ : "cc"); + +- if (eax == ebx) ++ if (eax == ecx) + return ARCH_X86_VENDOR_NONE; + #endif + +@@ -385,7 +391,6 @@ + accel = arch_accel (); + + #ifdef USE_SSE +- + /* test OS support for SSE */ + if (accel & CPU_ACCEL_X86_SSE) + { +@@ -396,7 +401,7 @@ + else + { + signal (SIGILL, sigill_handler); +- __asm __volatile ("xorps %xmm0, %xmm0"); ++ __asm__ __volatile__ ("xorps %xmm0, %xmm0"); + signal (SIGILL, SIG_DFL); + } + } |