3 #include "../../string/strcmp.c"
11 strcmp (const char *s1
, const char *s2
)
13 asm (PRELOADSTR ("%0") : : "r" (s1
));
14 asm (PRELOADSTR ("%0") : : "r" (s2
));
16 #ifndef __OPTIMIZE_SIZE__
17 if (((long)s1
& 3) == ((long)s2
& 3))
21 /* Skip unaligned part. */
24 if (*s1
== '\0' || *s1
!= *s2
)
30 /* Load two constants:
31 lr = 0xfefefeff [ == ~(0x80808080 << 1) ]
41 add ip, ip, #0x8000\n\
42 add ip, ip, ip, lsl #16\n\
56 " PRELOADSTR("%1") "\n\
57 " PRELOADSTR("%2") "\n\
61 /* The following part could be done in a C loop as well, but it needs
62 to be assembler to save some cycles in the case where the optimized
63 loop above finds the strings to be equal. */
67 " PRELOADSTR("%1") "\n\
68 " PRELOADSTR("%2") "\n\
89 : "=r" (result
), "=&r" (s1
), "=&r" (s2
)
91 : "lr", "ip", "r2", "r3", "cc");
96 while (*s1
!= '\0' && *s1
== *s2
)
98 asm (PRELOADSTR("%0") : : "r" (s1
));
99 asm (PRELOADSTR("%0") : : "r" (s2
));
104 return (*(unsigned char *) s1
) - (*(unsigned char *) s2
);