Explicitly set armv7-eabi target triple on ARM.
This lets the compiler generate FMA instructions, which seems desirable.
This commit is contained in:
34
ispc.cpp
34
ispc.cpp
@@ -576,22 +576,26 @@ Target::SupportedTargetISAs() {
|
|||||||
std::string
|
std::string
|
||||||
Target::GetTripleString() const {
|
Target::GetTripleString() const {
|
||||||
llvm::Triple triple;
|
llvm::Triple triple;
|
||||||
// Start with the host triple as the default
|
if (m_arch == "arm") {
|
||||||
triple.setTriple(llvm::sys::getDefaultTargetTriple());
|
triple.setTriple("armv7-eabi");
|
||||||
|
}
|
||||||
// And override the arch in the host triple based on what the user
|
else {
|
||||||
// specified. Here we need to deal with the fact that LLVM uses one
|
// Start with the host triple as the default
|
||||||
// naming convention for targets TargetRegistry, but wants some
|
triple.setTriple(llvm::sys::getDefaultTargetTriple());
|
||||||
// slightly different ones for the triple. TODO: is there a way to
|
|
||||||
// have it do this remapping, which would presumably be a bit less
|
|
||||||
// error prone?
|
|
||||||
if (m_arch == "x86")
|
|
||||||
triple.setArchName("i386");
|
|
||||||
else if (m_arch == "x86-64")
|
|
||||||
triple.setArchName("x86_64");
|
|
||||||
else
|
|
||||||
triple.setArchName(m_arch);
|
|
||||||
|
|
||||||
|
// And override the arch in the host triple based on what the user
|
||||||
|
// specified. Here we need to deal with the fact that LLVM uses one
|
||||||
|
// naming convention for targets TargetRegistry, but wants some
|
||||||
|
// slightly different ones for the triple. TODO: is there a way to
|
||||||
|
// have it do this remapping, which would presumably be a bit less
|
||||||
|
// error prone?
|
||||||
|
if (m_arch == "x86")
|
||||||
|
triple.setArchName("i386");
|
||||||
|
else if (m_arch == "x86-64")
|
||||||
|
triple.setArchName("x86_64");
|
||||||
|
else
|
||||||
|
triple.setArchName(m_arch);
|
||||||
|
}
|
||||||
return triple.str();
|
return triple.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user