mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: musl@lists.openwall.com, Robert Clausecker <fuz@fuz.su>
Subject: Re: [musl] strcmp() guarantees and assumptions
Date: Mon, 17 Jul 2023 13:22:05 -0300	[thread overview]
Message-ID: <e7525544-134c-bcce-f007-00f587f52522@linaro.org> (raw)
In-Reply-To: <ZLRdasdXiHLTxKx7@fuz.su>



On 16/07/23 18:13, Robert Clausecker wrote:
> Hi Markus,
> 
>> Also, glibc already has an SSE strcmp implementation you may want to
>> look at.
> 
> I'm not going to look at glibc as it's LGPL licensed.  I am aware of the
> Intel implementation, but I don't like that it has to duplicate the code
> 16 times for each possible misalignment pattern.  Without having to
> ensure that a cacheline of data is only touched once we confirm there
> is no previous mismatch, it might be possible to write simpler code, but
> I'm currently not entirely sure how.

On glibc side we have discussed the requirement of null-terminated for
string functions on some occasions [1][2][3] and we leaned toward allows
non-null terminated buffers for strncmp (where implementations must stop
are either first null or the at end of the buffer) and require 
null-terminated buffers for strcmp.

[1] https://sourceware.org/pipermail/libc-alpha/2023-February/145840.html
[2] https://sourceware.org/pipermail/libc-alpha/2023-February/145860.html
[3] https://sourceware.org/pipermail/libc-alpha/2023-February/145907.html

      reply	other threads:[~2023-07-17 16:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-16 17:22 Robert Clausecker
2023-07-16 17:49 ` NRK
2023-07-16 17:59   ` Robert Clausecker
2023-07-16 19:24     ` Pedro Falcato
2023-07-16 19:29       ` Pedro Falcato
2023-07-16 19:33     ` Markus Wichmann
2023-07-16 21:13       ` Robert Clausecker
2023-07-17 16:22         ` Adhemerval Zanella Netto [this message]

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=e7525544-134c-bcce-f007-00f587f52522@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fuz@fuz.su \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).