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

Alexander von Gluck IV via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 26 08:01:37 PST 2018


kallisti5 created this revision.
kallisti5 added reviewers: chandlerc, joerg, compnerd, kristina, js.
kallisti5 added a project: clang.
Herald added a subscriber: cfe-commits.

A revision on https://reviews.llvm.org/D53696 from another user.


Repository:
  rC Clang

https://reviews.llvm.org/D54901

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


Index: test/CodeGenCXX/float128-declarations.cpp
===================================================================
--- test/CodeGenCXX/float128-declarations.cpp
+++ test/CodeGenCXX/float128-declarations.cpp
@@ -16,6 +16,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 and different calling
Index: lib/Basic/Targets/OSTargets.h
===================================================================
--- lib/Basic/Targets/OSTargets.h
+++ lib/Basic/Targets/OSTargets.h
@@ -257,6 +257,9 @@
     Builder.defineMacro("__HAIKU__");
     Builder.defineMacro("__ELF__");
     DefineStd(Builder, "unix", Opts);
+    if (this->HasFloat128) {
+      Builder.defineMacro("__FLOAT128__");
+    }
   }
 
 public:
@@ -267,6 +270,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.175266.patch
Type: text/x-patch
Size: 1572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181126/ccbaff72/attachment.bin>


More information about the cfe-commits mailing list