aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386/i586/strchr.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1996-09-11 01:52:48 +0000
committerUlrich Drepper <drepper@redhat.com>1996-09-11 01:52:48 +0000
commitda74e90200dd19f2f40a47135759eab62e8bfce7 (patch)
tree4b55ba7c99d3de4d313cf9180ff58ef525f1900b /sysdeps/i386/i586/strchr.S
parent569c558c880779d33c6642662d1aa57dff697244 (diff)
downloadglibc-da74e90200dd19f2f40a47135759eab62e8bfce7.tar
glibc-da74e90200dd19f2f40a47135759eab62e8bfce7.tar.gz
glibc-da74e90200dd19f2f40a47135759eab62e8bfce7.tar.bz2
glibc-da74e90200dd19f2f40a47135759eab62e8bfce7.zip
update from main archive 960910
Wed Sep 11 02:57:31 1996 Ulrich Drepper <drepper@cygnus.com> * configure.in: Quote $add_ons argument in loop to generated prefices. Tue Sep 10 20:43:45 1996 Ulrich Drepper <drepper@cygnus.com> * db/makedb.c: Include <locale.h>. Reported by Fila Kolodny. Tue Sep 10 13:49:08 1996 Ulrich Drepper <drepper@cygnus.com> * inet/herrno.c: Initialize `h_errno' so that we can provide alias. * Makefile (version-info.h): Fix typo in shell script. * sysdeps/i386/i586/strlen.S: Optimize startup code a bit. * sysdeps/i386/i586/strchr.S: Likewise.
Diffstat (limited to 'sysdeps/i386/i586/strchr.S')
-rw-r--r--sysdeps/i386/i586/strchr.S16
1 files changed, 6 insertions, 10 deletions
diff --git a/sysdeps/i386/i586/strchr.S b/sysdeps/i386/i586/strchr.S
index 30de6b069d..100cbbc706 100644
--- a/sysdeps/i386/i586/strchr.S
+++ b/sysdeps/i386/i586/strchr.S
@@ -1,6 +1,6 @@
/* strchr -- find character CH in a NUL terminated string.
Highly optimized version for ix85, x>=5.
-Copyright (C) 1995 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
@@ -68,9 +68,10 @@ ENTRY (strchr)
andl $3, %edi /* mask alignment bits */
jz L11 /* alignment is 0 => start loop */
+ jp L0 /* exactly two bits set */
movb (%eax), %cl /* load single byte */
- cmpb %cl, %dl /* is byte == C? */
+ cmpb (%eax), %dl /* is byte == C? */
je L2 /* aligned => return pointer */
@@ -78,26 +79,21 @@ ENTRY (strchr)
je L3 /* yes => return NULL */
incl %eax /* increment pointer */
- cmp $3, %edi /* was alignment == 3? */
+ xorl $3, %edi /* was alignment == 3? */
+L0: movb (%eax), %cl /* load single byte */
je L11 /* yes => start loop */
- movb (%eax), %cl /* load single byte */
cmpb %cl, %dl /* is byte == C? */
-
je L2 /* aligned => return pointer */
cmpb $0, %cl /* is byte NUL? */
je L3 /* yes => return NULL */
+ movb 1(%eax), %cl /* load single byte */
incl %eax /* increment pointer */
- cmp $2, %edi /* was alignment == 2? */
- je L11 /* yes => start loop */
-
- movb (%eax), %cl /* load single byte */
cmpb %cl, %dl /* is byte == C? */
-
je L2 /* aligned => return pointer */
cmpb $0, %cl /* is byte NUL? */