[llvm-commits] [llvm] r121299 - in /llvm/trunk/utils/TableGen: NeonEmitter.cpp NeonEmitter.h
Bob Wilson
bob.wilson at apple.com
Wed Dec 8 14:36:08 PST 2010
Author: bwilson
Date: Wed Dec 8 16:36:08 2010
New Revision: 121299
URL: http://llvm.org/viewvc/llvm-project?rev=121299&view=rev
Log:
Add operators for "_lane" variants of some saturating Neon multiply intrinsics
so they can be implemented without separate clang builtins.
Modified:
llvm/trunk/utils/TableGen/NeonEmitter.cpp
llvm/trunk/utils/TableGen/NeonEmitter.h
Modified: llvm/trunk/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.cpp?rev=121299&r1=121298&r2=121299&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Wed Dec 8 16:36:08 2010
@@ -660,6 +660,26 @@
s += "__a - (" + Extend(typestr, "__b") + " * " +
Extend(typestr, "__c") + ");";
break;
+ case OpQDMullLane:
+ s += MangleName("vqdmull", typestr, ClassS) + "(__a, " +
+ SplatLane(nElts, "__b", "__c") + ");";
+ break;
+ case OpQDMlalLane:
+ s += MangleName("vqdmlal", typestr, ClassS) + "(__a, " +
+ SplatLane(nElts, "__b", "__c") + ");";
+ break;
+ case OpQDMlslLane:
+ s += MangleName("vqdmlsl", typestr, ClassS) + "(__a, " +
+ SplatLane(nElts, "__b", "__c") + ");";
+ break;
+ case OpQDMulhLane:
+ s += MangleName("vqdmulh", typestr, ClassS) + "(__a, " +
+ SplatLane(nElts, "__b", "__c") + ");";
+ break;
+ case OpQRDMulhLane:
+ s += MangleName("vqrdmulh", typestr, ClassS) + "(__a, " +
+ SplatLane(nElts, "__b", "__c") + ");";
+ break;
case OpEq:
s += "(" + ts + ")(__a == __b);";
break;
@@ -1103,11 +1123,13 @@
std::vector<Record*> RV = Records.getAllDerivedDefinitions("Inst");
// Emit vmovl and vabd intrinsics first so they can be used by other
- // intrinsics.
+ // intrinsics. (Some of the saturating multiply instructions are also
+ // used to implement the corresponding "_lane" variants, but tablegen
+ // sorts the records into alphabetical order so that the "_lane" variants
+ // come after the intrinsics they use.)
emitIntrinsic(OS, Records.getDef("VMOVL"));
emitIntrinsic(OS, Records.getDef("VABD"));
- // Unique the return+pattern types, and assign them.
for (unsigned i = 0, e = RV.size(); i != e; ++i) {
Record *R = RV[i];
if (R->getName() != "VMOVL" && R->getName() != "VABD")
Modified: llvm/trunk/utils/TableGen/NeonEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.h?rev=121299&r1=121298&r2=121299&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.h (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.h Wed Dec 8 16:36:08 2010
@@ -47,6 +47,11 @@
OpMlsLane,
OpMlalLane,
OpMlslLane,
+ OpQDMullLane,
+ OpQDMlalLane,
+ OpQDMlslLane,
+ OpQDMulhLane,
+ OpQRDMulhLane,
OpEq,
OpGe,
OpLe,
@@ -117,6 +122,11 @@
OpMap["OP_MLS_LN"]= OpMlsLane;
OpMap["OP_MLAL_LN"] = OpMlalLane;
OpMap["OP_MLSL_LN"] = OpMlslLane;
+ OpMap["OP_QDMULL_LN"] = OpQDMullLane;
+ OpMap["OP_QDMLAL_LN"] = OpQDMlalLane;
+ OpMap["OP_QDMLSL_LN"] = OpQDMlslLane;
+ OpMap["OP_QDMULH_LN"] = OpQDMulhLane;
+ OpMap["OP_QRDMULH_LN"] = OpQRDMulhLane;
OpMap["OP_EQ"] = OpEq;
OpMap["OP_GE"] = OpGe;
OpMap["OP_LE"] = OpLe;
More information about the llvm-commits
mailing list