From: liuhongt <hongtao.liu@intel.com>
To: gcc-patches@gcc.gnu.org
Cc: thiago@kde.org, crazylht@gmail.com, hjl.tools@gmail.com
Subject: [PATCH] Remove macro check for __AMX_BF16/INT8/TILE__ in header file.
Date: Thu, 2 Sep 2021 12:58:57 +0800 [thread overview]
Message-ID: <20210902045857.3926805-1-hongtao.liu@intel.com> (raw)
Hi:
Details discussed in PR.
Bootstrapped and regtested on x86-64_linux-gnu{-m32,}.
Pushed to master and GCC-11.
gcc/ChangeLog:
PR target/102166
* config/i386/amxbf16intrin.h : Remove macro check for __AMX_BF16__.
* config/i386/amxint8intrin.h : Remove macro check for __AMX_INT8__.
* config/i386/amxtileintrin.h : Remove macro check for __AMX_TILE__.
gcc/testsuite/ChangeLog:
PR target/102166
* g++.target/i386/pr102166.C: New test.
---
gcc/config/i386/amxbf16intrin.h | 2 +-
gcc/config/i386/amxint8intrin.h | 2 +-
gcc/config/i386/amxtileintrin.h | 2 +-
gcc/testsuite/g++.target/i386/pr102166.C | 20 ++++++++++++++++++++
4 files changed, 23 insertions(+), 3 deletions(-)
create mode 100644 gcc/testsuite/g++.target/i386/pr102166.C
diff --git a/gcc/config/i386/amxbf16intrin.h b/gcc/config/i386/amxbf16intrin.h
index 8c24cdd50a0..1d60e8e609f 100644
--- a/gcc/config/i386/amxbf16intrin.h
+++ b/gcc/config/i386/amxbf16intrin.h
@@ -34,7 +34,7 @@
#define __DISABLE_AMX_BF16__
#endif /* __AMX_BF16__ */
-#if defined(__x86_64__) && defined(__AMX_BF16__)
+#if defined(__x86_64__)
#define _tile_dpbf16ps_internal(dst,src1,src2) \
__asm__ volatile\
("{tdpbf16ps\t%%tmm"#src2", %%tmm"#src1", %%tmm"#dst"|tdpbf16ps\t%%tmm"#dst", %%tmm"#src1", %%tmm"#src2"}" ::)
diff --git a/gcc/config/i386/amxint8intrin.h b/gcc/config/i386/amxint8intrin.h
index 180c2436278..dbb7b6cc5ad 100644
--- a/gcc/config/i386/amxint8intrin.h
+++ b/gcc/config/i386/amxint8intrin.h
@@ -34,7 +34,7 @@
#define __DISABLE_AMX_INT8__
#endif /* __AMX_INT8__ */
-#if defined(__x86_64__) && defined(__AMX_INT8__)
+#if defined(__x86_64__)
#define _tile_int8_dp_internal(name,dst,src1,src2) \
__asm__ volatile \
("{"#name"\t%%tmm"#src2", %%tmm"#src1", %%tmm"#dst"|"#name"\t%%tmm"#dst", %%tmm"#src1", %%tmm"#src2"}" ::)
diff --git a/gcc/config/i386/amxtileintrin.h b/gcc/config/i386/amxtileintrin.h
index 16c8b6ef681..75d784ad160 100644
--- a/gcc/config/i386/amxtileintrin.h
+++ b/gcc/config/i386/amxtileintrin.h
@@ -34,7 +34,7 @@
#define __DISABLE_AMX_TILE__
#endif /* __AMX_TILE__ */
-#if defined(__x86_64__) && defined(__AMX_TILE__)
+#if defined(__x86_64__)
extern __inline void
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
_tile_loadconfig (const void *__config)
diff --git a/gcc/testsuite/g++.target/i386/pr102166.C b/gcc/testsuite/g++.target/i386/pr102166.C
new file mode 100644
index 00000000000..751cd2c6d26
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/pr102166.C
@@ -0,0 +1,20 @@
+/* PR target/102166 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -std=c++14" } */
+
+#include<immintrin.h>
+__attribute__((target("amx-tile"))) void amx()
+{
+ _tile_loadd(0, 0, 0);
+ _tile_release();
+}
+
+__attribute__((target("amx-int8"))) void amxint8()
+{
+ _tile_dpbssd(0, 1, 2);
+}
+
+__attribute__((target("amx-bf16"))) void amxbf16()
+{
+ _tile_dpbf16ps (0, 1, 2);
+}
--
2.27.0
reply other threads:[~2021-09-02 4:59 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=20210902045857.3926805-1-hongtao.liu@intel.com \
--to=hongtao.liu@intel.com \
--cc=crazylht@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hjl.tools@gmail.com \
--cc=thiago@kde.org \
/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).