summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-12-26 13:22:51 +0000
committerJens Arnold <amiconn@rockbox.org>2009-12-26 13:22:51 +0000
commit099ab1f73181a4574d945055dbefb13802a39d85 (patch)
tree854c49263469fdd93cbd48742dcdc740c9af6801
parent60012e195f852c1a3950281da63fcc4c080cf9ac (diff)
downloadrockbox-099ab1f73181a4574d945055dbefb13802a39d85.tar.gz
rockbox-099ab1f73181a4574d945055dbefb13802a39d85.zip
ARM <= v5: Tiny optimisation exploiting the location of the table.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24116 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/ffs-arm.S3
1 files changed, 1 insertions, 2 deletions
diff --git a/firmware/target/arm/ffs-arm.S b/firmware/target/arm/ffs-arm.S
index 30c62a4806..4e912c5317 100644
--- a/firmware/target/arm/ffs-arm.S
+++ b/firmware/target/arm/ffs-arm.S
@@ -52,13 +52,12 @@ find_first_set_bit:
52 @ 52 @
53 @ Output modified to suit Rockbox purposes. 53 @ Output modified to suit Rockbox purposes.
54 54
55 adr r2, L_ffs_table
56 orrne r1, r1, r1, lsl #4 @ r1 = X * 0x11 55 orrne r1, r1, r1, lsl #4 @ r1 = X * 0x11
57 orrne r1, r1, r1, lsl #6 @ r1 = X * 0x451 56 orrne r1, r1, r1, lsl #6 @ r1 = X * 0x451
58 rsbne r1, r1, r1, lsl #16 @ r1 = X * 0x0450fbaf 57 rsbne r1, r1, r1, lsl #16 @ r1 = X * 0x0450fbaf
59 58
60 @ now lookup in table indexed on top 6 bits of r1 59 @ now lookup in table indexed on top 6 bits of r1
61 ldrb r0, [ r2, r1, lsr #26 ] @ 60 ldrb r0, [ pc, r1, lsr #26 ] @ exploit location of table
62 bx lr @ 61 bx lr @
63 62
64L_ffs_table: 63L_ffs_table: