From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D5F683847725; Wed, 3 Apr 2024 23:12:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5F683847725 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712185957; bh=uw0uwqZjA0nFtwHkReiJ0nvA3VyIEFqiGD9XAphClmk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gmeOvp8WtglDJN57EmWUtPrCOtc3v4/YGk3/tV9l0O4U+oFGFZcar8CiLpSQPokwq ZrPXzz7ONi/mO5m4Dz/q/OFgYIJVVUZ17/UmbgG6/zTUwfEtZ8HS4ih9sj+kbv6TMV rVuet1kOAObFBF0+HHRkYZr75qHQOVxsTRa98C8w= From: "thiago at kde dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114576] [14 regression] VEX-prefixed AES instruction without AVX enabled Date: Wed, 03 Apr 2024 23:12:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: thiago at kde dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114576 --- Comment #4 from Thiago Macieira --- (In reply to Jakub Jelinek from comment #3) > vaesenc etc. instructions can be used even if just -maes -mavx, not just > -mvaes -mavx512vl. Correct, that's just VEX-prefixed AESNI instructions. VAES added the 256-bit and 512-bit versions of those instructions. The tabl= e at felix's website is accurate: https://www.felixcloutier.com/x86/aesenc This is actually similar to GFNI: * GFNI: 128-bit only, non-VEX, non-EVEX * GFNI+AVX: VEX allowed, 128- and 256-bit; no EVEX * GFNI+AVX512F: 128- and 256-bit with VEX, 512-bit with EVEX * GFNI+AVX512VL: 128- and 256-bit with VEX, all with EVEX * GFNI+AVX10 without EVEX512: 128- and 256-bit with VEX and EVEX, no 512-bit The F-no-VL case does not exist in practice. > But, it is especially messy because -mvaes doesn't imply -maes, so IMHO if > somebody e.g. asks for -mvaes -mavx512vl -mno-aes and the insns don't use > any xmm16+ register, it would emit the insn using VEX encoding rather than > EVEX, so I think we need to use {evex} prefixes. Would it be simpler to just imply that VAES includes AESNI? There are no processors that have VAES without AESNI and it doesn't make sense for there= to be one.=