From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by sourceware.org (Postfix) with ESMTPS id CE7173858C50; Tue, 4 Oct 2022 21:30:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CE7173858C50 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-qk1-x72e.google.com with SMTP id i3so9197963qkl.3; Tue, 04 Oct 2022 14:30:06 -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=H0yAbZQxQTHUzRRSxnizLxNYLRkswNvlTDL5/l9CAdY=; b=VOyqEFoMy+56M+G6h5JX9JMsCAFtHkARnenO7eWX0LW42DuXgRk+n5XeuNnCW5EYgf wMXePFkNyRGJPQkWdsNFZ9cK0F+CHkCu26p07ORbPif0nr0bT4zgTyrn3Pk5R0//Az9C QjtVeWfMXUPfsobEYXGtYt06V3Bi/polFEqfNu8+3takDSc72Xb79ts8SpPAkviXU2BY 2IK9LCGHUDiEkdF+I3yZRnmPCKavJw+oQ475vHFGsazOQhzoONQdsEubrqBm9lPJq2Ok fbqMCw31AgEQzSRqrvCWFVYpQTHzFbavVa5uCvA2wxym6Q2e1xhIoEfGkoaGbUgL3wiW H6RA== 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=H0yAbZQxQTHUzRRSxnizLxNYLRkswNvlTDL5/l9CAdY=; b=MFYBGqI4a/vikvJh2IbNN53CRSDjabXoLcSnHnzyKaLnCCoJ/h8XoOgLCXf53mKcck bo9gpAgu25DmTeDEuQjfP6rGKc9Zq2UV51P26eri+WNzOoDBaruw6NDsyGlVXOPpHF6F tOhrWSNcgbOasQiVtgn2dDXz/EppYOyvVDEMggrPYWZC/HvTzLNx0lER6WlMv91jYHlK pgxssA1wC3syP9VxJDybukRv/82hgpfYOuK8LUwztTn1OiJwLXkh/SQVIbgY+Nh7fJMB 96QRRV10JXf4a3lwFwvR+bRG4IUBFQJUuEKOC1o3hCQGVfxtb6aDfhlm74NG8aJ/maRa LrfA== X-Gm-Message-State: ACrzQf378fyi8vIxlq9VMn1/BDNU+S7ATKXUCyVIpJNSslg8yLkl18Iy WLJNKqy9O2F+M6S8DEgen3qyIHvPDgepBlsrJvQ= X-Google-Smtp-Source: AMsMyM5ltOvnDIPDXzMoyujcmPolVoOC55SbYuOoHpeYcyDQWXTZjpyVKesaNE8l9QOSOEbcog3kSkiH22KYsoHz8YQ= X-Received: by 2002:a05:620a:2683:b0:6cf:3768:8e4b with SMTP id c3-20020a05620a268300b006cf37688e4bmr17866487qkp.768.1664919006094; Tue, 04 Oct 2022 14:30:06 -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: "H.J. Lu" Date: Tue, 4 Oct 2022 14:29:30 -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=-3018.5 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.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. > > NB: at this stage, I haven't verified the consistency of the ifunc > selectors with ifunc-impl-list.c. > Changes to ifunc-impl-list.c aren't strictly needed since strchr functions don't use BMI2. AVX2 strchr functions are still tested on machines with AVX2 and BMI2. -- H.J.