Add a missing cast for Neon vsbl results.
authorBob Wilson <bob.wilson@apple.com>
Thu, 2 Dec 2010 01:18:20 +0000 (01:18 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 2 Dec 2010 01:18:20 +0000 (01:18 +0000)
The bitwise operations are always done with unsigned values, but the result may
be signed.

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

utils/TableGen/NeonEmitter.cpp

index 56e7e185b4544157f281c1b35913017611db1190..7badd5af860254786ddf4dbac4901e3f28f2ec79 100644 (file)
@@ -611,9 +611,10 @@ static std::string GenOpString(OpKind op, const std::string &proto,
     break;
   case OpSelect:
     // ((0 & 1) | (~0 & 2))
+    s += "(" + ts + ")";
     ts = TypeString(proto[1], typestr);
-    s += "(a & (" + ts + ")b) | ";
-    s += "(~a & (" + ts + ")c)";
+    s += "((a & (" + ts + ")b) | ";
+    s += "(~a & (" + ts + ")c))";
     break;
   case OpRev16:
     s += "__builtin_shufflevector(a, a";