diff options
Diffstat (limited to 'sysdeps/arm')
-rw-r--r-- | sysdeps/arm/strlen.S | 8 | ||||
-rw-r--r-- | sysdeps/arm/sysdep.h | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/arm/strlen.S b/sysdeps/arm/strlen.S index 9acef4f935..0e360e2653 100644 --- a/sysdeps/arm/strlen.S +++ b/sysdeps/arm/strlen.S @@ -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 @ diff --git a/sysdeps/arm/sysdep.h b/sysdeps/arm/sysdep.h index 28dd402ced..eeef7aaded 100644 --- a/sysdeps/arm/sysdep.h +++ b/sysdeps/arm/sysdep.h @@ -25,8 +25,7 @@ #ifdef HAVE_ELF -/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */ -#define ALIGNARG(log2) 1<<log2 +#define ALIGNARG(log2) log2 /* For ELF we need the `.type' directive to make shared libs work right. */ #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,%##typearg; #define ASM_SIZE_DIRECTIVE(name) .size name,.-name |