[PATCH] D134077: [RISCV] Support -mno-implicit-float.
Craig Topper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 16 14:20:05 PDT 2022
craig.topper created this revision.
craig.topper added reviewers: asb, reames, compnerd, rui.zhang.
Herald added subscribers: sunshaoce, VincentWu, StephenFan, vkmr, evandro, luismarques, sameer.abuasal, s.egerton, Jim, benna, psnobl, PkmX, rogfer01, shiva0217, kito-cheng, simoncook, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: clang.
This can be used to disable vectorization and memcpy/memset
expansion for things like OS kernels. It also disables implicit
uses of scalar FP, but I don't know if we have any of those for
RISC-V.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D134077
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/flags.c
Index: clang/test/Driver/flags.c
===================================================================
--- clang/test/Driver/flags.c
+++ clang/test/Driver/flags.c
@@ -27,3 +27,9 @@
// RUN: %clang -target x86_64-linux-gnu -### -c -fclang-abi-compat=3.2 %s 2>&1 | FileCheck -check-prefix=TEST9 %s
// TEST9: "-fclang-abi-compat=3.2"
+//
+// RUN: %clang -target riscv32 -### -S -mno-implicit-float %s 2>&1 | FileCheck -check-prefix=TEST10 %s
+// TEST10: "-no-implicit-float"
+//
+// RUN: %clang -target riscv64 -### -S -mno-implicit-float %s 2>&1 | FileCheck -check-prefix=TEST11 %s
+// TEST11: "-no-implicit-float"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -2194,6 +2194,10 @@
SetRISCVSmallDataLimit(getToolChain(), Args, CmdArgs);
+ if (!Args.hasFlag(options::OPT_mimplicit_float,
+ options::OPT_mno_implicit_float, true))
+ CmdArgs.push_back("-no-implicit-float");
+
if (const Arg *A = Args.getLastArg(options::OPT_mtune_EQ)) {
CmdArgs.push_back("-tune-cpu");
CmdArgs.push_back(A->getValue());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134077.460897.patch
Type: text/x-patch
Size: 1196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220916/1fbc52db/attachment.bin>
More information about the cfe-commits
mailing list