[cfe-commits] r129536 - in /cfe/trunk: lib/Sema/SemaOverload.cpp test/SemaCXX/neon-vector-types.cpp

Fariborz Jahanian fjahanian at apple.com
Thu Apr 14 13:33:36 PDT 2011


Author: fjahanian
Date: Thu Apr 14 15:33:36 2011
New Revision: 129536

URL: http://llvm.org/viewvc/llvm-project?rev=129536&view=rev
Log:
Match pointer of compatible vection types. 
// rdar://9208404

Added:
    cfe/trunk/test/SemaCXX/neon-vector-types.cpp
Modified:
    cfe/trunk/lib/Sema/SemaOverload.cpp

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=129536&r1=129535&r2=129536&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu Apr 14 15:33:36 2011
@@ -1661,6 +1661,14 @@
     return true;
   }
 
+  if (FromPointeeType->isVectorType() && ToPointeeType->isVectorType() &&
+      Context.areCompatibleVectorTypes(FromPointeeType, ToPointeeType)) {
+    ConvertedType = BuildSimilarlyQualifiedPointerType(FromTypePtr,
+                                                       ToPointeeType,
+                                                       ToType, Context);
+    return true;
+  }
+  
   return false;
 }
 

Added: cfe/trunk/test/SemaCXX/neon-vector-types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/neon-vector-types.cpp?rev=129536&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/neon-vector-types.cpp (added)
+++ cfe/trunk/test/SemaCXX/neon-vector-types.cpp Thu Apr 14 15:33:36 2011
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// rdar://9208404
+
+typedef int MP4Err;
+typedef float Float32;
+typedef float float32_t;
+typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
+typedef float vFloat __attribute__((__vector_size__(16)));
+typedef vFloat VFLOAT;
+typedef unsigned long UInt32;
+
+extern int bar (float32x4_t const *p);
+
+int foo (const Float32 *realBufPtr) {
+  float32x4_t const *vRealPtr = (VFLOAT *)&realBufPtr[0];
+  return bar(vRealPtr);
+}
+
+MP4Err autoCorrelation2nd_Neon(Float32 *alphar, Float32 *alphai,
+			    const Float32 *realBufPtr,
+			    const Float32 *imagBufPtr,
+			    const UInt32 len)
+{
+  float32x4_t const *vRealPtr = (VFLOAT *)&realBufPtr[0];
+  return 0;
+}
+





More information about the cfe-commits mailing list