From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 213F61F8C6 for ; Wed, 15 Sep 2021 14:02:14 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE40B3857819 for ; Wed, 15 Sep 2021 14:02:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE40B3857819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631714532; bh=syZEl05Yw4mGaHwM15YQy3MVAXM/guzmNHu7ILr3kIA=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=N0cylub0aKsCfrvM64Hw7BtYLHuR7/wiv6bmwPassBNi9KPocVOs3VYgsX2X+QGdy j13/Kr2e0GAbAUVXXyFCdi9SDcAt3Qcsz1GUF18bpT9YtIx2ylb9PVmHcxu16Qr4+4 CU4sjA0TRJTuphhWyIRvk5nsRc37XpNKgtg3bP98= 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) To: Zack Weinberg via Libc-alpha 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-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: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Cc: Zack Weinberg Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" * 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