From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>
Subject: [PATCH] x86: KeyLocker insn interaction with -msse-check / .sse_check
Date: Fri, 1 Mar 2024 13:44:31 +0100 [thread overview]
Message-ID: <94075e2e-e553-4dbe-b1d1-cd0a3f4ebb20@suse.com> (raw)
Some of these have no explicit %xmm operand(s), yet they still act SSE-
like (in leaveing bits 128 and up untouched). Hence they want similarly
diagnosing, if that was asked for.
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -6761,7 +6761,8 @@ md_assemble (char *line)
&& !is_cpu (&i.tm, CpuSSE4a)
&& !is_any_vex_encoding (t))
{
- bool simd = false;
+ /* Some KL and all WideKL insns have only implicit %xmm operands. */
+ bool simd = is_cpu (t, CpuKL) || is_cpu (t, CpuWideKL);
for (j = 0; j < t->operands; ++j)
{
--- a/gas/testsuite/gas/i386/sse-check.d
+++ b/gas/testsuite/gas/i386/sse-check.d
@@ -22,4 +22,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 66 0f 38 cf d1 gf2p8mulb %xmm1,%xmm2
[ ]*[a-f0-9]+: 62 f2 7d 09 cf c0 vgf2p8mulb %xmm0,%xmm0,%xmm0\{%k1\}
[ ]*[a-f0-9]+: 62 f2 7d 48 cf c0 vgf2p8mulb %zmm0,%zmm0,%zmm0
+[ ]*[a-f0-9]+: (67 )?f3 0f 38 dd 00 + aesdec128kl \(%eax\),%xmm0
+[ ]*[a-f0-9]+: f3 0f 38 fa f8 encodekey128 %eax,%edi
+[ ]*[a-f0-9]+: (67 )?f3 0f 38 d8 10 + aesencwide256kl \(%eax\)
#pass
--- a/gas/testsuite/gas/i386/sse-check.s
+++ b/gas/testsuite/gas/i386/sse-check.s
@@ -39,3 +39,10 @@ _start:
gf2p8mulb %xmm1,%xmm2
vgf2p8mulb %xmm0, %xmm0, %xmm0{%k1}
vgf2p8mulb %zmm0, %zmm0, %zmm0
+
+# KeyLocker instructions
+ aesdec128kl (%eax), %xmm0
+ encodekey128 %eax, %edi
+
+# WideKL instructions
+ aesencwide256kl (%eax)
--- a/gas/testsuite/gas/i386/sse-check-error.l
+++ b/gas/testsuite/gas/i386/sse-check-error.l
@@ -10,6 +10,9 @@
.*:33: Error: .*
.*:36: Error: .*
.*:39: Error: .*
+.*:44: Error: .*
+.*:45: Error: .*
+.*:48: Error: .*
GAS LISTING .*
@@ -78,4 +81,17 @@ GAS LISTING .*
[ ]*[0-9]+[ ]+CFC0
[ ]*[0-9]+[ ]+\?\?\?\? 62F27D48 vgf2p8mulb %zmm0, %zmm0, %zmm0
[ ]*[0-9]+[ ]+CFC0
-
+[ ]*[0-9]+[ ]+
+[ ]*[0-9]+[ ]+\# KeyLocker instructions
+[ ]*[0-9]+[ ]+\?\?\?\? F30F38DD aesdec128kl \(%eax\), %xmm0
+.* Error: SSE instruction `aesdec128kl' is used
+[ ]*[0-9]+[ ]+00
+[ ]*[0-9]+[ ]+\?\?\?\? F30F38FA encodekey128 %eax, %edi
+.* Error: SSE instruction `encodekey128' is used
+[ ]*[0-9]+[ ]+F8
+[ ]*[0-9]+[ ]+
+[ ]*[0-9]+[ ]+\# WideKL instructions
+[ ]*[0-9]+[ ]+\?\?\?\? F30F38D8 aesencwide256kl \(%eax\)
+.* Error: SSE instruction `aesencwide256kl' is used
+[ ]*[0-9]+[ ]+10
+#pass
--- a/gas/testsuite/gas/i386/sse-check-warn.e
+++ b/gas/testsuite/gas/i386/sse-check-warn.e
@@ -10,3 +10,6 @@
.*:33: Warning: SSE instruction `aesdec' is used
.*:36: Warning: SSE instruction `sha1nexte' is used
.*:39: Warning: SSE instruction `gf2p8mulb' is used
+.*:44: Warning: SSE instruction `aesdec128kl' is used
+.*:45: Warning: SSE instruction `encodekey128' is used
+.*:48: Warning: SSE instruction `aesencwide256kl' is used
--- a/gas/testsuite/gas/i386/x86-64-sse-check-error.l
+++ b/gas/testsuite/gas/i386/x86-64-sse-check-error.l
@@ -10,6 +10,9 @@
.*:33: Error: .*
.*:36: Error: .*
.*:39: Error: .*
+.*:44: Error: .*
+.*:45: Error: .*
+.*:48: Error: .*
GAS LISTING .*
@@ -79,4 +82,17 @@ GAS LISTING .*
[ ]*[0-9]+[ ]+CFC0
[ ]*[0-9]+[ ]+\?\?\?\? 62F27D48 vgf2p8mulb %zmm0, %zmm0, %zmm0
[ ]*[0-9]+[ ]+CFC0
-
+[ ]*[0-9]+[ ]+
+[ ]*[0-9]+[ ]+\# KeyLocker instructions
+[ ]*[0-9]+[ ]+\?\?\?\? 67F30F38 aesdec128kl \(%eax\), %xmm0
+.* Error: SSE instruction `aesdec128kl' is used
+[ ]*[0-9]+[ ]+DD00
+[ ]*[0-9]+[ ]+\?\?\?\? F30F38FA encodekey128 %eax, %edi
+.* Error: SSE instruction `encodekey128' is used
+[ ]*[0-9]+[ ]+F8
+[ ]*[0-9]+[ ]+
+[ ]*[0-9]+[ ]+\# WideKL instructions
+[ ]*[0-9]+[ ]+\?\?\?\? 67F30F38 aesencwide256kl \(%eax\)
+.* Error: SSE instruction `aesencwide256kl' is used
+[ ]*[0-9]+[ ]+D810
+#pass
reply other threads:[~2024-03-01 12:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94075e2e-e553-4dbe-b1d1-cd0a3f4ebb20@suse.com \
--to=jbeulich@suse.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).