Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/machine/xscale/strcmp.c')
-rw-r--r--newlib/libc/machine/xscale/strcmp.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/newlib/libc/machine/xscale/strcmp.c b/newlib/libc/machine/xscale/strcmp.c
index d9ec99b5d..6c94d126f 100644
--- a/newlib/libc/machine/xscale/strcmp.c
+++ b/newlib/libc/machine/xscale/strcmp.c
@@ -32,58 +32,58 @@ strcmp (const char *s1, const char *s2)
ip = 0x80808080 */
asm (
- "ldr r2, [%1, #0]
- ldr r3, [%2, #0]
- cmp r2, r3
- bne 2f
-
- mov ip, #0x80
- add ip, ip, #0x8000
- add ip, ip, ip, lsl #16
- mvn lr, ip, lsl #1
-
-0:
- ldr r2, [%1, #0]
- add r3, r2, lr
- bic r3, r3, r2
- tst r3, ip
- beq 1f
- mov %0, #0x0
- b 3f
-1:
- ldr r2, [%1, #4]!
- ldr r3, [%2, #4]!
-" PRELOADSTR("%1") "
-" PRELOADSTR("%2") "
- cmp r2, r3
+ "ldr r2, [%1, #0]\n\
+ ldr r3, [%2, #0]\n\
+ cmp r2, r3\n\
+ bne 2f\n\
+\n\
+ mov ip, #0x80\n\
+ add ip, ip, #0x8000\n\
+ add ip, ip, ip, lsl #16\n\
+ mvn lr, ip, lsl #1\n\
+\n\
+0:\n\
+ ldr r2, [%1, #0]\n\
+ add r3, r2, lr\n\
+ bic r3, r3, r2\n\
+ tst r3, ip\n\
+ beq 1f\n\
+ mov %0, #0x0\n\
+ b 3f\n\
+1:\n\
+ ldr r2, [%1, #4]!\n\
+ ldr r3, [%2, #4]!\n\
+" PRELOADSTR("%1") "\n\
+" PRELOADSTR("%2") "\n\
+ cmp r2, r3\n\
beq 0b"
/* The following part could be done in a C loop as well, but it needs
to be assembler to save some cycles in the case where the optimized
loop above finds the strings to be equal. */
-"
-2:
- ldrb r2, [%1, #0]
-" PRELOADSTR("%1") "
-" PRELOADSTR("%2") "
- cmp r2, #0x0
- beq 1f
- ldrb r3, [%2, #0]
- cmp r2, r3
- bne 1f
-0:
- ldrb r3, [%1, #1]!
- add %2, %2, #1
- ands ip, r3, #0xff
- beq 1f
- ldrb r3, [%2]
- cmp ip, r3
- beq 0b
-1:
- ldrb lr, [%1, #0]
- ldrb ip, [%2, #0]
- rsb %0, ip, lr
-3:
+"\n\
+2:\n\
+ ldrb r2, [%1, #0]\n\
+" PRELOADSTR("%1") "\n\
+" PRELOADSTR("%2") "\n\
+ cmp r2, #0x0\n\
+ beq 1f\n\
+ ldrb r3, [%2, #0]\n\
+ cmp r2, r3\n\
+ bne 1f\n\
+0:\n\
+ ldrb r3, [%1, #1]!\n\
+ add %2, %2, #1\n\
+ ands ip, r3, #0xff\n\
+ beq 1f\n\
+ ldrb r3, [%2]\n\
+ cmp ip, r3\n\
+ beq 0b\n\
+1:\n\
+ ldrb lr, [%1, #0]\n\
+ ldrb ip, [%2, #0]\n\
+ rsb %0, ip, lr\n\
+3:\n\
"
: "=r" (result), "=&r" (s1), "=&r" (s2)