[llvm-commits] [llvm-gcc-4.2] r79225 - /llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
Bob Wilson
bob.wilson at apple.com
Sun Aug 16 22:04:02 PDT 2009
Author: bwilson
Date: Mon Aug 17 00:04:01 2009
New Revision: 79225
URL: http://llvm.org/viewvc/llvm-project?rev=79225&view=rev
Log:
Canonicalize vector types for VBSL to use 32-bit integer elements.
This fixes pr4731.
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=79225&r1=79224&r2=79225&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Mon Aug 17 00:04:01 2009
@@ -1866,11 +1866,20 @@
break;
}
- case NEON_BUILTIN_vbsl:
+ case NEON_BUILTIN_vbsl: {
+ // Canonicalize the vector type to have 32-bit integer elements.
+ const VectorType *VTy = dyn_cast<const VectorType>(Ops[0]->getType());
+ assert(VTy && "expected a vector type");
+ VTy = VectorType::get(Type::getInt32Ty(Context), VTy->getBitWidth() / 32);
+ Ops[0] = Builder.CreateBitCast(Ops[0], VTy);
+ Ops[1] = Builder.CreateBitCast(Ops[1], VTy);
+ Ops[2] = Builder.CreateBitCast(Ops[2], VTy);
Result = Builder.CreateOr(Builder.CreateAnd(Ops[1], Ops[0]),
Builder.CreateAnd(Ops[2],
Builder.CreateNot(Ops[0])));
+ Result = Builder.CreateBitCast(Result, ResultType);
break;
+ }
case NEON_BUILTIN_vtbl1:
case NEON_BUILTIN_vtbl2:
More information about the llvm-commits
mailing list