diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2014-10-10 15:09:43 +0000 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2014-10-10 15:09:43 +0000 |
commit | e30a0772b776ac9dd48a7797ea585f9c2337ba99 (patch) | |
tree | fc08cbb124a3b01adbe7a41629904d57b8cfc23e /lib/Basic | |
parent | 8c59824a45c275452a5fd74a83dee0f5fb7a89cf (diff) |
[PowerPC] Add feature for Power8 vector extensions
The current VSX feature for PowerPC specifies availability of the VSX
instructions added with the 2.06 architecture version. With 2.07, the
architecture adds new instructions to both the Category:Vector and
Category:VSX instruction sets. Additionally, unaligned vector storage
operations have improved performance.
This patch adds a feature to provide access to the new instructions
and performance capabilities of Power8. For compatibility with GCC,
the feature is controlled via a new -mpower8-vector switch, and the
feature causes the __POWER8_VECTOR__ builtin define to be generated by
the preprocessor.
There is a companion patch for llvm being committed at the same time.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r-- | lib/Basic/Targets.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 0df01df77f..902f1c3c61 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -672,13 +672,14 @@ class PPCTargetInfo : public TargetInfo { // Target cpu features. bool HasVSX; + bool HasPower8Vector; protected: std::string ABI; public: PPCTargetInfo(const llvm::Triple &Triple) - : TargetInfo(Triple), HasVSX(false) { + : TargetInfo(Triple), HasVSX(false), HasPower8Vector(false) { BigEndian = (Triple.getArch() != llvm::Triple::ppc64le); LongDoubleWidth = LongDoubleAlign = 128; LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble; @@ -934,6 +935,11 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features, continue; } + if (Feature == "power8-vector") { + HasPower8Vector = true; + continue; + } + // TODO: Finish this list and add an assert that we've handled them // all. } @@ -1084,6 +1090,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, if (HasVSX) Builder.defineMacro("__VSX__"); + if (HasPower8Vector) + Builder.defineMacro("__POWER8_VECTOR__"); // FIXME: The following are not yet generated here by Clang, but are // generated by GCC: |