From cfb20fdf2b445fc15b1374392abb21f948b4ba85 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Wed, 25 Mar 2009 22:57:13 +0000 Subject: Should be the last one... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20542 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/mips/ffs-mips.S | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/firmware/target/mips/ffs-mips.S b/firmware/target/mips/ffs-mips.S index fd937a4cae..a2a82a6a32 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 -- cgit v1.2.3