[llvm-commits] [llvm] r121287 - in /llvm/trunk/utils/TableGen: NeonEmitter.cpp NeonEmitter.h
Bob Wilson
bob.wilson at apple.com
Wed Dec 8 13:39:04 PST 2010
Author: bwilson
Date: Wed Dec 8 15:39:04 2010
New Revision: 121287
URL: http://llvm.org/viewvc/llvm-project?rev=121287&view=rev
Log:
Add operators for vabdl and vabal so they can be implemented without builtins.
Modified:
llvm/trunk/utils/TableGen/NeonEmitter.cpp
llvm/trunk/utils/TableGen/NeonEmitter.h
Modified: llvm/trunk/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.cpp?rev=121287&r1=121286&r2=121287&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Wed Dec 8 15:39:04 2010
@@ -747,9 +747,36 @@
s += ");";
break;
}
+ case OpAbdl: {
+ std::string abd = MangleName("vabd", typestr, ClassS) + "(__a, __b)";
+ if (typestr[0] != 'U') {
+ // vabd results are always unsigned and must be zero-extended.
+ std::string utype = "U" + typestr.str();
+ s += "(" + TypeString(proto[0], typestr) + ")";
+ abd = "(" + TypeString('d', utype) + ")" + abd;
+ s += Extend(utype, abd) + ";";
+ } else {
+ s += Extend(typestr, abd) + ";";
+ }
+ break;
+ }
case OpAba:
s += "__a + " + MangleName("vabd", typestr, ClassS) + "(__b, __c);";
break;
+ case OpAbal: {
+ s += "__a + ";
+ std::string abd = MangleName("vabd", typestr, ClassS) + "(__b, __c)";
+ if (typestr[0] != 'U') {
+ // vabd results are always unsigned and must be zero-extended.
+ std::string utype = "U" + typestr.str();
+ s += "(" + TypeString(proto[0], typestr) + ")";
+ abd = "(" + TypeString('d', utype) + ")" + abd;
+ s += Extend(utype, abd) + ";";
+ } else {
+ s += Extend(typestr, abd) + ";";
+ }
+ break;
+ }
default:
throw "unknown OpKind!";
break;
Modified: llvm/trunk/utils/TableGen/NeonEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.h?rev=121287&r1=121286&r2=121287&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.h (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.h Wed Dec 8 15:39:04 2010
@@ -70,7 +70,9 @@
OpRev32,
OpRev64,
OpReinterpret,
- OpAba
+ OpAbdl,
+ OpAba,
+ OpAbal
};
enum ClassKind {
@@ -138,7 +140,9 @@
OpMap["OP_REV32"] = OpRev32;
OpMap["OP_REV64"] = OpRev64;
OpMap["OP_REINT"] = OpReinterpret;
+ OpMap["OP_ABDL"] = OpAbdl;
OpMap["OP_ABA"] = OpAba;
+ OpMap["OP_ABAL"] = OpAbal;
Record *SI = R.getClass("SInst");
Record *II = R.getClass("IInst");
More information about the llvm-commits
mailing list