S/390: arch13: Add arch13 as architecture option
authorAndreas Krebbel <krebbel@linux.ibm.com>
Tue, 2 Apr 2019 10:50:03 +0000 (10:50 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Tue, 2 Apr 2019 10:50:03 +0000 (10:50 +0000)
This patch enables the command line options and provides the proper
macros for checking.

gcc/ChangeLog:

2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>

* common/config/s390/s390-common.c (processor_flags_table): New
entry for arch13.
* config.gcc: Support arch13 with the --with-arch= configure flag.
* config/s390/driver-native.c (s390_host_detect_local_cpu):
* config/s390/s390-opts.h (enum processor_type): Add PROCESSOR_ARCH13.
* config/s390/s390.c (s390_get_sched_attrmask)
(s390_get_unit_mask): Add PROCESSOR_ARCH13.
* config/s390/s390.h (enum processor_flags): Add PF_VXE2 and PF_ARCH13.
* config/s390/s390.md (TARGET_CPU_ARCH13, TARGET_CPU_ARCH13_P)
(TARGET_CPU_VXE2, TARGET_CPU_VXE2_P, TARGET_ARCH13)
(TARGET_ARCH13_P, TARGET_VXE2, TARGET_VXE2_P): New macro
definitions.
* config/s390/s390.opt: Support arch13 as processor type in
command line options.

gcc/testsuite/ChangeLog:

2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/s390.exp: Run tests in arch13 subdir.
* lib/target-supports.exp (check_effective_target_s390_vxe2): New
runtime check for the vxe2 hardware feature on IBM Z.

From-SVN: r270077

12 files changed:
gcc/ChangeLog
gcc/common/config/s390/s390-common.c
gcc/config.gcc
gcc/config/s390/driver-native.c
gcc/config/s390/s390-opts.h
gcc/config/s390/s390.c
gcc/config/s390/s390.h
gcc/config/s390/s390.md
gcc/config/s390/s390.opt
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/s390.exp
gcc/testsuite/lib/target-supports.exp

index 63c1223c67bcaaed9baf2a66b6426e50ba3afc0a..2ab9586762e1fc0c27507060441c07b1a8dee99c 100644 (file)
@@ -1,3 +1,20 @@
+2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>
+
+       * common/config/s390/s390-common.c (processor_flags_table): New
+       entry for arch13.
+       * config.gcc: Support arch13 with the --with-arch= configure flag.
+       * config/s390/driver-native.c (s390_host_detect_local_cpu):
+       * config/s390/s390-opts.h (enum processor_type): Add PROCESSOR_ARCH13.
+       * config/s390/s390.c (s390_get_sched_attrmask)
+       (s390_get_unit_mask): Add PROCESSOR_ARCH13.
+       * config/s390/s390.h (enum processor_flags): Add PF_VXE2 and PF_ARCH13.
+       * config/s390/s390.md (TARGET_CPU_ARCH13, TARGET_CPU_ARCH13_P)
+       (TARGET_CPU_VXE2, TARGET_CPU_VXE2_P, TARGET_ARCH13)
+       (TARGET_ARCH13_P, TARGET_VXE2, TARGET_VXE2_P): New macro
+       definitions.
+       * config/s390/s390.opt: Support arch13 as processor type in
+       command line options.
+
 2019-04-02  Martin Liska  <mliska@suse.cz>
 
        PR translation/89912
index 95699fb3734e987e74806a6c4e334a725d055211..f9c3a95f897d2fe8da12c19c4e4f133be1cd5b79 100644 (file)
@@ -32,21 +32,24 @@ EXPORTED_CONST int processor_flags_table[] =
     /* z900 */   PF_IEEE_FLOAT | PF_ZARCH,
     /* z990 */   PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT,
     /* z9-109 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM,
+                | PF_EXTIMM,
     /* z9-ec */  PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP,
+                | PF_EXTIMM | PF_DFP,
     /* z10 */    PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP | PF_Z10,
+                | PF_EXTIMM | PF_DFP | PF_Z10,
     /* z196 */   PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196,
+                | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196,
     /* zEC12 */  PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX,
+                | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX,
     /* z13 */    PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
-                 | PF_Z13 | PF_VX,
+                | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
+                | PF_Z13 | PF_VX,
     /* z14 */    PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
-                 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
-                 | PF_Z13 | PF_VX | PF_VXE | PF_Z14
+                | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
+                | PF_Z13 | PF_VX | PF_VXE | PF_Z14,
+    /* arch13 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
+                | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
+                | PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_ARCH13
   };
 
 /* Change optimizations to be performed, depending on the
index 3eb2e800fc53683fcdb0fcbdfb7a2f45f217d96f..0a8830a0d57f3d294ab7da82339ace590d57d432 100644 (file)
@@ -4727,7 +4727,7 @@ case "${target}" in
                for which in arch tune; do
                        eval "val=\$with_$which"
                        case ${val} in
-                       "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12)
+                       "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 )
                                # OK
                                ;;
                        *)
index 95b85f07785bc4b3a86ec18c730a9ff1b61dbae0..0352a79868abbac1bf226fb590fce63a74ae94b4 100644 (file)
@@ -120,7 +120,7 @@ s390_host_detect_local_cpu (int argc, const char **argv)
              cpu = "z14";
              break;
            default:
-             cpu = "z14";
+             cpu = "arch13";
              break;
            }
        }
index e58eee4c67d77789f819f706303cd3c945a98a9a..db9dc62971402a190e52353cb4a39d876419b2f7 100644 (file)
@@ -37,6 +37,7 @@ enum processor_type
   PROCESSOR_2827_ZEC12,
   PROCESSOR_2964_Z13,
   PROCESSOR_3906_Z14,
+  PROCESSOR_ARCH13,
   PROCESSOR_NATIVE,
   PROCESSOR_max
 };
index 5f26437bed907e43c664c347cfc71ad2b3d4750c..5c55ebe32981e9ad3c28d8ce72bb7b744d44bd7f 100644 (file)
@@ -337,6 +337,7 @@ const struct s390_processor processor_table[] =
   { "zEC12",  "zEC12",  PROCESSOR_2827_ZEC12,  &zEC12_cost,  10 },
   { "z13",    "z13",    PROCESSOR_2964_Z13,    &zEC12_cost,  11 },
   { "z14",    "arch12", PROCESSOR_3906_Z14,    &zEC12_cost,  12 },
+  { "arch13", "",       PROCESSOR_ARCH13,      &zEC12_cost,  13 },
   { "native", "",       PROCESSOR_NATIVE,      NULL,         0  }
 };
 
@@ -14313,6 +14314,7 @@ s390_get_sched_attrmask (rtx_insn *insn)
        mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO;
       break;
     case PROCESSOR_3906_Z14:
+    case PROCESSOR_ARCH13:
       if (get_attr_z14_cracked (insn))
        mask |= S390_SCHED_ATTR_MASK_CRACKED;
       if (get_attr_z14_expanded (insn))
@@ -14349,6 +14351,7 @@ s390_get_unit_mask (rtx_insn *insn, int *units)
        mask |= 1 << 3;
       break;
     case PROCESSOR_3906_Z14:
+    case PROCESSOR_ARCH13:
       *units = 4;
       if (get_attr_z14_unit_lsu (insn))
        mask |= 1 << 0;
index fcb85d653a25d75f06dd18652cdd91a50930bfd3..c7aa67c83ce0dc311ccd01f1a9e73bdb335d7f2a 100644 (file)
@@ -39,7 +39,9 @@ enum processor_flags
   PF_Z13 = 512,
   PF_VX = 1024,
   PF_Z14 = 2048,
-  PF_VXE = 4096
+  PF_VXE = 4096,
+  PF_VXE2 = 8192,
+  PF_ARCH13 = 16384
 };
 
 /* This is necessary to avoid a warning about comparing different enum
@@ -98,6 +100,14 @@ enum processor_flags
        (s390_arch_flags & PF_VXE)
 #define TARGET_CPU_VXE_P(opts) \
        (opts->x_s390_arch_flags & PF_VXE)
+#define TARGET_CPU_ARCH13 \
+       (s390_arch_flags & PF_ARCH13)
+#define TARGET_CPU_ARCH13_P(opts) \
+       (opts->x_s390_arch_flags & PF_ARCH13)
+#define TARGET_CPU_VXE2 \
+       (s390_arch_flags & PF_VXE2)
+#define TARGET_CPU_VXE2_P(opts) \
+       (opts->x_s390_arch_flags & PF_VXE2)
 
 #define TARGET_HARD_FLOAT_P(opts) (!TARGET_SOFT_FLOAT_P(opts))
 
@@ -150,6 +160,13 @@ enum processor_flags
        (TARGET_VX && TARGET_CPU_VXE)
 #define TARGET_VXE_P(opts)                                             \
        (TARGET_VX_P (opts) && TARGET_CPU_VXE_P (opts))
+#define TARGET_ARCH13 (TARGET_ZARCH && TARGET_CPU_ARCH13)
+#define TARGET_ARCH13_P(opts)                                          \
+       (TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_ARCH13_P (opts))
+#define TARGET_VXE2                                    \
+       (TARGET_VX && TARGET_CPU_VXE2)
+#define TARGET_VXE2_P(opts)                                            \
+       (TARGET_VX_P (opts) && TARGET_CPU_VXE2_P (opts))
 
 #ifdef HAVE_AS_MACHINE_MACHINEMODE
 #define S390_USE_TARGET_ATTRIBUTE 1
index b455b638134e6bf1a832415535f1da53c04d9f8c..bbe1ea5f01ccbb6a58333652fc3eea9af6fc3b09 100644 (file)
   (const (symbol_ref "s390_tune_attr")))
 
 (define_attr "cpu_facility"
-  "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe"
+  "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe,arch13,vxe2"
   (const_string "standard"))
 
 (define_attr "enabled" ""
          (and (eq_attr "cpu_facility" "vxe")
              (match_test "TARGET_VXE"))
         (const_int 1)
+
+        (and (eq_attr "cpu_facility" "arch13")
+             (match_test "TARGET_ARCH13"))
+        (const_int 1)
+
+         (and (eq_attr "cpu_facility" "vxe2")
+             (match_test "TARGET_VXE2"))
+        (const_int 1)
         ]
        (const_int 0)))
 
index b6d987cf52ad9d33d6f2028384f5371d76270f6d..0fb738fb261363435fc4aa50e16960a19e310aed 100644 (file)
@@ -109,6 +109,9 @@ Enum(processor_type) String(z14) Value(PROCESSOR_3906_Z14)
 EnumValue
 Enum(processor_type) String(arch12) Value(PROCESSOR_3906_Z14)
 
+EnumValue
+Enum(processor_type) String(arch13) Value(PROCESSOR_ARCH13)
+
 EnumValue
 Enum(processor_type) String(native) Value(PROCESSOR_NATIVE) DriverOnly
 
index 54b2e39f9573ab6bef36b00b5c41e92f87bb8cb7..35eb6fe09ce5021ebe7ea066d338202e01fbbfbc 100644 (file)
@@ -1,3 +1,9 @@
+2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>
+
+       * gcc.target/s390/s390.exp: Run tests in arch13 subdir.
+       * lib/target-supports.exp (check_effective_target_s390_vxe2): New
+       runtime check for the vxe2 hardware feature on IBM Z.
+
 2019-04-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR testsuite/89907
index 4dfb8b5f40852a3b2dd41f8061b9cacfd1312ccd..86f7e4398eb8d94251ebd7062c85dac4e7dfe3b1 100644 (file)
@@ -215,6 +215,9 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/target-attribute/*.{c,S}]] \
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/arch12/*.{c,S}]] \
        "" "-O3 -march=arch12 -mzarch"
 
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/arch13/*.{c,S}]] \
+       "" "-O3 -march=arch13 -mzarch"
+
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vxe/*.{c,S}]] \
        "" "-O3 -march=arch12 -mzarch"
 
index 90efaea804d34d480ad752ff07faaf85f71fd51b..0dc1e184f55028e02fe08e37dea7c3ab412c23d0 100644 (file)
@@ -8961,6 +8961,22 @@ proc check_effective_target_s390_vxe { } {
     } "-march=z14 -mzarch" ]
 }
 
+# Same as above but for the arch13 vector enhancement facility. Test
+# is performed with the vector shift left double by bit instruction.
+proc check_effective_target_s390_vxe2 { } {
+    if ![istarget s390*-*-*] then {
+       return 0;
+    }
+
+    return [check_runtime s390_check_vxe2 {
+       int main (void)
+       {
+           asm ("vsld %%v24, %%v26, %%v28, 3" : : : "v24", "v26", "v28");
+           return 0;
+       }
+    } "-march=arch13 -mzarch" ]
+}
+
 #For versions of ARM architectures that have hardware div insn,
 #disable the divmod transform