[llvm-commits] [llvm] r119406 - /llvm/trunk/utils/TableGen/NeonEmitter.cpp

Bob Wilson bob.wilson at apple.com
Tue Nov 16 15:57:06 PST 2010


Author: bwilson
Date: Tue Nov 16 17:57:06 2010
New Revision: 119406

URL: http://llvm.org/viewvc/llvm-project?rev=119406&view=rev
Log:
Use new neon_vector_type and neon_polyvector_type attributes for Neon vectors.

Modified:
    llvm/trunk/utils/TableGen/NeonEmitter.cpp

Modified: llvm/trunk/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.cpp?rev=119406&r1=119405&r2=119406&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Tue Nov 16 17:57:06 2010
@@ -844,21 +844,25 @@
 
   // Emit vector typedefs.
   for (unsigned i = 0, e = TDTypeVec.size(); i != e; ++i) {
-    bool dummy, quad = false;
-    (void) ClassifyType(TDTypeVec[i], quad, dummy, dummy);
-    OS << "typedef __attribute__(( __vector_size__(";
-      
-    OS << utostr(8*(quad ? 2 : 1)) << ") )) ";
-    if (!quad)
+    bool dummy, quad = false, poly = false;
+    (void) ClassifyType(TDTypeVec[i], quad, poly, dummy);
+    if (poly)
+      OS << "typedef __attribute__((neon_polyvector_type(";
+    else
+      OS << "typedef __attribute__((neon_vector_type(";
+      
+    unsigned nElts = GetNumElements(TDTypeVec[i], quad);
+    OS << utostr(nElts) << "))) ";
+    if (nElts < 10)
       OS << " ";
       
     OS << TypeString('s', TDTypeVec[i]);
     OS << " " << TypeString('d', TDTypeVec[i]) << ";\n";
   }
   OS << "\n";
-  OS << "typedef __attribute__(( __vector_size__(8) ))  "
+  OS << "typedef __attribute__((__vector_size__(8)))  "
     "double float64x1_t;\n";
-  OS << "typedef __attribute__(( __vector_size__(16) )) "
+  OS << "typedef __attribute__((__vector_size__(16))) "
     "double float64x2_t;\n";
   OS << "\n";
 





More information about the llvm-commits mailing list