diff options
author | Simon Tatham <simon.tatham@arm.com> | 2019-06-03 11:02:53 +0000 |
---|---|---|
committer | Simon Tatham <simon.tatham@arm.com> | 2019-06-03 11:02:53 +0000 |
commit | dc83a3c44940ca4d13839613dc55049e5eddc42e (patch) | |
tree | 20dd4fabc8599c75138ac84dabe11f587dd610d4 /llvm/lib/Support/ARMTargetParser.cpp | |
parent | d8d3e17b8b07a34e6118a8b6cd66aea657265531 (diff) | |
download | bcm5719-llvm-dc83a3c44940ca4d13839613dc55049e5eddc42e.tar.gz bcm5719-llvm-dc83a3c44940ca4d13839613dc55049e5eddc42e.zip |
[ARM] Fix recent breakage of -mfpu=none.
The recent change D60691 introduced a bug in clang when handling
option combinations such as `-mcpu=cortex-m4 -mfpu=none`. Those
options together should select Cortex-M4 but disable all use of
hardware FP, but in fact, now hardware FP instructions can still be
generated in that mode.
The reason is because the handling of FPUVersion::NONE disables all
the same feature names it used to, of which the base one is `vfp2`.
But now there are further features below that, like `vfp2d16fp` and
(following D60694) `fpregs`, which also need to be turned off to
disable hardware FP completely.
Added a tiny test which double-checks that compiling a simple FP
function doesn't access the FP registers.
Reviewers: SjoerdMeijer, dmgreen
Reviewed By: dmgreen
Subscribers: lebedev.ri, javed.absar, kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62729
llvm-svn: 362380
Diffstat (limited to 'llvm/lib/Support/ARMTargetParser.cpp')
-rw-r--r-- | llvm/lib/Support/ARMTargetParser.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Support/ARMTargetParser.cpp b/llvm/lib/Support/ARMTargetParser.cpp index a33f602e532..8806ea52fdf 100644 --- a/llvm/lib/Support/ARMTargetParser.cpp +++ b/llvm/lib/Support/ARMTargetParser.cpp @@ -198,6 +198,7 @@ bool ARM::getFPUFeatures(unsigned FPUKind, std::vector<StringRef> &Features) { Features.push_back("-fp-armv8"); break; case FPUVersion::NONE: + Features.push_back("-fpregs"); Features.push_back("-vfp2"); Features.push_back("-vfp3"); Features.push_back("-fp16"); |