From: Andreas Jaeger <aj@suse.de>
To: GNU libc hacker <libc-hacker@sources.redhat.com>
Subject: Re: i386/strchr.S broken?
Date: Sat, 10 Aug 2002 10:02:00 -0000 [thread overview]
Message-ID: <u8r8h6hcl1.fsf@gromit.moeb> (raw)
In-Reply-To: <u8vg6ihcyc.fsf@gromit.moeb> (Andreas Jaeger's message of "Sat, 10 Aug 2002 18:54:03 +0200")
Ignore the patch - I understand the algorithm now. But now I'd like
to add a comment to it.
Ok to commit to mainline?
Andreas
2002-08-10 Andreas Jaeger <aj@suse.de>
* sysdeps/i386/strchr.S: Add comment.
============================================================
Index: sysdeps/i386/strchr.S
--- sysdeps/i386/strchr.S 6 Jul 2001 04:55:52 -0000 1.11
+++ sysdeps/i386/strchr.S 10 Aug 2002 17:01:19 -0000
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
- Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
@@ -254,7 +254,9 @@ L(71): addl $4, %eax
/* We now scan for the byte in which the character was matched.
But we have to take care of the case that a NUL char is
- found before this in the dword. */
+ found before this in the dword. Note that we XORed the %ecx
+ with the byte we're looking for, therefore the tests below look
+ reversed. */
L(7): testb %cl, %cl /* is first byte C? */
jz L(6) /* yes => return pointer */
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
next prev parent reply other threads:[~2002-08-10 17:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-10 9:54 Andreas Jaeger
2002-08-10 10:02 ` Andreas Jaeger [this message]
2002-08-10 11:01 ` Ulrich Drepper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=u8r8h6hcl1.fsf@gromit.moeb \
--to=aj@suse.de \
--cc=libc-hacker@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).