summaryrefslogtreecommitdiff
path: root/utils/TableGen/NeonEmitter.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-12-07 20:02:45 +0000
committerBob Wilson <bob.wilson@apple.com>2010-12-07 20:02:45 +0000
commitc4ba09da6064c61ff75890987d6e73a5fc7a6125 (patch)
tree98686f2fc1f93fbbc7e1bf4e365e3683073e2e59 /utils/TableGen/NeonEmitter.cpp
parent9801b5c822bf475e859e3fe18b87dbb308b0e22c (diff)
downloadllvm-c4ba09da6064c61ff75890987d6e73a5fc7a6125.tar.gz
llvm-c4ba09da6064c61ff75890987d6e73a5fc7a6125.tar.bz2
llvm-c4ba09da6064c61ff75890987d6e73a5fc7a6125.tar.xz
Add new built-in operations for vmull and vmull_n
so they can be implemented without requiring clang builtins. Radar 8446238. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/NeonEmitter.cpp')
-rw-r--r--utils/TableGen/NeonEmitter.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp
index 3752db0f4d..7fdc1cacd6 100644
--- a/utils/TableGen/NeonEmitter.cpp
+++ b/utils/TableGen/NeonEmitter.cpp
@@ -508,6 +508,15 @@ static std::string GenMacroLocals(const std::string &proto, StringRef typestr) {
return s;
}
+// Use the vmovl builtin to sign-extend or zero-extend a vector.
+static std::string Extend(const std::string &proto, StringRef typestr,
+ const std::string &a) {
+ std::string s;
+ s = MangleName("vmovl", typestr, ClassS);
+ s += "(" + a + ")";
+ return s;
+}
+
static std::string Duplicate(unsigned nElts, StringRef typestr,
const std::string &a) {
std::string s;
@@ -587,6 +596,15 @@ static std::string GenOpString(OpKind op, const std::string &proto,
case OpMul:
s += "__a * __b;";
break;
+ case OpMullN:
+ s += Extend(proto, typestr, "__a") + " * " +
+ Extend(proto, typestr,
+ Duplicate(nElts << (int)quad, typestr, "__b")) + ";";
+ break;
+ case OpMull:
+ s += Extend(proto, typestr, "__a") + " * " +
+ Extend(proto, typestr, "__b") + ";";
+ break;
case OpMlaN:
s += "__a + (__b * " + Duplicate(nElts, typestr, "__c") + ");";
break;