Add avx5124vnniw/avx5124fmaps to target attributes
authorH.J. Lu <hjl@gcc.gnu.org>
Thu, 17 Nov 2016 22:18:23 +0000 (14:18 -0800)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 17 Nov 2016 22:18:23 +0000 (14:18 -0800)
gcc/

2016-11-17  Andrew Senkevich <andrew.senkevich@intel.com>

* config/i386/i386.c (processor_features): Add F_AVX5124VNNIW,
F_AVX5124FMAPS.
(isa_names_table): Handle new features.

gcc/testsuite/

2016-11-17  Andrew Senkevich <andrew.senkevich@intel.com>

* gcc.target/i386/builtin_target.c: Handle new "avx5124vnniw",
"avx5124fmaps".
* gcc.target/i386/funcspec-56.inc: Test new attributes.

libgcc/

2016-11-17  Andrew Senkevich <andrew.senkevich@intel.com>

* config/i386/cpuinfo.c (processor_features): Add
FEATURE_AVX5124VNNIW, FEATURE_AVX5124FMAPS.

From-SVN: r242570

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/builtin_target.c
gcc/testsuite/gcc.target/i386/funcspec-56.inc
libgcc/ChangeLog
libgcc/config/i386/cpuinfo.c

index f997b96b671996b8902dbc3d83044f9e901e621e..6132cdcf17714f6edfcb155dc9f6f37c5dceb647 100644 (file)
@@ -1,3 +1,90 @@
+2016-11-17  Andrew Senkevich <andrew.senkevich@intel.com>
+
+       * config/i386/i386.c (processor_features): Add F_AVX5124VNNIW,
+       F_AVX5124FMAPS.
+       (isa_names_table): Handle new features.
+
+2016-11-17  Kirill Yukhin  <kirill.yukhin@gmail.com>
+           Andrew Senkevich <andrew.senkevich@intel.com>
+
+       * common/config/i386/i386-common.c
+       (OPTION_MASK_ISA_AVX5124FMAPS_SET,
+       OPTION_MASK_ISA_AVX5124FMAPS_UNSET,
+       OPTION_MASK_ISA_AVX5124VNNIW_SET,
+       OPTION_MASK_ISA_AVX5124VNNIW_UNSET): New.
+       (ix86_handle_option): Handle OPT_mavx5124fmaps,
+       OPT_mavx5124vnniw.
+       * config.gcc: Add avx5124fmapsintrin.h, avx5124vnniwintrin.h.
+       * config/i386/avx5124fmapsintrin.h: New file.
+       * config/i386/avx5124vnniwintrin.h: Ditto.
+       * config/i386/constraints.md (h): New constraint.
+       * config/i386/cpuid.h: (bit_AVX5124VNNIW,
+       bit_AVX5124FMAPS): New.
+       * config/i386/driver-i386.c (host_detect_local_cpu):
+       Detect avx5124fmaps, avx5124vnniw.
+       * config/i386/i386-builtin-types.def: Add types
+       V16SF_FTYPE_V16SF_V16SF_V16SF_V16SF_V16SF_PCV4SF_V16SF_UHI,
+       V16SF_FTYPE_V16SF_V16SF_V16SF_V16SF_V16SF_PCV4SF,
+       V4SF_FTYPE_V4SF_V4SF_V4SF_V4SF_V4SF_PCV4SF,
+       V4SF_FTYPE_V4SF_V4SF_V4SF_V4SF_V4SF_PCV4SF_V4SF_UQI,
+       V16SI_FTYPE_V16SI_V16SI_V16SI_V16SI_V16SI_PCV4SI,
+       V16SI_FTYPE_V16SI_V16SI_V16SI_V16SI_V16SI_PCV4SI_V16SI_UHI.
+       * config/i386/i386-builtin.def (__builtin_ia32_4fmaddps_mask,
+       __builtin_ia32_4fmaddps, __builtin_ia32_4fmaddss,
+       __builtin_ia32_4fmaddss_mask, __builtin_ia32_4fnmaddps_mask,
+       __builtin_ia32_4fnmaddps, __builtin_ia32_4fnmaddss,
+       __builtin_ia32_4fnmaddss_mask, __builtin_ia32_vp4dpwssd,
+       __builtin_ia32_vp4dpwssd_mask, __builtin_ia32_vp4dpwssds,
+       __builtin_ia32_vp4dpwssds_mask): New.
+       * config/i386/i386-c.c (ix86_target_macros_internal):
+       Define __AVX5124FMAPS__, __AVX5124VNNIW__.
+       * config/i386/i386-modes.def: Fixed comment typos, added new
+       modes (VECTOR_MODES (FLOAT, 256), VECTOR_MODE (INT, SI, 64)).
+       * config/i386/i386.c (ix86_target_string): Add -mavx5124fmaps,
+       -mavx5124vnniw.
+       (PTA_AVX5124FMAPS, PTA_AVX5124VNNIW): Define.
+       (ix86_option_override_internal): Handle new options.
+       (ix86_valid_target_attribute_inner_p): Add avx5124fmaps,
+       avx5124vnniw.
+       (ix86_expand_builtin): Handle new builtins.
+       (ix86_additional_allocno_class_p): New.
+       * config/i386/i386.h (TARGET_AVX5124FMAPS,
+       TARGET_AVX5124FMAPS_P,
+       TARGET_AVX5124VNNIW,
+       TARGET_AVX5124VNNIW_P): Define.
+       (reg_class): Add MOD4_SSE_REGS.
+       (MOD4_SSE_REG_P, MOD4_SSE_REGNO_P): New.
+       * config/i386/i386.opt: Add mavx5124fmaps, mavx5124vnniw.
+       * config/i386/immintrin.h: Include avx5124fmapsintrin.h,
+       avx5124vnniwintrin.h.
+       * config/i386/sse.md (unspec): Add UNSPEC_VP4FMADD,
+       UNSPEC_VP4FNMADD,
+       UNSPEC_VP4DPWSSD, UNSPEC_VP4DPWSSDS.
+       (define_mode_iterator IMOD4): New.
+       (define_mode_attr imod4_narrow): Ditto.
+       (define_insn "mov<mode>"): Ditto.
+       (define_insn "avx5124fmaddps_4fmaddps"): Ditto.
+       (define_insn "avx5124fmaddps_4fmaddps_mask"): Ditto.
+       (define_insn "avx5124fmaddps_4fmaddps_maskz"): Ditto.
+       (define_insn "avx5124fmaddps_4fmaddss"): Ditto.
+       (define_insn "avx5124fmaddps_4fmaddss_mask"): Ditto.
+       (define_insn "avx5124fmaddps_4fmaddss_maskz"): Ditto.
+       (define_insn "avx5124fmaddps_4fnmaddps"): Ditto.
+       (define_insn "avx5124fmaddps_4fnmaddps_mask"): Ditto.
+       (define_insn "avx5124fmaddps_4fnmaddps_maskz"): Ditto.
+       (define_insn "avx5124fmaddps_4fnmaddss"): Ditto.
+       (define_insn "avx5124fmaddps_4fnmaddss_mask"): Ditto.
+       (define_insn "avx5124fmaddps_4fnmaddss_maskz"): Ditto.
+       (define_insn "avx5124vnniw_vp4dpwssd"): Ditto.
+       (define_insn "avx5124vnniw_vp4dpwssd_mask"): Ditto.
+       (define_insn "avx5124vnniw_vp4dpwssd_maskz"): Ditto.
+       (define_insn "avx5124vnniw_vp4dpwssds"): Ditto.
+       (define_insn "avx5124vnniw_vp4dpwssds_mask"): Ditto.
+       (define_insn "avx5124vnniw_vp4dpwssds_maskz"): Ditto.
+       * init-regs.c (initialize_uninitialized_regs): Add emit_clobber call.
+       * genmodes.c (mode_size_inline): Extend return type.
+       * machmode.h (mode_size, mode_base_align): Extend type.
+
 2016-11-17  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/78101
index 1da1abcaa49d71c16ba0660f0e1194204dbbd16e..823930d07f961a5e2a2d7397ad7669c077a4c956 100644 (file)
@@ -33205,6 +33205,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
     F_AVX512PF,
     F_AVX512VBMI,
     F_AVX512IFMA,
+    F_AVX5124VNNIW,
+    F_AVX5124FMAPS,
     F_MAX
   };
 
@@ -33317,6 +33319,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
       {"avx512pf",F_AVX512PF},
       {"avx512vbmi",F_AVX512VBMI},
       {"avx512ifma",F_AVX512IFMA},
+      {"avx5124vnniw",F_AVX5124VNNIW},
+      {"avx5124fmaps",F_AVX5124FMAPS},
     };
 
   tree __processor_model_type = build_processor_model_struct ();
index ed6b9a72bac7da7597876897d4cb2f8b159b421b..e84613fe5f744ce71accd48602b35e498109ab89 100644 (file)
@@ -1,3 +1,37 @@
+2016-11-17  Andrew Senkevich <andrew.senkevich@intel.com>
+
+       * gcc.target/i386/builtin_target.c: Handle new "avx5124vnniw",
+       "avx5124fmaps".
+       * gcc.target/i386/funcspec-56.inc: Test new attributes.
+
+2016-11-17  Kirill Yukhin  <kirill.yukhin@gmail.com>
+           Andrew Senkevich <andrew.senkevich@intel.com>
+
+       * gcc.target/i386/avx5124fmadd-v4fmaddps-1.c: New test.
+       * gcc.target/i386/avx5124fmadd-v4fmaddps-2.c: Ditto.
+       * gcc.target/i386/avx5124fmadd-v4fmaddss-1.c: Ditto.
+       * gcc.target/i386/avx5124fmadd-v4fnmaddps-1.c: Ditto.
+       * gcc.target/i386/avx5124fmadd-v4fnmaddps-2.c: Ditto.
+       * gcc.target/i386/avx5124fmadd-v4fnmaddss-1.c: Ditto.
+       * gcc.target/i386/avx5124fmaps-check.h: Ditto.
+       * gcc.target/i386/avx5124vnniw-check.h: Ditto.
+       * gcc.target/i386/avx5124vnniw-vp4dpwssd-1.c: Ditto.
+       * gcc.target/i386/avx5124vnniw-vp4dpwssd-2.c: Ditto.
+       * gcc.target/i386/avx5124vnniw-vp4dpwssds-1.c: Ditto.
+       * gcc.target/i386/avx5124vnniw-vp4dpwssds-2.c: Ditto.
+       * gcc.target/i386/avx512f-helper.h: Add avx5124fmaps-check.h,
+       avx5124vnniw-check.h.
+       * gcc.target/i386/i386.exp (check_effective_target_avx5124fmaps,
+       check_effective_target_avx5124vnniw): New.
+       * gcc.target/i386/m128-check.h (ESP_FLOAT, ESP_DOUBLE):
+       Set under ifndef.
+       * gcc.target/i386/sse-12.c: Add -mavx5124fmaps, -mavx5124vnniw.
+       * gcc.target/i386/sse-13.c: Ditto.
+       * g++.dg/other/i386-2.C: Ditto.
+       * g++.dg/other/i386-3.C: Ditto.
+       * gcc.target/i386/sse-22.c: Ditto.
+       * gcc.target/i386/sse-23.c: Ditto.
+
 2016-11-17  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/55080
index 8d45d83c89ab15643db3fcb94fa7aeba3fcac9d0..c620a7415ac65ff7672dcd058b520adf1796ad0f 100644 (file)
@@ -213,6 +213,10 @@ check_features (unsigned int ecx, unsigned int edx,
        assert (__builtin_cpu_supports ("avx512ifma"));
       if (ecx & bit_AVX512VBMI)
        assert (__builtin_cpu_supports ("avx512vbmi"));
+      if (edx & bit_AVX5124VNNIW)
+       assert (__builtin_cpu_supports ("avx5124vnniw"));
+      if (edx & bit_AVX5124FMAPS)
+       assert (__builtin_cpu_supports ("avx5124fmaps"));
     }
 }
 
@@ -311,6 +315,10 @@ quick_check ()
 
   assert (__builtin_cpu_supports ("avx512f") >= 0);
 
+  assert (__builtin_cpu_supports ("avx5124vnniw") >= 0);
+
+  assert (__builtin_cpu_supports ("avx5124fmaps") >= 0);
+
   /* Check CPU type.  */
   assert (__builtin_cpu_is ("amd") >= 0);
 
index 521ac8a5df842f00ec28c660bc263d111748c0c2..9334e9e3a274c096ed258749bf10844758694025 100644 (file)
@@ -28,6 +28,8 @@ extern void test_avx512dq(void)                       __attribute__((__target__("avx512dq")));
 extern void test_avx512er(void)                        __attribute__((__target__("avx512er")));
 extern void test_avx512pf(void)                        __attribute__((__target__("avx512pf")));
 extern void test_avx512cd(void)                        __attribute__((__target__("avx512cd")));
+extern void test_avx5124fmaps(void)             __attribute__((__target__("avx5124fmaps")));
+extern void test_avx5124vnniw(void)             __attribute__((__target__("avx5124vnniw")));
 extern void test_bmi (void)                    __attribute__((__target__("bmi")));
 extern void test_bmi2 (void)                   __attribute__((__target__("bmi2")));
 
@@ -59,6 +61,8 @@ extern void test_no_avx512dq(void)            __attribute__((__target__("no-avx512dq")));
 extern void test_no_avx512er(void)             __attribute__((__target__("no-avx512er")));
 extern void test_bo_avx512pf(void)             __attribute__((__target__("no-avx512pf")));
 extern void test_no_avx512cd(void)             __attribute__((__target__("no-avx512cd")));
+extern void test_no_avx5124fmaps(void)          __attribute__((__target__("no-avx5124fmaps")));
+extern void test_no_avx5124vnniw(void)          __attribute__((__target__("no-avx5124vnniw")));
 extern void test_no_bmi (void)                 __attribute__((__target__("no-bmi")));
 extern void test_no_bmi2 (void)                        __attribute__((__target__("no-bmi2")));
 
index b03a47c07f51d3ad2d31857c064365f2c2e24994..aff110d79165b864707bdd3da5692129aa50da13 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-17  Andrew Senkevich <andrew.senkevich@intel.com>
+
+       * config/i386/cpuinfo.c (processor_features): Add
+       FEATURE_AVX5124VNNIW, FEATURE_AVX5124FMAPS.
+
 2016-11-17  Claudiu Zissulescu  <claziss@synopsys.com>
 
        * config/arc/dp-hack.h (ARC_OPTFPE): Define.
index af203f2a37e433813d3889f6dde7688caafb2561..4a0ad254cd9a9248bdea381c223a3462655d6a26 100644 (file)
@@ -115,7 +115,9 @@ enum processor_features
   FEATURE_AVX512ER,
   FEATURE_AVX512PF,
   FEATURE_AVX512VBMI,
-  FEATURE_AVX512IFMA
+  FEATURE_AVX512IFMA,
+  FEATURE_AVX5124VNNIW,
+  FEATURE_AVX5124FMAPS
 };
 
 struct __processor_model
@@ -359,6 +361,10 @@ get_available_features (unsigned int ecx, unsigned int edx,
        features |= (1 << FEATURE_AVX512IFMA);
       if (ecx & bit_AVX512VBMI)
        features |= (1 << FEATURE_AVX512VBMI);
+      if (edx & bit_AVX5124VNNIW)
+       features |= (1 << FEATURE_AVX5124VNNIW);
+      if (edx & bit_AVX5124FMAPS)
+       features |= (1 << FEATURE_AVX5124FMAPS);
     }
 
   unsigned int ext_level;