From 78bb12276acd5975df0201404dd249b33f61fa75 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 15 Apr 2018 05:27:37 -0400 Subject: [PATCH] A64: Implement CMHI (register, scalar) --- 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 8c0e0bf9..dce40eab 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -456,7 +456,7 @@ INST(ADD_1, "ADD (vector)", "01011 //INST(SQDMULH_vec_1, "SQDMULH (vector)", "01011110zz1mmmmm101101nnnnnddddd") //INST(UQADD_1, "UQADD", "01111110zz1mmmmm000011nnnnnddddd") //INST(UQSUB_1, "UQSUB", "01111110zz1mmmmm001011nnnnnddddd") -//INST(CMHI_1, "CMHI (register)", "01111110zz1mmmmm001101nnnnnddddd") +INST(CMHI_1, "CMHI (register)", "01111110zz1mmmmm001101nnnnnddddd") //INST(CMHS_1, "CMHS (register)", "01111110zz1mmmmm001111nnnnnddddd") //INST(USHL_1, "USHL", "01111110zz1mmmmm010001nnnnnddddd") //INST(UQSHL_reg_1, "UQSHL (register)", "01111110zz1mmmmm010011nnnnnddddd") 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 f38d788c..5bfdb24e 100644 --- a/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp +++ b/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp @@ -12,6 +12,7 @@ namespace { enum class ComparisonType { GE, GT, + HI, }; bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, Vec Vm, Vec Vn, Vec Vd, ComparisonType type) { @@ -30,8 +31,10 @@ bool ScalarCompare(TranslatorVisitor& v, Imm<2> size, Vec Vm, Vec Vn, Vec Vd, Co case ComparisonType::GE: return v.ir.VectorGreaterEqualSigned(esize, operand1, operand2); case ComparisonType::GT: - default: return v.ir.VectorGreaterSigned(esize, operand1, operand2); + case ComparisonType::HI: + default: + return v.ir.VectorGreaterUnsigned(esize, operand1, operand2); } }(); @@ -62,6 +65,10 @@ bool TranslatorVisitor::CMGT_reg_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { return ScalarCompare(*this, size, Vm, Vn, Vd, ComparisonType::GT); } +bool TranslatorVisitor::CMHI_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { + return ScalarCompare(*this, size, Vm, Vn, Vd, ComparisonType::HI); +} + bool TranslatorVisitor::SUB_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) { if (size != 0b11) { return ReservedValue();