forked from OSchip/llvm-project
Add support for "_lane" variants of VMUL, VMLA, and VMLS Neon intrinsics.
llvm-svn: 120764
This commit is contained in:
parent
791934e122
commit
e6b421ccb5
|
@ -523,6 +523,15 @@ static std::string Duplicate(unsigned nElts, StringRef typestr,
|
|||
return s;
|
||||
}
|
||||
|
||||
static std::string SplatLane(unsigned nElts, const std::string &vec,
|
||||
const std::string &lane) {
|
||||
std::string s = "__builtin_shufflevector(" + vec + ", " + vec;
|
||||
for (unsigned i = 0; i < nElts; ++i)
|
||||
s += ", " + lane;
|
||||
s += ")";
|
||||
return s;
|
||||
}
|
||||
|
||||
static unsigned GetNumElements(StringRef typestr, bool &quad) {
|
||||
quad = false;
|
||||
bool dummy = false;
|
||||
|
@ -572,18 +581,27 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
|||
case OpMulN:
|
||||
s += "__a * " + Duplicate(nElts, typestr, "__b") + ";";
|
||||
break;
|
||||
case OpMulLane:
|
||||
s += "__a * " + SplatLane(nElts, "__b", "__c") + ";";
|
||||
break;
|
||||
case OpMul:
|
||||
s += "__a * __b;";
|
||||
break;
|
||||
case OpMlaN:
|
||||
s += "__a + (__b * " + Duplicate(nElts, typestr, "__c") + ");";
|
||||
break;
|
||||
case OpMlaLane:
|
||||
s += "__a + (__b * " + SplatLane(nElts, "__c", "__d") + ");";
|
||||
break;
|
||||
case OpMla:
|
||||
s += "__a + (__b * __c);";
|
||||
break;
|
||||
case OpMlsN:
|
||||
s += "__a - (__b * " + Duplicate(nElts, typestr, "__c") + ");";
|
||||
break;
|
||||
case OpMlsLane:
|
||||
s += "__a - (__b * " + SplatLane(nElts, "__c", "__d") + ");";
|
||||
break;
|
||||
case OpMls:
|
||||
s += "__a - (__b * __c);";
|
||||
break;
|
||||
|
|
|
@ -31,6 +31,9 @@ enum OpKind {
|
|||
OpMulN,
|
||||
OpMlaN,
|
||||
OpMlsN,
|
||||
OpMulLane,
|
||||
OpMlaLane,
|
||||
OpMlsLane,
|
||||
OpEq,
|
||||
OpGe,
|
||||
OpLe,
|
||||
|
@ -80,6 +83,9 @@ namespace llvm {
|
|||
OpMap["OP_MUL_N"] = OpMulN;
|
||||
OpMap["OP_MLA_N"] = OpMlaN;
|
||||
OpMap["OP_MLS_N"] = OpMlsN;
|
||||
OpMap["OP_MUL_LN"]= OpMulLane;
|
||||
OpMap["OP_MLA_LN"]= OpMlaLane;
|
||||
OpMap["OP_MLS_LN"]= OpMlsLane;
|
||||
OpMap["OP_EQ"] = OpEq;
|
||||
OpMap["OP_GE"] = OpGe;
|
||||
OpMap["OP_LE"] = OpLe;
|
||||
|
|
Loading…
Reference in New Issue