[PATCH] D72433: [Driver][PowerPC] Move powerpcspe logic from cc1 to Driver
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 8 21:37:44 PST 2020
MaskRay updated this revision to Diff 236961.
MaskRay retitled this revision from "[PowerPC] Change SubArchType if -mspe is specified" to "[Driver][PowerPC] Move powerpcspe logic from cc1 to Driver".
MaskRay edited the summary of this revision.
MaskRay removed subscribers: wuzish, merge_guards_bot.
MaskRay added a comment.
Repurpose
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72433/new/
https://reviews.llvm.org/D72433
Files:
clang/lib/Basic/Targets/PPC.cpp
clang/lib/Driver/ToolChains/Arch/PPC.cpp
clang/test/Driver/ppc-features.cpp
clang/test/Preprocessor/init.c
Index: clang/test/Preprocessor/init.c
===================================================================
--- clang/test/Preprocessor/init.c
+++ clang/test/Preprocessor/init.c
@@ -6551,7 +6551,6 @@
// PPC32-LINUX-NOT: _CALL_LINUX
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-unknown-linux-gnu -target-feature +spe < /dev/null | FileCheck -match-full-lines -check-prefix PPC32-SPE %s
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpcspe-unknown-linux-gnu < /dev/null | FileCheck -match-full-lines -check-prefix PPC32-SPE %s
//
// PPC32-SPE:#define __NO_FPRS__ 1
// PPC32-SPE:#define __SPE__ 1
Index: clang/test/Driver/ppc-features.cpp
===================================================================
--- clang/test/Driver/ppc-features.cpp
+++ clang/test/Driver/ppc-features.cpp
@@ -168,7 +168,9 @@
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-invariant-function-descriptors -minvariant-function-descriptors -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-INVFUNCDESC %s
// CHECK-INVFUNCDESC: "-target-feature" "+invariant-function-descriptors"
-// RUN: %clang -target powerpc-unknown-linux-gnu %s -mno-spe -mspe -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-SPE %s
+// RUN: %clang -target powerpc-unknown-freebsd %s -mno-spe -mspe -c -### 2>&1 | FileCheck -check-prefix=CHECK-SPE %s
+// RUN: %clang -target powerpcspe-unknown-freebsd %s -c -### 2>&1 | FileCheck -check-prefix=CHECK-SPE %s
+// CHECK-SPE: "-triple" "powerpc-unknown-freebsd"
// CHECK-SPE: "-target-feature" "+spe"
// Assembler features
Index: clang/lib/Driver/ToolChains/Arch/PPC.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Arch/PPC.cpp
+++ clang/lib/Driver/ToolChains/Arch/PPC.cpp
@@ -104,6 +104,9 @@
void ppc::getPPCTargetFeatures(const Driver &D, const llvm::Triple &Triple,
const ArgList &Args,
std::vector<StringRef> &Features) {
+ if (Triple.getSubArch() == llvm::Triple::PPCSubArch_spe)
+ Features.push_back("+spe");
+
handleTargetFeaturesGroup(Args, Features, options::OPT_m_ppc_Features_Group);
ppc::FloatABI FloatABI = ppc::getPPCFloatABI(D, Args);
Index: clang/lib/Basic/Targets/PPC.cpp
===================================================================
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -316,8 +316,7 @@
.Case("pwr8", true)
.Default(false);
- Features["spe"] = getTriple().getSubArch() == llvm::Triple::PPCSubArch_spe ||
- llvm::StringSwitch<bool>(CPU)
+ Features["spe"] = llvm::StringSwitch<bool>(CPU)
.Case("8548", true)
.Case("e500", true)
.Default(false);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72433.236961.patch
Type: text/x-patch
Size: 2823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200109/c2d5e7a9/attachment.bin>
More information about the cfe-commits
mailing list