[PATCH] D90213: [PowerPC] [Clang] Enable float128 feature on P9 by default
Qiu Chaofan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 27 02:24:06 PDT 2020
qiucf created this revision.
qiucf added reviewers: echristo, stefanp, nemanjai, jsji, steven.zhang, PowerPC.
Herald added subscribers: cfe-commits, dexonsmith, shchenz, kbarton.
Herald added a project: clang.
qiucf requested review of this revision.
As Power9 introduced hardware support for IEEE quad-precision FP type, the feature should be enabled by default on Power9 or newer targets.
And as I saw, GCC also enables the feature for all VSX-enabled targets (Power7 and Power8). If we want to align with GCC behaviors about FP128, we'd also do that after fixing f128 libcalls' calling convention issue.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D90213
Files:
clang/lib/Basic/Targets/PPC.cpp
clang/test/Driver/ppc-f128-support-check.c
Index: clang/test/Driver/ppc-f128-support-check.c
===================================================================
--- clang/test/Driver/ppc-f128-support-check.c
+++ clang/test/Driver/ppc-f128-support-check.c
@@ -1,7 +1,7 @@
// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
-// RUN: -mcpu=pwr9 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=HASF128
+// RUN: -mcpu=pwr9 %s 2>&1 | FileCheck %s --check-prefix=HASF128
// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
-// RUN: -mcpu=power9 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=HASF128
+// RUN: -mcpu=power9 %s 2>&1 | FileCheck %s --check-prefix=HASF128
// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
// RUN: -mcpu=pwr8 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=NOF128
Index: clang/lib/Basic/Targets/PPC.cpp
===================================================================
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -313,6 +313,9 @@
.Case("pwr9", true)
.Case("pwr8", true)
.Default(false);
+ Features["float128"] = llvm::StringSwitch<bool>(CPU)
+ .Case("pwr9", true)
+ .Default(false);
Features["spe"] = llvm::StringSwitch<bool>(CPU)
.Case("8548", true)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90213.300919.patch
Type: text/x-patch
Size: 1400 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201027/65d1d4c9/attachment.bin>
More information about the cfe-commits
mailing list