[llvm-commits] [llvm] r121173 - in /llvm/trunk/utils/TableGen: NeonEmitter.cpp NeonEmitter.h

Bob Wilson bob.wilson at apple.com
Tue Dec 7 12:02:45 PST 2010


Author: bwilson
Date: Tue Dec  7 14:02:45 2010
New Revision: 121173

URL: http://llvm.org/viewvc/llvm-project?rev=121173&view=rev
Log:
Add new built-in operations for vmull and vmull_n
so they can be implemented without requiring clang builtins.
Radar 8446238.

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

Modified: llvm/trunk/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.cpp?rev=121173&r1=121172&r2=121173&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Tue Dec  7 14:02:45 2010
@@ -508,6 +508,15 @@
   return s;
 }
 
+// Use the vmovl builtin to sign-extend or zero-extend a vector.
+static std::string Extend(const std::string &proto, StringRef typestr,
+                          const std::string &a) {
+  std::string s;
+  s = MangleName("vmovl", typestr, ClassS);
+  s += "(" + a + ")";
+  return s;
+}
+
 static std::string Duplicate(unsigned nElts, StringRef typestr,
                              const std::string &a) {
   std::string s;
@@ -587,6 +596,15 @@
   case OpMul:
     s += "__a * __b;";
     break;
+  case OpMullN:
+    s += Extend(proto, typestr, "__a") + " * " +
+      Extend(proto, typestr,
+             Duplicate(nElts << (int)quad, typestr, "__b")) + ";";
+    break;
+  case OpMull:
+    s += Extend(proto, typestr, "__a") + " * " +
+      Extend(proto, typestr, "__b") + ";";
+    break;
   case OpMlaN:
     s += "__a + (__b * " + Duplicate(nElts, typestr, "__c") + ");";
     break;

Modified: llvm/trunk/utils/TableGen/NeonEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.h?rev=121173&r1=121172&r2=121173&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.h (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.h Tue Dec  7 14:02:45 2010
@@ -26,9 +26,11 @@
   OpAdd,
   OpSub,
   OpMul,
+  OpMull,
   OpMla,
   OpMls,
   OpMulN,
+  OpMullN,
   OpMlaN,
   OpMlsN,
   OpMulLane,
@@ -79,9 +81,11 @@
       OpMap["OP_ADD"]   = OpAdd;
       OpMap["OP_SUB"]   = OpSub;
       OpMap["OP_MUL"]   = OpMul;
+      OpMap["OP_MULL"]  = OpMull;
       OpMap["OP_MLA"]   = OpMla;
       OpMap["OP_MLS"]   = OpMls;
       OpMap["OP_MUL_N"] = OpMulN;
+      OpMap["OP_MULL_N"]= OpMullN;
       OpMap["OP_MLA_N"] = OpMlaN;
       OpMap["OP_MLS_N"] = OpMlsN;
       OpMap["OP_MUL_LN"]= OpMulLane;





More information about the llvm-commits mailing list