Merge pull request #961 from Vsevolod-Livinskij/knc_header_fix

Codegenerator fix for compability with generic
This commit is contained in:
Dmitry Babokin
2015-02-12 16:16:06 +03:00

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";
} }
} }
} }