From 6041792ec6b89f5e9eae79d8addbb0f706f9addd Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 16 Jul 2013 07:48:53 +0000 Subject: * configure.host: Change to microblaze*. * libc/include/machine/ieeefp.h: Add __MICROBLAZEEL__. * libc/machine/microblaze/mb_endian.h: New file. * newlib/libc/machine/microblaze/strcmp.c: Add little endian support. * newlib/libc/machine/microblaze/strcpy.c: Likewise. * newlib/libc/machine/microblaze/strlen.c: Likewise. * configure.in: Change to microblaze*. * configure: Regenerate. * microblaze/xilinx.ld: Remove OUTPUT_FORMAT. --- newlib/libc/machine/microblaze/strcmp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'newlib/libc/machine/microblaze/strcmp.c') diff --git a/newlib/libc/machine/microblaze/strcmp.c b/newlib/libc/machine/microblaze/strcmp.c index dbac3878f..2f0337412 100644 --- a/newlib/libc/machine/microblaze/strcmp.c +++ b/newlib/libc/machine/microblaze/strcmp.c @@ -138,16 +138,19 @@ _DEFUN (strcmp, (s1, s2), #else +#include "mb_endian.h" + asm volatile (" \n\ - or r9, r0, r0 /* Index register */ \n\ + or r9, r0, r0 /* Index register */\n\ check_alignment: \n\ andi r3, r5, 3 \n\ andi r4, r6, 3 \n\ bnei r3, try_align_args \n\ bnei r4, regular_strcmp /* At this point we don't have a choice */ \n\ -cmp_loop: \n\ - lw r3, r5, r9 \n\ - lw r4, r6, r9 \n\ +cmp_loop: \n" + LOAD4BYTES("r3", "r5", "r9") + LOAD4BYTES("r4", "r6", "r9") +" \n\ pcmpbf r7, r3, r0 /* See if there is Null byte */ \n\ bnei r7, end_cmp_loop /* IF yes (r7 > 0) use byte compares in end_cmp_loop */ \n\ cmpu r7, r4, r3 /* ELSE compare whole word */ \n\ -- cgit v1.2.3