summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-03-25 22:29:49 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-03-25 22:29:49 +0000
commit52cb340962505792bf9df1ee49bc400461624cd5 (patch)
tree7a715e82a1f34d5bfed6d9ae130902e496ca4c99
parent643236347692ac7464f744020dea1c020c863110 (diff)
downloadrockbox-52cb340962505792bf9df1ee49bc400461624cd5.tar.gz
rockbox-52cb340962505792bf9df1ee49bc400461624cd5.zip
Really fix it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20538 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/mips/ffs-mips.S15
1 files changed, 8 insertions, 7 deletions
diff --git a/firmware/target/mips/ffs-mips.S b/firmware/target/mips/ffs-mips.S
index 92f4e31729..fd937a4cae 100644
--- a/firmware/target/mips/ffs-mips.S
+++ b/firmware/target/mips/ffs-mips.S
@@ -40,14 +40,15 @@
40 .type find_first_set_bit, %function 40 .type find_first_set_bit, %function
41 41
42find_first_set_bit: 42find_first_set_bit:
43 beqz a0, 0 # if(a0 == 0) goto 1 43 beqz a0, l # if(a0 == 0) goto l
44 li v0, 32 # v0 = 32
45 negu t0, a0 # t0 = -a0 44 negu t0, a0 # t0 = -a0
46 and t0, t0, a0 # t0 = a0 & t0 45 and t0, a0, t0 # t0 = a0 & t0
47 clz v0, t0 # Get lead 0's count (v0=32 if all 0's) 46 clz v0, a0 # Get lead 0's count (v0=32 if all 0's)
48 li t0, 31 # t0 = 31 47 li t0, 31 # t0 = 31
48 subu v0, t0, v0 # v0 = t0 - v0
49 jr ra # 49 jr ra #
50 sub v0, t0, v0 # v0 = t0 - v0 50 nop #
511: 51l:
52 jr ra # 52 li v0, 32 # v0 = 32 (don't put this after jr ra!
53 jr ra # binutils bug?)
53 nop # 54 nop #