Add casts for splatted scalars in calls to Neon builtins.
authorBob Wilson <bob.wilson@apple.com>
Thu, 2 Dec 2010 01:18:23 +0000 (01:18 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 2 Dec 2010 01:18:23 +0000 (01:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120641 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/NeonEmitter.cpp

index 7badd5af860254786ddf4dbac4901e3f28f2ec79..eda76b3ca99c7ed4f9d928f2b3bbf9ba139bd1e7 100644 (file)
@@ -790,8 +790,11 @@ static std::string GenBuiltin(const std::string &name, const std::string &proto,
       continue;
     }
     
       continue;
     }
     
+    if (splat && (i + 1) == e)
+      args = Duplicate(GetNumElements(typestr, argQuad), typestr, args);
+
     // Check if an explicit cast is needed.
     // Check if an explicit cast is needed.
-    if (!argScalar &&
+    if ((splat || !argScalar) &&
         ((ck == ClassB && argType != 'c') || argPoly || argUsgn)) {
       std::string argTypeStr = "c";
       if (ck != ClassB)
         ((ck == ClassB && argType != 'c') || argPoly || argUsgn)) {
       std::string argTypeStr = "c";
       if (ck != ClassB)
@@ -801,10 +804,7 @@ static std::string GenBuiltin(const std::string &name, const std::string &proto,
       args = "(" + TypeString('d', argTypeStr) + ")" + args;
     }
     
       args = "(" + TypeString('d', argTypeStr) + ")" + args;
     }
     
-    if (splat && (i + 1) == e)
-      s += Duplicate(GetNumElements(typestr, argQuad), typestr, args);
-    else
-      s += args;
+    s += args;
     if ((i + 1) < e)
       s += ", ";
   }
     if ((i + 1) < e)
       s += ", ";
   }