[PATCH] D54901: [Haiku] Support __float128 for Haiku x86 and x86_64

Kristina Brooks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 5 07:08:09 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL348368: [Haiku] Support __float128 for x86 and x86_64 (authored by kristina, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D54901?vs=175266&id=176815#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54901/new/

https://reviews.llvm.org/D54901

Files:
  cfe/trunk/lib/Basic/Targets/OSTargets.h
  cfe/trunk/test/CodeGenCXX/float128-declarations.cpp


Index: cfe/trunk/test/CodeGenCXX/float128-declarations.cpp
===================================================================
--- cfe/trunk/test/CodeGenCXX/float128-declarations.cpp
+++ cfe/trunk/test/CodeGenCXX/float128-declarations.cpp
@@ -14,6 +14,10 @@
 // RUN:   %s -o - | FileCheck %s -check-prefix=CHECK-X86
 // RUN: %clang_cc1 -emit-llvm -triple x86_64-pc-solaris2.11 -std=c++11 \
 // RUN:   %s -o - | FileCheck %s -check-prefix=CHECK-X86
+// RUN: %clang_cc1 -emit-llvm -triple i586-pc-haiku -std=c++11 \
+// RUN:   %s -o - | FileCheck %s -check-prefix=CHECK-X86
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-haiku -std=c++11 \
+// RUN:   %s -o - | FileCheck %s -check-prefix=CHECK-X86
 //
 /*  Various contexts where type __float128 can appear. The different check
     prefixes are due to different mangling on X86.  */
Index: cfe/trunk/lib/Basic/Targets/OSTargets.h
===================================================================
--- cfe/trunk/lib/Basic/Targets/OSTargets.h
+++ cfe/trunk/lib/Basic/Targets/OSTargets.h
@@ -257,6 +257,8 @@
     Builder.defineMacro("__HAIKU__");
     Builder.defineMacro("__ELF__");
     DefineStd(Builder, "unix", Opts);
+    if (this->HasFloat128) 
+      Builder.defineMacro("__FLOAT128__");
   }
 
 public:
@@ -267,6 +269,14 @@
     this->PtrDiffType = TargetInfo::SignedLong;
     this->ProcessIDType = TargetInfo::SignedLong;
     this->TLSSupported = false;
+    switch (Triple.getArch()) {
+    default:
+      break;
+    case llvm::Triple::x86:
+    case llvm::Triple::x86_64:
+      this->HasFloat128 = true;
+      break;
+    }
   }
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54901.176815.patch
Type: text/x-patch
Size: 1607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181205/e518571b/attachment.bin>


More information about the cfe-commits mailing list