diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-02-05 21:36:11 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-02-05 21:36:11 +0000 |
commit | e1aee318782d89e017e1241847706b21ea014974 (patch) | |
tree | 3ac116f5d3b44e68a33df10ec0f1a71bdd9f9ccf /firmware | |
parent | e3927102ba1d68b4b7cc37511df85238a62e8f0e (diff) | |
download | rockbox-e1aee318782d89e017e1241847706b21ea014974.tar.gz rockbox-e1aee318782d89e017e1241847706b21ea014974.zip |
Fix MIPS ffs implementation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19930 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/mips/ffs-mips.S | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/firmware/target/mips/ffs-mips.S b/firmware/target/mips/ffs-mips.S index 4f798720a5..f1547778d4 100644 --- a/firmware/target/mips/ffs-mips.S +++ b/firmware/target/mips/ffs-mips.S | |||
@@ -40,15 +40,11 @@ | |||
40 | .type find_first_set_bit, %function | 40 | .type find_first_set_bit, %function |
41 | 41 | ||
42 | find_first_set_bit: | 42 | find_first_set_bit: |
43 | beqz a0, no_bits_set # If val == 0 branch to no_bits_set | 43 | negu t0, a0 # t0 = a0 & -a0 |
44 | and t0, t0, a0 # | ||
44 | 45 | ||
45 | clz v0, a0 # Get lead 0's count | 46 | clz v0, t0 # Get lead 0's count |
46 | li t0, 31 # t0 = 31 | 47 | li t0, 31 # t0 = 31 |
47 | sub v0, t0, v0 # Return value = t0 - v0 | 48 | sub v0, t0, v0 # Return value = t0 - v0 |
48 | jr ra # Return | 49 | jr ra |
49 | nop | ||
50 | |||
51 | no_bits_set: | ||
52 | li v0, 32 # Return value = 32 | ||
53 | jr ra # Return | ||
54 | nop | 50 | nop |