Add operators for vadd[lw] and vsub[lw]
authorBob Wilson <bob.wilson@apple.com>
Wed, 8 Dec 2010 00:14:04 +0000 (00:14 +0000)
committerBob Wilson <bob.wilson@apple.com>
Wed, 8 Dec 2010 00:14:04 +0000 (00:14 +0000)
so they can be implemented without clang builtins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121213 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/NeonEmitter.cpp
utils/TableGen/NeonEmitter.h

index c7b3ec55a69fe1a95d3f5a8ee4a4b4ab86b476df..7a623583f3af046a0736d4ee9656259dddac7ff9 100644 (file)
@@ -584,9 +584,23 @@ static std::string GenOpString(OpKind op, const std::string &proto,
   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;
index 4c5889388ba673836c2fa0ec1590ddcaf2726fa0..6c0937b3579d8a3c96c7f7e6c6146736971215d8 100644 (file)
 enum OpKind {
   OpNone,
   OpAdd,
+  OpAddl,
+  OpAddw,
   OpSub,
+  OpSubl,
+  OpSubw,
   OpMul,
   OpMull,
   OpMla,
@@ -87,7 +91,11 @@ namespace llvm {
     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;