]> git.neil.brown.name Git - history.git/commitdiff
[ARM] Fix div64 implementation.
authorRussell King <rmk@flint.arm.linux.org.uk>
Tue, 14 Oct 2003 22:40:22 +0000 (23:40 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Tue, 14 Oct 2003 22:40:22 +0000 (23:40 +0100)
Our do_div implementation can't correctly handle divisors with the
top bit set.  This cset fixes this up with a minimal change.

arch/arm/lib/div64.S

index b3f42097690dbfa639c1f36c799b75b8fc67fc6f..0870b84c845b662e0be56502a758855439430d93 100644 (file)
@@ -30,6 +30,8 @@ ENTRY(do_div64)
        moveq   lr, #1                  @ only divide low bits
        moveq   nh, onl
 
+       tst     dh, #0x80000000
+       bne     2f
 1:     cmp     nh, dh
        bls     2f
        add     lr, lr, #1