From 4032b4c307368b491abf1092c2bc9342a41b05b4 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 18 Jun 2011 05:43:51 +0000 Subject: [PATCH] - Fixed: In gccinlines.h, the alternative for DivScale32 that took idiv's parameter in memory did not mark eax as an early-clobber register, so GCC might decide to pass the memory address in eax, and it would get clobbered by the inline assembly before fetching the value to divide by. But rather than fix it by adding another '&', I have opted to mark it as in/out and do the zeroing outside the inline assembly, so GCC has maximum flexibility for scheduling the code. SVN r3242 (trunk) --- src/gccinlines.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gccinlines.h b/src/gccinlines.h index 4f1ec7e5e..b905449de 100644 --- a/src/gccinlines.h +++ b/src/gccinlines.h @@ -279,12 +279,11 @@ MAKECONSTDivScale(31) static inline SDWORD DivScale32 (SDWORD a, SDWORD b) { - SDWORD result, dummy; + SDWORD result = 0, dummy; asm volatile - ("xor %%eax,%%eax\n\t" - "idivl %3" - :"=&a,a" (result), + ("idivl %3" + :"+a,a" (result), "=d,d" (dummy) : "d,d" (a), "r,m" (b)