]> gcc.gnu.org Git - gcc.git/commitdiff
i386: Enable UINTR and HRESET for -march that supports it
authorMartin Liska <mliska@suse.cz>
Mon, 8 Mar 2021 11:08:37 +0000 (12:08 +0100)
committerMartin Liska <mliska@suse.cz>
Mon, 8 Mar 2021 14:14:28 +0000 (15:14 +0100)
gcc/ChangeLog:

PR target/99463
* config/i386/i386-options.c (ix86_option_override_internal):
Enable UINTR and HRESET for -march that supports it.

gcc/testsuite/ChangeLog:

PR target/99463
* gcc.target/i386/pr99463-2.c: New test.
* gcc.target/i386/pr99463.c: New test.

gcc/config/i386/i386-options.c
gcc/testsuite/gcc.target/i386/pr99463-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr99463.c [new file with mode: 0644]

index cdeabbfca4b539b79e7a9ba91fb212af98479dd5..410fa0cc436ce44b7562653ad67a3f62a05e17b0 100644 (file)
@@ -2354,6 +2354,13 @@ ix86_option_override_internal (bool main_args_p,
        if (((processor_alias_table[i].flags & PTA_PKU) != 0)
            && !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_PKU))
          opts->x_ix86_isa_flags |= OPTION_MASK_ISA_PKU;
+       if (((processor_alias_table[i].flags & PTA_UINTR) != 0)
+           && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA2_UINTR))
+         opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA2_UINTR;
+       if (((processor_alias_table[i].flags & PTA_HRESET) != 0)
+           && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA2_HRESET))
+         opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA2_HRESET;
+
 
        /* Don't enable x87 instructions if only general registers are
           allowed by target("general-regs-only") function attribute or
diff --git a/gcc/testsuite/gcc.target/i386/pr99463-2.c b/gcc/testsuite/gcc.target/i386/pr99463-2.c
new file mode 100644 (file)
index 0000000..017ca95
--- /dev/null
@@ -0,0 +1,5 @@
+/* PR target/99463 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -march=sapphirerapids" } */
+
+#include "uintr-1.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr99463.c b/gcc/testsuite/gcc.target/i386/pr99463.c
new file mode 100644 (file)
index 0000000..0b29092
--- /dev/null
@@ -0,0 +1,5 @@
+/* PR target/99463 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=alderlake" } */
+
+#include "hreset-1.c"
This page took 0.084582 seconds and 5 git commands to generate.