From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 77AB93858D37; Wed, 5 Oct 2022 14:23:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 77AB93858D37 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-ed1-x533.google.com with SMTP id a13so23254010edj.0; Wed, 05 Oct 2022 07:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dqlP88yKBwoUhEIND2vWbHQjx4lnNKchMOWJRB8G9Nw=; b=h04EcrY73SWual0ShNaQVzd5Rbwsnn3NkddRiKQkn90pbEBK3M3MgRpkx6s2UnRcM6 KJHfYeMyV/fBxFkVm19G8wghg5cJ+wIbdW5DV7anF3BcUYB4Q1N2y9OskEnrtURla9XD 74MllP0x7R67I6X6mcdwlxd4g5F8bE1bA6mzXrPDIiicuaLxdN9YCEaFd0sy1kkGQpJ6 V+2SfKOh9ya9Fq//0obha02zhWDO8G00bLhYMP/AH9MUmYumveTDlQLLyHzG0TyHnzK7 0W+VChTrI8mB7snZ4S0WdPBBj4DG6QMFyoMVEYyWz2tlx64U2na4FaSMMdDGHFQdCMSE 97AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dqlP88yKBwoUhEIND2vWbHQjx4lnNKchMOWJRB8G9Nw=; b=0Q46yPqBpyBl3b23bcxk1gpr6xlUxDVa2ZJ4GS5BCuWjXMOVC/bWqT/vCW5IOLEsqz 0nBw0uhaAUzQ1D6h7PU+mm22ijwGA0k43pKQddWxrpI5h3f/frZeeQLvcSbXG5l/98Fp 4JRFFZRrplVug75Vx7QzLZyY6SJSUj9jRNgEMlenfDLVfkabHYbKaJkE27tE7OBdZ1Yd XpXNjOxjOzmAxr6f05GP7KQK6tDzowuczBTQp4MSd3QhI371W06T0JPzySLhIF925iqM getrg9juum92hNcy3RL+wjCMZypqoXw72F+fW68u4nv5IcqezE2G1gIcP7DG62yOPqQp XTpQ== X-Gm-Message-State: ACrzQf0zsd9MnUACf2l2sDDcrBP1jxij/uyUsFMfwmeB5MuIaA8qwGD5 yazUkN6meag82L0q/Nwo2Fm8TJTwipNCP+2VDpAHNkee X-Google-Smtp-Source: AMsMyM510hUloHbSk7mZN/ZtG5wydvFu5O3P3jLSf02cPlnDUicT3OIuIyeot08DWzwfppczQBAJ57oSq2F0JX6hhzo= X-Received: by 2002:a05:6402:3709:b0:459:279e:fdc6 with SMTP id ek9-20020a056402370900b00459279efdc6mr14465edb.338.1664979823132; Wed, 05 Oct 2022 07:23:43 -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: Noah Goldstein Date: Wed, 5 Oct 2022 07:23:31 -0700 Message-ID: Subject: Re: [PATCH v5 2/2] x86: Optimize strlen-avx2.S To: Sunil Pandey Cc: Libc-stable Mailing List , Hongjiu Lu , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.4 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 6:11 PM Sunil Pandey wrote: > > 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? There might not be evidence about the intention of the authors but clearly the strchr commit message does not clarify that it also fixes memchr/strlen. > > > > > 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