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

Nate Begeman natebegeman at mac.com
Tue Jun 8 22:11:55 PDT 2010


Author: sampo
Date: Wed Jun  9 00:11:55 2010
New Revision: 105682

URL: http://llvm.org/viewvc/llvm-project?rev=105682&view=rev
Log:
Specialize I-Class instructions better so that we have less work to do in codegen.
Parenthesize macro args

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=105682&r1=105681&r2=105682&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Wed Jun  9 00:11:55 2010
@@ -310,10 +310,14 @@
       return quad ? "V48c" : "V24c";
     if (mod == '4')
       return quad ? "V64c" : "V32c";
-    if (mod == 'f')
+    if (mod == 'f' || (ck == ClassI && type == 'f'))
       return quad ? "V4f" : "V2f";
-    if (mod == 'x' || mod == 'u')
+    if (ck == ClassI && type == 's')
+      return quad ? "V8s" : "V4s";
+    if (ck == ClassI && type == 'i')
       return quad ? "V4i" : "V2i";
+    if (ck == ClassI && type == 'l')
+      return quad ? "V2LLi" : "V1LLi";
     
     return quad ? "V16c" : "V8c";
   }    
@@ -325,9 +329,16 @@
     return quad ? "V16cV16cV16c" : "V8cV8cV8c";
   if (mod == '4')
     return quad ? "V16cV16cV16cV16c" : "V8cV8cV8cV8c";
-  if (mod == 'f')
-    return quad ? "V4f" : "V2f";
 
+  if (mod == 'f' || (ck == ClassI && type == 'f'))
+    return quad ? "V4f" : "V2f";
+  if (ck == ClassI && type == 's')
+    return quad ? "V8s" : "V4s";
+  if (ck == ClassI && type == 'i')
+    return quad ? "V4i" : "V2i";
+  if (ck == ClassI && type == 'l')
+    return quad ? "V2LLi" : "V1LLi";
+  
   return quad ? "V16c" : "V8c";
 }
 
@@ -658,7 +669,12 @@
       continue;
     }
     
+    // Parenthesize the args from the macro.
+    if (define)
+      s.push_back('(');
     s.push_back(arg);
+    if (define)
+      s.push_back(')');
     
     if (structTypes && proto[i] != 's' && proto[i] != 'i' && proto[i] != 'l' &&
         proto[i] != 'p' && proto[i] != 'c') {





More information about the llvm-commits mailing list