Fix for __vec16_i64 element extracting

This commit is contained in:
Vsevolod Livinskiy
2015-01-30 16:26:18 +03:00
parent 64bc48863d
commit 7816fae331

View File

@@ -4418,10 +4418,16 @@ void CWriter::visitShuffleVectorInst(llvm::ShuffleVectorInst &SVI) {
}
else {
// Do an extractelement of this value from the appropriate input.
Out << "((";
printType(Out, llvm::PointerType::getUnqual(EltTy));
Out << ")(&" << GetValueName(Op)
<< "))[" << SrcVal << "]";
if (OpElts != 1) { // all __vec16_* have overloaded operator []
Out << "(" << GetValueName(Op)
<< ")[" << SrcVal << "]";
}
else { // but __vec1_* don't have it
Out << "((";
printType(Out, llvm::PointerType::getUnqual(EltTy));
Out << ")(&" << GetValueName(Op)
<< "))[" << SrcVal << "]";
}
}
}
}