[newlib-cygwin] Fix minor issues in memchr NEON implementation

Corinna Vinschen corinna@sourceware.org
Wed Jun 7 10:16:00 GMT 2017


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=21ff2cf9306d59508386919ec9770035f0783ad1

commit 21ff2cf9306d59508386919ec9770035f0783ad1
Author: Prakhar Bahuguna <prakhar.bahuguna@arm.com>
Date:   Fri Jun 2 10:22:32 2017 +0100

    Fix minor issues in memchr NEON implementation

Diff:
---
 newlib/libc/machine/arm/memchr.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/machine/arm/memchr.S b/newlib/libc/machine/arm/memchr.S
index b5dcf83..7c22b11 100644
--- a/newlib/libc/machine/arm/memchr.S
+++ b/newlib/libc/machine/arm/memchr.S
@@ -135,10 +135,11 @@ memchr:
 	/* Use a simple loop if there are less than 8 bytes to search.  */
 	cmp	cntin, #7
 	bhi	.Llargestr
+	and	chrin, chrin, #0xff
 
 .Lsmallstr:
 	subs	cntin, cntin, #1
-	blt	.Lnotfound	/* Return not found if reached end.  */
+	blo	.Lnotfound	/* Return not found if reached end.  */
 	ldrb	tmp, [srcin], #1
 	cmp	tmp, chrin
 	bne	.Lsmallstr	/* Loop again if not found.  */



More information about the Newlib-cvs mailing list