Fixed a bug where certain vector code didn't

work on i386.  Now we let the JIT emit SSE/SSE2
instructions on i386.

<rdar://problem/13240476>

llvm-svn: 175700
This commit is contained in:
Sean Callanan 2013-02-21 01:04:23 +00:00
parent 515dc0f100
commit b45a6f065e
1 changed files with 10 additions and 0 deletions

View File

@ -240,6 +240,13 @@ ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope,
m_compiler->getTargetOpts().Triple = llvm::sys::getDefaultTargetTriple();
}
if (target_sp->GetArchitecture().GetMachine() == llvm::Triple::x86 ||
target_sp->GetArchitecture().GetMachine() == llvm::Triple::x86_64)
{
m_compiler->getTargetOpts().Features.push_back("+sse");
m_compiler->getTargetOpts().Features.push_back("+sse2");
}
if (m_compiler->getTargetOpts().Triple.find("ios") != std::string::npos)
m_compiler->getTargetOpts().ABI = "apcs-gnu";
@ -620,6 +627,9 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_allocation_addr,
StringRef mCPU;
SmallVector<std::string, 0> mAttrs;
for (std::string &feature : m_compiler->getTargetOpts().Features)
mAttrs.push_back(feature);
TargetMachine *target_machine = builder.selectTarget(triple,
mArch,
mCPU,