summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-09-15 01:52:33 +0000
committerBob Wilson <bob.wilson@apple.com>2010-09-15 01:52:33 +0000
commitee9ca07e7f88ba100c56e2171009e158352026c8 (patch)
treeda4ba07c3713e53957674962035175b2ff653ccb /utils
parent168f382dc67e5940cabdb28dc933c4f91cdd3137 (diff)
downloadllvm-ee9ca07e7f88ba100c56e2171009e158352026c8.tar.gz
llvm-ee9ca07e7f88ba100c56e2171009e158352026c8.tar.bz2
llvm-ee9ca07e7f88ba100c56e2171009e158352026c8.tar.xz
Use float64 instead of int64 vector elements for NEON vget_low and vget_high
functions, since int64 is not a legal type and using it leads to inefficient code. PR8036. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/NeonEmitter.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp
index 5db1564229..f3707f2b22 100644
--- a/utils/TableGen/NeonEmitter.cpp
+++ b/utils/TableGen/NeonEmitter.cpp
@@ -552,10 +552,14 @@ static std::string GenOpString(OpKind op, const std::string &proto,
}
std::string ts = TypeString(proto[0], typestr);
- std::string s = ts + " r; r";
-
- if (structTypes)
- s += ".val";
+ std::string s;
+ if (op == OpHi || op == OpLo) {
+ s = "union { " + ts + " r; double d; } u; u.d";
+ } else {
+ s = ts + " r; r";
+ if (structTypes)
+ s += ".val";
+ }
s += " = ";
@@ -631,10 +635,10 @@ static std::string GenOpString(OpKind op, const std::string &proto,
s += ", (__neon_int64x1_t)" + b + ", 0, 1)";
break;
case OpHi:
- s += "(__neon_int64x1_t)(((__neon_int64x2_t)" + a + ")[1])";
+ s += "(((__neon_float64x2_t)" + a + ")[1])";
break;
case OpLo:
- s += "(__neon_int64x1_t)(((__neon_int64x2_t)" + a + ")[0])";
+ s += "(((__neon_float64x2_t)" + a + ")[0])";
break;
case OpDup:
s += Duplicate(nElts << (int)quad, typestr, a);
@@ -671,7 +675,10 @@ static std::string GenOpString(OpKind op, const std::string &proto,
throw "unknown OpKind!";
break;
}
- s += "; return r;";
+ if (op == OpHi || op == OpLo)
+ s += "; return u.r;";
+ else
+ s += "; return r;";
return s;
}
@@ -923,6 +930,11 @@ void NeonEmitter::run(raw_ostream &OS) {
}
}
OS << "\n";
+ OS << "typedef __attribute__(( __vector_size__(8) )) "
+ "double __neon_float64x1_t;\n";
+ OS << "typedef __attribute__(( __vector_size__(16) )) "
+ "double __neon_float64x2_t;\n";
+ OS << "\n";
// Emit struct typedefs.
for (unsigned vi = 1; vi != 5; ++vi) {