r188796 - ARM: default to arm1176jzf-s for hard-float platforms.
Tim Northover
tnorthover at apple.com
Tue Aug 20 06:13:38 PDT 2013
Author: tnorthover
Date: Tue Aug 20 08:13:38 2013
New Revision: 188796
URL: http://llvm.org/viewvc/llvm-project?rev=188796&view=rev
Log:
ARM: default to arm1176jzf-s for hard-float platforms.
It makes no sense to try and compile for arm7tdmi when we're targeting
something like gnueabihf. Although not strictly the most basic hardware
conceivable, I believe arm1176jzf-s is a reasonable compromise (that can always
be overridden explicitly if needed) since it's still in reasonably common use
unlike earlier cores.
Patch by Stephen Kelly.
Modified:
cfe/trunk/lib/Driver/ToolChain.cpp
Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=188796&r1=188795&r2=188796&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Tue Aug 20 08:13:38 2013
@@ -180,7 +180,7 @@ static const char *getARMTargetCPU(const
MArch = Triple.getArchName();
}
- return llvm::StringSwitch<const char *>(MArch)
+ const char *result = llvm::StringSwitch<const char *>(MArch)
.Cases("armv2", "armv2a","arm2")
.Case("armv3", "arm6")
.Case("armv3m", "arm7m")
@@ -207,7 +207,15 @@ static const char *getARMTargetCPU(const
.Case("xscale", "xscale")
// If all else failed, return the most base CPU with thumb interworking
// supported by LLVM.
- .Default("arm7tdmi");
+ .Default(0);
+
+ if (result)
+ return result;
+
+ return
+ Triple.getEnvironment() == llvm::Triple::GNUEABIHF
+ ? "arm1176jzf-s"
+ : "arm7tdmi";
}
/// getLLVMArchSuffixForARM - Get the LLVM arch name to use for a particular
More information about the cfe-commits
mailing list