public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: -mno-xsave should disable all relevant ISA flags [PR104462]
@ 2022-02-09 19:23 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2022-02-09 19:23 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

2022-02-09  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

    PR target/104462
    * common/config/i386/i386-common.cc (OPTION_MASK_ISA2_XSAVE_UNSET):
    Also include OPTION_MASK_ISA2_AVX2_UNSET.

gcc/testsuite/ChangeLog:

    PR target/104462
    * gcc.target/i386/pr104462.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Pushed to master.

Uros.

[-- Attachment #2: r.diff.txt --]
[-- Type: text/plain, Size: 1218 bytes --]

diff --git a/gcc/common/config/i386/i386-common.cc b/gcc/common/config/i386/i386-common.cc
index 607e9f20e85..449df6351c9 100644
--- a/gcc/common/config/i386/i386-common.cc
+++ b/gcc/common/config/i386/i386-common.cc
@@ -206,7 +206,8 @@ along with GCC; see the file COPYING3.  If not see
   (OPTION_MASK_ISA_XSAVE | OPTION_MASK_ISA_XSAVEOPT_UNSET \
    | OPTION_MASK_ISA_XSAVES_UNSET | OPTION_MASK_ISA_XSAVEC_UNSET \
    | OPTION_MASK_ISA_AVX_UNSET)
-#define OPTION_MASK_ISA2_XSAVE_UNSET OPTION_MASK_ISA2_AMX_TILE_UNSET
+#define OPTION_MASK_ISA2_XSAVE_UNSET \
+  (OPTION_MASK_ISA2_AVX2_UNSET | OPTION_MASK_ISA2_AMX_TILE_UNSET)
 #define OPTION_MASK_ISA_XSAVEOPT_UNSET OPTION_MASK_ISA_XSAVEOPT
 #define OPTION_MASK_ISA_AVX2_UNSET \
   (OPTION_MASK_ISA_AVX2 | OPTION_MASK_ISA_AVX512F_UNSET)
diff --git a/gcc/testsuite/gcc.target/i386/pr104462.c b/gcc/testsuite/gcc.target/i386/pr104462.c
new file mode 100644
index 00000000000..7a5ee64f431
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr104462.c
@@ -0,0 +1,13 @@
+/* PR target/104462 */
+/* { dg-do compile } */
+/* { dg-options "-mavx512fp16 -mno-xsave" } */
+
+typedef _Float16 __attribute__((__vector_size__ (8))) F;
+
+F f;
+
+void
+foo (void)
+{
+  f *= -f;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-09 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 19:23 [PATCH] i386: -mno-xsave should disable all relevant ISA flags [PR104462] Uros Bizjak

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).