[PATCH] D135171: FreeBSD: enable __float128 on x86
Brooks Davis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 31 00:57:01 PDT 2023
brooks updated this revision to Diff 509934.
brooks added a comment.
- Rebase
- Add powerpc64le
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135171/new/
https://reviews.llvm.org/D135171
Files:
clang/lib/Basic/Targets/OSTargets.h
clang/test/CodeGenCXX/float128-declarations.cpp
Index: clang/test/CodeGenCXX/float128-declarations.cpp
===================================================================
--- clang/test/CodeGenCXX/float128-declarations.cpp
+++ clang/test/CodeGenCXX/float128-declarations.cpp
@@ -2,6 +2,8 @@
// RUN: -target-feature +float128 -std=c++11 %s -o - | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -triple powerpc64le-unknown-unknown \
// RUN: -target-feature +float128 -std=c++11 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-freebsd -std=c++11 \
+// RUN: %s -o - | FileCheck %s -check-prefix=CHECK-X86
// RUN: %clang_cc1 -emit-llvm -triple i386-unknown-linux-gnu -std=c++11 \
// RUN: %s -o - | FileCheck %s -check-prefix=CHECK-X86
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-linux-gnu -std=c++11 \
Index: clang/lib/Basic/Targets/OSTargets.h
===================================================================
--- clang/lib/Basic/Targets/OSTargets.h
+++ clang/lib/Basic/Targets/OSTargets.h
@@ -234,15 +234,24 @@
// 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::ppc64le:
case llvm::Triple::x86:
case llvm::Triple::x86_64:
+ this->HasFloat128 = true;
+ }
+ switch (Triple.getArch()) {
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
+ default:
this->MCountName = ".mcount";
break;
case llvm::Triple::mips:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135171.509934.patch
Type: text/x-patch
Size: 1791 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230331/3847d48f/attachment.bin>
More information about the cfe-commits
mailing list