Fixed g++.dg/ext/mv16.C with -march=native.
authorOlga Makhotina <olga.makhotina@intel.com>
Mon, 16 Apr 2018 11:23:55 +0000 (11:23 +0000)
committerJulia Koval <jkoval@gcc.gnu.org>
Mon, 16 Apr 2018 11:23:55 +0000 (13:23 +0200)
gcc/
PR target/84331
* gcc/config.gcc: Support "skylake".
* gcc/config/i386/i386-c.c (ix86_target_macros_internal): Handle
PROCESSOR_SKYLAKE.
* gcc/config/i386/i386.c (m_SKYLAKE): Define.
(processor_target_table): Add "skylake".
(ix86_option_override_internal): Add "skylake".
(get_builtin_code_for_version): Handle PROCESSOR_SKYLAKE,
PROCESSOR_CANNONLAKE.
(get_builtin_code_for_version): Fix priority for
PROCESSOR_ICELAKE_CLIENT, PROCESSOR_ICELAKE_SERVER,
PROCESSOR_SKYLAKE-AVX512.
* gcc/config/i386/i386.h (processor_costs): Define TARGET_SKYLAKE.
(processor_type): Add PROCESSOR_SKYLAKE.

gcc/testsuite/
PR target/84331
* gcc/testsuite/gcc.target/i386/funcspec-56.inc: Test arch=skylake.

From-SVN: r259399

gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/i386-c.c
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/funcspec-56.inc

index 3a82dfec269d9f86f728fa63eeb71950a9b43404..8cc7a6b8167e812465a595ecc2ba3507cb004994 100644 (file)
@@ -1,3 +1,20 @@
+2018-04-16  Olga Makhotina  <olga.makhotina@intel.com>
+
+       PR target/84331
+       * gcc/config.gcc: Support "skylake".
+       * gcc/config/i386/i386-c.c (ix86_target_macros_internal): Handle
+       PROCESSOR_SKYLAKE.
+       * gcc/config/i386/i386.c (m_SKYLAKE): Define.
+       (processor_target_table): Add "skylake".
+       (ix86_option_override_internal): Add "skylake".
+       (get_builtin_code_for_version): Handle PROCESSOR_SKYLAKE,
+       PROCESSOR_CANNONLAKE.
+       (get_builtin_code_for_version): Fix priority for
+       PROCESSOR_ICELAKE_CLIENT, PROCESSOR_ICELAKE_SERVER,
+       PROCESSOR_SKYLAKE-AVX512.
+       * gcc/config/i386/i386.h (processor_costs): Define TARGET_SKYLAKE.
+       (processor_type): Add PROCESSOR_SKYLAKE.
+       
 2018-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
            Jason Merrill  <jason@redhat.com>
 
index 55c314afdbd3ad936792f681807ebb88ba494e6d..787d8f40e4ad17bb37e8555d77e077f49c17e838 100644 (file)
@@ -637,7 +637,7 @@ x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \
 bdver3 bdver4 znver1 btver1 btver2 k8 k8-sse3 opteron opteron-sse3 nocona \
 core2 corei7 corei7-avx core-avx-i core-avx2 atom slm nehalem westmere \
 sandybridge ivybridge haswell broadwell bonnell silvermont knl knm \
-skylake-avx512 cannonlake icelake-client icelake-server x86-64 native"
+skylake-avx512 cannonlake icelake-client icelake-server skylake x86-64 native"
 
 # Additional x86 processors supported by --with-cpu=.  Each processor
 # MUST be separated by exactly one space.
index 6c50e2096a0f15d8266570f0715332530e2eb206..2e0e9f66c9e65defbcebb2cfea8e3986e6063365 100644 (file)
@@ -182,6 +182,10 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
       def_or_undef (parse_in, "__knm");
       def_or_undef (parse_in, "__knm__");
       break;
+    case PROCESSOR_SKYLAKE:
+      def_or_undef (parse_in, "__skylake");
+      def_or_undef (parse_in, "__skylake__");
+      break;
     case PROCESSOR_SKYLAKE_AVX512:
       def_or_undef (parse_in, "__skylake_avx512");
       def_or_undef (parse_in, "__skylake_avx512__");
@@ -313,6 +317,9 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
     case PROCESSOR_KNM:
       def_or_undef (parse_in, "__tune_knm__");
       break;
+    case PROCESSOR_SKYLAKE:
+      def_or_undef (parse_in, "__tune_skylake__");
+      break;
     case PROCESSOR_SKYLAKE_AVX512:
       def_or_undef (parse_in, "__tune_skylake_avx512__");
       break;
index 99ac84e9ed4c4a4df3f2e1751414bdf5a22433a0..b62fdad992794584926548f8f11d5cd2c1a2500d 100644 (file)
@@ -144,6 +144,7 @@ const struct processor_costs *ix86_cost = NULL;
 #define m_SILVERMONT (HOST_WIDE_INT_1U<<PROCESSOR_SILVERMONT)
 #define m_KNL (HOST_WIDE_INT_1U<<PROCESSOR_KNL)
 #define m_KNM (HOST_WIDE_INT_1U<<PROCESSOR_KNM)
+#define m_SKYLAKE (HOST_WIDE_INT_1U<<PROCESSOR_SKYLAKE)
 #define m_SKYLAKE_AVX512 (HOST_WIDE_INT_1U<<PROCESSOR_SKYLAKE_AVX512)
 #define m_CANNONLAKE (HOST_WIDE_INT_1U<<PROCESSOR_CANNONLAKE)
 #define m_ICELAKE_CLIENT (HOST_WIDE_INT_1U<<PROCESSOR_ICELAKE_CLIENT)
@@ -859,6 +860,7 @@ static const struct ptt processor_target_table[PROCESSOR_max] =
   {"silvermont", &slm_cost, 16, 15, 16, 7, 16},
   {"knl", &slm_cost, 16, 15, 16, 7, 16},
   {"knm", &slm_cost, 16, 15, 16, 7, 16},
+  {"skylake", &skylake_cost, 16, 10, 16, 10, 16},
   {"skylake-avx512", &skylake_cost, 16, 10, 16, 10, 16},
   {"cannonlake", &skylake_cost, 16, 10, 16, 10, 16},
   {"icelake-client", &skylake_cost, 16, 10, 16, 10, 16},
@@ -3544,10 +3546,10 @@ ix86_option_override_internal (bool main_args_p,
       {"haswell", PROCESSOR_HASWELL, CPU_HASWELL, PTA_HASWELL},
       {"core-avx2", PROCESSOR_HASWELL, CPU_HASWELL, PTA_HASWELL},
       {"broadwell", PROCESSOR_HASWELL, CPU_HASWELL, PTA_BROADWELL},
-      {"skylake", PROCESSOR_HASWELL, CPU_HASWELL, PTA_SKYLAKE},
+      {"skylake", PROCESSOR_SKYLAKE, CPU_HASWELL, PTA_SKYLAKE},
       {"skylake-avx512", PROCESSOR_SKYLAKE_AVX512, CPU_HASWELL,
         PTA_SKYLAKE_AVX512},
-      {"cannonlake", PROCESSOR_SKYLAKE_AVX512, CPU_HASWELL, PTA_CANNONLAKE},
+      {"cannonlake", PROCESSOR_CANNONLAKE, CPU_HASWELL, PTA_CANNONLAKE},
       {"icelake-client", PROCESSOR_ICELAKE_CLIENT, CPU_HASWELL,
        PTA_ICELAKE_CLIENT},
       {"icelake-server", PROCESSOR_ICELAKE_SERVER, CPU_HASWELL,
@@ -32369,27 +32371,31 @@ get_builtin_code_for_version (tree decl, tree *predicate_list)
              priority = P_PROC_AVX;
              break;
            case PROCESSOR_HASWELL:
-           case PROCESSOR_SKYLAKE_AVX512:
-             if (new_target->x_ix86_isa_flags
-                       & OPTION_MASK_ISA_AVX512VBMI)
-               arg_str = "cannonlake";
-             else if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_AVX512VL)
-               arg_str = "skylake-avx512";
-             else if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_XSAVES)
-               arg_str = "skylake";
-             else if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_ADX)
+             if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_ADX)
                arg_str = "broadwell";
              else
                arg_str = "haswell";
              priority = P_PROC_AVX2;
              break;
+           case PROCESSOR_SKYLAKE:
+             arg_str = "skylake";
+             priority = P_PROC_AVX2;
+             break;
+           case PROCESSOR_SKYLAKE_AVX512:
+             arg_str = "skylake-avx512";
+             priority = P_PROC_AVX512F;
+             break;
+           case PROCESSOR_CANNONLAKE:
+             arg_str = "cannonlake";
+             priority = P_PROC_AVX512F;
+             break;
            case PROCESSOR_ICELAKE_CLIENT:
              arg_str = "icelake-client";
-             priority = P_PROC_AVX2;
+             priority = P_PROC_AVX512F;
              break;
            case PROCESSOR_ICELAKE_SERVER:
              arg_str = "icelake-server";
-             priority = P_PROC_AVX2;
+             priority = P_PROC_AVX512F;
              break;
            case PROCESSOR_BONNELL:
              arg_str = "bonnell";
index c7f9b4551b31c08528015fc4524d22fe00dcb36a..c9f19b66dcad785c517604d840a0e5f6d83cb29a 100644 (file)
@@ -385,6 +385,7 @@ extern const struct processor_costs ix86_size_cost;
 #define TARGET_SILVERMONT (ix86_tune == PROCESSOR_SILVERMONT)
 #define TARGET_KNL (ix86_tune == PROCESSOR_KNL)
 #define TARGET_KNM (ix86_tune == PROCESSOR_KNM)
+#define TARGET_SKYLAKE (ix86_tune == PROCESSOR_SKYLAKE)
 #define TARGET_SKYLAKE_AVX512 (ix86_tune == PROCESSOR_SKYLAKE_AVX512)
 #define TARGET_CANNONLAKE (ix86_tune == PROCESSOR_CANNONLAKE)
 #define TARGET_ICELAKE_CLIENT (ix86_tune == PROCESSOR_ICELAKE_CLIENT)
@@ -2267,6 +2268,7 @@ enum processor_type
   PROCESSOR_SILVERMONT,
   PROCESSOR_KNL,
   PROCESSOR_KNM,
+  PROCESSOR_SKYLAKE,
   PROCESSOR_SKYLAKE_AVX512,
   PROCESSOR_CANNONLAKE,
   PROCESSOR_ICELAKE_CLIENT,
index 8806b95bb3f486bb04840ca52b20f7148319e5ca..1aa8476339e3420596005db9b6fd58fc0549614e 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-16  Olga Makhotina  <olga.makhotina@intel.com>
+
+       PR target/84331
+       * gcc/testsuite/gcc.target/i386/funcspec-56.inc: Test arch=skylake.
+
 2018-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
            Jason Merrill  <jason@redhat.com>
 
index 35b287a6d781c624536e160c5463ac360b25ed49..4636631d5f09ae58311cd0f202a31e212a858cf3 100644 (file)
@@ -143,6 +143,7 @@ extern void test_arch_corei7_avx (void)             __attribute__((__target__("arch=corei7-
 extern void test_arch_core_avx2 (void)         __attribute__((__target__("arch=core-avx2")));
 extern void test_arch_knl (void)               __attribute__((__target__("arch=knl")));
 extern void test_arch_knm (void)               __attribute__((__target__("arch=knm")));
+extern void test_arch_skylake (void)           __attribute__((__target__("arch=skylake")));
 extern void test_arch_skylake_avx512 (void)    __attribute__((__target__("arch=skylake-avx512")));
 extern void test_arch_cannonlake (void)                __attribute__((__target__("arch=cannonlake")));
 extern void test_arch_icelake_client (void)    __attribute__((__target__("arch=icelake-client")));