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