diff options
author | Bob Wilson <bob.wilson@apple.com> | 2011-01-07 23:40:49 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2011-01-07 23:40:49 +0000 |
commit | 067a16c974fef473fd3bca1d58db0d50c59882ce (patch) | |
tree | fbf6198dd5f8e9ceb2782fe7919819e51f232f78 /utils | |
parent | 70f85730b199839891166b2a0acff126d1cc7c12 (diff) | |
download | llvm-067a16c974fef473fd3bca1d58db0d50c59882ce.tar.gz llvm-067a16c974fef473fd3bca1d58db0d50c59882ce.tar.bz2 llvm-067a16c974fef473fd3bca1d58db0d50c59882ce.tar.xz |
Use __builtin_shufflevector to implement vget_low and vget_high intrinsics.
This was suggested by Edmund Grimley Evans in pr8411.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/NeonEmitter.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp index d019f1cada..64224d9e51 100644 --- a/utils/TableGen/NeonEmitter.cpp +++ b/utils/TableGen/NeonEmitter.cpp @@ -576,9 +576,7 @@ static std::string GenOpString(OpKind op, const std::string &proto, std::string ts = TypeString(proto[0], typestr); std::string s; - if (op == OpHi || op == OpLo) { - s = "union { " + ts + " r; double d; } u; u.d = "; - } else if (!define) { + if (!define) { s = "return "; } @@ -727,10 +725,12 @@ static std::string GenOpString(OpKind op, const std::string &proto, s += ", (int64x1_t)__b, 0, 1);"; break; case OpHi: - s += "(((float64x2_t)__a)[1]);"; + s += "(" + ts + + ")__builtin_shufflevector((int64x2_t)__a, (int64x2_t)__a, 1);"; break; case OpLo: - s += "(((float64x2_t)__a)[0]);"; + s += "(" + ts + + ")__builtin_shufflevector((int64x2_t)__a, (int64x2_t)__a, 0);"; break; case OpDup: s += Duplicate(nElts, typestr, "__a") + ";"; @@ -804,11 +804,6 @@ static std::string GenOpString(OpKind op, const std::string &proto, throw "unknown OpKind!"; break; } - if (op == OpHi || op == OpLo) { - if (!define) - s += " return"; - s += " u.r;"; - } return s; } @@ -1135,11 +1130,6 @@ void NeonEmitter::run(raw_ostream &OS) { OS << " " << TypeString('d', TDTypeVec[i]) << ";\n"; } OS << "\n"; - OS << "typedef __attribute__((__vector_size__(8))) " - "double float64x1_t;\n"; - OS << "typedef __attribute__((__vector_size__(16))) " - "double float64x2_t;\n"; - OS << "\n"; // Emit struct typedefs. for (unsigned vi = 2; vi != 5; ++vi) { |