[llvm-commits] [llvm-gcc-4.2] r104016 - /llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp

Bob Wilson bob.wilson at apple.com
Mon May 17 22:54:29 PDT 2010


Author: bwilson
Date: Tue May 18 00:54:29 2010
New Revision: 104016

URL: http://llvm.org/viewvc/llvm-project?rev=104016&view=rev
Log:
For vectors with 64-bit elements, vldN_dup is equivalent to vldN (and there
are no Neon instructions for vldN_dup with 64-bit elements), so translate
those builtins to the vldN intrinsics.  Radar 7985191.

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=104016&r1=104015&r2=104016&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 Tue May 18 00:54:29 2010
@@ -2093,6 +2093,23 @@
     assert(STy && "expected a struct type");
     const VectorType *VTy = dyn_cast<const VectorType>(STy->getElementType(0));
     assert(VTy && "expected a vector type");
+    intOpTypes[0] = VTy;
+
+    // Handle 64-bit elements as a special-case.  There is no "dup" needed.
+    if (VTy->getElementType()->getPrimitiveSizeInBits() == 64) {
+      switch (neon_code) {
+      case NEON_BUILTIN_vld2_dup: intID = Intrinsic::arm_neon_vld2; break;
+      case NEON_BUILTIN_vld3_dup: intID = Intrinsic::arm_neon_vld3; break;
+      case NEON_BUILTIN_vld4_dup: intID = Intrinsic::arm_neon_vld4; break;
+      default: assert(false);
+      }
+      intFn = Intrinsic::getDeclaration(TheModule, intID, intOpTypes, 1);
+      Type *VPTy = PointerType::getUnqual(Type::getInt8Ty(Context));
+      Result = Builder.CreateCall(intFn, BitCastToType(Ops[0], VPTy));
+      Builder.CreateStore(Result, DestLoc->Ptr);
+      Result = 0;
+      break;
+    }
 
     // First use a vldN_lane intrinsic to load into lane 0 of undef vectors.
     switch (neon_code) {
@@ -2101,7 +2118,6 @@
     case NEON_BUILTIN_vld4_dup: intID = Intrinsic::arm_neon_vld4lane; break;
     default: assert(false);
     }
-    intOpTypes[0] = VTy;
     intFn = Intrinsic::getDeclaration(TheModule, intID, intOpTypes, 1);
     unsigned NumVecs = 0;
     switch (neon_code) {





More information about the llvm-commits mailing list