Support both big and little endian processors.

This commit is contained in:
Ulrich Drepper 1998-05-19 16:11:41 +00:00
parent 59f4b0c86c
commit 69069c4a57
1 changed files with 8 additions and 0 deletions

View File

@ -31,11 +31,19 @@ ENTRY(strlen)
rsb r0, r3, $0 @ get - that number into counter.
beq Laligned @ skip into main check routine if no
@ more
#ifdef __ARMEB__
orr r2, r2, $0xff000000 @ set this byte to non-zero
subs r3, r3, $1 @ any more to do?
orrgt r2, r2, $0x00ff0000 @ if so, set this byte
subs r3, r3, $1 @ more?
orrgt r2, r2, $0x0000ff00 @ then set.
#else
orr r2, r2, $0x000000ff @ set this byte to non-zero
subs r3, r3, $1 @ any more to do?
orrgt r2, r2, $0x0000ff00 @ if so, set this byte
subs r3, r3, $1 @ more?
orrgt r2, r2, $0x00ff0000 @ then set.
#endif
Laligned: @ here, we have a word in r2. Does it
tst r2, $0x000000ff @ contain any zeroes?
tstne r2, $0x0000ff00 @