From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-xc2d.google.com with SMTP id h1-20020a4aa741000000b004756c611188so9918056oom.4; Tue, 04 Oct 2022 18:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date; bh=nX1KGozezYN0qDg6cOCNm5Fsii0PSGFc0R4400F0NZU=; b=p5NVgR3Baqq+DHL0Ouj+18tTrIxsDFe/z8pi/LS35uNyuG8YqIPPwt+9vV8ZVe+XMb H0JWF8Rb2CTe16cDz5uYhCVqI9meW2975uW4/XoVFbxxgWWTQsAnKfCnFOEx0JfnCIHw Bxx7DvbYwXk6g+vaicH+4rBKVR4T3xumqt50JBtPx+Vi1OyeZ5H2T+JHc1xu0Y49Lte4 eBhZYJSZdEkmpQ9ICxDuKWaMcnwDYpOg/4vSXQWe2uZOvSYgapeLtDA7ixgk2BKxr7Op dj+REBtoWMHdJeRwvdDbtav4112P1c7pEfB0GLigOBr91yyX1HAtC4GaDkx6r6lDyZmc LlfA== 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: From: Sunil Pandey 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-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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