mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-11 13:37:07 +00:00
Add operators for "_lane" variants of some saturating Neon multiply intrinsics
so they can be implemented without separate clang builtins. llvm-svn: 121299
This commit is contained in:
parent
13c16125f1
commit
8c693a934a
@ -660,6 +660,26 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
|||||||
s += "__a - (" + Extend(typestr, "__b") + " * " +
|
s += "__a - (" + Extend(typestr, "__b") + " * " +
|
||||||
Extend(typestr, "__c") + ");";
|
Extend(typestr, "__c") + ");";
|
||||||
break;
|
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:
|
case OpEq:
|
||||||
s += "(" + ts + ")(__a == __b);";
|
s += "(" + ts + ")(__a == __b);";
|
||||||
break;
|
break;
|
||||||
@ -1103,11 +1123,13 @@ void NeonEmitter::run(raw_ostream &OS) {
|
|||||||
std::vector<Record*> RV = Records.getAllDerivedDefinitions("Inst");
|
std::vector<Record*> RV = Records.getAllDerivedDefinitions("Inst");
|
||||||
|
|
||||||
// Emit vmovl and vabd intrinsics first so they can be used by other
|
// 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("VMOVL"));
|
||||||
emitIntrinsic(OS, Records.getDef("VABD"));
|
emitIntrinsic(OS, Records.getDef("VABD"));
|
||||||
|
|
||||||
// Unique the return+pattern types, and assign them.
|
|
||||||
for (unsigned i = 0, e = RV.size(); i != e; ++i) {
|
for (unsigned i = 0, e = RV.size(); i != e; ++i) {
|
||||||
Record *R = RV[i];
|
Record *R = RV[i];
|
||||||
if (R->getName() != "VMOVL" && R->getName() != "VABD")
|
if (R->getName() != "VMOVL" && R->getName() != "VABD")
|
||||||
|
@ -47,6 +47,11 @@ enum OpKind {
|
|||||||
OpMlsLane,
|
OpMlsLane,
|
||||||
OpMlalLane,
|
OpMlalLane,
|
||||||
OpMlslLane,
|
OpMlslLane,
|
||||||
|
OpQDMullLane,
|
||||||
|
OpQDMlalLane,
|
||||||
|
OpQDMlslLane,
|
||||||
|
OpQDMulhLane,
|
||||||
|
OpQRDMulhLane,
|
||||||
OpEq,
|
OpEq,
|
||||||
OpGe,
|
OpGe,
|
||||||
OpLe,
|
OpLe,
|
||||||
@ -117,6 +122,11 @@ namespace llvm {
|
|||||||
OpMap["OP_MLS_LN"]= OpMlsLane;
|
OpMap["OP_MLS_LN"]= OpMlsLane;
|
||||||
OpMap["OP_MLAL_LN"] = OpMlalLane;
|
OpMap["OP_MLAL_LN"] = OpMlalLane;
|
||||||
OpMap["OP_MLSL_LN"] = OpMlslLane;
|
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_EQ"] = OpEq;
|
||||||
OpMap["OP_GE"] = OpGe;
|
OpMap["OP_GE"] = OpGe;
|
||||||
OpMap["OP_LE"] = OpLe;
|
OpMap["OP_LE"] = OpLe;
|
||||||
|
Loading…
Reference in New Issue
Block a user