From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id CD6513939C16; Wed, 10 Jun 2020 16:40:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CD6513939C16 Received: by mail-wm1-x332.google.com with SMTP id u13so2438105wml.1; Wed, 10 Jun 2020 09:40:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=jWT3W4UBa9jDsOqqab61O1xSlfaDFkxqVeOynyIOFUY=; b=kwF15ddyzR3NZTK430fNIbz5AjlwtzBZ8UaYVK2MtRemA583IiMm9zU+GSA0plY7OY n7+wHMFnoceaPxDWxyFPTFxTntCG7pHsdJ7mxBTzWcWTHb5SE+BnP6eKPEdTW0uP1YCA yYglVhRhTez6Remdydzk1MXyPZyjkHS3fTa/y8aBjo2vQh4wThxg0MimcCqrBLAumi19 OS8n0RRy8L+GRTuVpRvB/X2Uh35e4jkzZbU2D0yWtfz+k9H1s+IhHmcWzZWasJ3zNaCW D8E2RUF4IiVJVCe+0yI2xdMa2D5yReMn8KLOKL/EtNUM0FpeFYWNV6L/mIvZwIayXfwJ bkBA== X-Gm-Message-State: AOAM531rGLTkxqxekhNaDXdZYPO+q/LsiYd7Pnxc3Bu9WXrlHn7Hlq/2 G2NtCZrhKLHyDdG8hFv+it/zOcwMUso= X-Google-Smtp-Source: ABdhPJz3ZOQn8zpRjme92hvuAU3gbBDmk8KDTNyyPVXBwerNdsNY7G9cA0oggdR3DVm282K76MzlNQ== X-Received: by 2002:a7b:c145:: with SMTP id z5mr4192800wmi.6.1591807203722; Wed, 10 Jun 2020 09:40:03 -0700 (PDT) Received: from ?IPv6:2a01:e0a:1dc:b1c0:944b:b04a:be5d:98ba? ([2a01:e0a:1dc:b1c0:944b:b04a:be5d:98ba]) by smtp.googlemail.com with ESMTPSA id x18sm278095wmi.35.2020.06.10.09.40.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jun 2020 09:40:02 -0700 (PDT) Subject: Re: libstdc++: Extend memcmp optimization in std::lexicographical_compare To: Jonathan Wakely Cc: "libstdc++@gcc.gnu.org" , gcc-patches References: <0cfba2ec-cd66-fe64-a41c-4028403d9dea@gmail.com> <20200608182040.GA352899@redhat.com> <20200608210806.GS4137376@redhat.com> <20200608230222.GT4137376@redhat.com> <20200609161113.GY4137376@redhat.com> <14eb22ca-a5bb-6f2b-e5aa-d563ca5a6244@gmail.com> <20200609205311.GC4137376@redhat.com> <3a40cd2b-81a2-9d7e-30b3-56e538ba5075@gmail.com> <20200610144905.GL4137376@redhat.com> From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= Message-ID: <81b107c0-699d-0f7c-f104-d239a3b01d67@gmail.com> Date: Wed, 10 Jun 2020 18:40:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200610144905.GL4137376@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 16:40:08 -0000 On 10/06/20 4:49 pm, Jonathan Wakely wrote: > 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. > > That's fine with me, the patch looks good. Do you want me to get rid of the enable_if usage before the commit ? Otherwise I let you commit it ?