diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2010-12-07 20:02:45 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2010-12-07 20:02:45 +0000 |
| commit | 192336b8654d457cd955b9744f54bb667a41eca9 (patch) | |
| tree | e51ad7cb1117b01092e5f8678423ae7a24e0803e /llvm/utils/TableGen/NeonEmitter.cpp | |
| parent | c27c95696638207437513cb5d1ed4808dbf2b4c7 (diff) | |
| download | bcm5719-llvm-192336b8654d457cd955b9744f54bb667a41eca9.tar.gz bcm5719-llvm-192336b8654d457cd955b9744f54bb667a41eca9.zip | |
Add new built-in operations for vmull and vmull_n
so they can be implemented without requiring clang builtins.
Radar 8446238.
llvm-svn: 121173
Diffstat (limited to 'llvm/utils/TableGen/NeonEmitter.cpp')
| -rw-r--r-- | llvm/utils/TableGen/NeonEmitter.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/NeonEmitter.cpp b/llvm/utils/TableGen/NeonEmitter.cpp index 3752db0f4d0..7fdc1cacd69 100644 --- a/llvm/utils/TableGen/NeonEmitter.cpp +++ b/llvm/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; |

