From d9914b1d51c796140c1f3a9211aaa17eaa9d06d2 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 4 Jul 2020 10:16:41 +0100 Subject: [PATCH] simd_permute: Implement VectorUnzip with deinterleave lower --- src/frontend/A64/translate/impl/simd_permute.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/frontend/A64/translate/impl/simd_permute.cpp b/src/frontend/A64/translate/impl/simd_permute.cpp index bf677156..3315f2fb 100644 --- a/src/frontend/A64/translate/impl/simd_permute.cpp +++ b/src/frontend/A64/translate/impl/simd_permute.cpp @@ -44,16 +44,9 @@ bool VectorUnzip(TranslatorVisitor& v, bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec const IR::U128 n = v.V(datasize, Vn); const IR::U128 m = v.V(datasize, Vm); - IR::U128 result = [&] { - if (type == UnzipType::Even) { - return v.ir.VectorDeinterleaveEven(esize, n, m); - } - return v.ir.VectorDeinterleaveOdd(esize, n, m); - }(); - - if (datasize == 64) { - result = v.ir.VectorShuffleWords(result, 0b11011000); - } + const IR::U128 result = type == UnzipType::Even + ? (Q ? v.ir.VectorDeinterleaveEven(esize, n, m) : v.ir.VectorDeinterleaveEvenLower(esize, n, m)) + : (Q ? v.ir.VectorDeinterleaveOdd(esize, n, m) : v.ir.VectorDeinterleaveOddLower(esize, n, m)); v.V(datasize, Vd, result); return true;