Add casts for splatted scalars in calls to Neon builtins.

llvm-svn: 120641
diff --git a/llvm/utils/TableGen/NeonEmitter.cpp b/llvm/utils/TableGen/NeonEmitter.cpp
index 7badd5a..eda76b3 100644
--- a/llvm/utils/TableGen/NeonEmitter.cpp
+++ b/llvm/utils/TableGen/NeonEmitter.cpp
@@ -790,8 +790,11 @@
       continue;
     }
     
+    if (splat && (i + 1) == e)
+      args = Duplicate(GetNumElements(typestr, argQuad), typestr, args);
+
     // 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)
@@ -801,10 +804,7 @@
       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 += ", ";
   }