33fa5a
From d249a8128806d08285eeda00b2a35b62a22236f4 Mon Sep 17 00:00:00 2001
33fa5a
From: Andreas Arnez <arnez@linux.ibm.com>
33fa5a
Date: Thu, 26 Mar 2020 17:14:49 +0100
33fa5a
Subject: [PATCH 8/8] Add IBM z15 support
33fa5a
33fa5a
Add support for specifying "IBMz15" as target architecture.
33fa5a
---
33fa5a
 CONFIG/include/atlconf.h            | 8 ++++----
33fa5a
 CONFIG/src/atlcomp.txt              | 4 ++++
33fa5a
 CONFIG/src/backend/archinfo_linux.c | 1 +
33fa5a
 CONFIG/src/probe_comp.c             | 1 +
33fa5a
 include/atlas_prefetch.h            | 2 +-
33fa5a
 5 files changed, 11 insertions(+), 5 deletions(-)
33fa5a
33fa5a
diff --git a/CONFIG/include/atlconf.h b/CONFIG/include/atlconf.h
33fa5a
index 3828fdb..382601f 100644
33fa5a
--- a/CONFIG/include/atlconf.h
33fa5a
+++ b/CONFIG/include/atlconf.h
33fa5a
@@ -25,11 +25,11 @@ enum ARCHFAM {AFOther=0, AFPPC, AFSPARC, AFALPHA, AFX86, AFIA64, AFMIPS,
33fa5a
  * Corei3EP: v3 Haswell, E5-26XX
33fa5a
  * Corei4: skylake
33fa5a
  */
33fa5a
-#define NMACH 63
33fa5a
+#define NMACH 64
33fa5a
 static char *machnam[NMACH] =
33fa5a
    {"UNKNOWN", "PPCG4", "PPCG5", "POWER3", "POWER4", "POWER5",
33fa5a
     "POWER6", "POWER7", "POWER8", "POWERe6500",
33fa5a
-    "IBMz9", "IBMz10", "IBMz196", "IBMz12", "IBMz13", "IBMz14",
33fa5a
+    "IBMz9", "IBMz10", "IBMz196", "IBMz12", "IBMz13", "IBMz14", "IBMz15",
33fa5a
     "x86x87", "x86SSE1", "x86SSE2", "x86SSE3",
33fa5a
     "P5", "P5MMX", "PPRO", "PII", "PIII", "PM", "CoreSolo",
33fa5a
     "CoreDuo", "Core2Solo", "Core2", "Corei1", "Corei2", "Corei3",
33fa5a
@@ -42,7 +42,7 @@ static char *machnam[NMACH] =
33fa5a
     "ARM64xgene1", "ARM64a53", "ARM64a57"};
33fa5a
 enum MACHTYPE {MACHOther, PPCG4, PPCG5, IbmPwr3, IbmPwr4, IbmPwr5,
33fa5a
                IbmPwr6, IbmPwr7, IbmPwr8, Pwre6500,
33fa5a
-               IbmZ9, IbmZ10, IbmZ196, IbmZ12, IbmZ13, IbmZ14, /* s390(x) */
33fa5a
+               IbmZ9, IbmZ10, IbmZ196, IbmZ12, IbmZ13, IbmZ14, IbmZ15,
33fa5a
                x86x87, x86SSE1, x86SSE2, x86SSE3, /* generic targets */
33fa5a
                IntP5, IntP5MMX, IntPPRO, IntPII, IntPIII, IntPM, IntCoreS,
33fa5a
                IntCoreDuo, IntCore2Solo, IntCore2, IntCorei1, IntCorei2,
33fa5a
@@ -82,7 +82,7 @@ enum MACHTYPE {MACHOther, PPCG4, PPCG5, IbmPwr3, IbmPwr4, IbmPwr5,
33fa5a
 #define MachIsARM64(mach_) \
33fa5a
    ( (mach_) >= ARM64xg && || (mach_) <= ARM64a57)
33fa5a
 #define MachIsS390(mach_) \
33fa5a
-   ( (mach_) >= IbmZ9 && (mach_) <= IbmZ14 )
33fa5a
+   ( (mach_) >= IbmZ9 && (mach_) <= IbmZ15 )
33fa5a
 
33fa5a
 
33fa5a
 static char *f2c_namestr[5] = {"UNKNOWN","Add_", "Add__", "NoChange", "UpCase"};
33fa5a
diff --git a/CONFIG/src/atlcomp.txt b/CONFIG/src/atlcomp.txt
33fa5a
index 2cfacc2..acb2c83 100644
33fa5a
--- a/CONFIG/src/atlcomp.txt
33fa5a
+++ b/CONFIG/src/atlcomp.txt
33fa5a
@@ -254,6 +254,10 @@ MACH=IBMz14 OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc,xcc,gcc
33fa5a
    'gcc' '-march=z14 -mtune=z14 -O2'
33fa5a
 MACH=IBMz14 OS=ALL LVL=1000 COMPS=f77
33fa5a
    'gfortran' '-march=z14 -mtune=z14 -O2'
33fa5a
+MACH=IBMz15 OS=ALL LVL=1000 COMPS=smc,dmc,skc,dkc,icc,xcc,gcc
33fa5a
+   'gcc' '-march=arch13 -mtune=arch13 -O2'
33fa5a
+MACH=IBMz15 OS=ALL LVL=1000 COMPS=f77
33fa5a
+   'gfortran' '-march=arch13 -mtune=arch13 -O2'
33fa5a
 #
33fa5a
 # Windows defaults ; need to make SSE/SSE2 arch dep.
33fa5a
 #
33fa5a
diff --git a/CONFIG/src/backend/archinfo_linux.c b/CONFIG/src/backend/archinfo_linux.c
33fa5a
index ed6f476..934a005 100644
33fa5a
--- a/CONFIG/src/backend/archinfo_linux.c
33fa5a
+++ b/CONFIG/src/backend/archinfo_linux.c
33fa5a
@@ -337,6 +337,7 @@ enum MACHTYPE ProbeArch()
33fa5a
          else if (strstr(res, "2827") || strstr(res, "2828")) mach = IbmZ12;
33fa5a
          else if (strstr(res, "2964") || strstr(res, "2965")) mach = IbmZ13;
33fa5a
          else if (strstr(res, "3906") || strstr(res, "3907")) mach = IbmZ14;
33fa5a
+         else if (strstr(res, "8561") || strstr(res, "8562")) mach = IbmZ15;
33fa5a
          else mach = IbmZ14;  /* looks risky to me, but IBM folks did it */
33fa5a
          free(res);
33fa5a
       }
33fa5a
diff --git a/CONFIG/src/probe_comp.c b/CONFIG/src/probe_comp.c
33fa5a
index 857ea82..88bb25e 100644
33fa5a
--- a/CONFIG/src/probe_comp.c
33fa5a
+++ b/CONFIG/src/probe_comp.c
33fa5a
@@ -1208,6 +1208,7 @@ void GetBestGccVers(enum OSTYPE OS, enum MACHTYPE arch,
33fa5a
    case IbmZ12:
33fa5a
    case IbmZ13:
33fa5a
    case IbmZ14:
33fa5a
+   case IbmZ15:
33fa5a
    case IntCorei3:
33fa5a
    case IntCorei4:
33fa5a
    case IntCorei2:
33fa5a
diff --git a/include/atlas_prefetch.h b/include/atlas_prefetch.h
33fa5a
index fa426ac..583f19d 100644
33fa5a
--- a/include/atlas_prefetch.h
33fa5a
+++ b/include/atlas_prefetch.h
33fa5a
@@ -156,7 +156,7 @@
33fa5a
    #define ATL_L2LS 64
33fa5a
 #elif defined(ATL_ARCH_IBMz196) || defined(ATL_ARCH_IBMz10) || \
33fa5a
       defined(ATL_ARCH_IBMzEC12) || defined(ATL_ARCH_IBMz13) || \
33fa5a
-      defined(ATL_ARCH_IbmZ14)
33fa5a
+      defined(ATL_ARCH_IbmZ14) || defined(ATL_ARCH_IbmZ15)
33fa5a
    #define ATL_pfl1R(mem) __builtin_prefetch(mem, 0, 3)
33fa5a
    #define ATL_pfl1W(mem) __builtin_prefetch(mem, 1, 3)
33fa5a
    #define ATL_GOT_L1PREFETCH
33fa5a
-- 
33fa5a
2.23.0
33fa5a