Commit 9a2bf4cc authored by Russell King's avatar Russell King

[ARM] Fix BE find_*_bit operations

These broke when find_first_bit/find_next_bit was added.
parent 5fdc760e
...@@ -40,7 +40,7 @@ ENTRY(_find_first_zero_bit_le) ...@@ -40,7 +40,7 @@ ENTRY(_find_first_zero_bit_le)
*/ */
ENTRY(_find_next_zero_bit_le) ENTRY(_find_next_zero_bit_le)
teq r1, #0 teq r1, #0
beq 2b beq 3b
ands ip, r2, #7 ands ip, r2, #7
beq 1b @ If new byte, goto old routine beq 1b @ If new byte, goto old routine
ldrb r3, [r0, r2, lsr #3] ldrb r3, [r0, r2, lsr #3]
...@@ -74,7 +74,7 @@ ENTRY(_find_first_bit_le) ...@@ -74,7 +74,7 @@ ENTRY(_find_first_bit_le)
*/ */
ENTRY(_find_next_bit_le) ENTRY(_find_next_bit_le)
teq r1, #0 teq r1, #0
beq 2b beq 3b
ands ip, r2, #7 ands ip, r2, #7
beq 1b @ If new byte, goto old routine beq 1b @ If new byte, goto old routine
ldrb r3, [r0, r2, lsr #3] ldrb r3, [r0, r2, lsr #3]
...@@ -101,15 +101,18 @@ ENTRY(_find_first_zero_bit_be) ...@@ -101,15 +101,18 @@ ENTRY(_find_first_zero_bit_be)
RETINSTR(mov,pc,lr) RETINSTR(mov,pc,lr)
ENTRY(_find_next_zero_bit_be) ENTRY(_find_next_zero_bit_be)
teq r1, #0
beq 3b
ands ip, r2, #7 ands ip, r2, #7
beq 1b @ If new byte, goto old routine beq 1b @ If new byte, goto old routine
eor r3, r2, #0x18 @ big endian byte ordering eor r3, r2, #0x18 @ big endian byte ordering
ldrb r3, [r0, r3, lsr #3] ldrb r3, [r0, r3, lsr #3]
eor r3, r3, #0xff @ now looking for a 1 bit eor r3, r3, #0xff @ now looking for a 1 bit
movs r3, r3, lsr ip @ shift off unused bits movs r3, r3, lsr ip @ shift off unused bits
orreq r2, r2, #7 @ if zero, then no bits here bne .found
addeq r2, r2, #1 @ align bit pointer orr r2, r2, #7 @ if zero, then no bits here
beq 2b @ loop for next bit add r2, r2, #1 @ align bit pointer
b 2b @ loop for next bit
ENTRY(_find_first_bit_be) ENTRY(_find_first_bit_be)
teq r1, #0 teq r1, #0
...@@ -126,14 +129,17 @@ ENTRY(_find_first_bit_be) ...@@ -126,14 +129,17 @@ ENTRY(_find_first_bit_be)
RETINSTR(mov,pc,lr) RETINSTR(mov,pc,lr)
ENTRY(_find_next_bit_be) ENTRY(_find_next_bit_be)
teq r1, #0
beq 3b
ands ip, r2, #7 ands ip, r2, #7
beq 1b @ If new byte, goto old routine beq 1b @ If new byte, goto old routine
eor r3, r2, #0x18 @ big endian byte ordering eor r3, r2, #0x18 @ big endian byte ordering
ldrb r3, [r0, r3, lsr #3] ldrb r3, [r0, r3, lsr #3]
movs r3, r3, lsr ip @ shift off unused bits movs r3, r3, lsr ip @ shift off unused bits
orreq r2, r2, #7 @ if zero, then no bits here bne .found
addeq r2, r2, #1 @ align bit pointer orr r2, r2, #7 @ if zero, then no bits here
beq 2b @ loop for next bit add r2, r2, #1 @ align bit pointer
b 2b @ loop for next bit
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment