parent
66a8bf57ea
commit
bf74755e62
|
@ -509,8 +509,7 @@ static std::string GenMacroLocals(const std::string &proto, StringRef typestr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the vmovl builtin to sign-extend or zero-extend a vector.
|
// Use the vmovl builtin to sign-extend or zero-extend a vector.
|
||||||
static std::string Extend(const std::string &proto, StringRef typestr,
|
static std::string Extend(StringRef typestr, const std::string &a) {
|
||||||
const std::string &a) {
|
|
||||||
std::string s;
|
std::string s;
|
||||||
s = MangleName("vmovl", typestr, ClassS);
|
s = MangleName("vmovl", typestr, ClassS);
|
||||||
s += "(" + a + ")";
|
s += "(" + a + ")";
|
||||||
|
@ -585,21 +584,19 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
||||||
s += "__a + __b;";
|
s += "__a + __b;";
|
||||||
break;
|
break;
|
||||||
case OpAddl:
|
case OpAddl:
|
||||||
s += Extend(proto, typestr, "__a") + " + "
|
s += Extend(typestr, "__a") + " + " + Extend(typestr, "__b") + ";";
|
||||||
+ Extend(proto, typestr, "__b") + ";";
|
|
||||||
break;
|
break;
|
||||||
case OpAddw:
|
case OpAddw:
|
||||||
s += "__a + " + Extend(proto, typestr, "__b") + ";";
|
s += "__a + " + Extend(typestr, "__b") + ";";
|
||||||
break;
|
break;
|
||||||
case OpSub:
|
case OpSub:
|
||||||
s += "__a - __b;";
|
s += "__a - __b;";
|
||||||
break;
|
break;
|
||||||
case OpSubl:
|
case OpSubl:
|
||||||
s += Extend(proto, typestr, "__a") + " - "
|
s += Extend(typestr, "__a") + " - " + Extend(typestr, "__b") + ";";
|
||||||
+ Extend(proto, typestr, "__b") + ";";
|
|
||||||
break;
|
break;
|
||||||
case OpSubw:
|
case OpSubw:
|
||||||
s += "__a - " + Extend(proto, typestr, "__b") + ";";
|
s += "__a - " + Extend(typestr, "__b") + ";";
|
||||||
break;
|
break;
|
||||||
case OpMulN:
|
case OpMulN:
|
||||||
s += "__a * " + Duplicate(nElts, typestr, "__b") + ";";
|
s += "__a * " + Duplicate(nElts, typestr, "__b") + ";";
|
||||||
|
@ -611,17 +608,15 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
||||||
s += "__a * __b;";
|
s += "__a * __b;";
|
||||||
break;
|
break;
|
||||||
case OpMullN:
|
case OpMullN:
|
||||||
s += Extend(proto, typestr, "__a") + " * " +
|
s += Extend(typestr, "__a") + " * " +
|
||||||
Extend(proto, typestr,
|
Extend(typestr, Duplicate(nElts << (int)quad, typestr, "__b")) + ";";
|
||||||
Duplicate(nElts << (int)quad, typestr, "__b")) + ";";
|
|
||||||
break;
|
break;
|
||||||
case OpMullLane:
|
case OpMullLane:
|
||||||
s += Extend(proto, typestr, "__a") + " * " +
|
s += Extend(typestr, "__a") + " * " +
|
||||||
Extend(proto, typestr, SplatLane(nElts, "__b", "__c")) + ";";
|
Extend(typestr, SplatLane(nElts, "__b", "__c")) + ";";
|
||||||
break;
|
break;
|
||||||
case OpMull:
|
case OpMull:
|
||||||
s += Extend(proto, typestr, "__a") + " * " +
|
s += Extend(typestr, "__a") + " * " + Extend(typestr, "__b") + ";";
|
||||||
Extend(proto, typestr, "__b") + ";";
|
|
||||||
break;
|
break;
|
||||||
case OpMlaN:
|
case OpMlaN:
|
||||||
s += "__a + (__b * " + Duplicate(nElts, typestr, "__c") + ");";
|
s += "__a + (__b * " + Duplicate(nElts, typestr, "__c") + ");";
|
||||||
|
@ -633,16 +628,16 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
||||||
s += "__a + (__b * __c);";
|
s += "__a + (__b * __c);";
|
||||||
break;
|
break;
|
||||||
case OpMlalN:
|
case OpMlalN:
|
||||||
s += "__a + (" + Extend(proto, typestr, "__b") + " * " +
|
s += "__a + (" + Extend(typestr, "__b") + " * " +
|
||||||
Extend(proto, typestr, Duplicate(nElts, typestr, "__c")) + ");";
|
Extend(typestr, Duplicate(nElts, typestr, "__c")) + ");";
|
||||||
break;
|
break;
|
||||||
case OpMlalLane:
|
case OpMlalLane:
|
||||||
s += "__a + (" + Extend(proto, typestr, "__b") + " * " +
|
s += "__a + (" + Extend(typestr, "__b") + " * " +
|
||||||
Extend(proto, typestr, SplatLane(nElts, "__c", "__d")) + ");";
|
Extend(typestr, SplatLane(nElts, "__c", "__d")) + ");";
|
||||||
break;
|
break;
|
||||||
case OpMlal:
|
case OpMlal:
|
||||||
s += "__a + (" + Extend(proto, typestr, "__b") + " * " +
|
s += "__a + (" + Extend(typestr, "__b") + " * " +
|
||||||
Extend(proto, typestr, "__c") + ");";
|
Extend(typestr, "__c") + ");";
|
||||||
break;
|
break;
|
||||||
case OpMlsN:
|
case OpMlsN:
|
||||||
s += "__a - (__b * " + Duplicate(nElts, typestr, "__c") + ");";
|
s += "__a - (__b * " + Duplicate(nElts, typestr, "__c") + ");";
|
||||||
|
@ -654,16 +649,16 @@ static std::string GenOpString(OpKind op, const std::string &proto,
|
||||||
s += "__a - (__b * __c);";
|
s += "__a - (__b * __c);";
|
||||||
break;
|
break;
|
||||||
case OpMlslN:
|
case OpMlslN:
|
||||||
s += "__a - (" + Extend(proto, typestr, "__b") + " * " +
|
s += "__a - (" + Extend(typestr, "__b") + " * " +
|
||||||
Extend(proto, typestr, Duplicate(nElts, typestr, "__c")) + ");";
|
Extend(typestr, Duplicate(nElts, typestr, "__c")) + ");";
|
||||||
break;
|
break;
|
||||||
case OpMlslLane:
|
case OpMlslLane:
|
||||||
s += "__a - (" + Extend(proto, typestr, "__b") + " * " +
|
s += "__a - (" + Extend(typestr, "__b") + " * " +
|
||||||
Extend(proto, typestr, SplatLane(nElts, "__c", "__d")) + ");";
|
Extend(typestr, SplatLane(nElts, "__c", "__d")) + ");";
|
||||||
break;
|
break;
|
||||||
case OpMlsl:
|
case OpMlsl:
|
||||||
s += "__a - (" + Extend(proto, typestr, "__b") + " * " +
|
s += "__a - (" + Extend(typestr, "__b") + " * " +
|
||||||
Extend(proto, typestr, "__c") + ");";
|
Extend(typestr, "__c") + ");";
|
||||||
break;
|
break;
|
||||||
case OpEq:
|
case OpEq:
|
||||||
s += "(" + ts + ")(__a == __b);";
|
s += "(" + ts + ")(__a == __b);";
|
||||||
|
|
Loading…
Reference in New Issue