Blame SOURCES/0008-Currently-we-have-DivU64x32-on-ia32-but-it-tries-to-.patch

d1fe48
From d039cd620b8a270d9b231691c9b31d6824f18c08 Mon Sep 17 00:00:00 2001
d1fe48
From: Nigel Croxon <ncroxon@redhat.com>
d1fe48
Date: Wed, 10 Jan 2018 10:28:36 -0500
d1fe48
Subject: [PATCH 08/25] Currently we have DivU64x32 on ia32, but it tries to
d1fe48
 call __umoddi3 and __udivdi3 from libgcc, which we don't have. This fixes it
d1fe48
 to use our implementation in that case.
d1fe48
d1fe48
Signed-off-by: Peter Jones <pjones@redhat.com>
d1fe48
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
d1fe48
---
d1fe48
 lib/ia32/math.c | 4 ++--
d1fe48
 1 file changed, 2 insertions(+), 2 deletions(-)
d1fe48
d1fe48
diff --git a/lib/ia32/math.c b/lib/ia32/math.c
d1fe48
index 81f51bf45e4..fce7a8d4875 100644
d1fe48
--- a/lib/ia32/math.c
d1fe48
+++ b/lib/ia32/math.c
d1fe48
@@ -140,7 +140,7 @@ DivU64x32 (
d1fe48
 // divide 64bit by 32bit and get a 64bit result
d1fe48
 // N.B. only works for 31bit divisors!!
d1fe48
 {
d1fe48
-#if defined(__GNUC__) && !defined(__MINGW32__)
d1fe48
+#if 0 && defined(__GNUC__) && !defined(__MINGW32__)
d1fe48
     if (Remainder)
d1fe48
         *Remainder = Dividend % Divisor;
d1fe48
     return Dividend / Divisor;
d1fe48
@@ -157,7 +157,7 @@ DivU64x32 (
d1fe48
 
d1fe48
     Rem = 0;
d1fe48
     for (bit=0; bit < 64; bit++) {
d1fe48
-#ifdef __MINGW32__
d1fe48
+#if defined(__GNUC__) || defined(__MINGW32__)
d1fe48
         asm (
d1fe48
             "shll	$1, %0\n\t"
d1fe48
             "rcll	$1, 4%0\n\t"
d1fe48
-- 
d1fe48
2.15.0
d1fe48