]> granicus.if.org Git - clang/commitdiff
Add support for vector shifts, pretty straight forward.
authorNate Begeman <natebegeman@mac.com>
Sun, 25 Oct 2009 02:26:48 +0000 (02:26 +0000)
committerNate Begeman <natebegeman@mac.com>
Sun, 25 Oct 2009 02:26:48 +0000 (02:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85033 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index b1915750c9e9164ea6081568450acd2bd46ea73f..17956e65ae583c1548e90e1c55d0116d84d396d1 100644 (file)
@@ -4406,6 +4406,10 @@ QualType Sema::CheckShiftOperands(Expr *&lex, Expr *&rex, SourceLocation Loc,
   if (!lex->getType()->isIntegerType() || !rex->getType()->isIntegerType())
     return InvalidOperands(Loc, lex, rex);
 
+  // Vector shifts promote their scalar inputs to vector type.
+  if (lex->getType()->isVectorType() || rex->getType()->isVectorType())
+    return CheckVectorOperands(Loc, lex, rex);
+
   // Shifts don't perform usual arithmetic conversions, they just do integer
   // promotions on each operand. C99 6.5.7p3
   QualType LHSTy = Context.isPromotableBitField(lex);