[llvm] 1283ccb - Support z16 processor name

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 10:58:51 PDT 2022


Author: Ulrich Weigand
Date: 2022-04-21T19:58:22+02:00
New Revision: 1283ccb610feef4f2e0edf22f66a705155a0e0c7

URL: https://github.com/llvm/llvm-project/commit/1283ccb610feef4f2e0edf22f66a705155a0e0c7
DIFF: https://github.com/llvm/llvm-project/commit/1283ccb610feef4f2e0edf22f66a705155a0e0c7.diff

LOG: Support z16 processor name

The recently announced IBM z16 processor implements the architecture
already supported as "arch14" in LLVM.  This patch adds support for
"z16" as an alternate architecture name for arch14.

Added: 
    llvm/test/MC/Disassembler/SystemZ/insns-z16.txt
    llvm/test/MC/SystemZ/insn-bad-z16.s
    llvm/test/MC/SystemZ/insn-good-z16.s

Modified: 
    clang/lib/Basic/Targets/SystemZ.cpp
    clang/test/CodeGen/SystemZ/builtins-systemz-vector4.c
    clang/test/CodeGen/SystemZ/builtins-systemz-zvector4-error.c
    clang/test/CodeGen/SystemZ/builtins-systemz-zvector4.c
    clang/test/CodeGen/SystemZ/systemz-abi-vector.c
    clang/test/CodeGen/SystemZ/systemz-abi.c
    clang/test/Driver/systemz-march.c
    clang/test/Misc/target-invalid-cpu-note.c
    clang/test/Preprocessor/predefined-arch-macros.c
    llvm/lib/Support/Host.cpp
    llvm/lib/Target/SystemZ/SystemZProcessors.td
    llvm/test/CodeGen/SystemZ/vec-intrinsics-04.ll
    llvm/unittests/Support/Host.cpp

Removed: 
    llvm/test/MC/Disassembler/SystemZ/insns-arch14.txt
    llvm/test/MC/SystemZ/insn-bad-arch14.s
    llvm/test/MC/SystemZ/insn-good-arch14.s


################################################################################
diff  --git a/clang/lib/Basic/Targets/SystemZ.cpp b/clang/lib/Basic/Targets/SystemZ.cpp
index 3af9216315132..84874b58ba68c 100644
--- a/clang/lib/Basic/Targets/SystemZ.cpp
+++ b/clang/lib/Basic/Targets/SystemZ.cpp
@@ -104,7 +104,7 @@ static constexpr ISANameRevision ISARevisions[] = {
   {{"arch11"}, 11}, {{"z13"}, 11},
   {{"arch12"}, 12}, {{"z14"}, 12},
   {{"arch13"}, 13}, {{"z15"}, 13},
-  {{"arch14"}, 14}
+  {{"arch14"}, 14}, {{"z16"}, 14},
 };
 
 int SystemZTargetInfo::getISARevision(StringRef Name) const {

diff  --git a/clang/test/CodeGen/SystemZ/builtins-systemz-vector4.c b/clang/test/CodeGen/SystemZ/builtins-systemz-vector4.c
index b0cd994904134..c5ce47cea2ea8 100644
--- a/clang/test/CodeGen/SystemZ/builtins-systemz-vector4.c
+++ b/clang/test/CodeGen/SystemZ/builtins-systemz-vector4.c
@@ -1,5 +1,5 @@
 // REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu arch14 -triple s390x-ibm-linux -flax-vector-conversions=none \
+// RUN: %clang_cc1 -target-cpu z16 -triple s390x-ibm-linux -flax-vector-conversions=none \
 // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
 
 typedef __attribute__((vector_size(16))) signed char vec_schar;

diff  --git a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4-error.c b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4-error.c
index a893e77acbf60..df547cb99f24b 100644
--- a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4-error.c
+++ b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4-error.c
@@ -1,5 +1,5 @@
 // REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu arch14 -triple s390x-linux-gnu \
+// RUN: %clang_cc1 -target-cpu z16 -triple s390x-linux-gnu \
 // RUN: -fzvector -flax-vector-conversions=none \
 // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
 

diff  --git a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4.c b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4.c
index 602886c17d198..adc55927ce366 100644
--- a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4.c
+++ b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector4.c
@@ -1,8 +1,8 @@
 // REQUIRES: systemz-registered-target
-// RUN: %clang_cc1 -target-cpu arch14 -triple s390x-linux-gnu \
+// RUN: %clang_cc1 -target-cpu z16 -triple s390x-linux-gnu \
 // RUN: -O2 -fzvector -flax-vector-conversions=none \
 // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
-// RUN: %clang_cc1 -target-cpu arch14 -triple s390x-linux-gnu \
+// RUN: %clang_cc1 -target-cpu z16 -triple s390x-linux-gnu \
 // RUN: -O2 -fzvector -flax-vector-conversions=none \
 // RUN: -Wall -Wno-unused -Werror -S %s -o - | FileCheck %s --check-prefix=CHECK-ASM
 

diff  --git a/clang/test/CodeGen/SystemZ/systemz-abi-vector.c b/clang/test/CodeGen/SystemZ/systemz-abi-vector.c
index 4a4f03c813463..7817249da757b 100644
--- a/clang/test/CodeGen/SystemZ/systemz-abi-vector.c
+++ b/clang/test/CodeGen/SystemZ/systemz-abi-vector.c
@@ -14,6 +14,8 @@
 // RUN:   -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
 // RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple s390x-linux-gnu -target-cpu arch13 \
 // RUN:   -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
+// RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple s390x-linux-gnu -target-cpu z16 \
+// RUN:   -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
 // RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple s390x-linux-gnu -target-cpu arch14 \
 // RUN:   -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
 

diff  --git a/clang/test/CodeGen/SystemZ/systemz-abi.c b/clang/test/CodeGen/SystemZ/systemz-abi.c
index f507c23b6736c..e79a287852e2d 100644
--- a/clang/test/CodeGen/SystemZ/systemz-abi.c
+++ b/clang/test/CodeGen/SystemZ/systemz-abi.c
@@ -17,6 +17,8 @@
 // RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple s390x-linux-gnu -target-cpu arch13 \
 // RUN:   -emit-llvm -o - %s -mfloat-abi soft | FileCheck %s \
 // RUN:   --check-prefixes=CHECK,SOFT-FLOAT
+// RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple s390x-linux-gnu -target-cpu z16 \
+// RUN:   -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,HARD-FLOAT
 // RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple s390x-linux-gnu -target-cpu arch14 \
 // RUN:   -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,HARD-FLOAT
 // RUN: %clang_cc1 -no-opaque-pointers -no-enable-noundef-analysis -triple s390x-linux-gnu -target-cpu arch14 \

diff  --git a/clang/test/Driver/systemz-march.c b/clang/test/Driver/systemz-march.c
index 7860a85736386..31079435d2c6a 100644
--- a/clang/test/Driver/systemz-march.c
+++ b/clang/test/Driver/systemz-march.c
@@ -13,6 +13,7 @@
 // RUN: %clang -target s390x -### -S -emit-llvm -march=arch12 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH12 %s
 // RUN: %clang -target s390x -### -S -emit-llvm -march=z15 %s 2>&1 | FileCheck --check-prefix=CHECK-Z15 %s
 // RUN: %clang -target s390x -### -S -emit-llvm -march=arch13 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH13 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=z16 %s 2>&1 | FileCheck --check-prefix=CHECK-Z16 %s
 // RUN: %clang -target s390x -### -S -emit-llvm -march=arch14 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH14 %s
 
 // CHECK-Z9: error: unknown target CPU 'z9'
@@ -28,6 +29,7 @@
 // CHECK-ARCH12: "-target-cpu" "arch12"
 // CHECK-Z15: "-target-cpu" "z15"
 // CHECK-ARCH13: "-target-cpu" "arch13"
+// CHECK-Z16: "-target-cpu" "z16"
 // CHECK-ARCH14: "-target-cpu" "arch14"
 
 int x;

diff  --git a/clang/test/Misc/target-invalid-cpu-note.c b/clang/test/Misc/target-invalid-cpu-note.c
index 84bdb68b741c2..8b9409336d1cb 100644
--- a/clang/test/Misc/target-invalid-cpu-note.c
+++ b/clang/test/Misc/target-invalid-cpu-note.c
@@ -45,7 +45,7 @@
 
 // RUN: not %clang_cc1 -triple systemz--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SYSTEMZ
 // SYSTEMZ: error: unknown target CPU 'not-a-cpu'
-// SYSTEMZ-NEXT: note: valid target CPU values are: arch8, z10, arch9, z196, arch10, zEC12, arch11, z13, arch12, z14, arch13, z15, arch14{{$}}
+// SYSTEMZ-NEXT: note: valid target CPU values are: arch8, z10, arch9, z196, arch10, zEC12, arch11, z13, arch12, z14, arch13, z15, arch14, z16{{$}}
 
 // RUN: not %clang_cc1 -triple sparc--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SPARC
 // SPARC: error: unknown target CPU 'not-a-cpu'

diff  --git a/clang/test/Preprocessor/predefined-arch-macros.c b/clang/test/Preprocessor/predefined-arch-macros.c
index f0604de684fbe..6384b139c4054 100644
--- a/clang/test/Preprocessor/predefined-arch-macros.c
+++ b/clang/test/Preprocessor/predefined-arch-macros.c
@@ -3690,6 +3690,9 @@
 // RUN: %clang -march=arch14 -E -dM %s -o - 2>&1 \
 // RUN:     -target s390x-unknown-linux \
 // RUN:   | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH14
+// RUN: %clang -march=z16 -E -dM %s -o - 2>&1 \
+// RUN:     -target s390x-unknown-linux \
+// RUN:   | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ARCH14
 // CHECK_SYSTEMZ_ARCH14: #define __ARCH__ 14
 // CHECK_SYSTEMZ_ARCH14: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
 // CHECK_SYSTEMZ_ARCH14: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1

diff  --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index 2684b02fc43bb..98272bb59ee27 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -330,7 +330,7 @@ StringRef getCPUNameFromS390Model(unsigned int Id, bool HaveVectorSupport) {
     case 3931:
     case 3932:
     default:
-      return HaveVectorSupport? "arch14" : "zEC12";
+      return HaveVectorSupport? "z16" : "zEC12";
   }
 }
 } // end anonymous namespace

diff  --git a/llvm/lib/Target/SystemZ/SystemZProcessors.td b/llvm/lib/Target/SystemZ/SystemZProcessors.td
index 4fceaa14c5987..bf2e6ea4bbd46 100644
--- a/llvm/lib/Target/SystemZ/SystemZProcessors.td
+++ b/llvm/lib/Target/SystemZ/SystemZProcessors.td
@@ -39,4 +39,5 @@ def : ProcessorModel<"arch13", Z15Model, Arch13SupportedFeatures.List>;
 def : ProcessorModel<"z15", Z15Model, Arch13SupportedFeatures.List>;
 
 def : ProcessorModel<"arch14", Z15Model, Arch14SupportedFeatures.List>;
+def : ProcessorModel<"z16", Z15Model, Arch14SupportedFeatures.List>;
 

diff  --git a/llvm/test/CodeGen/SystemZ/vec-intrinsics-04.ll b/llvm/test/CodeGen/SystemZ/vec-intrinsics-04.ll
index 4b61d5a43f183..351a981f7018b 100644
--- a/llvm/test/CodeGen/SystemZ/vec-intrinsics-04.ll
+++ b/llvm/test/CodeGen/SystemZ/vec-intrinsics-04.ll
@@ -1,6 +1,6 @@
-; Test vector intrinsics added with arch14.
+; Test vector intrinsics added with z16.
 ;
-; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=arch14 | FileCheck %s
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z16 | FileCheck %s
 
 declare <4 x float> @llvm.s390.vclfnhs(<8 x i16>, i32)
 declare <4 x float> @llvm.s390.vclfnls(<8 x i16>, i32)

diff  --git a/llvm/test/MC/Disassembler/SystemZ/insns-arch14.txt b/llvm/test/MC/Disassembler/SystemZ/insns-z16.txt
similarity index 98%
rename from llvm/test/MC/Disassembler/SystemZ/insns-arch14.txt
rename to llvm/test/MC/Disassembler/SystemZ/insns-z16.txt
index 5f8dacc2d2f48..8b292d93298a0 100644
--- a/llvm/test/MC/Disassembler/SystemZ/insns-arch14.txt
+++ b/llvm/test/MC/Disassembler/SystemZ/insns-z16.txt
@@ -1,5 +1,5 @@
-# Test arch14 instructions that don't have PC-relative operands.
-# RUN: llvm-mc --disassemble %s -triple=s390x-linux-gnu -mcpu=arch14 \
+# Test z16 instructions that don't have PC-relative operands.
+# RUN: llvm-mc --disassemble %s -triple=s390x-linux-gnu -mcpu=z16 \
 # RUN:   | FileCheck %s
 
 # CHECK: lbear 0

diff  --git a/llvm/test/MC/SystemZ/insn-bad-arch14.s b/llvm/test/MC/SystemZ/insn-bad-z16.s
similarity index 98%
rename from llvm/test/MC/SystemZ/insn-bad-arch14.s
rename to llvm/test/MC/SystemZ/insn-bad-z16.s
index 712f16faec7af..db69c20262279 100644
--- a/llvm/test/MC/SystemZ/insn-bad-arch14.s
+++ b/llvm/test/MC/SystemZ/insn-bad-z16.s
@@ -1,5 +1,5 @@
-# For arch14 only.
-# RUN: not llvm-mc -triple s390x-linux-gnu -mcpu=arch14 < %s 2> %t
+# For z16 only.
+# RUN: not llvm-mc -triple s390x-linux-gnu -mcpu=z16 < %s 2> %t
 # RUN: FileCheck < %t %s
 
 #CHECK: error: invalid operand

diff  --git a/llvm/test/MC/SystemZ/insn-good-arch14.s b/llvm/test/MC/SystemZ/insn-good-z16.s
similarity index 99%
rename from llvm/test/MC/SystemZ/insn-good-arch14.s
rename to llvm/test/MC/SystemZ/insn-good-z16.s
index 2cc666950ec1f..3c402f72ca098 100644
--- a/llvm/test/MC/SystemZ/insn-good-arch14.s
+++ b/llvm/test/MC/SystemZ/insn-good-z16.s
@@ -1,5 +1,5 @@
-# For arch14 and above.
-# RUN: llvm-mc -triple s390x-linux-gnu -mcpu=arch14 -show-encoding %s \
+# For z16 and above.
+# RUN: llvm-mc -triple s390x-linux-gnu -mcpu=z16 -show-encoding %s \
 # RUN:   | FileCheck %s
 
 #CHECK: lbear	0                       # encoding: [0xb2,0x00,0x00,0x00]

diff  --git a/llvm/unittests/Support/Host.cpp b/llvm/unittests/Support/Host.cpp
index 0a0adcebc43d7..484c88bddb129 100644
--- a/llvm/unittests/Support/Host.cpp
+++ b/llvm/unittests/Support/Host.cpp
@@ -326,7 +326,7 @@ TEST(getLinuxHostCPUName, s390x) {
 
   // Model Id: 3931
   ExpectedCPUs.push_back("zEC12");
-  ExpectedCPUs.push_back("arch14");
+  ExpectedCPUs.push_back("z16");
 
   // Model Id: 8561
   ExpectedCPUs.push_back("zEC12");


        


More information about the llvm-commits mailing list