Define a feature for __float128 support in the PPC back end
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 15 Dec 2015 12:19:34 +0000 (12:19 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 15 Dec 2015 12:19:34 +0000 (12:19 +0000)
This patch corresponds to review:
http://reviews.llvm.org/D15117

In preparation for supporting IEEE Quad precision floating point,
this patch simply defines a feature to specify the target supports this.
For now, nothing is done with the target feature, we just don't want
warnings from the Clang FE when a user specifies -mfloat128.
Calling convention and other related work will add to this patch in
the near future.

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

lib/Target/PowerPC/PPC.td
lib/Target/PowerPC/PPCSubtarget.cpp
lib/Target/PowerPC/PPCSubtarget.h

index f0269112328aec53f1fc7fe15f28d6a0fc23ca4b..b03be12cfd97f78011e75139db0e0085b06de333 100644 (file)
@@ -141,6 +141,10 @@ def FeatureMFTB   : SubtargetFeature<"", "FeatureMFTB", "true",
                                         "Implement mftb using the mfspr instruction">;
 def FeatureFusion : SubtargetFeature<"fusion", "HasFusion", "true",
                                      "Target supports add/load integer fusion.">;
+def FeatureFloat128 :
+  SubtargetFeature<"float128", "HasFloat128", "true",
+                   "Enable the __float128 data type for IEEE-754R Binary128.",
+                   [FeatureVSX]>;
 
 def DeprecatedDST    : SubtargetFeature<"", "DeprecatedDST", "true",
   "Treat vector data stream cache control instructions as deprecated">;
index 89bbcf783463771358f7e9c2309d7199061a3c51..c0fcb6cbb9dcb6f1871e2f8c2b214308a08d3b93 100644 (file)
@@ -102,6 +102,7 @@ void PPCSubtarget::initializeEnvironment() {
   IsQPXStackUnaligned = false;
   HasHTM = false;
   HasFusion = false;
+  HasFloat128 = false;
 }
 
 void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
index a55c0d3a72280ed2a735c704dd5e5f366d286dcb..4f5c95c1483fa4cc3759d5f1b3bf47984488f106 100644 (file)
@@ -121,6 +121,7 @@ protected:
   bool HasDirectMove;
   bool HasHTM;
   bool HasFusion;
+  bool HasFloat128;
 
   /// When targeting QPX running a stock PPC64 Linux kernel where the stack
   /// alignment has not been changed, we need to keep the 16-byte alignment
@@ -259,6 +260,7 @@ public:
   }
   bool hasHTM() const { return HasHTM; }
   bool hasFusion() const { return HasFusion; }
+  bool hasFloat128() const { return HasFloat128; }
 
   const Triple &getTargetTriple() const { return TargetTriple; }