aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-06-11 10:15:34 +0000
committerRoland McGrath <roland@gnu.org>2004-06-11 10:15:34 +0000
commit482f87008140f8aa5354822fdffd160cd25e0e6b (patch)
treee03c0a98d462ffea84aef229fc33e3b018a03217 /sysdeps
parent64d5339733aa65f02c532f37d71206190c140d40 (diff)
downloadglibc-482f87008140f8aa5354822fdffd160cd25e0e6b.tar.xz
glibc-482f87008140f8aa5354822fdffd160cd25e0e6b.zip
2004-06-11 Roland McGrath <roland@redhat.com>
* sysdeps/arm/strlen.S [__ARMEB__]: Compute correctly for big-endian. From Krzysztof Halasa <khc@pm.waw.pl>.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/arm/strlen.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/sysdeps/arm/strlen.S b/sysdeps/arm/strlen.S
index f29528ada2..a83c41d26a 100644
--- a/sysdeps/arm/strlen.S
+++ b/sysdeps/arm/strlen.S
@@ -53,12 +53,21 @@ Laligned: @ here, we have a word in r2. Does it
ldrne r2, [r1], $4 @ and we continue to the next word
bne Laligned @
Llastword: @ drop through to here once we find a
+#ifdef __ARMEB__
+ tst r2, $0xff000000 @ word that has a zero byte in it
+ addne r0, r0, $1 @
+ tstne r2, $0x00ff0000 @ and add up to 3 bytes on to it
+ addne r0, r0, $1 @
+ tstne r2, $0x0000ff00 @ (if first three all non-zero, 4th
+ addne r0, r0, $1 @ must be zero)
+#else
tst r2, $0x000000ff @ word that has a zero byte in it
addne r0, r0, $1 @
tstne r2, $0x0000ff00 @ and add up to 3 bytes on to it
addne r0, r0, $1 @
tstne r2, $0x00ff0000 @ (if first three all non-zero, 4th
addne r0, r0, $1 @ must be zero)
+#endif
RETINSTR(mov,pc,lr)
END(strlen)
libc_hidden_builtin_def (strlen)