summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-10-28 22:29:52 +0000
committerReid Kleckner <rnk@google.com>2015-10-28 22:29:52 +0000
commit11a17198e0396ac11d8034cf9d88e3c4c5c4e1f6 (patch)
tree0673d7bd4ecc3c59bfeff15d8fecaf9dfa692f3a /clang/lib/Basic/Targets.cpp
parent34d4149452225e61e14ba346dde223183f617658 (diff)
downloadbcm5719-llvm-11a17198e0396ac11d8034cf9d88e3c4c5c4e1f6.tar.gz
bcm5719-llvm-11a17198e0396ac11d8034cf9d88e3c4c5c4e1f6.zip
Fix the calling convention of Mingw64 long double values
GCC uses the x87DoubleExtended model for long doubles, and passes them indirectly by address through function calls. Also replace the existing mingw-long-double assembly emitting test with an IR-level test. llvm-svn: 251567
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 0094ce8cc5c..a0c379aeb7f 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -4009,7 +4009,13 @@ public:
class MinGWX86_64TargetInfo : public WindowsX86_64TargetInfo {
public:
MinGWX86_64TargetInfo(const llvm::Triple &Triple)
- : WindowsX86_64TargetInfo(Triple) {}
+ : WindowsX86_64TargetInfo(Triple) {
+ // Mingw64 rounds long double size and alignment up to 16 bytes, but sticks
+ // with x86 FP ops. Weird.
+ LongDoubleWidth = LongDoubleAlign = 128;
+ LongDoubleFormat = &llvm::APFloat::x87DoubleExtended;
+ }
+
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
WindowsX86_64TargetInfo::getTargetDefines(Opts, Builder);
OpenPOWER on IntegriCloud