diff options
author | Dan Albert <danalbert@google.com> | 2018-10-12 17:06:31 +0000 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2018-10-12 17:06:31 +0000 |
commit | 085848c54cf3102f13d2595c6c22624af06197dd (patch) | |
tree | 1c4964945ffe099c2f15e38c20178c28dafab68e /lib/Driver/ToolChains/Arch | |
parent | 0fffaaba7991802f24588cd4bf683d03299c271f (diff) | |
download | clang-085848c54cf3102f13d2595c6c22624af06197dd.tar.gz |
[Driver] Add defaults for Android ARM FPUs.
Summary:
Android mandates that devices have at least vfpv3-d16 until
Marshmallow and NEON after that. Still honor the user's decision, but
raise the defaults for Android targets.
Reviewers: srhines, pirama, javed.absar, kristof.beyls, peter.smith
Reviewed By: peter.smith
Subscribers: peter.smith, rengolin, kristof.beyls, chrib, cfe-commits
Differential Revision: https://reviews.llvm.org/D53121
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains/Arch')
-rw-r--r-- | lib/Driver/ToolChains/Arch/ARM.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains/Arch/ARM.cpp b/lib/Driver/ToolChains/Arch/ARM.cpp index 1ff73ea4fd..e454a30b61 100644 --- a/lib/Driver/ToolChains/Arch/ARM.cpp +++ b/lib/Driver/ToolChains/Arch/ARM.cpp @@ -378,6 +378,13 @@ void arm::getARMTargetFeatures(const ToolChain &TC, Features); } else if (FPUArg) { getARMFPUFeatures(D, FPUArg, Args, FPUArg->getValue(), Features); + } else if (Triple.isAndroid() && getARMSubArchVersionNumber(Triple) >= 7) { + // Android mandates minimum FPU requirements based on OS version. + const char *AndroidFPU = + Triple.isAndroidVersionLT(23) ? "vfpv3-d16" : "neon"; + if (!llvm::ARM::getFPUFeatures(llvm::ARM::parseFPU(AndroidFPU), Features)) + D.Diag(clang::diag::err_drv_clang_unsupported) + << std::string("-mfpu=") + AndroidFPU; } // Honor -mhwdiv=. ClangAs gives preference to -Wa,-mhwdiv=. |