--- libs/lensfun/cpuid.cpp.bak 2011-07-07 00:13:34.227910367 -0400 +++ libs/lensfun/cpuid.cpp 2011-07-07 03:27:39.676452438 -0400 @@ -25,17 +25,14 @@ guint _lf_detect_cpu_features () { #define cpuid(cmd) \ - asm ( \ + __asm volatile ( \ "push %%"R_BX"\n" \ "cpuid\n" \ "pop %%"R_BX"\n" \ : "=a" (ax), "=c" (cx), "=d" (dx) \ : "0" (cmd)) - register __SIZE_TYPE__ ax asm (R_AX); - register __SIZE_TYPE__ bx asm (R_BX); - register __SIZE_TYPE__ dx asm (R_DX); - register __SIZE_TYPE__ cx asm (R_CX); + __SIZE_TYPE__ ax, cx, dx, tmp; static GStaticMutex lock = G_STATIC_MUTEX_INIT; static guint cpuflags = -1; @@ -45,7 +42,7 @@ cpuflags = 0; /* Test cpuid presence by checking bit 21 of eflags */ - asm ( + __asm volatile ( "pushf\n" "pop %0\n" "mov %0, %1\n" @@ -57,7 +54,7 @@ "cmp %0, %1\n" "setne %%al\n" "movzb %%al, %0\n" - : "=r" (ax), "=r" (bx)); + : "=r" (ax), "=r" (tmp)); if (ax) { @@ -88,12 +85,12 @@ cpuflags |= LF_CPU_FLAG_SSE4_2; } - /* Is there extensions */ + /* Are there extensions? */ cpuid (0x80000000); if (ax) { - /* Request for extensions */ + /* Ask extensions */ cpuid (0x80000001); if (dx & 0x80000000) @@ -112,12 +109,4 @@ #undef cpuid } -#else - -guint -rs_detect_cpu_features() -{ - return 0; -} - #endif /* __i386__ || __x86_64__ */