From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BF9E83851C13; Mon, 22 Feb 2021 12:40:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF9E83851C13 From: "rguenth at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug string/27457] New: vzeroupper use in AVX2 multiarch string functions cause HTM aborts Date: Mon, 22 Feb 2021 12:40:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: string X-Bugzilla-Version: 2.31 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2021 12:40:32 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27457 Bug ID: 27457 Summary: vzeroupper use in AVX2 multiarch string functions cause HTM aborts Product: glibc Version: 2.31 Status: NEW Severity: normal Priority: P2 Component: string Assignee: unassigned at sourceware dot org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- The use of vzeroupper in for example strcmp on a AVX2 capable machine like Skylake-X causes HTM aborts when used inside transactions. This causes sev= ere performance degradation for some workloads compared to glibc without those multiarch implementations. For one specific benchmark the following hack restores performance (as does removing the VZEROUPPER or replacing it with the way more costly VZEROALL): diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S index ee82fa3e19..208b396557 100644 --- a/sysdeps/x86_64/multiarch/strcmp-avx2.S +++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S @@ -127,7 +127,8 @@ L(return): movzbl (%rsi, %rdx), %edx subl %edx, %eax # endif - VZEROUPPER + vpxor %ymm0, %ymm0, %ymm0 + vpxor %ymm1, %ymm1, %ymm1 ret .p2align 4 --=20 You are receiving this mail because: You are on the CC list for the bug.=