summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2010-02-20 06:29:23 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2010-02-20 06:29:23 +0000
commit950b2dfa2c42e6d8e0d1af546efb9368d5b89dc3 (patch)
tree992c34a5a572cf1a3ede22849a64c8e2f3405091
parent3716abba9274f544dd31cdf4e6c83a845bf2a801 (diff)
downloadrockbox-950b2dfa2c42e6d8e0d1af546efb9368d5b89dc3.tar.gz
rockbox-950b2dfa2c42e6d8e0d1af546efb9368d5b89dc3.zip
Clarify comments in ARMv6 divider regarding special-case handling of large (high bit set) numerators.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24783 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/demac/libdemac/udiv32_arm.S10
-rw-r--r--firmware/target/arm/support-arm.S4
2 files changed, 9 insertions, 5 deletions
diff --git a/apps/codecs/demac/libdemac/udiv32_arm.S b/apps/codecs/demac/libdemac/udiv32_arm.S
index 939fce17d4..10c0731db1 100644
--- a/apps/codecs/demac/libdemac/udiv32_arm.S
+++ b/apps/codecs/demac/libdemac/udiv32_arm.S
@@ -234,10 +234,12 @@ udiv32_arm:
234 mul \inv, \divisor, \neg 234 mul \inv, \divisor, \neg
235 smlawt \divisor, \divisor, \inv, \divisor 235 smlawt \divisor, \divisor, \inv, \divisor
236 mul \inv, \divisor, \neg 236 mul \inv, \divisor, \neg
237 /* This will save a cycle on ARMv6, but does not produce a correct result 237 /* This will save a cycle on ARMv6, but requires that the numerator sign
238 if numerator sign bit is set. This case accounts for about 1 in 10^7 of 238 bit is not set (that of inv is guaranteed unset). The branch should
239 divisions, done by the APE decoder, so we specialize for the more common 239 predict very well, making it typically 1 cycle, and thus both the branch
240 case and handle the uncommon large-numerator separately */ 240 and test fill delay cycles for the multiplies. Based on logging of
241 numerator sizes in the APE codec, the branch is taken about 1/10^7 of
242 the time. */
241#if ARM_ARCH >= 6 243#if ARM_ARCH >= 6
242 tst \numerator, \numerator 244 tst \numerator, \numerator
243 smmla \divisor, \divisor, \inv, \divisor 245 smmla \divisor, \divisor, \inv, \divisor
diff --git a/firmware/target/arm/support-arm.S b/firmware/target/arm/support-arm.S
index dd17e0f5f7..b4577f6e9b 100644
--- a/firmware/target/arm/support-arm.S
+++ b/firmware/target/arm/support-arm.S
@@ -244,7 +244,9 @@
244 tst \numerator, \numerator 244 tst \numerator, \numerator
245 smmla \divisor, \divisor, \inv, \divisor 245 smmla \divisor, \divisor, \inv, \divisor
246 /* Branch to large-numerator handler, or else use smmul if sign bit is not 246 /* Branch to large-numerator handler, or else use smmul if sign bit is not
247 set. */ 247 set. This wins on average with random numerators, and should be no
248 slower than using umull for small numerator, even if prediction fails.
249 */
248 bmi 40f 250 bmi 40f
249 smmul \inv, \numerator, \divisor 251 smmul \inv, \numerator, \divisor
250#else 252#else