Codegenerator fix for compability with generic

This commit is contained in:
Vsevolod Livinskiy
2015-02-12 16:00:22 +03:00
parent ab6c7e42d6
commit f84f359d8b

View File

@@ -4418,6 +4418,7 @@ void CWriter::visitShuffleVectorInst(llvm::ShuffleVectorInst &SVI) {
} }
else { else {
// Do an extractelement of this value from the appropriate input. // Do an extractelement of this value from the appropriate input.
Out << " \n#if defined(KNC) \n";
if (OpElts != 1) { // all __vec16_* have overloaded operator [] if (OpElts != 1) { // all __vec16_* have overloaded operator []
Out << "(" << GetValueName(Op) Out << "(" << GetValueName(Op)
<< ")[" << SrcVal << "]"; << ")[" << SrcVal << "]";
@@ -4428,6 +4429,12 @@ void CWriter::visitShuffleVectorInst(llvm::ShuffleVectorInst &SVI) {
Out << ")(&" << GetValueName(Op) Out << ")(&" << GetValueName(Op)
<< "))[" << SrcVal << "]"; << "))[" << SrcVal << "]";
} }
Out << " \n#else \n";
Out << "((";
printType(Out, llvm::PointerType::getUnqual(EltTy));
Out << ")(&" << GetValueName(Op)
<< "))[" << SrcVal << "]";
Out << " \n#endif \n";
} }
} }
} }