summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2015-05-05 19:35:52 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2015-05-05 19:35:52 +0000
commit66ff51b4ea5d8f2b5cabb09c5d5ff210422dffd2 (patch)
tree1fa19f63215e6c1f747d43b142728efaa61527b2 /clang/lib/Driver/Tools.cpp
parent9958c489bb85708438fa66b1c0e2c2c1c5d73424 (diff)
downloadbcm5719-llvm-66ff51b4ea5d8f2b5cabb09c5d5ff210422dffd2.tar.gz
bcm5719-llvm-66ff51b4ea5d8f2b5cabb09c5d5ff210422dffd2.zip
[SystemZ] Add support for z13 and its vector facility
This patch adds support for the z13 architecture type. For compatibility with GCC, a pair of options -mvx / -mno-vx can be used to selectively enable/disable use of the vector facility. When the vector facility is present, we default to the new vector ABI. This is characterized by two major differences: - Vector types are passed/returned in vector registers (except for unnamed arguments of a variable-argument list function). - Vector types are at most 8-byte aligned. The reason for the choice of 8-byte vector alignment is that the hardware is able to efficiently load vectors at 8-byte alignment, and the ABI only guarantees 8-byte alignment of the stack pointer, so requiring any higher alignment for vectors would require dynamic stack re-alignment code. However, for compatibility with old code that may use vector types, when *not* using the vector facility, the old alignment rules (vector types are naturally aligned) remain in use. These alignment rules are not only implemented at the C language level, but also at the LLVM IR level. This is done by selecting a different DataLayout string depending on whether the vector ABI is in effect or not. Based on a patch by Richard Sandiford. llvm-svn: 236531
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 27e6427d0d4..3f4c3171332 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -1442,6 +1442,14 @@ static void getSystemZTargetFeatures(const ArgList &Args,
else
Features.push_back("-transactional-execution");
}
+ // -m(no-)vx overrides use of the vector facility.
+ if (Arg *A = Args.getLastArg(options::OPT_mvx,
+ options::OPT_mno_vx)) {
+ if (A->getOption().matches(options::OPT_mvx))
+ Features.push_back("+vector");
+ else
+ Features.push_back("-vector");
+ }
}
static const char *getX86TargetCPU(const ArgList &Args,
OpenPOWER on IntegriCloud