From 7870b133ac7b03bd53388f51250d009325f43399 Mon Sep 17 00:00:00 2001 From: Anton Yartsev Date: Sun, 27 Mar 2011 15:36:07 +0000 Subject: AltiVec vector comparison logic now affect only vectors of fundamental AltiVec vector types. It fixes bug 9347. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128381 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprScalar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExprScalar.cpp') diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 27b868974d..c6a5a40d76 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -2119,7 +2119,9 @@ Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E,unsigned UICmpOpc, // If AltiVec, the comparison results in a numeric type, so we use // intrinsics comparing vectors and giving 0 or 1 as a result - if (LHSTy->isVectorType() && CGF.getContext().getLangOptions().AltiVec) { + if (LHSTy->isVectorType() && + LHSTy->getAs()->getVectorKind() == + VectorType::AltiVecVector) { // constants for mapping CR6 register bits to predicate result enum { CR6_EQ=0, CR6_EQ_REV, CR6_LT, CR6_LT_REV } CR6; -- cgit v1.2.3