summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-05-12 12:32:34 +0000
committerNils Wallménius <nils@rockbox.org>2010-05-12 12:32:34 +0000
commitaa1e471f9aa05f56edd00a0bf70bb416efa0529f (patch)
tree0859f03ec73b229bb7fb3d7f84d531f6bcb13c99
parenta5d8d215964b31c3257083846dab71af51eb1af2 (diff)
downloadrockbox-aa1e471f9aa05f56edd00a0bf70bb416efa0529f.zip
rockbox-aa1e471f9aa05f56edd00a0bf70bb416efa0529f.tar.gz
rockbox-aa1e471f9aa05f56edd00a0bf70bb416efa0529f.tar.bz2
rockbox-aa1e471f9aa05f56edd00a0bf70bb416efa0529f.tar.xz
Coldfire strlen, slight optimization pointed out by amiconn, eliminate some unconditionla branches by rearranging the code handling the head bytes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25968 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/coldfire/strlen-coldfire.S11
1 files changed, 2 insertions, 9 deletions
diff --git a/firmware/target/coldfire/strlen-coldfire.S b/firmware/target/coldfire/strlen-coldfire.S
index f1e5aca..765969d 100644
--- a/firmware/target/coldfire/strlen-coldfire.S
+++ b/firmware/target/coldfire/strlen-coldfire.S
@@ -31,21 +31,14 @@ strlen:
move.l %a0, %a1 /* %a1 = start address */
move.l %a0, %d0
andi.l #3, %d0 /* %d0 = %a0 & 3 */
- jmp.l (2,%pc,%d0.l*2)
- bra.b .bytes0
- bra.b .bytes3
- bra.b .bytes2
- bra.b .bytes1
-.bytes3:
+ beq.b 1f /* already aligned */
+ jmp.l (-2,%pc,%d0.l*4)
tst.b (%a0)+
beq.b .done
-.bytes2:
tst.b (%a0)+
beq.b .done
-.bytes1:
tst.b (%a0)+
beq.b .done
-.bytes0:
1:
move.l (%a0)+, %d0 /* load %d0 increment %a0 */