--- src/HostCPU.cc.orig 2005-07-24 13:56:56.000000000 +0200 +++ src/HostCPU.cc 2005-07-24 14:00:19.000000000 +0200 @@ -23,7 +23,7 @@ "pushfl;" "popl %%eax;" // Save current value. - "movl %%eax,%%ebx;" + "movl %%eax,%%ecx;" // Toggle bit 21. "xorl $0x200000, %%eax;" // Load EAX into EFLAGS. @@ -33,29 +33,33 @@ "pushfl;" "popl %%eax;" // Did bit 21 change? - "xor %%ebx, %%eax;" + "xor %%ecx, %%eax;" "andl $0x200000, %%eax;" : "=a" (hasCPUID) // 0 : // no input - : "ebx" + : "ecx" // use ecx not ebx to avoid PIC abi clobber ); if (hasCPUID) { // Which CPUID calls are supported? unsigned highest; asm ( + "pushl %%ebx;" "cpuid;" + "popl %%ebx;" : "=a" (highest) // 0 : "0" (0) // 1: function - : "ebx", "ecx", "edx" + : "ecx", "edx" // ebx save/restored to avoid PIC abi clobber ); if (highest >= 1) { // Get features flags. unsigned features; asm ( + "pushl %%ebx;" "cpuid;" + "pushl %%ebx;" : "=d" (features) // 0 : "a" (1) // 1: function - : "ebx", "ecx" + : "ecx" // ebx save/restored to avoid PIC abi clobber ); PRT_DEBUG("CPU flags: " << std::hex << std::setw(8) << std::setfill('0') << std::uppercase << features); mmxFlag = features & 0x800000; --- src/video/SimpleScaler.cc.orig 2005-07-24 14:35:13.000000000 +0200 +++ src/video/SimpleScaler.cc 2005-07-24 14:43:01.000000000 +0200 @@ -684,6 +684,7 @@ "paddw %%mm4, %%mm0;" "paddw %%mm5, %%mm1;" + "movd %%eax, %%mm6;" // save eax "pextrw $0, %%mm0, %%eax;" "movw (%2,%%eax,2), %%ax;" "pinsrw $0, %%eax, %%mm0;" @@ -711,6 +712,7 @@ "pextrw $3, %%mm1, %%eax;" "movw (%2,%%eax,2), %%ax;" "pinsrw $3, %%eax, %%mm1;" + "movd %%mm6, %%eax;" // restore eax "movntq %%mm0, (%3,%%ecx,2);" "movntq %%mm1, 8(%3,%%ecx,2);" @@ -726,7 +728,7 @@ , "r" (dst) // 3 , "m" (mask) // 4 : "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm7" - , "eax", "ecx" + , "ecx" // eax save/restored so available for 'r' ); return; }