From c4f11a2a990db91ed13822c0f4e573efd8eeca39 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 8 Nov 2013 09:07:33 +0100 Subject: [PATCH] * grub-core/kern/misc.c (grub_divmod64): Don't fallback to simple division on arm and ia64. --- ChangeLog | 5 +++++ grub-core/kern/misc.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index de6650fcf..b55f5faa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-08 Vladimir Serbinenko + + * grub-core/kern/misc.c (grub_divmod64): Don't fallback to + simple division on arm and ia64. + 2013-11-08 Vladimir Serbinenko * grub-core/kern/arm/misc.S (__aeabi_unwind_cpp_pr0): Add dummy to diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index c875d8524..f883fb911 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -551,6 +551,11 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) grub_uint64_t q = 0; grub_uint64_t m = 0; + /* ARM and IA64 don't have a fast 32-bit division. + Using that code would just make us use libgcc routines, calling + them twice (once for modulo and once for quotient. + */ +#if !defined (__arm__) && !defined (__ia64__) /* Skip the slow computation if 32-bit arithmetic is possible. */ if (n < 0xffffffff && d < 0xffffffff) { @@ -559,6 +564,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) return ((grub_uint32_t) n) / (grub_uint32_t) d; } +#endif while (bits--) {