diff options
| author | Amara Emerson <amara.emerson@arm.com> | 2013-10-01 10:20:54 +0000 |
|---|---|---|
| committer | Amara Emerson <amara.emerson@arm.com> | 2013-10-01 10:20:54 +0000 |
| commit | 4cdb87b2d5ebc6e8c3345d5b9b43ca9e9f29d236 (patch) | |
| tree | 4bf015b63b6a31c1cc09de1f3d3d544daa1b73be /clang/lib/Driver/Tools.cpp | |
| parent | 28942d4ca06c7a84b2ac1e2b7f80455f545b1439 (diff) | |
| download | bcm5719-llvm-4cdb87b2d5ebc6e8c3345d5b9b43ca9e9f29d236.tar.gz bcm5719-llvm-4cdb87b2d5ebc6e8c3345d5b9b43ca9e9f29d236.zip | |
[ARM] Add -mfpu=none option to the driver.
llvm-svn: 191736
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index dd48bc18e81..ff50169e44f 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -573,8 +573,36 @@ static bool isNoCommonDefault(const llvm::Triple &Triple) { // // FIXME: Centralize feature selection, defaulting shouldn't be also in the // frontend target. -static void getFPUFeatures(const Driver &D, const Arg *A, const ArgList &Args, - std::vector<const char *> &Features) { +static void getAArch64FPUFeatures(const Driver &D, const Arg *A, + const ArgList &Args, + std::vector<const char *> &Features) { + StringRef FPU = A->getValue(); + if (FPU == "fp-armv8") { + Features.push_back("+fp-armv8"); + } else if (FPU == "neon-fp-armv8") { + Features.push_back("+fp-armv8"); + Features.push_back("+neon"); + } else if (FPU == "crypto-neon-fp-armv8") { + Features.push_back("+fp-armv8"); + Features.push_back("+neon"); + Features.push_back("+crypto"); + } else if (FPU == "neon") { + Features.push_back("+neon"); + } else if (FPU == "none") { + Features.push_back("-fp-armv8"); + Features.push_back("-crypto"); + Features.push_back("-neon"); + } else + D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args); +} + +// Handle -mfpu=. +// +// FIXME: Centralize feature selection, defaulting shouldn't be also in the +// frontend target. +static void getARMFPUFeatures(const Driver &D, const Arg *A, + const ArgList &Args, + std::vector<const char *> &Features) { StringRef FPU = A->getValue(); // Set the target features based on the FPU. @@ -603,6 +631,13 @@ static void getFPUFeatures(const Driver &D, const Arg *A, const ArgList &Args, Features.push_back("+fp-armv8"); } else if (FPU == "neon") { Features.push_back("+neon"); + } else if (FPU == "none") { + Features.push_back("-vfp2"); + Features.push_back("-vfp3"); + Features.push_back("-vfp4"); + Features.push_back("-fp-armv8"); + Features.push_back("-crypto"); + Features.push_back("-neon"); } else D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args); } @@ -704,7 +739,7 @@ static void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple, // Honor -mfpu=. if (const Arg *A = Args.getLastArg(options::OPT_mfpu_EQ)) - getFPUFeatures(D, A, Args, Features); + getARMFPUFeatures(D, A, Args, Features); // Setting -msoft-float effectively disables NEON because of the GCC // implementation, although the same isn't true of VFP or VFP3. @@ -1384,7 +1419,7 @@ static void getAArch64TargetFeatures(const Driver &D, const ArgList &Args, std::vector<const char *> &Features) { // Honor -mfpu=. if (const Arg *A = Args.getLastArg(options::OPT_mfpu_EQ)) - getFPUFeatures(D, A, Args, Features); + getAArch64FPUFeatures(D, A, Args, Features); } static void getTargetFeatures(const Driver &D, const llvm::Triple &Triple, |

