1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Add operators for vadd[lw] and vsub[lw]

so they can be implemented without clang builtins.

llvm-svn: 121213
This commit is contained in:
Bob Wilson 2010-12-08 00:14:04 +00:00
parent 0c0accf6bc
commit dd1d9cf3b6
2 changed files with 22 additions and 0 deletions

View File

@ -584,9 +584,23 @@ static std::string GenOpString(OpKind op, const std::string &proto,
case OpAdd:
s += "__a + __b;";
break;
case OpAddl:
s += Extend(proto, typestr, "__a") + " + "
+ Extend(proto, typestr, "__b") + ";";
break;
case OpAddw:
s += "__a + " + Extend(proto, typestr, "__b") + ";";
break;
case OpSub:
s += "__a - __b;";
break;
case OpSubl:
s += Extend(proto, typestr, "__a") + " - "
+ Extend(proto, typestr, "__b") + ";";
break;
case OpSubw:
s += "__a - " + Extend(proto, typestr, "__b") + ";";
break;
case OpMulN:
s += "__a * " + Duplicate(nElts, typestr, "__b") + ";";
break;

View File

@ -24,7 +24,11 @@
enum OpKind {
OpNone,
OpAdd,
OpAddl,
OpAddw,
OpSub,
OpSubl,
OpSubw,
OpMul,
OpMull,
OpMla,
@ -87,7 +91,11 @@ namespace llvm {
NeonEmitter(RecordKeeper &R) : Records(R) {
OpMap["OP_NONE"] = OpNone;
OpMap["OP_ADD"] = OpAdd;
OpMap["OP_ADDL"] = OpAddl;
OpMap["OP_ADDW"] = OpAddw;
OpMap["OP_SUB"] = OpSub;
OpMap["OP_SUBL"] = OpSubl;
OpMap["OP_SUBW"] = OpSubw;
OpMap["OP_MUL"] = OpMul;
OpMap["OP_MULL"] = OpMull;
OpMap["OP_MLA"] = OpMla;