[PowerPC] Add support for the QPX vector instruction set
[oota-llvm.git] / lib / Target / PowerPC / PPCSubtarget.h
index 704a226ed33322d4ab4a3ee1f0040a09b545fa80..247a96d405e99df82f9e7ad14e67ee065f2a5f61 100644 (file)
@@ -114,6 +114,11 @@ protected:
   bool HasICBT;
   bool HasInvariantFunctionDescriptors;
 
+  /// 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
+  /// of the stack.
+  bool IsQPXStackUnaligned;
+
   const PPCTargetMachine &TM;
   PPCFrameLowering FrameLowering;
   PPCInstrInfo InstrInfo;
@@ -230,6 +235,14 @@ public:
     return HasInvariantFunctionDescriptors;
   }
 
+  bool isQPXStackUnaligned() const { return IsQPXStackUnaligned; }
+  unsigned getPlatformStackAlignment() const {
+    if ((hasQPX() || isBGQ()) && !isQPXStackUnaligned())
+      return 32;
+
+    return 16;
+  }
+
   const Triple &getTargetTriple() const { return TargetTriple; }
 
   /// isDarwin - True if this is any darwin platform.