From 06c5dcaf5efcea6e6bd7fbe079e21e960a094a1e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 18 Apr 2018 19:20:44 -0400 Subject: [PATCH] simd_two_register_misc: Add missing zeroing of the vector for CMGT and CMLT --- .../A64/translate/impl/simd_two_register_misc.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/frontend/A64/translate/impl/simd_two_register_misc.cpp b/src/frontend/A64/translate/impl/simd_two_register_misc.cpp index 05231d5c..3c045c5e 100644 --- a/src/frontend/A64/translate/impl/simd_two_register_misc.cpp +++ b/src/frontend/A64/translate/impl/simd_two_register_misc.cpp @@ -49,7 +49,11 @@ bool TranslatorVisitor::CMGT_zero_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { const IR::U128 operand = V(datasize, Vn); const IR::U128 zero = ir.ZeroVector(); - const IR::U128 result = ir.VectorGreaterSigned(esize, operand, zero); + IR::U128 result = ir.VectorGreaterSigned(esize, operand, zero); + if (datasize == 64) { + result = ir.VectorZeroUpper(result); + } + V(datasize, Vd, result); return true; } @@ -95,7 +99,11 @@ bool TranslatorVisitor::CMLT_2(bool Q, Imm<2> size, Vec Vn, Vec Vd) { const IR::U128 operand = V(datasize, Vn); const IR::U128 zero = ir.ZeroVector(); - const IR::U128 result = ir.VectorLessSigned(esize, operand, zero); + IR::U128 result = ir.VectorLessSigned(esize, operand, zero); + if (datasize == 64) { + result = ir.VectorZeroUpper(result); + } + V(datasize, Vd, result); return true; }