diff options
Diffstat (limited to 'firmware/target')
-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 |