[cfe-commits] r45602 - /cfe/trunk/Sema/SemaExpr.cpp
Chris Lattner
sabre at nondot.org
Fri Jan 4 15:32:24 PST 2008
Author: lattner
Date: Fri Jan 4 17:32:24 2008
New Revision: 45602
URL: http://llvm.org/viewvc/llvm-project?rev=45602&view=rev
Log:
unnest vector handling again.
Modified:
cfe/trunk/Sema/SemaExpr.cpp
Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=45602&r1=45601&r2=45602&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Fri Jan 4 17:32:24 2008
@@ -1103,32 +1103,32 @@
return Compatible;
return Incompatible;
}
-
- if (lhsType->isArithmeticType() && rhsType->isArithmeticType()) {
- if (lhsType->isVectorType() || rhsType->isVectorType()) {
- // For OCUVector, allow vector splats; float -> <n x float>
- if (const OCUVectorType *LV = lhsType->getAsOCUVectorType()) {
- if (LV->getElementType().getTypePtr() == rhsType.getTypePtr())
+
+ if (lhsType->isVectorType() || rhsType->isVectorType()) {
+ // For OCUVector, allow vector splats; float -> <n x float>
+ if (const OCUVectorType *LV = lhsType->getAsOCUVectorType()) {
+ if (LV->getElementType().getTypePtr() == rhsType.getTypePtr())
+ return Compatible;
+ }
+
+ // If LHS and RHS are both vectors of integer or both vectors of floating
+ // point types, and the total vector length is the same, allow the
+ // conversion. This is a bitcast; no bits are changed but the result type
+ // is different.
+ if (getLangOptions().LaxVectorConversions &&
+ lhsType->isVectorType() && rhsType->isVectorType()) {
+ if ((lhsType->isIntegerType() && rhsType->isIntegerType()) ||
+ (lhsType->isRealFloatingType() && rhsType->isRealFloatingType())) {
+ if (Context.getTypeSize(lhsType, SourceLocation()) ==
+ Context.getTypeSize(rhsType, SourceLocation()))
return Compatible;
}
-
- if (getLangOptions().LaxVectorConversions &&
- lhsType->isVectorType() && rhsType->isVectorType()) {
- // If LHS and RHS are both integer or both floating point types, and
- // the total vector length is the same, allow the conversion. This is
- // a bitcast; no bits are changed but the result type is different.
- if ((lhsType->isIntegerType() && rhsType->isIntegerType()) ||
- (lhsType->isRealFloatingType() &&
- rhsType->isRealFloatingType())) {
- if (Context.getTypeSize(lhsType, SourceLocation()) ==
- Context.getTypeSize(rhsType, SourceLocation()))
- return Compatible;
- }
- }
- return Incompatible;
- }
+ }
+ return Incompatible;
+ }
+
+ if (lhsType->isArithmeticType() && rhsType->isArithmeticType())
return Compatible;
- }
if (lhsType->isPointerType()) {
if (rhsType->isIntegerType())
More information about the cfe-commits
mailing list