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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_REPLYTO_END_DIGIT, HK_RANDOM_REPLYTO,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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 3B5921F403 for ; Wed, 5 Oct 2022 01:11:55 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Ax1pP5/z"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A5083858CDA for ; Wed, 5 Oct 2022 01:11:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A5083858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664932309; bh=nX1KGozezYN0qDg6cOCNm5Fsii0PSGFc0R4400F0NZU=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Ax1pP5/zB5he5ay/zWOi9GttPdpbCVkkALzwsRyfp2dcwcy9ayldkgFeLv2ALAZ/X chz5nTW7L9CwxBRopORvkGTJ4gp/+Kz/ZwaMzFR5gOQhRLb8eBnClNjRqx/59jDrQw 74ZkLTLPr9UFqcRsUkAhI8prI9FGbWrO16wzLJ00= Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) by sourceware.org (Postfix) with ESMTPS id 6EAC03858D37; Wed, 5 Oct 2022 01:11:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6EAC03858D37 Received: by mail-oo1-xc2d.google.com with SMTP id h1-20020a4aa741000000b004756c611188so9918056oom.4; Tue, 04 Oct 2022 18:11:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=nX1KGozezYN0qDg6cOCNm5Fsii0PSGFc0R4400F0NZU=; b=2xLSScqEpHTECLVYeOXS/d3u7kPzxDG1vBZKFuqopQA+SBCAnQhH2bUARfM4Efpf7z o8cYtL/YwGUIWGgH1lQI67MkdAZRD1TMXC0DIoPbab9mZr03QOJGl4cou5WVLBXvoSJk ZnvlBEJbJX4922tuRCJOvWeRZ2ByXQB6A3WBytkPpj+aAqbGWh5FJdFQRGUxZILUWeLA 9naA4Y+bsYUEdxqkBfdsjKc5ivNNmyHW1QKaVfAqek7xmfP1b1SumCmAmnyX4s6L+swh JqK2ksx6gPTghYzI9uIeQ2ElBYSZEurAlrzFplMarkuEqsvETlI8XZ3s+i9jZ0wBL3Nu qPXg== X-Gm-Message-State: ACrzQf1FicJEVnvqEPwtXeaJoNCMgnLYNw0Tk8MPVo/vYyxgAvz78e9K /V6JdlMDUCXbp1c88YqCxW21QH1kKGqtg5+WPGrYQBIn X-Google-Smtp-Source: AMsMyM4N5c6JfKgrSYTpzRZCHc4TTrMjD+C9oL4HWiVtSTI16o1rvaZimZi2tU5BdrrfOZQhXe+l3XLUmYXGTuyBOHo= X-Received: by 2002:a4a:e9ac:0:b0:47f:706c:5809 with SMTP id t12-20020a4ae9ac000000b0047f706c5809mr938088ood.49.1664932287718; Tue, 04 Oct 2022 18:11:27 -0700 (PDT) MIME-Version: 1.0 References: <20210419233607.916848-1-goldstein.w.n@gmail.com> <20210419233607.916848-2-goldstein.w.n@gmail.com> In-Reply-To: Date: Tue, 4 Oct 2022 18:10:51 -0700 Message-ID: Subject: Re: [PATCH v5 2/2] x86: Optimize strlen-avx2.S To: Sunil Pandey , Noah Goldstein , Libc-stable Mailing List , Hongjiu Lu , GNU C Library Content-Type: text/plain; charset="UTF-8" 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: Sunil Pandey via Libc-alpha Reply-To: Sunil Pandey Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Tue, Oct 4, 2022 at 2:20 PM Aurelien Jarno wrote: > > On 2022-09-28 06:54, Sunil Pandey via Libc-stable wrote: > > Attached patch fixes BZ# 29611. > > > > I would like to backport it to 2.32,2.31,2.30,2.29 and 2.29. Let me know > > if there is any objection. > > Sorry to be late on this. I have a few comments about that patch: > > > From 86e1d88e1a3c126597ef39165275ada7564cfce9 Mon Sep 17 00:00:00 2001 > > From: "H.J. Lu" > > Date: Mon, 19 Apr 2021 10:45:07 -0700 > > Subject: [PATCH] x86-64: Require BMI2 for strchr-avx2.S > > > > Since strchr-avx2.S updated by > > > > commit 1f745ecc2109890886b161d4791e1406fdfc29b8 > > Author: noah > > Date: Wed Feb 3 00:38:59 2021 -0500 > > > > x86-64: Refactor and improve performance of strchr-avx2.S > > > > uses sarx: > > > > c4 e2 72 f7 c0 sarx %ecx,%eax,%eax > > > > for strchr-avx2 family functions, require BMI2 in ifunc-impl-list.c and > > ifunc-avx2.h. > > > > (cherry picked from commit 83c5b368226c34a2f0a5287df40fc290b2b34359) > > --- > > sysdeps/x86_64/multiarch/ifunc-avx2.h | 4 ++-- > > sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++--- > > 2 files changed, 11 insertions(+), 5 deletions(-) > > First of all 1f745ecc2109890886b161d4791e1406fdfc29b8 never got > backported to 2.32 and older branches, and strchr-avx2.S in those > branches do not use BMI2 instructions. So it doesn't make sense to > backport it. > > That said the change in ifunc-avx2.h fixes: > > - memchr and rawmemchr, broken by the backport of acfd088a1963 ("x86: > Optimize memchr-avx2.S") > - strlen and strnlen, broken by the backport of aaa23c350715 ("x86: > Optimize strlen-avx2.S") > > So the issues are fixed, but mostly by chance. How do you know it is a "by chance" fix, do you have any evidence to back your claim? > > NB: at this stage, I haven't verified the consistency of the ifunc > selectors with ifunc-impl-list.c. > > -- > Aurelien Jarno GPG: 4096R/1DDD8C9B > aurelien@aurel32.net http://www.aurel32.net