X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FNeonEmitter.cpp;h=64224d9e51d0b79e78944b5144dfc7050899ab38;hb=505f3cd2965e65b6b7ad023eaba0e3dc89b67409;hp=4864db436213584f7a7703faac01be88eacdf96f;hpb=ae6be764f9e3133932e61b779940106d8488a825;p=oota-llvm.git diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp index 4864db43621..64224d9e51d 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) { @@ -1492,7 +1482,7 @@ static std::string GenTest(const std::string &name, void NeonEmitter::runTests(raw_ostream &OS) { OS << "// RUN: %clang_cc1 -triple thumbv7-apple-darwin \\\n" - "// RUN: -target-cpu cortex-a8 -ffreestanding -S -o - %s | FileCheck %s\n" + "// RUN: -target-cpu cortex-a9 -ffreestanding -S -o - %s | FileCheck %s\n" "\n" "#include \n" "\n";