]> granicus.if.org Git - clang/commitdiff
[SystemZ] Add -march=archX aliases
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 31 Oct 2016 14:38:05 +0000 (14:38 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 31 Oct 2016 14:38:05 +0000 (14:38 +0000)
For compatibility with other compilers on the platform, allow specifying
levels of the z/Architecture instead of model names with -march.  In
particular, the following aliases are now supported:

  -march=arch8   equals  -march=z10
  -march=arch9   equals  -march=z196
  -march=arch10  equals  -march=zEC12
  -march=arch11  equals  -march=z13

This parallels the equivalent (and prerequisite) LLVM change in r285577.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285578 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/CodeGen/systemz-abi-vector.c
test/CodeGen/systemz-abi.c
test/CodeGen/target-data.c
test/Driver/systemz-march.c
test/Preprocessor/predefined-arch-macros.c

index 9355f3b71b07f03c7b35253c2d8587f7eae437f6..64c7dbee3e87d402ef05d4ce96a8ba66629ec592 100644 (file)
@@ -6941,9 +6941,13 @@ public:
     CPU = Name;
     bool CPUKnown = llvm::StringSwitch<bool>(Name)
       .Case("z10", true)
+      .Case("arch8", true)
       .Case("z196", true)
+      .Case("arch9", true)
       .Case("zEC12", true)
+      .Case("arch10", true)
       .Case("z13", true)
+      .Case("arch11", true)
       .Default(false);
 
     return CPUKnown;
@@ -6952,9 +6956,9 @@ public:
   initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
                  StringRef CPU,
                  const std::vector<std::string> &FeaturesVec) const override {
-    if (CPU == "zEC12")
+    if (CPU == "zEC12" || CPU == "arch10")
       Features["transactional-execution"] = true;
-    if (CPU == "z13") {
+    if (CPU == "z13" || CPU == "arch11") {
       Features["transactional-execution"] = true;
       Features["vector"] = true;
     }
index 1d1f302e632453e673d185da58fd257a899a369d..455e3bbcced27fccc6c5c1a6a5f8ddc64c56885e 100644 (file)
@@ -4,6 +4,8 @@
 // RUN:   -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
 // RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z13 \
 // RUN:   -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
+// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu arch11 \
+// RUN:   -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-VECTOR %s
 
 // Vector types
 
index 375d02a35889aba3d64c622ca1e5ecec1c5c619c..17fdb9e322c8c24202d12f6e9c45bc7f237aa262 100644 (file)
@@ -4,6 +4,8 @@
 // RUN:   -emit-llvm -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z13 \
 // RUN:   -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu arch11 \
+// RUN:   -emit-llvm -o - %s | FileCheck %s
 
 // Scalar types
 
index c12ad2c1c9778844304623f97e8e63950b613e58..63a85b59417caf6e4ba051461a920dda459fe68e 100644 (file)
 
 // RUN: %clang_cc1 -triple s390x-unknown -target-cpu z13 -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=SYSTEMZ-VECTOR
+// RUN: %clang_cc1 -triple s390x-unknown -target-cpu arch11 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=SYSTEMZ-VECTOR
 // SYSTEMZ-VECTOR: target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
 
 // RUN: %clang_cc1 -triple msp430-unknown -o - -emit-llvm %s | \
index ffc126f14fe1e5e820a45f2be7e3e314f5fdc52d..a5df1f482d1ea4eedca0cf8e6a2da9a6e01f3789 100644 (file)
@@ -2,12 +2,22 @@
 
 // RUN: not %clang -target s390x -S -emit-llvm -march=z9 %s -o - 2>&1 | FileCheck --check-prefix=CHECK-Z9 %s
 // RUN: %clang -target s390x -### -S -emit-llvm -march=z10 %s 2>&1 | FileCheck --check-prefix=CHECK-Z10 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=arch8 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH8 %s
 // RUN: %clang -target s390x -### -S -emit-llvm -march=z196 %s 2>&1 | FileCheck --check-prefix=CHECK-Z196 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=arch9 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH9 %s
 // RUN: %clang -target s390x -### -S -emit-llvm -march=zEC12 %s 2>&1 | FileCheck --check-prefix=CHECK-ZEC12 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=arch10 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH10 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=z13 %s 2>&1 | FileCheck --check-prefix=CHECK-Z13 %s
+// RUN: %clang -target s390x -### -S -emit-llvm -march=arch11 %s 2>&1 | FileCheck --check-prefix=CHECK-ARCH11 %s
 
 // CHECK-Z9: error: unknown target CPU 'z9'
 // CHECK-Z10: "-target-cpu" "z10"
+// CHECK-ARCH8: "-target-cpu" "arch8"
 // CHECK-Z196: "-target-cpu" "z196"
+// CHECK-ARCH9: "-target-cpu" "arch9"
 // CHECK-ZEC12: "-target-cpu" "zEC12"
+// CHECK-ARCH10: "-target-cpu" "arch10"
+// CHECK-Z13: "-target-cpu" "z13"
+// CHECK-ARCH11: "-target-cpu" "arch11"
 
 int x;
index dcb03b14d068c42c02d06b7570246b25a50ce57c..51b587e403e032c3aaaffe7e8e829ce6bcafdcd2 100644 (file)
 // RUN: %clang -march=zEC12 -E -dM %s -o - 2>&1 \
 // RUN:     -target s390x-unknown-linux \
 // RUN:   | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ZEC12
+// RUN: %clang -march=arch10 -E -dM %s -o - 2>&1 \
+// RUN:     -target s390x-unknown-linux \
+// RUN:   | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ZEC12
 //
 // CHECK_SYSTEMZ_ZEC12: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
 // CHECK_SYSTEMZ_ZEC12: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1