public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-9880] IBM zSystems: Add support for z16 as CPU name.
@ 2022-04-14  9:38 Andreas Krebbel
  0 siblings, 0 replies; only message in thread
From: Andreas Krebbel @ 2022-04-14  9:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:36e93aab01202f99d7c49289ffa4321510962632

commit r11-9880-g36e93aab01202f99d7c49289ffa4321510962632
Author: Andreas Krebbel <krebbel@linux.ibm.com>
Date:   Wed Apr 13 07:41:08 2022 +0200

    IBM zSystems: Add support for z16 as CPU name.
    
    So far z16 was identified as arch14. After the machine has been
    announced we can now add the real name.
    
    gcc/ChangeLog:
    
            * common/config/s390/s390-common.c: Rename PF_ARCH14 to PF_Z16.
            * config.gcc: Add z16 as march/mtune switch.
            * config/s390/driver-native.c (s390_host_detect_local_cpu):
            Recognize z16 with -march=native.
            * config/s390/s390-opts.h (enum processor_type): Rename
            PROCESSOR_ARCH14 to PROCESSOR_3931_Z16.
            * config/s390/s390.c (PROCESSOR_ARCH14): Rename to ...
            (PROCESSOR_3931_Z16): ... throughout the file.
            (s390_processor processor_table): Add z16 as cpu string.
            * config/s390/s390.h (enum processor_flags): Rename PF_ARCH14 to
            PF_Z16.
            (TARGET_CPU_ARCH14): Rename to ...
            (TARGET_CPU_Z16): ... this.
            (TARGET_CPU_ARCH14_P): Rename to ...
            (TARGET_CPU_Z16_P): ... this.
            (TARGET_ARCH14): Rename to ...
            (TARGET_Z16): ... this.
            (TARGET_ARCH14_P): Rename to ...
            (TARGET_Z16_P): ... this.
            * config/s390/s390.md (cpu_facility): Rename arch14 to z16 and
            check TARGET_Z16 instead of TARGET_ARCH14.
            * config/s390/s390.opt: Add z16 to processor_type.
            * doc/invoke.texi: Document z16 and arch14.
    
    (cherry picked from commit 82a4c5c704433249aa2adc89ef58b6b70e50c930)

Diff:
---
 gcc/common/config/s390/s390-common.c |  4 ++--
 gcc/config.gcc                       |  2 +-
 gcc/config/s390/driver-native.c      |  6 +++++-
 gcc/config/s390/s390-opts.h          |  2 +-
 gcc/config/s390/s390.c               | 10 +++++-----
 gcc/config/s390/s390.h               | 16 ++++++++--------
 gcc/config/s390/s390.md              |  6 +++---
 gcc/config/s390/s390.opt             |  5 ++++-
 gcc/doc/invoke.texi                  |  3 ++-
 9 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
index b6bc8501742..2bde1b69c02 100644
--- a/gcc/common/config/s390/s390-common.c
+++ b/gcc/common/config/s390/s390-common.c
@@ -50,10 +50,10 @@ EXPORTED_CONST int processor_flags_table[] =
     /* z15 */    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,
-    /* arch14 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
+    /* 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_ARCH14
+		 | PF_NNPA | PF_Z16
   };
 
 /* Change optimizations to be performed, depending on the
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 5e33570a2bd..5636acc2270 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -5150,7 +5150,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 | 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 )
 				# OK
 				;;
 			*)
diff --git a/gcc/config/s390/driver-native.c b/gcc/config/s390/driver-native.c
index c0247154c0b..aa7acade6f2 100644
--- a/gcc/config/s390/driver-native.c
+++ b/gcc/config/s390/driver-native.c
@@ -123,8 +123,12 @@ s390_host_detect_local_cpu (int argc, const char **argv)
 	    case 0x8562:
 	      cpu = "z15";
 	      break;
+	    case 0x3931:
+	    case 0x3932:
+	      cpu = "z16";
+	      break;
 	    default:
-	      cpu = "arch14";
+	      cpu = "z16";
 	      break;
 	    }
 	}
diff --git a/gcc/config/s390/s390-opts.h b/gcc/config/s390/s390-opts.h
index 4141b4d36dd..6933413036c 100644
--- a/gcc/config/s390/s390-opts.h
+++ b/gcc/config/s390/s390-opts.h
@@ -38,7 +38,7 @@ enum processor_type
   PROCESSOR_2964_Z13,
   PROCESSOR_3906_Z14,
   PROCESSOR_8561_Z15,
-  PROCESSOR_ARCH14,
+  PROCESSOR_3931_Z16,
   PROCESSOR_NATIVE,
   PROCESSOR_max
 };
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 2d2e6522eb4..44e48d90beb 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -337,7 +337,7 @@ const struct s390_processor processor_table[] =
   { "z13",    "z13",    PROCESSOR_2964_Z13,    &zEC12_cost,  11 },
   { "z14",    "arch12", PROCESSOR_3906_Z14,    &zEC12_cost,  12 },
   { "z15",    "arch13", PROCESSOR_8561_Z15,    &zEC12_cost,  13 },
-  { "arch14", "arch14", PROCESSOR_ARCH14,      &zEC12_cost,  14 },
+  { "z16",    "arch14", PROCESSOR_3931_Z16,    &zEC12_cost,  14 },
   { "native", "",       PROCESSOR_NATIVE,      NULL,         0  }
 };
 
@@ -856,7 +856,7 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
 
       if ((bflags & B_NNPA) && !TARGET_NNPA)
 	{
-	  error ("Builtin %qF requires arch14 or higher.", fndecl);
+	  error ("Builtin %qF requires z16 or higher.", fndecl);
 	  return const0_rtx;
 	}
     }
@@ -8489,7 +8489,7 @@ s390_issue_rate (void)
     case PROCESSOR_2827_ZEC12:
     case PROCESSOR_2964_Z13:
     case PROCESSOR_3906_Z14:
-    case PROCESSOR_ARCH14:
+    case PROCESSOR_3931_Z16:
     default:
       return 1;
     }
@@ -14845,7 +14845,7 @@ s390_get_sched_attrmask (rtx_insn *insn)
 	mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO;
       break;
     case PROCESSOR_8561_Z15:
-    case PROCESSOR_ARCH14:
+    case PROCESSOR_3931_Z16:
       if (get_attr_z15_cracked (insn))
 	mask |= S390_SCHED_ATTR_MASK_CRACKED;
       if (get_attr_z15_expanded (insn))
@@ -14893,7 +14893,7 @@ s390_get_unit_mask (rtx_insn *insn, int *units)
 	mask |= 1 << 3;
       break;
     case PROCESSOR_8561_Z15:
-    case PROCESSOR_ARCH14:
+    case PROCESSOR_3931_Z16:
       *units = 4;
       if (get_attr_z15_unit_lsu (insn))
 	mask |= 1 << 0;
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index fb16a455a03..df5a8be86cc 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -43,7 +43,7 @@ enum processor_flags
   PF_VXE2 = 8192,
   PF_Z15 = 16384,
   PF_NNPA = 32768,
-  PF_ARCH14 = 65536
+  PF_Z16 = 65536
 };
 
 /* This is necessary to avoid a warning about comparing different enum
@@ -110,10 +110,10 @@ enum processor_flags
 	(s390_arch_flags & PF_VXE2)
 #define TARGET_CPU_VXE2_P(opts) \
 	(opts->x_s390_arch_flags & PF_VXE2)
-#define TARGET_CPU_ARCH14 \
-	(s390_arch_flags & PF_ARCH14)
-#define TARGET_CPU_ARCH14_P(opts) \
-	(opts->x_s390_arch_flags & PF_ARCH14)
+#define TARGET_CPU_Z16 \
+	(s390_arch_flags & PF_Z16)
+#define TARGET_CPU_Z16_P(opts) \
+	(opts->x_s390_arch_flags & PF_Z16)
 #define TARGET_CPU_NNPA \
 	(s390_arch_flags & PF_NNPA)
 #define TARGET_CPU_NNPA_P(opts) \
@@ -177,9 +177,9 @@ enum processor_flags
 	(TARGET_VX && TARGET_CPU_VXE2)
 #define TARGET_VXE2_P(opts)						\
 	(TARGET_VX_P (opts) && TARGET_CPU_VXE2_P (opts))
-#define TARGET_ARCH14 (TARGET_ZARCH && TARGET_CPU_ARCH14)
-#define TARGET_ARCH14_P(opts)						\
-	(TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_ARCH14_P (opts))
+#define TARGET_Z16 (TARGET_ZARCH && TARGET_CPU_Z16)
+#define TARGET_Z16_P(opts)						\
+	(TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_Z16_P (opts))
 #define TARGET_NNPA					\
 	(TARGET_ZARCH && TARGET_CPU_NNPA)
 #define TARGET_NNPA_P(opts)						\
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 5f817c52437..75d112f21eb 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -525,7 +525,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,arch14,nnpa"
+  "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe,z15,vxe2,z16,nnpa"
   (const_string "standard"))
 
 (define_attr "enabled" ""
@@ -591,8 +591,8 @@
 	      (match_test "TARGET_VXE2"))
 	 (const_int 1)
 
-	 (and (eq_attr "cpu_facility" "arch14")
-	      (match_test "TARGET_ARCH14"))
+	 (and (eq_attr "cpu_facility" "z16")
+	      (match_test "TARGET_Z16"))
 	 (const_int 1)
 
          (and (eq_attr "cpu_facility" "nnpa")
diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt
index 1027f6ab33d..d5d2a9c7091 100644
--- a/gcc/config/s390/s390.opt
+++ b/gcc/config/s390/s390.opt
@@ -116,7 +116,10 @@ EnumValue
 Enum(processor_type) String(arch13) Value(PROCESSOR_8561_Z15)
 
 EnumValue
-Enum(processor_type) String(arch14) Value(PROCESSOR_ARCH14)
+Enum(processor_type) String(arch14) Value(PROCESSOR_3931_Z16)
+
+EnumValue
+Enum(processor_type) String(z16) Value(PROCESSOR_3931_Z16)
 
 EnumValue
 Enum(processor_type) String(native) Value(PROCESSOR_NATIVE) DriverOnly
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index f3168f2ebab..9f5b40cabbc 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -28488,7 +28488,8 @@ system representing a certain processor type.  Possible values for
 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11},
-@samp{z14}/@samp{arch12}, @samp{z15}/@samp{arch13}, and @samp{native}.
+@samp{z14}/@samp{arch12}, @samp{z15}/@samp{arch13},
+@samp{z16}/@samp{arch14}, and @samp{native}.
 
 The default is @option{-march=z900}.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-14  9:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14  9:38 [gcc r11-9880] IBM zSystems: Add support for z16 as CPU name Andreas Krebbel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).