mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
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
This commit is contained in:
parent
3716abba92
commit
950b2dfa2c
2 changed files with 9 additions and 5 deletions
|
|
@ -234,10 +234,12 @@ udiv32_arm:
|
|||
mul \inv, \divisor, \neg
|
||||
smlawt \divisor, \divisor, \inv, \divisor
|
||||
mul \inv, \divisor, \neg
|
||||
/* This will save a cycle on ARMv6, but does not produce a correct result
|
||||
if numerator sign bit is set. This case accounts for about 1 in 10^7 of
|
||||
divisions, done by the APE decoder, so we specialize for the more common
|
||||
case and handle the uncommon large-numerator separately */
|
||||
/* This will save a cycle on ARMv6, but requires that the numerator sign
|
||||
bit is not set (that of inv is guaranteed unset). The branch should
|
||||
predict very well, making it typically 1 cycle, and thus both the branch
|
||||
and test fill delay cycles for the multiplies. Based on logging of
|
||||
numerator sizes in the APE codec, the branch is taken about 1/10^7 of
|
||||
the time. */
|
||||
#if ARM_ARCH >= 6
|
||||
tst \numerator, \numerator
|
||||
smmla \divisor, \divisor, \inv, \divisor
|
||||
|
|
|
|||
|
|
@ -244,7 +244,9 @@
|
|||
tst \numerator, \numerator
|
||||
smmla \divisor, \divisor, \inv, \divisor
|
||||
/* Branch to large-numerator handler, or else use smmul if sign bit is not
|
||||
set. */
|
||||
set. This wins on average with random numerators, and should be no
|
||||
slower than using umull for small numerator, even if prediction fails.
|
||||
*/
|
||||
bmi 40f
|
||||
smmul \inv, \numerator, \divisor
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue