summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2015-03-11 19:14:15 +0000
committerHal Finkel <hfinkel@anl.gov>2015-03-11 19:14:15 +0000
commit0d0a1a53e3870d1c816bec193841e9d2db1a1b68 (patch)
tree4e702e29d48a2ea73a594c01ca2c9e4bda6e0f86 /clang/lib/Basic/Targets.cpp
parent8cda34f5e7e6af23910e62ab3edb430dab07799f (diff)
downloadbcm5719-llvm-0d0a1a53e3870d1c816bec193841e9d2db1a1b68.tar.gz
bcm5719-llvm-0d0a1a53e3870d1c816bec193841e9d2db1a1b68.zip
[PowerPC] ABI support for the QPX vector instruction set
Support for the QPX vector instruction set, used on the IBM BG/Q supercomputer, has recently been added to the LLVM PowerPC backend. This vector instruction set requires some ABI modifications because the ABI on the BG/Q expects <4 x double> vectors to be provided with 32-byte stack alignment, and to be handled as native vector types (similar to how Altivec vectors are handled on mainline PPC systems). I've named this ABI variant elfv1-qpx, have made this the default ABI when QPX is supported, and have updated the ABI handling code to provide QPX vectors with the correct stack alignment and associated register-assignment logic. llvm-svn: 231960
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 15c35490ec0..3f6177eecd5 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -742,6 +742,7 @@ class PPCTargetInfo : public TargetInfo {
bool HasVSX;
bool HasP8Vector;
bool HasP8Crypto;
+ bool HasQPX;
protected:
std::string ABI;
@@ -749,7 +750,7 @@ protected:
public:
PPCTargetInfo(const llvm::Triple &Triple)
: TargetInfo(Triple), HasVSX(false), HasP8Vector(false),
- HasP8Crypto(false) {
+ HasP8Crypto(false), HasQPX(false) {
BigEndian = (Triple.getArch() != llvm::Triple::ppc64le);
LongDoubleWidth = LongDoubleAlign = 128;
LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble;
@@ -1015,6 +1016,11 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
continue;
}
+ if (Feature == "qpx") {
+ HasQPX = true;
+ continue;
+ }
+
// TODO: Finish this list and add an assert that we've handled them
// all.
}
@@ -1049,7 +1055,7 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
}
// ABI options.
- if (ABI == "elfv1")
+ if (ABI == "elfv1" || ABI == "elfv1-qpx")
Builder.defineMacro("_CALL_ELF", "1");
if (ABI == "elfv2")
Builder.defineMacro("_CALL_ELF", "2");
@@ -1223,6 +1229,7 @@ bool PPCTargetInfo::hasFeature(StringRef Feature) const {
.Case("vsx", HasVSX)
.Case("power8-vector", HasP8Vector)
.Case("crypto", HasP8Crypto)
+ .Case("qpx", HasQPX)
.Default(false);
}
@@ -1403,7 +1410,7 @@ public:
}
// PPC64 Linux-specifc ABI options.
bool setABI(const std::string &Name) override {
- if (Name == "elfv1" || Name == "elfv2") {
+ if (Name == "elfv1" || Name == "elfv1-qpx" || Name == "elfv2") {
ABI = Name;
return true;
}
OpenPOWER on IntegriCloud