From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E37F3938C2D; Mon, 1 Mar 2021 14:05:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E37F3938C2D From: "hjl.tools at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug string/27457] vzeroupper use in AVX2 multiarch string functions cause HTM aborts Date: Mon, 01 Mar 2021 14:05:44 +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: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: hjl.tools at gmail dot com X-Bugzilla-Target-Milestone: 2.34 X-Bugzilla-Flags: security- 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 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, 01 Mar 2021 14:05:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27457 --- Comment #15 from H.J. Lu --- (In reply to Richard Biener from comment #14) >=20 > Note according to Agner vzeroall, for example on Haswell, decodes to > 20 uops while vzeroupper only requires 4. On Skylake it's even worse > (34 uops). For short sizes (as in our benchmark which had 16-31 byte > strcmp) this might be a bigger difference than using the SSE2 variant > off an early xtest result. That said, why not, for HTM + AVX2 CPUs, > have an intermediate dispatcher between the AVX2 and the SSE variant > using xtest? That leaves the actual implementations unchanged and thus > with known performance characteristic? It is implemented on users/hjl/pr27457/wrapper branch: https://gitlab.com/x86-glibc/glibc/-/tree/users/hjl/pr27457/wrapper There are 2 problems: 1. Many RTM tests failed for other reasons. 2. Even with vzeroall overhead, AVX version may still be faster than SSE version. --=20 You are receiving this mail because: You are on the CC list for the bug.=