]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
s390: arch15: Prepare for a future architecture
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Mon, 20 Jan 2025 09:01:08 +0000 (10:01 +0100)
committerStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
Mon, 20 Jan 2025 09:01:08 +0000 (10:01 +0100)
gcc/ChangeLog:

* common/config/s390/s390-common.cc: Add arch15 processor flags.
* config.gcc: Add arch15 for options --with-{arch,mtune}.
* config/s390/driver-native.cc (s390_host_detect_local_cpu):
Default to arch15.
* config/s390/s390-opts.h (enum processor_type): Add
PROCESSOR_ARCH15.
* config/s390/s390.cc (processor_table,s390_issue_rate,
s390_get_sched_attrmask,s390_get_unit_mask): Add arch15.
* config/s390/s390.h (enum processor_flags): Add processor flags
for VXE3 and ARCH15.
(TARGET_CPU_VXE3): Define.
(TARGET_CPU_VXE3_P): Define.
(TARGET_CPU_ARCH15): Define.
(TARGET_CPU_ARCH15_P): Define.
(TARGET_VXE3): Define.
(TARGET_VXE3_P): Define.
(TARGET_ARCH15): Define.
(TARGET_ARCH15_P): Define.
* config/s390/s390.md: Add VXE3 and ARCH15 to cpu_facility, and
let attribute "enabled" deal with them.
* config/s390/s390.opt: Add arch15.

gcc/testsuite/ChangeLog:

* gcc.target/s390/s390.exp: Set compiler flags for the vxe3
subdirectory of the testsuite as done e.g. for vxe2.

gcc/common/config/s390/s390-common.cc
gcc/config.gcc
gcc/config/s390/driver-native.cc
gcc/config/s390/s390-opts.h
gcc/config/s390/s390.cc
gcc/config/s390/s390.h
gcc/config/s390/s390.md
gcc/config/s390/s390.opt
gcc/testsuite/gcc.target/s390/s390.exp

index b723871e68b97c1256aaaaf290ba49f819154f3d..4b0691d5a16fa8a0b97c3ff7421cb08d71a1cea6 100644 (file)
@@ -53,7 +53,11 @@ EXPORTED_CONST int processor_flags_table[] =
     /* z16 */    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_Z15
-                | PF_NNPA | PF_Z16
+                | PF_NNPA | PF_Z16,
+    /* arch15 */ 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_Z15
+                | PF_NNPA | PF_Z16 | PF_VXE3 | PF_ARCH15
   };
 
 /* Change optimizations to be performed, depending on the
index 371143e4f8d4dfcb9d9ab2ab77507a694e607b70..82227e86521c4a264bb0a7331ec6db98e7cf0b5d 100644 (file)
@@ -5757,7 +5757,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 | z15 | z16 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 | arch14 )
+                       "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | z15 | z16 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 | arch14 | arch15 )
                                # OK
                                ;;
                        *)
index c6b56933654ab696d8263c42872466f80d2758a7..49e8fa01a19b3d0e817b196a5c53e750d09c49ac 100644 (file)
@@ -128,7 +128,7 @@ s390_host_detect_local_cpu (int argc, const char **argv)
              cpu = "arch14";
              break;
            default:
-             cpu = "arch14";
+             cpu = "arch15";
              break;
            }
        }
index c100725de32aab2eb6844d29b66920736b46f96e..437d3b9e4c79c8bea4fd41545dff406248961c75 100644 (file)
@@ -39,6 +39,7 @@ enum processor_type
   PROCESSOR_3906_Z14,
   PROCESSOR_8561_Z15,
   PROCESSOR_3931_Z16,
+  PROCESSOR_ARCH15,
   PROCESSOR_NATIVE,
   PROCESSOR_max
 };
index f166a8a07dd964df4848e6d4ad6f5b1a29737887..327e44c80784e766dc19e2ffd8d7994e8d8ae75e 100644 (file)
@@ -342,6 +342,7 @@ const struct s390_processor processor_table[] =
   { "z14",    "arch12", PROCESSOR_3906_Z14,    &zEC12_cost,  12 },
   { "z15",    "arch13", PROCESSOR_8561_Z15,    &zEC12_cost,  13 },
   { "z16",    "arch14", PROCESSOR_3931_Z16,    &zEC12_cost,  14 },
+  { "arch15", "",       PROCESSOR_ARCH15,      &zEC12_cost,  15 },
   { "native", "",       PROCESSOR_NATIVE,      NULL,         0  }
 };
 
@@ -9163,6 +9164,7 @@ s390_issue_rate (void)
     case PROCESSOR_3906_Z14:
     case PROCESSOR_8561_Z15:
     case PROCESSOR_3931_Z16:
+    case PROCESSOR_ARCH15:
     default:
       return 1;
     }
@@ -15590,6 +15592,7 @@ s390_get_sched_attrmask (rtx_insn *insn)
        mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO;
       break;
     case PROCESSOR_3931_Z16:
+    case PROCESSOR_ARCH15:
       if (get_attr_z16_cracked (insn))
        mask |= S390_SCHED_ATTR_MASK_CRACKED;
       if (get_attr_z16_expanded (insn))
@@ -15648,6 +15651,7 @@ s390_get_unit_mask (rtx_insn *insn, int *units)
        mask |= 1 << 3;
       break;
     case PROCESSOR_3931_Z16:
+    case PROCESSOR_ARCH15:
       *units = 4;
       if (get_attr_z16_unit_lsu (insn))
        mask |= 1 << 0;
index d7fe6995bd488908e9796d9e267ed70b9c939ecd..2f5b95fa2b843b53ead50aa6fa846e20aa3a91ee 100644 (file)
@@ -43,7 +43,9 @@ enum processor_flags
   PF_VXE2 = 8192,
   PF_Z15 = 16384,
   PF_NNPA = 32768,
-  PF_Z16 = 65536
+  PF_Z16 = 65536,
+  PF_VXE3 = 131072,
+  PF_ARCH15 = 262144
 };
 
 /* This is necessary to avoid a warning about comparing different enum
@@ -118,6 +120,14 @@ enum processor_flags
        (s390_arch_flags & PF_NNPA)
 #define TARGET_CPU_NNPA_P(opts) \
        (opts->x_s390_arch_flags & PF_NNPA)
+#define TARGET_CPU_VXE3 \
+       (s390_arch_flags & PF_VXE3)
+#define TARGET_CPU_VXE3_P(opts) \
+       (opts->x_s390_arch_flags & PF_VXE3)
+#define TARGET_CPU_ARCH15 \
+       (s390_arch_flags & PF_ARCH15)
+#define TARGET_CPU_ARCH15_P(opts) \
+       (opts->x_s390_arch_flags & PF_ARCH15)
 
 #define TARGET_HARD_FLOAT_P(opts) (!TARGET_SOFT_FLOAT_P(opts))
 
@@ -184,6 +194,13 @@ enum processor_flags
        (TARGET_ZARCH && TARGET_CPU_NNPA)
 #define TARGET_NNPA_P(opts)                                            \
        (TARGET_ZARCH_P (opts) && TARGET_CPU_NNPA_P (opts))
+#define TARGET_VXE3 \
+       (TARGET_VX && TARGET_CPU_VXE3)
+#define TARGET_VXE3_P(opts)                                            \
+       (TARGET_VX_P (opts) && TARGET_CPU_VXE3_P (opts))
+#define TARGET_ARCH15 (TARGET_ZARCH && TARGET_CPU_ARCH15)
+#define TARGET_ARCH15_P(opts)                                          \
+       (TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_ARCH15_P (opts))
 
 #if defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13)
 #define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z13
index 5cab7aff0c00578f63bd163634597f0cba452833..6a660f108b79630bde14987f6403b25dd84f5728 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,z15,vxe2,z16,nnpa"
+  "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe,z15,vxe2,z16,nnpa,vxe3,arch15"
   (const_string "standard"))
 
 (define_attr "enabled" ""
          (and (eq_attr "cpu_facility" "nnpa")
              (match_test "TARGET_NNPA"))
         (const_int 1)
+
+        (and (eq_attr "cpu_facility" "vxe3")
+             (match_test "TARGET_VXE3"))
+        (const_int 1)
+
+        (and (eq_attr "cpu_facility" "arch15")
+             (match_test "TARGET_ARCH15"))
+        (const_int 1)
 ]
        (const_int 0)))
 
index 94157f8c454a74b34709ffd08b0fb0053e6736d5..f064597f8367046763983d1903bb67c373f62454 100644 (file)
@@ -121,6 +121,9 @@ Enum(processor_type) String(arch14) Value(PROCESSOR_3931_Z16)
 EnumValue
 Enum(processor_type) String(z16) Value(PROCESSOR_3931_Z16)
 
+EnumValue
+Enum(processor_type) String(arch15) Value(PROCESSOR_ARCH15)
+
 EnumValue
 Enum(processor_type) String(native) Value(PROCESSOR_NATIVE) DriverOnly
 
index 3764b896686563bf249557e1b7761420389d8310..fbb3c17c3ad6dbcb98b0ac8ab6957d53cdd3ed6c 100644 (file)
@@ -257,6 +257,9 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vxe/*.{c,S}]] \
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vxe2/*.{c,S}]] \
        "" "-O3 -march=arch13 -mzarch"
 
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vxe3/*.{c,S}]] \
+       "" "-O3 -march=arch15 -mzarch"
+
 # Some md tests require libatomic
 atomic_init
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/md/*.{c,S}]] \