From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 656B83857828 for ; Fri, 22 Oct 2021 18:33:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 656B83857828 Received: by mail-pg1-x52a.google.com with SMTP id s136so4091237pgs.4 for ; Fri, 22 Oct 2021 11:33:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AJhF78ZRS4sICN2crZy2oyDuyz1XDgr749LcECtEA3I=; b=GVl8anHZq1U6+K1RCl4G20xn/ftCRCskIUvmidd/WFVUMiL6gsmuGLALAhsZNT/6Cr J9vyL3Mk4FqbvHSVVRaVEfO8IB3nplZydVWwb+SUjiTgaAkgM09INDPTsepWYVYufwIm t91QLO2ryEgyiZG3grNYdD2x3ZmRpFagUhFG+SWN8ReEDFoe3brN9bZT9+7oTcwSqGpr lpF92bV8beFKWRwjaY4YQmxLZCm012cr6M8Pe59+CZ8gDHFKqePFq+H15mB7QQGZTrGQ dqj25jHt+s4ecz/Y6rg2MZBLm+J7EQCn9RY3v/hO3z2CJdUmMwAId5iG2wm9mCETPa93 JP8w== X-Gm-Message-State: AOAM531hEYjbLRc1LdyINVl8guRZqg9vVlyryKg7YJL0nWEP8w79Uf2i 8awDcxar7mqY8S4Rz23Rh8AFElb2G8NYvuyY/kC9V27L X-Google-Smtp-Source: ABdhPJyDeZPLpdy4QGxlXFhWS7DiM9Zk96Iq9N2wD1r0QYOEJHWU3H/H5AlQg7Q0bM65Z8pYok+nacMb6ENom923U7Y= X-Received: by 2002:aa7:8f28:0:b0:44c:f281:c261 with SMTP id y8-20020aa78f28000000b0044cf281c261mr1698528pfr.76.1634927623434; Fri, 22 Oct 2021 11:33:43 -0700 (PDT) MIME-Version: 1.0 References: <20210927203827.2852935-1-goldstein.w.n@gmail.com> <20211022054949.895120-1-goldstein.w.n@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Fri, 22 Oct 2021 11:33:06 -0700 Message-ID: Subject: Re: [PATCH v9 1/3] String: Add support for __memcmpeq() ABI on all targets To: Noah Goldstein Cc: GNU C Library , "Carlos O'Donell" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3023.9 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.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: Fri, 22 Oct 2021 18:33:45 -0000 On Fri, Oct 22, 2021 at 11:09 AM Noah Goldstein wrote: > > On Fri, Oct 22, 2021 at 12:45 PM H.J. Lu wrote: > > > > On Fri, Oct 22, 2021 at 10:41 AM Noah Goldstein wrote: > > > > > > On Fri, Oct 22, 2021 at 12:19 PM Noah Goldstein wrote: > > > > > > > > On Fri, Oct 22, 2021 at 12:51 AM Noah Goldstein wrote: > > > > > > > > > > No bug. > > > > > > > > > > This commit adds support for __memcmpeq() as a new ABI for all > > > > > targets. In this commit __memcmpeq() is implemented only as an alias > > > > > to the corresponding targets memcmp() implementation. __memcmpeq() is > > > > > added as a new symbol starting with GLIBC_2.35 and defined in string.h > > > > > with comments explaining its behavior. Basic tests that it is callable > > > > > and works where added in string/tester.c > > > > > > > > > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc" > > > > > __memcmpeq() is essentially a reserved namespace for bcmp(). The means > > > > > is shares the same specifications as memcmp() except the return value > > > > > for non-equal byte sequences is any non-zero value. This is less > > > > > strict than memcmp()'s return value specification and can be better > > > > > optimized when a boolean return is all that is needed. > > > > > > > > > > __memcmpeq() is meant to only be called by compilers if they can prove > > > > > that the return value of a memcmp() call is only used for its boolean > > > > > value. > > > > > > > > > > All tests in string/tester.c passed. As well build succeeds on > > > > > x86_64-linux-gnu target. > > > > > --- > > > > > Kept one weak alias in in: > > > > > sysdeps/x86_64/memcmp.S > > > > > > > > > > This will be preempted by the strong_alias in: > > > > > sysdeps/x86_64/multiarch/memcmp.c > > > > > > > > This issue is present on some other builds. Fixing. > > > > > > Should the check on --disable-multi-arch also include > > > IS_IN (LIBC)? > > > > Why? It can be used in ld.so. > > Just looking at: > '#if ! HAVE_MEMCMP_IFUNC' > in memcmp-z900.S which requires > both. Different targets have different requirements. For x86, it is safe to use IFUNC for memcmp in ld.so, except when initializing tunables. -- H.J.