[PATCH] D135171: FreeBSD: enable __float128 on x86

Brooks Davis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 09:04:25 PDT 2022


brooks created this revision.
brooks added reviewers: arichardson, emaste, dim.
Herald added a subscriber: krytarowski.
Herald added a project: All.
brooks requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This is a prerequisite for proper runtime support on FreeBSD as it will
allow such a runtime to be compiled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135171

Files:
  clang/lib/Basic/Targets/OSTargets.h


Index: clang/lib/Basic/Targets/OSTargets.h
===================================================================
--- clang/lib/Basic/Targets/OSTargets.h
+++ clang/lib/Basic/Targets/OSTargets.h
@@ -232,15 +232,20 @@
     // setting this to 1 is conforming even if all the basic source
     // character literals have the same encoding as char and wchar_t.
     Builder.defineMacro("__STDC_MB_MIGHT_NEQ_WC__", "1");
+
+    if (this->HasFloat128)
+      Builder.defineMacro("__FLOAT128__");
   }
 
 public:
   FreeBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
       : OSTargetInfo<Target>(Triple, Opts) {
     switch (Triple.getArch()) {
-    default:
     case llvm::Triple::x86:
     case llvm::Triple::x86_64:
+      this->HasFloat128 = true;
+      [[fallthrough]];
+    default:
       this->MCountName = ".mcount";
       break;
     case llvm::Triple::mips:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135171.465037.patch
Type: text/x-patch
Size: 884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221004/8d9e9afe/attachment.bin>


More information about the cfe-commits mailing list