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.

llvm-svn: 188796
This commit is contained in:
Tim Northover 2013-08-20 13:13:38 +00:00
parent 1593c7b20a
commit b9facf72aa
1 changed files with 10 additions and 2 deletions

View File

@ -180,7 +180,7 @@ static const char *getARMTargetCPU(const ArgList &Args,
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 ArgList &Args,
.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