]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/misc.c (grub_divmod64): Don't fallback to
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 8 Nov 2013 08:07:33 +0000 (09:07 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Fri, 8 Nov 2013 08:07:33 +0000 (09:07 +0100)
simple division on arm and ia64.

ChangeLog
grub-core/kern/misc.c

index de6650fcf599d3d79889a3a8bcfac46cf4c5aa2a..b55f5faa71c8d7e2a6615881ea63d9e18b29fd01 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-08  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/misc.c (grub_divmod64): Don't fallback to
+       simple division on arm and ia64.
+
 2013-11-08  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/arm/misc.S (__aeabi_unwind_cpp_pr0): Add dummy to
index c875d8524ac05a1be4a5cc47476c1f6db9e7e7c6..f883fb911ea5cb4409d9779cec6e15931584b86f 100644 (file)
@@ -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--)
     {