From: Vladimir Serbinenko Date: Fri, 8 Nov 2013 08:07:33 +0000 (+0100) Subject: * grub-core/kern/misc.c (grub_divmod64): Don't fallback to X-Git-Tag: grub-2.02-beta1~438 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4f11a2a990db91ed13822c0f4e573efd8eeca39;p=thirdparty%2Fgrub.git * grub-core/kern/misc.c (grub_divmod64): Don't fallback to simple division on arm and ia64. --- 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--) {