diff options
| author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-03-25 22:57:13 +0000 |
|---|---|---|
| committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-03-25 22:57:13 +0000 |
| commit | cfb20fdf2b445fc15b1374392abb21f948b4ba85 (patch) | |
| tree | aacd236e4fa84ccd86e053b981c548978fd28b59 | |
| parent | b84c06372b7763aa5937173307c45fb44ed4e703 (diff) | |
| download | rockbox-cfb20fdf2b445fc15b1374392abb21f948b4ba85.zip rockbox-cfb20fdf2b445fc15b1374392abb21f948b4ba85.tar.gz rockbox-cfb20fdf2b445fc15b1374392abb21f948b4ba85.tar.bz2 rockbox-cfb20fdf2b445fc15b1374392abb21f948b4ba85.tar.xz | |
Should be the last one...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20542 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/target/mips/ffs-mips.S | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/firmware/target/mips/ffs-mips.S b/firmware/target/mips/ffs-mips.S index fd937a4..a2a82a6 100644 --- a/firmware/target/mips/ffs-mips.S +++ b/firmware/target/mips/ffs-mips.S @@ -38,17 +38,22 @@ .align 2 .global find_first_set_bit .type find_first_set_bit, %function + .set noreorder + .set noat find_first_set_bit: beqz a0, l # if(a0 == 0) goto l + nop # negu t0, a0 # t0 = -a0 and t0, a0, t0 # t0 = a0 & t0 - clz v0, a0 # Get lead 0's count (v0=32 if all 0's) + clz v0, t0 # get lead 0's count li t0, 31 # t0 = 31 - subu v0, t0, v0 # v0 = t0 - v0 jr ra # - nop # + subu v0, t0, v0 # v0 = t0 - v0 + l: - li v0, 32 # v0 = 32 (don't put this after jr ra! - jr ra # binutils bug?) - nop # + jr ra # + li v0, 32 # v0 = 32 + + .set reorder + .set at |