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

Bob Wilson bob.wilson at apple.com
Tue Dec 7 16:14:04 PST 2010


Author: bwilson
Date: Tue Dec  7 18:14:04 2010
New Revision: 121213

URL: http://llvm.org/viewvc/llvm-project?rev=121213&view=rev
Log:
Add operators for vadd[lw] and vsub[lw]
so they can be implemented without clang builtins.

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=121213&r1=121212&r2=121213&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Tue Dec  7 18:14:04 2010
@@ -584,9 +584,23 @@
   case OpAdd:
     s += "__a + __b;";
     break;
+  case OpAddl:
+    s += Extend(proto, typestr, "__a") + " + "
+      + Extend(proto, typestr, "__b") + ";";
+    break;
+  case OpAddw:
+    s += "__a + " + Extend(proto, typestr, "__b") + ";";
+    break;
   case OpSub:
     s += "__a - __b;";
     break;
+  case OpSubl:
+    s += Extend(proto, typestr, "__a") + " - "
+      + Extend(proto, typestr, "__b") + ";";
+    break;
+  case OpSubw:
+    s += "__a - " + Extend(proto, typestr, "__b") + ";";
+    break;
   case OpMulN:
     s += "__a * " + Duplicate(nElts, typestr, "__b") + ";";
     break;

Modified: llvm/trunk/utils/TableGen/NeonEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.h?rev=121213&r1=121212&r2=121213&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.h (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.h Tue Dec  7 18:14:04 2010
@@ -24,7 +24,11 @@
 enum OpKind {
   OpNone,
   OpAdd,
+  OpAddl,
+  OpAddw,
   OpSub,
+  OpSubl,
+  OpSubw,
   OpMul,
   OpMull,
   OpMla,
@@ -87,7 +91,11 @@
     NeonEmitter(RecordKeeper &R) : Records(R) {
       OpMap["OP_NONE"]  = OpNone;
       OpMap["OP_ADD"]   = OpAdd;
+      OpMap["OP_ADDL"]  = OpAddl;
+      OpMap["OP_ADDW"]  = OpAddw;
       OpMap["OP_SUB"]   = OpSub;
+      OpMap["OP_SUBL"]  = OpSubl;
+      OpMap["OP_SUBW"]  = OpSubw;
       OpMap["OP_MUL"]   = OpMul;
       OpMap["OP_MULL"]  = OpMull;
       OpMap["OP_MLA"]   = OpMla;





More information about the llvm-commits mailing list