public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: libstdc++: Extend memcmp optimization in std::lexicographical_compare
Date: Wed, 10 Jun 2020 15:49:05 +0100	[thread overview]
Message-ID: <20200610144905.GL4137376@redhat.com> (raw)
In-Reply-To: <3a40cd2b-81a2-9d7e-30b3-56e538ba5075@gmail.com>

On 10/06/20 08:18 +0200, François Dumont via Libstdc++ wrote:
>On 09/06/20 10:53 pm, Jonathan Wakely wrote:
>>This reminds me that I was going to extend the condition for using
>>memcmp to also apply to unsigned integers with sizeof(T) > 1 on big
>>endian targets.
>>
>This illustrates what I tried to avoid in my original patch, the code 
>duplication. I was calling __lexicographical_compare_aux1 because I 
>didn't want to duplicate the code to compute __simple.
>
>Of course it can be expose as a template using.

Not for C++98.

I'm not very concerned about duplicating the boolean condition. I
definitely prefer that to codegen changes that affect every user of
lexicographical_compare just to benefit the handful of people using
it with std::deque.

If __lexicographical_compare_aux1 could be reused without changes,
great, but it needed changes with consequences for more code than just
deque iterators.



  reply	other threads:[~2020-06-10 14:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 20:24 François Dumont
2020-06-08 18:20 ` Jonathan Wakely
2020-06-08 21:08   ` Jonathan Wakely
2020-06-08 23:02     ` Jonathan Wakely
2020-06-09 16:11       ` Jonathan Wakely
2020-06-09 16:12         ` Jonathan Wakely
2020-06-09 20:42         ` François Dumont
2020-06-09 20:53           ` Jonathan Wakely
2020-06-10  6:18             ` François Dumont
2020-06-10 14:49               ` Jonathan Wakely [this message]
2020-06-10 16:40                 ` François Dumont
2020-06-10 17:14                   ` Jonathan Wakely
2020-06-09 10:24   ` Jonathan Wakely
2020-06-09 20:35     ` François Dumont
2020-06-09 20:50       ` Jonathan Wakely
2020-06-09 20:20   ` François Dumont
2020-06-09 20:38     ` Jonathan Wakely
2020-06-08 20:07 ` Jonathan Wakely
2020-06-08 21:05   ` Jonathan Wakely

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=20200610144905.GL4137376@redhat.com \
    --to=jwakely@redhat.com \
    --cc=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /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).