https://gcc.gnu.org/g:a8192b59175e2cfcf665573d8168a8be09bdfa51

commit r15-7040-ga8192b59175e2cfcf665573d8168a8be09bdfa51
Author: Stefan Schulze Frielinghaus <stefa...@linux.ibm.com>
Date:   Mon Jan 20 10:01:08 2025 +0100

    s390: arch15: Prepare for a future architecture
    
    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.

Diff:
---
 gcc/common/config/s390/s390-common.cc  |  6 +++++-
 gcc/config.gcc                         |  2 +-
 gcc/config/s390/driver-native.cc       |  2 +-
 gcc/config/s390/s390-opts.h            |  1 +
 gcc/config/s390/s390.cc                |  4 ++++
 gcc/config/s390/s390.h                 | 19 ++++++++++++++++++-
 gcc/config/s390/s390.md                | 10 +++++++++-
 gcc/config/s390/s390.opt               |  3 +++
 gcc/testsuite/gcc.target/s390/s390.exp |  3 +++
 9 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/gcc/common/config/s390/s390-common.cc 
b/gcc/common/config/s390/s390-common.cc
index b723871e68b9..4b0691d5a16f 100644
--- a/gcc/common/config/s390/s390-common.cc
+++ b/gcc/common/config/s390/s390-common.cc
@@ -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
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 371143e4f8d4..82227e86521c 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -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
                                ;;
                        *)
diff --git a/gcc/config/s390/driver-native.cc b/gcc/config/s390/driver-native.cc
index c6b56933654a..49e8fa01a19b 100644
--- a/gcc/config/s390/driver-native.cc
+++ b/gcc/config/s390/driver-native.cc
@@ -128,7 +128,7 @@ s390_host_detect_local_cpu (int argc, const char **argv)
              cpu = "arch14";
              break;
            default:
-             cpu = "arch14";
+             cpu = "arch15";
              break;
            }
        }
diff --git a/gcc/config/s390/s390-opts.h b/gcc/config/s390/s390-opts.h
index c100725de32a..437d3b9e4c79 100644
--- a/gcc/config/s390/s390-opts.h
+++ b/gcc/config/s390/s390-opts.h
@@ -39,6 +39,7 @@ enum processor_type
   PROCESSOR_3906_Z14,
   PROCESSOR_8561_Z15,
   PROCESSOR_3931_Z16,
+  PROCESSOR_ARCH15,
   PROCESSOR_NATIVE,
   PROCESSOR_max
 };
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index f166a8a07dd9..327e44c80784 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -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;
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index d7fe6995bd48..2f5b95fa2b84 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -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
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 5cab7aff0c00..6a660f108b79 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -521,7 +521,7 @@
   (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" ""
@@ -594,6 +594,14 @@
          (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)))
 
diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt
index 94157f8c454a..f064597f8367 100644
--- a/gcc/config/s390/s390.opt
+++ b/gcc/config/s390/s390.opt
@@ -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
 
diff --git a/gcc/testsuite/gcc.target/s390/s390.exp 
b/gcc/testsuite/gcc.target/s390/s390.exp
index 3764b8966865..fbb3c17c3ad6 100644
--- a/gcc/testsuite/gcc.target/s390/s390.exp
+++ b/gcc/testsuite/gcc.target/s390/s390.exp
@@ -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}]] \

Reply via email to