From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 53E8A3858403 for ; Wed, 15 Sep 2021 14:01:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53E8A3858403 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-333-Opt5n7PxNViV3m7EE6Qmzg-1; Wed, 15 Sep 2021 10:01:50 -0400 X-MC-Unique: Opt5n7PxNViV3m7EE6Qmzg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74EF15721D; Wed, 15 Sep 2021 14:01:49 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80C787A5CF; Wed, 15 Sep 2021 14:01:48 +0000 (UTC) From: Florian Weimer To: Zack Weinberg via Libc-alpha Cc: Zack Weinberg Subject: Re: Re: [PATCH 1/5] x86_64: Add support for bcmp using sse2, sse 4_1, avx2, and evex References: <20210913230506.546749-1-goldstein.w.n@gmail.com> <02afac02-47a5-43a5-8437-79fdbbea62aa@www.fastmail.com> Date: Wed, 15 Sep 2021 16:01:46 +0200 In-Reply-To: <02afac02-47a5-43a5-8437-79fdbbea62aa@www.fastmail.com> (Zack Weinberg via Libc-alpha's message of "Wed, 15 Sep 2021 09:37:23 -0400") Message-ID: <87mtoerl85.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 14:01:54 -0000 * Zack Weinberg via Libc-alpha: > On Tue, Sep 14, 2021, at 8:00 PM, Joseph Myers wrote: >> bcmp is an obsolescent function that no modern programs should be using, >> and it's not in the implementation namespace either so compilers shouldn't >> translate memcmp calls to bcmp. > > I want to add that glibc has made bcmp an alias for memcmp for many > years, which means that Linux- or Hurd-specific programs that are > still using bcmp may have come to depend on its return value > indicating ordering rather than just equality. I myself had been > under the impression that they were *specified* exactly the same, > until this thread prompted me to double-check the specifications. As > such I don't think it's safe for *glibc* to accept patches that > optimize bcmp separately from memcmp. That's a very good point. > I do rather like the idea of a __gnu_memeq() that compilers could > optimize memcmp calls to, when they can prove that the result is used > only for its truth value. Yes, we should use a name in the implementation namespace because even if we pick an obvious like memequal, it will probably come back under a different name from the C committee. Thanks, Florian