From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 952E2385841F; Sat, 1 Oct 2022 16:52:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 952E2385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664643170; bh=G2Y1eggdzSS3V+5VoY0id8rf1Opz+0GOzylcpQoYJgU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x4KcHM3Ql2bb5w/fHT2XQSWoFim4lLrHtod4kKHmWtVHSG25mWmayleoeokL77KM+ YUNDyEk0mCaZ49q0jdre2BzGZAKfCKVONI7lVoZJJJ8TlzMsI86Qs0psUKgPfS5rci O3FJSaQWDkDeEAuopTzPeBvYuWQfsTlMnkR3mtDA= From: "aurelien at aurel32 dot net" To: glibc-bugs@sourceware.org Subject: [Bug string/29611] Optimized AVX2 string functions unconditionally use BMI2 instructions Date: Sat, 01 Oct 2022 16:52:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: string X-Bugzilla-Version: 2.31 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: aurelien at aurel32 dot net X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: goldstein.w.n at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29611 --- Comment #31 from Aurelien Jarno --- (In reply to Noah Goldstein from comment #12) > (In reply to Aurelien Jarno from comment #11) > > Before trying to fix that in older branches, we should start by fixing > > master. 3 groups of functions are using BMI2: memchr, strchr and strlen. > > * strchr is fixed by this commit: > >=20 > > commit 83c5b368226c34a2f0a5287df40fc290b2b34359 > > Author: H.J. Lu > > Date: Mon Apr 19 10:45:07 2021 -0700 > >=20 > > x86-64: Require BMI2 for strchr-avx2.S > >=20 > > * strlen is fixed by this commit: > >=20 > > commit aaa23c35071537e2dcf5807e956802ed215210aa > > Author: Noah Goldstein > > Date: Mon Apr 19 19:36:07 2021 -0400 > >=20 > > x86: Optimize strlen-avx2.S > >=20 > > * memchr is not yet fixed in master > memchr should be fine in master. It is not see: https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dsysdeps/x86_64/multi= arch/ifunc-impl-list.c;h=3Da71444eccb3cb7cf59775408b3b2524397aaa2ec;hb=3DHE= AD#l71 There are many more issues on master, so I am reopening the bug. I'll send a patch series fixing the issues. Once this is fixed in master, we can proceed with fixing the stable branches.(In reply to Noah Goldstein from comment #3= 0) > (In reply to Noah Goldstein from comment #29) > > (In reply to Aurelien Jarno from comment #28) > > > (In reply to Noah Goldstein from comment #12) > > > > (In reply to Aurelien Jarno from comment #11) > > > > > Before trying to fix that in older branches, we should start by f= ixing > > > > > master. 3 groups of functions are using BMI2: memchr, strchr and = strlen. > > > > > * strchr is fixed by this commit: > > > > >=20 > > > > > commit 83c5b368226c34a2f0a5287df40fc290b2b34359 > > > > > Author: H.J. Lu > > > > > Date: Mon Apr 19 10:45:07 2021 -0700 > > > > >=20 > > > > > x86-64: Require BMI2 for strchr-avx2.S > > > > >=20 > > > > > * strlen is fixed by this commit: > > > > >=20 > > > > > commit aaa23c35071537e2dcf5807e956802ed215210aa > > > > > Author: Noah Goldstein > > > > > Date: Mon Apr 19 19:36:07 2021 -0400 > > > > >=20 > > > > > x86: Optimize strlen-avx2.S > > > > >=20 > > > > > * memchr is not yet fixed in master > > > > memchr should be fine in master. > > >=20 > > > It is not see: > > >=20 > > > https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dsysdeps/x86_64= /multiarch/ > > > ifunc-impl-list.c;h=3Da71444eccb3cb7cf59775408b3b2524397aaa2ec;hb=3DH= EAD#l71 > > >=20 > > > There are many more issues on master, so I am reopening the bug. I'll= send a > > > patch series fixing the issues. Once this is fixed in master, we can = proceed > > > with fixing the stable branches. > >=20 > > That will break the internal test suite of GLIBC but the ifunc-impl-list > > isn't actually used for selecting which function version is used. > >=20 > > In memchr's case it uses ifunc-evex.h: > > https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dsysdeps/x86_64/m= ultiarch/ > > memchr.c;h=3D0c1555dd00f93777f7575f2a959171352b2ec845;hb=3DHEAD#l27 > >=20 > > WHich does have a BMI2 check for avx2: > > https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dsysdeps/x86_64/m= ultiarch/ > > ifunc-evex.h;h=3D310cfd269f5e4a4a94e96ab971201ae55a41b0b8;hb=3DHEAD#l38 >=20 >=20 > strcmp-avx2.S also has this bug. Yes and there are more, I am preparing a patchset. --=20 You are receiving this mail because: You are on the CC list for the bug.=