Merging r245084:
authorHans Wennborg <hans@hanshq.net>
Wed, 19 Aug 2015 16:40:03 +0000 (16:40 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 19 Aug 2015 16:40:03 +0000 (16:40 +0000)
------------------------------------------------------------------------
r245084 | martell | 2015-08-14 12:05:56 -0700 (Fri, 14 Aug 2015) | 13 lines

WindowsX86: long double is x87DoubleExtended on mingw

    Summary:
    long double on x86 mingw is 80bits and is aligned to 16bytes

Fixes:
    https://llvm.org/bugs/show_bug.cgi?id=24398

    Reviewers: rnk

    Subscribers: cfe-commits

    Differential Revision: http://reviews.llvm.org/D12037
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_37@245456 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp

index e4db004b4948a42b82ace2392f70739fe59f313c..23edea8dd5f201961f9f34524820cdadb8003f07 100644 (file)
@@ -3738,7 +3738,10 @@ namespace {
 class MinGWX86_32TargetInfo : public WindowsX86_32TargetInfo {
 public:
   MinGWX86_32TargetInfo(const llvm::Triple &Triple)
-      : WindowsX86_32TargetInfo(Triple) {}
+      : WindowsX86_32TargetInfo(Triple) {
+    LongDoubleWidth = LongDoubleAlign = 128;
+    LongDoubleFormat = &llvm::APFloat::x87DoubleExtended;
+  }
   void getTargetDefines(const LangOptions &Opts,
                         MacroBuilder &Builder) const override {
     WindowsX86_32TargetInfo::getTargetDefines(Opts, Builder);
@@ -3968,7 +3971,10 @@ public:
 class MinGWX86_64TargetInfo : public WindowsX86_64TargetInfo {
 public:
   MinGWX86_64TargetInfo(const llvm::Triple &Triple)
-      : WindowsX86_64TargetInfo(Triple) {}
+      : WindowsX86_64TargetInfo(Triple) {
+    LongDoubleWidth = LongDoubleAlign = 128;
+    LongDoubleFormat = &llvm::APFloat::x87DoubleExtended;
+  }
   void getTargetDefines(const LangOptions &Opts,
                         MacroBuilder &Builder) const override {
     WindowsX86_64TargetInfo::getTargetDefines(Opts, Builder);