summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-12-08 22:36:08 +0000
committerBob Wilson <bob.wilson@apple.com>2010-12-08 22:36:08 +0000
commit7441089c9b4df8b397f1f8b0ae486ddb24238a80 (patch)
tree119ff1ca88cb6b9b058a25d8d283b6fe86eaddf0 /utils
parent520820489905c3c9ed268a1c27416f2a726cb66e (diff)
downloadllvm-7441089c9b4df8b397f1f8b0ae486ddb24238a80.tar.gz
llvm-7441089c9b4df8b397f1f8b0ae486ddb24238a80.tar.bz2
llvm-7441089c9b4df8b397f1f8b0ae486ddb24238a80.tar.xz
Add operators for "_lane" variants of some saturating Neon multiply intrinsics
so they can be implemented without separate clang builtins. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/NeonEmitter.cpp26
-rw-r--r--utils/TableGen/NeonEmitter.h10
2 files changed, 34 insertions, 2 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp
index 355a9646de..0b3fdaf29a 100644
--- a/utils/TableGen/NeonEmitter.cpp
+++ b/utils/TableGen/NeonEmitter.cpp
@@ -660,6 +660,26 @@ static std::string GenOpString(OpKind op, const std::string &proto,
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 @@ void NeonEmitter::run(raw_ostream &OS) {
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")
diff --git a/utils/TableGen/NeonEmitter.h b/utils/TableGen/NeonEmitter.h
index 69b39e9e4f..f5fd37e71a 100644
--- a/utils/TableGen/NeonEmitter.h
+++ b/utils/TableGen/NeonEmitter.h
@@ -47,6 +47,11 @@ enum OpKind {
OpMlsLane,
OpMlalLane,
OpMlslLane,
+ OpQDMullLane,
+ OpQDMlalLane,
+ OpQDMlslLane,
+ OpQDMulhLane,
+ OpQRDMulhLane,
OpEq,
OpGe,
OpLe,
@@ -117,6 +122,11 @@ namespace llvm {
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;