glibc/sysdeps/powerpc/powerpc64
Alan Modra 466b039332 PowerPC LE memchr and memrchr
http://sourceware.org/ml/libc-alpha/2013-08/msg00105.html

Like strnlen, memchr and memrchr had a number of defects fixed by this
patch as well as adding little-endian support.  The first one I
noticed was that the entry to the main loop needlessly checked for
"are we done yet?" when we know the size is large enough that we can't
be done.  The second defect I noticed was that the main loop count was
wrong, which in turn meant that the small loop needed to handle an
extra word.  Thirdly, there is nothing to say that the string can't
wrap around zero, except of course that we'd normally hit a segfault
on trying to read from address zero.  Fixing that simplified a number
of places:

-	/* Are we done already?  */
-	addi    r9,r8,8
-	cmpld	r9,r7
-	bge	L(null)

becomes

+	cmpld	r8,r7
+	beqlr

However, the exit gets an extra test because I test for being on the
last word then if so whether the byte offset is less than the end.
Overall, the change is a win.

Lastly, memrchr used the wrong cache hint.

	* sysdeps/powerpc/powerpc64/power7/memchr.S: Replace rlwimi with
	insrdi.  Make better use of reg selection to speed exit slightly.
	Schedule entry path a little better.  Remove useless "are we done"
	checks on entry to main loop.  Handle wrapping around zero address.
	Correct main loop count.  Handle single left-over word from main
	loop inline rather than by using loop_small.  Remove extra word
	case in loop_small caused by wrong loop count.  Add little-endian
	support.
	* sysdeps/powerpc/powerpc32/power7/memchr.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/memrchr.S: Likewise.  Use proper
	cache hint.
	* sysdeps/powerpc/powerpc32/power7/memrchr.S: Likewise.
	* sysdeps/powerpc/powerpc64/power7/rawmemchr.S: Add little-endian
	support.  Avoid rlwimi.
	* sysdeps/powerpc/powerpc32/power7/rawmemchr.S: Likewise.
2013-10-04 10:41:46 +09:30
..
970
a2 Remove powerpc64 bounded-pointers code. 2013-03-06 00:10:21 +00:00
bits Fix spelling errors in sysdeps/powerpc files. 2013-01-07 11:20:53 -06:00
cell Fix typos. 2013-08-21 19:48:48 +02:00
fpu PowerPC floating point little-endian [14 of 15] 2013-10-04 10:36:24 +09:30
power4 PowerPC LE memset 2013-10-04 10:41:35 +09:30
power5 Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
power5+ Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
power6 PowerPC LE memset 2013-10-04 10:41:35 +09:30
power6x Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
power7 PowerPC LE memchr and memrchr 2013-10-04 10:41:46 +09:30
power8 PowerPC: Enable POWER8 platform sans hwcap bits. 2013-06-24 15:33:32 -05:00
Implies Revert "Use ieee754/dbl-64/wordsize-64 on powerpc64" 2013-01-10 10:44:05 +01:00
Makefile
__longjmp-common.S PowerPC LE setjmp/longjmp 2013-10-04 10:37:59 +09:30
__longjmp.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
backtrace.c PowerPC: fix backtrace to handle signal trampolines 2013-08-20 15:05:49 -05:00
bsd-_setjmp.S
bsd-setjmp.S
bzero.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
configure Add missing magic to GLIBC_PROVIDES. 2012-10-09 15:41:30 -07:00
configure.in Remove TLS configure checks. 2012-07-17 23:57:43 +02:00
crti.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
crtn.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-dtprocnum.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-irel.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-machine.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-machine.h Avoid crashing in LD_DEBUG when program name is unavailable 2013-05-29 21:34:12 +05:30
dl-trampoline.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
entry.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ffsll.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
hp-timing.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
hp-timing.h Fix spelling errors in sysdeps/powerpc files. 2013-01-07 11:20:53 -06:00
memcpy.S PowerPC LE memcpy 2013-10-04 10:41:24 +09:30
memset.S PowerPC LE memset 2013-10-04 10:41:35 +09:30
ppc-mcount.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
register-dump.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
rtld-memset.c
setjmp-common.S PowerPC LE setjmp/longjmp 2013-10-04 10:37:59 +09:30
setjmp.S PowerPC ugly symbol versioning 2013-10-04 10:38:28 +09:30
stackguard-macros.h PowerPC: Fix POINTER_CHK_GUARD thread register for PPC64 2013-09-25 13:43:04 -05:00
start.S PowerPC: .eh_frame info in crt1.o isn't useful and triggers gold bug 14675. 2013-03-28 12:16:28 -05:00
stpcpy.S PowerPC LE strcpy 2013-10-04 10:40:11 +09:30
strchr.S PowerPC LE strchr 2013-10-04 10:40:22 +09:30
strcmp.S PowerPC LE strcmp and strncmp 2013-10-04 10:39:52 +09:30
strcpy.S PowerPC LE strcpy 2013-10-04 10:40:11 +09:30
strlen.S PowerPC LE strlen 2013-10-04 10:39:32 +09:30
strncmp.S PowerPC LE strcmp and strncmp 2013-10-04 10:39:52 +09:30
sysdep.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tls-macros.h Split tls-macros.h in sysdeps directories. 2012-07-19 17:04:04 -03:00
tst-audit.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00