From 6534184df2ce58692c08b694fcc493f6eb1ac1ca Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 20 Apr 2018 10:23:16 -0400 Subject: [PATCH] A64: Implement CMLT (zero)'s scalar single/double-precision variant --- src/frontend/A64/decoder/a64.inc | 2 +- .../A64/translate/impl/simd_scalar_three_same.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index b513834c..4c67ef58 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -409,7 +409,7 @@ INST(UCVTF_int_2, "UCVTF (vector, integer)", "01111 //INST(SQABS_1, "SQABS", "01011110zz100000011110nnnnnddddd") INST(CMGT_zero_1, "CMGT (zero)", "01011110zz100000100010nnnnnddddd") INST(CMEQ_zero_1, "CMEQ (zero)", "01011110zz100000100110nnnnnddddd") -//INST(CMLT_1, "CMLT (zero)", "01011110zz100000101010nnnnnddddd") +INST(CMLT_1, "CMLT (zero)", "01011110zz100000101010nnnnnddddd") INST(ABS_1, "ABS", "01011110zz100000101110nnnnnddddd") //INST(SQXTN_1, "SQXTN, SQXTN2", "01011110zz100001010010nnnnnddddd") //INST(USQADD_1, "USQADD", "01111110zz100000001110nnnnnddddd") diff --git a/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp b/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp index 6c93cd58..09232206 100644 --- a/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp +++ b/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp @@ -16,6 +16,7 @@ enum class ComparisonType { GT, HI, HS, + LT, }; enum class ComparisonVariant { @@ -46,8 +47,10 @@ bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, boost::optional Vm, V case ComparisonType::HI: return v.ir.VectorGreaterUnsigned(esize, operand1, operand2); case ComparisonType::HS: - default: return v.ir.VectorGreaterEqualUnsigned(esize, operand1, operand2); + case ComparisonType::LT: + default: + return v.ir.VectorLessSigned(esize, operand1, operand2); } }(); @@ -94,6 +97,10 @@ bool TranslatorVisitor::CMGT_zero_1(Imm<2> size, Vec Vn, Vec Vd) { return ScalarCompare(*this, size, {}, Vn, Vd, ComparisonType::GT, ComparisonVariant::Zero); } +bool TranslatorVisitor::CMLT_1(Imm<2> size, Vec Vn, Vec Vd) { + return ScalarCompare(*this, size, {}, Vn, Vd, ComparisonType::LT, ComparisonVariant::Zero); +} + bool TranslatorVisitor::CMHI_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { return ScalarCompare(*this, size, Vm, Vn, Vd, ComparisonType::HI, ComparisonVariant::Register); }