From: Haochen Jiang <haochen.jiang@intel.com>
To: binutils@sourceware.org
Cc: jbeulich@suse.com, hjl.tools@gmail.com
Subject: [PATCH] x86: Add inval tests for AMX instructions
Date: Fri, 7 Apr 2023 11:28:09 +0800 [thread overview]
Message-ID: <20230407032809.3763561-1-haochen.jiang@intel.com> (raw)
Hi all,
As the AMX-COMPLEX thread said, the AMX invalid checks are missing.
This patch adds those missing all-operands-must- be-distinct checking.
Tested on x86_64-pc-linux-gnu. Ok for trunk?
BRs,
Haochen
gas/ChangeLog:
* testsuite/gas/i386/i386.exp: Run AMX-FP16 and AMX-COMPLEX
inval testcases.
* testsuite/gas/i386/x86-64-amx-inval.l: Add AMX-BF16 tests.
* testsuite/gas/i386/x86-64-amx-inval.s: Ditto.
* testsuite/gas/i386/x86-64-amx-complex-inval.l: New test.
* testsuite/gas/i386/x86-64-amx-complex-inval.s: Ditto.
* testsuite/gas/i386/x86-64-amx-fp16-inval.l: Ditto.
* testsuite/gas/i386/x86-64-amx-fp16-inval.s: Ditto.
---
gas/testsuite/gas/i386/i386.exp | 2 ++
.../gas/i386/x86-64-amx-complex-inval.l | 7 ++++++
.../gas/i386/x86-64-amx-complex-inval.s | 12 ++++++++++
.../gas/i386/x86-64-amx-fp16-inval.l | 7 ++++++
.../gas/i386/x86-64-amx-fp16-inval.s | 12 ++++++++++
gas/testsuite/gas/i386/x86-64-amx-inval.l | 22 ++++++++++++-------
gas/testsuite/gas/i386/x86-64-amx-inval.s | 6 +++++
7 files changed, 60 insertions(+), 8 deletions(-)
create mode 100644 gas/testsuite/gas/i386/x86-64-amx-complex-inval.l
create mode 100644 gas/testsuite/gas/i386/x86-64-amx-complex-inval.s
create mode 100644 gas/testsuite/gas/i386/x86-64-amx-fp16-inval.l
create mode 100644 gas/testsuite/gas/i386/x86-64-amx-fp16-inval.s
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 6d326b49a39..40e75ac6f88 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -1169,6 +1169,7 @@ if [gas_64_check] then {
run_dump_test "x86-64-amx-fp16"
run_dump_test "x86-64-amx-fp16-intel"
run_dump_test "x86-64-amx-fp16-bad"
+ run_list_test "x86-64-amx-fp16-inval"
run_dump_test "x86-64-avx-ifma"
run_dump_test "x86-64-avx-ifma-intel"
run_list_test "x86-64-avx-ifma-inval"
@@ -1187,6 +1188,7 @@ if [gas_64_check] then {
run_dump_test "x86-64-amx-complex"
run_dump_test "x86-64-amx-complex-intel"
run_dump_test "x86-64-amx-complex-bad"
+ run_list_test "x86-64-amx-complex-inval"
run_dump_test "x86-64-clzero"
run_dump_test "x86-64-mwaitx-bdver4"
run_list_test "x86-64-mwaitx-reg"
diff --git a/gas/testsuite/gas/i386/x86-64-amx-complex-inval.l b/gas/testsuite/gas/i386/x86-64-amx-complex-inval.l
new file mode 100644
index 00000000000..f9832ada295
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-amx-complex-inval.l
@@ -0,0 +1,7 @@
+.* Assembler messages:
+.*:5: Error: all tmm registers must be distinct for `tcmmimfp16ps'
+.*:6: Error: all tmm registers must be distinct for `tcmmimfp16ps'
+.*:7: Error: all tmm registers must be distinct for `tcmmimfp16ps'
+.*:10: Error: all tmm registers must be distinct for `tcmmimfp16ps'
+.*:11: Error: all tmm registers must be distinct for `tcmmimfp16ps'
+.*:12: Error: all tmm registers must be distinct for `tcmmimfp16ps'
diff --git a/gas/testsuite/gas/i386/x86-64-amx-complex-inval.s b/gas/testsuite/gas/i386/x86-64-amx-complex-inval.s
new file mode 100644
index 00000000000..eb34c4e48e0
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-amx-complex-inval.s
@@ -0,0 +1,12 @@
+# Check illegal register usage in AMX-COMPLEX instructions
+
+ .text
+_start:
+ tcmmimfp16ps %tmm1, %tmm1, %tmm0
+ tcmmimfp16ps %tmm1, %tmm0, %tmm1
+ tcmmimfp16ps %tmm0, %tmm1, %tmm1
+
+ .intel_syntax noprefix
+ tcmmimfp16ps tmm0, tmm1, tmm1
+ tcmmimfp16ps tmm1, tmm0, tmm1
+ tcmmimfp16ps tmm0, tmm1, tmm1
diff --git a/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.l b/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.l
new file mode 100644
index 00000000000..0e0a332b665
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.l
@@ -0,0 +1,7 @@
+.* Assembler messages:
+.*:5: Error: all tmm registers must be distinct for `tdpfp16ps'
+.*:6: Error: all tmm registers must be distinct for `tdpfp16ps'
+.*:7: Error: all tmm registers must be distinct for `tdpfp16ps'
+.*:10: Error: all tmm registers must be distinct for `tdpfp16ps'
+.*:11: Error: all tmm registers must be distinct for `tdpfp16ps'
+.*:12: Error: all tmm registers must be distinct for `tdpfp16ps'
diff --git a/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.s b/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.s
new file mode 100644
index 00000000000..dab3151983d
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-amx-fp16-inval.s
@@ -0,0 +1,12 @@
+# Check illegal register usage in AMX-FP16 instructions
+
+ .text
+_start:
+ tdpfp16ps %tmm1, %tmm1, %tmm0
+ tdpfp16ps %tmm1, %tmm0, %tmm1
+ tdpfp16ps %tmm0, %tmm1, %tmm1
+
+ .intel_syntax noprefix
+ tdpfp16ps tmm0, tmm1, tmm1
+ tdpfp16ps tmm1, tmm0, tmm1
+ tdpfp16ps tmm0, tmm1, tmm1
diff --git a/gas/testsuite/gas/i386/x86-64-amx-inval.l b/gas/testsuite/gas/i386/x86-64-amx-inval.l
index 6757b780ea8..73300e84d4f 100644
--- a/gas/testsuite/gas/i386/x86-64-amx-inval.l
+++ b/gas/testsuite/gas/i386/x86-64-amx-inval.l
@@ -7,11 +7,17 @@
.*:10: Error: all tmm registers must be distinct for `tdpbssd'
.*:11: Error: all tmm registers must be distinct for `tdpbssd'
.*:12: Error: all tmm registers must be distinct for `tdpbssd'
-.*:15: Error: `\[rip\]' cannot be used here
-.*:16: Error: `\[rip\]' cannot be used here
-.*:17: Error: `\[rip\]' cannot be used here
-.*:18: Error: operand size mismatch for `tdpbssd'
-.*:19: Error: operand size mismatch for `vaddps'
-.*:20: Error: all tmm registers must be distinct for `tdpbssd'
-.*:21: Error: all tmm registers must be distinct for `tdpbssd'
-.*:22: Error: all tmm registers must be distinct for `tdpbssd'
+.*:13: Error: all tmm registers must be distinct for `tdpbf16ps'
+.*:14: Error: all tmm registers must be distinct for `tdpbf16ps'
+.*:15: Error: all tmm registers must be distinct for `tdpbf16ps'
+.*:18: Error: `\[rip\]' cannot be used here
+.*:19: Error: `\[rip\]' cannot be used here
+.*:20: Error: `\[rip\]' cannot be used here
+.*:21: Error: operand size mismatch for `tdpbssd'
+.*:22: Error: operand size mismatch for `vaddps'
+.*:23: Error: all tmm registers must be distinct for `tdpbssd'
+.*:24: Error: all tmm registers must be distinct for `tdpbssd'
+.*:25: Error: all tmm registers must be distinct for `tdpbssd'
+.*:26: Error: all tmm registers must be distinct for `tdpbf16ps'
+.*:27: Error: all tmm registers must be distinct for `tdpbf16ps'
+.*:28: Error: all tmm registers must be distinct for `tdpbf16ps'
diff --git a/gas/testsuite/gas/i386/x86-64-amx-inval.s b/gas/testsuite/gas/i386/x86-64-amx-inval.s
index 6e294536697..a083727e5d5 100644
--- a/gas/testsuite/gas/i386/x86-64-amx-inval.s
+++ b/gas/testsuite/gas/i386/x86-64-amx-inval.s
@@ -10,6 +10,9 @@ _start:
tdpbssd %tmm1, %tmm1, %tmm0
tdpbssd %tmm1, %tmm0, %tmm1
tdpbssd %tmm0, %tmm1, %tmm1
+ tdpbf16ps %tmm1, %tmm1, %tmm0
+ tdpbf16ps %tmm1, %tmm0, %tmm1
+ tdpbf16ps %tmm0, %tmm1, %tmm1
.intel_syntax noprefix
tileloadd tmm1, [rip]
@@ -20,3 +23,6 @@ _start:
tdpbssd tmm0, tmm1, tmm1
tdpbssd tmm1, tmm0, tmm1
tdpbssd tmm1, tmm1, tmm0
+ tdpbf16ps tmm0, tmm1, tmm1
+ tdpbf16ps tmm1, tmm0, tmm1
+ tdpbf16ps tmm0, tmm1, tmm1
--
2.31.1
next reply other threads:[~2023-04-07 3:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 3:28 Haochen Jiang [this message]
2023-04-07 15:50 ` H.J. Lu
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=20230407032809.3763561-1-haochen.jiang@intel.com \
--to=haochen.jiang@intel.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=jbeulich@suse.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).