diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-11-05 07:36:39 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-11-05 07:36:39 +0000 |
commit | 0eb6ae938ea11e3db28b98be0dd524aee31a8dd3 (patch) | |
tree | 606d4d77ff498688498b2e653976a02656152d0c | |
parent | 4af26e7e98b6d4b2e1c94a54ad7ca02d55bb04cc (diff) |
This optimisation breaks for very large divisors (MSB set), so remove it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19012 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/lib/udiv32_armv4.S | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/codecs/lib/udiv32_armv4.S b/apps/codecs/lib/udiv32_armv4.S index a659a9eb8e..2cb6fc8088 100644 --- a/apps/codecs/lib/udiv32_armv4.S +++ b/apps/codecs/lib/udiv32_armv4.S @@ -33,7 +33,7 @@ .macro ARM_DIV_BODY dividend, divisor, result, curbit mov \result, \dividend - mov \curbit, #90 @ 3 * 30, (calculating branch dest) + mov \curbit, #93 @ 3 * 31, (calculating branch dest) cmp \divisor, \result, lsr #16 movls \result,\result, lsr #16 subls \curbit, \curbit, #48 @@ -44,9 +44,10 @@ movls \result,\result, lsr #4 subls \curbit, \curbit, #12 cmp \divisor, \result, lsr #2 + movls \result,\result, lsr #2 subls \curbit, \curbit, #6 - @ calculation is only done down to shift=2, because the shift=1 step - @ would need 3 more cycles, but would only gain 1.5 cycles on average + cmp \divisor, \result, lsr #1 + subls \curbit, \curbit, #3 mov \result, #0 add pc, pc, \curbit, lsl #2 nop |