diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-12-21 23:28:17 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-12-21 23:28:17 +0000 |
commit | a91320b8af7143f7af4c0665ffa62a3b244c0bd9 (patch) | |
tree | eb3e54ffd49e46cc4390b7d1b12acdd6754a27b6 /lib/Driver/Tools.cpp | |
parent | a9829ae7a3a4e3a753dfcb7bb023a799db465791 (diff) |
ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
- Correctly is in quotes, because we are following what I interpreted as GCC's
intent (which diverges from practice, naturally).
- Also, fix the arch define for arm1136jf-s.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 8cdd00c536..8ac448fdaa 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -450,6 +450,35 @@ void Clang::AddARMTargetArgs(const ArgList &Args, CmdArgs.push_back("-target-feature"); CmdArgs.push_back("+soft-float-abi"); } + + // Honor -mfpu=. + // + // FIXME: Centralize feature selection, defaulting shouldn't be also in the + // frontend target. + if (const Arg *A = Args.getLastArg(options::OPT_mfpu_EQ)) { + llvm::StringRef FPU = A->getValue(Args); + + // Set the target features based on the FPU. + if (FPU == "fpa" || FPU == "fpe2" || FPU == "fpe3" || FPU == "maverick") { + // Disable any default FPU support. + CmdArgs.push_back("-target-feature"); + CmdArgs.push_back("-vfp2"); + CmdArgs.push_back("-target-feature"); + CmdArgs.push_back("-vfp3"); + CmdArgs.push_back("-target-feature"); + CmdArgs.push_back("-neon"); + } else if (FPU == "vfp") { + CmdArgs.push_back("-target-feature"); + CmdArgs.push_back("+vfp2"); + } else if (FPU == "vfp3") { + CmdArgs.push_back("-target-feature"); + CmdArgs.push_back("+vfp3"); + } else if (FPU == "neon") { + CmdArgs.push_back("-target-feature"); + CmdArgs.push_back("+neon"); + } else + D.Diag(clang::diag::err_drv_clang_unsupported) << A->getAsString(Args); + } } void Clang::AddX86TargetArgs(const ArgList &Args, |