forked from OSchip/llvm-project
Add operators for vmlal{_n,_lane} and vmlsl{_n,_lane}
so they can be implemented without clang builtins. llvm-svn: 121209
This commit is contained in:
parent
7a36c68748
commit
c40935fa0c
|
@ -603,8 +603,7 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
|||
break;
|
||||
case OpMullLane:
|
||||
s += Extend(proto, typestr, "__a") + " * " +
|
||||
Extend(proto, typestr,
|
||||
SplatLane(nElts, "__b", "__c")) + ";";
|
||||
Extend(proto, typestr, SplatLane(nElts, "__b", "__c")) + ";";
|
||||
break;
|
||||
case OpMull:
|
||||
s += Extend(proto, typestr, "__a") + " * " +
|
||||
|
@ -619,6 +618,18 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
|||
case OpMla:
|
||||
s += "__a + (__b * __c);";
|
||||
break;
|
||||
case OpMlalN:
|
||||
s += "__a + (" + Extend(proto, typestr, "__b") + " * " +
|
||||
Extend(proto, typestr, Duplicate(nElts, typestr, "__c")) + ");";
|
||||
break;
|
||||
case OpMlalLane:
|
||||
s += "__a + (" + Extend(proto, typestr, "__b") + " * " +
|
||||
Extend(proto, typestr, SplatLane(nElts, "__c", "__d")) + ");";
|
||||
break;
|
||||
case OpMlal:
|
||||
s += "__a + (" + Extend(proto, typestr, "__b") + " * " +
|
||||
Extend(proto, typestr, "__c") + ");";
|
||||
break;
|
||||
case OpMlsN:
|
||||
s += "__a - (__b * " + Duplicate(nElts, typestr, "__c") + ");";
|
||||
break;
|
||||
|
@ -628,6 +639,18 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
|||
case OpMls:
|
||||
s += "__a - (__b * __c);";
|
||||
break;
|
||||
case OpMlslN:
|
||||
s += "__a - (" + Extend(proto, typestr, "__b") + " * " +
|
||||
Extend(proto, typestr, Duplicate(nElts, typestr, "__c")) + ");";
|
||||
break;
|
||||
case OpMlslLane:
|
||||
s += "__a - (" + Extend(proto, typestr, "__b") + " * " +
|
||||
Extend(proto, typestr, SplatLane(nElts, "__c", "__d")) + ");";
|
||||
break;
|
||||
case OpMlsl:
|
||||
s += "__a - (" + Extend(proto, typestr, "__b") + " * " +
|
||||
Extend(proto, typestr, "__c") + ");";
|
||||
break;
|
||||
case OpEq:
|
||||
s += "(" + ts + ")(__a == __b);";
|
||||
break;
|
||||
|
|
|
@ -28,15 +28,21 @@ enum OpKind {
|
|||
OpMul,
|
||||
OpMull,
|
||||
OpMla,
|
||||
OpMlal,
|
||||
OpMls,
|
||||
OpMlsl,
|
||||
OpMulN,
|
||||
OpMullN,
|
||||
OpMlaN,
|
||||
OpMlsN,
|
||||
OpMlalN,
|
||||
OpMlslN,
|
||||
OpMulLane,
|
||||
OpMullLane,
|
||||
OpMlaLane,
|
||||
OpMlsLane,
|
||||
OpMlalLane,
|
||||
OpMlslLane,
|
||||
OpEq,
|
||||
OpGe,
|
||||
OpLe,
|
||||
|
@ -85,15 +91,21 @@ namespace llvm {
|
|||
OpMap["OP_MUL"] = OpMul;
|
||||
OpMap["OP_MULL"] = OpMull;
|
||||
OpMap["OP_MLA"] = OpMla;
|
||||
OpMap["OP_MLAL"] = OpMlal;
|
||||
OpMap["OP_MLS"] = OpMls;
|
||||
OpMap["OP_MLSL"] = OpMlsl;
|
||||
OpMap["OP_MUL_N"] = OpMulN;
|
||||
OpMap["OP_MULL_N"]= OpMullN;
|
||||
OpMap["OP_MLA_N"] = OpMlaN;
|
||||
OpMap["OP_MLS_N"] = OpMlsN;
|
||||
OpMap["OP_MLAL_N"] = OpMlalN;
|
||||
OpMap["OP_MLSL_N"] = OpMlslN;
|
||||
OpMap["OP_MUL_LN"]= OpMulLane;
|
||||
OpMap["OP_MULL_LN"] = OpMullLane;
|
||||
OpMap["OP_MLA_LN"]= OpMlaLane;
|
||||
OpMap["OP_MLS_LN"]= OpMlsLane;
|
||||
OpMap["OP_MLAL_LN"] = OpMlalLane;
|
||||
OpMap["OP_MLSL_LN"] = OpMlslLane;
|
||||
OpMap["OP_EQ"] = OpEq;
|
||||
OpMap["OP_GE"] = OpGe;
|
||||
OpMap["OP_LE"] = OpLe;
|
||||
|
|
Loading…
Reference in New Issue