[llvm-commits] [llvm] r120641 - /llvm/trunk/utils/TableGen/NeonEmitter.cpp

Bob Wilson bob.wilson at apple.com
Wed Dec 1 17:18:23 PST 2010


Author: bwilson
Date: Wed Dec  1 19:18:23 2010
New Revision: 120641

URL: http://llvm.org/viewvc/llvm-project?rev=120641&view=rev
Log:
Add casts for splatted scalars in calls to Neon builtins.

Modified:
    llvm/trunk/utils/TableGen/NeonEmitter.cpp

Modified: llvm/trunk/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.cpp?rev=120641&r1=120640&r2=120641&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Wed Dec  1 19:18:23 2010
@@ -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 += ", ";
   }





More information about the llvm-commits mailing list