From: Martin Lucina Date: Tue, 13 Oct 2015 10:55:56 +0000 (+0200) Subject: Fix mul64_32() for i386 clobbering CF X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1118fa6e32f81027ba363a00a9438926af9ff57d;p=osstest%2Frumprun.git Fix mul64_32() for i386 clobbering CF --- diff --git a/platform/hw/arch/x86/clock.c b/platform/hw/arch/x86/clock.c index 4598f44..664cf64 100644 --- a/platform/hw/arch/x86/clock.c +++ b/platform/hw/arch/x86/clock.c @@ -125,9 +125,9 @@ mul64_32(uint64_t a, uint32_t b) "mov %4,%%eax ; " /* %eax = h */ "mov %%edx,%4 ; " /* t1 = ((l * b) >> 32) */ "mul %5 ; " /* %edx:%eax = (h * b) */ - "add %4,%%eax ; " - "xor %5,%5 ; " - "adc %5,%%edx ; " /* %edx:%eax = (h * b) + ((l * b) >> 32) */ + "xor %5,%5 ; " /* t2 = 0 */ + "add %4,%%eax ; " /* %eax = (h * b) + t1 (LSW) */ + "adc %5,%%edx ; " /* %edx = (h * b) + t1 (MSW) */ : "=A" (prod), "=r" (t1), "=r" (t2) : "a" (l), "1" (h), "2" (b) );