diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 582d1c4..ff21e43 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -2516,7 +2516,55 @@ VisitAbstractConditionalOperator(const AbstractConditionalOperator *E) {
       return Result;
     }
   }
+  
+  // ARM: support vector the select function.
+  if ( Context.getTargetInfo().getTriple().getArch() == llvm::Triple::arm &&
+       !CGF.getContext().getLangOptions().OpenCL &&
+       condExpr->getType()->isVectorType() ) {
+    llvm::Value *CondV = CGF.EmitScalarExpr(condExpr);
+    llvm::Value *LHS = Visit(lhsExpr);
+    llvm::Value *RHS = Visit(rhsExpr);
+    
+    llvm::Type *condType = ConvertType(condExpr->getType());
+    llvm::VectorType *vecTy = cast<llvm::VectorType>(condType);
+    
+    unsigned numElem = vecTy->getNumElements();      
+    llvm::Type *elemType = vecTy->getElementType();
+    
+    std::vector<llvm::Constant*> Zvals;
+    for (unsigned i = 0; i < numElem; ++i)
+      Zvals.push_back(llvm::ConstantInt::get(elemType, 0));
 
+    llvm::Value *zeroVec = llvm::ConstantVector::get(Zvals);    
+    llvm::Value *TestMSB = Builder.CreateICmpSLT(CondV, zeroVec);
+    llvm::Value *tmp = Builder.CreateSExt(TestMSB, 
+                                          llvm::VectorType::get(elemType,
+                                                                numElem),         
+                                          "sext");
+    llvm::Value *tmp2 = Builder.CreateNot(tmp);
+    
+    // Cast float to int to perform ANDs if necessary.
+    llvm::Value *RHSTmp = RHS;
+    llvm::Value *LHSTmp = LHS;
+    bool wasCast = false;
+    llvm::VectorType *rhsVTy = cast<llvm::VectorType>(RHS->getType());
+    
+    if ( rhsVTy->getElementType()->isFloatTy() ||
+         rhsVTy->getElementType()->isDoubleTy() ) {
+      RHSTmp = Builder.CreateBitCast(RHS, tmp2->getType());
+      LHSTmp = Builder.CreateBitCast(LHS, tmp->getType());
+      wasCast = true;
+    }
+    
+    llvm::Value *tmp3 = Builder.CreateAnd(RHSTmp, tmp2);
+    llvm::Value *tmp4 = Builder.CreateAnd(LHSTmp, tmp);
+    llvm::Value *tmp5 = Builder.CreateOr(tmp3, tmp4, "cond");
+    if (wasCast)
+      tmp5 = Builder.CreateBitCast(tmp5, RHS->getType());
+
+    return tmp5;
+  } 
+  
   // OpenCL: If the condition is a vector, we can treat this condition like
   // the select function.
   if (CGF.getContext().getLangOptions().OpenCL 
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 885b966..32758e5 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -4452,6 +4452,12 @@ static bool checkCondition(Sema &S, Expr *Cond) {
   // C99 6.5.15p2
   if (CondTy->isScalarType()) return false;
 
+  // condition is allowed to be a vector for ARM 
+  if ( !S.getLangOptions().OpenCL && 
+       Context.getTargetInfo().getTriple().getArch() == llvm::Triple::arm &&
+       CondTy->isVectorType() )
+    return false;
+  
   // OpenCL: Sec 6.3.i says the condition is allowed to be a vector or scalar.
   if (S.getLangOptions().OpenCL && CondTy->isVectorType())
     return false;
