From 3ad4e547e4e59692b479bc9de75592ca0a256361 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 15 Apr 2018 07:19:07 -0400 Subject: [PATCH] A64: Implement scalar variant of NEG --- src/frontend/A64/decoder/a64.inc | 2 +- .../translate/impl/simd_scalar_two_register_misc.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index 3839f5dd..f2aa8ab7 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -416,7 +416,7 @@ INST(UCVTF_int_2, "UCVTF (vector, integer)", "01111 //INST(SQNEG_1, "SQNEG", "01111110zz100000011110nnnnnddddd") //INST(CMGE_zero_1, "CMGE (zero)", "01111110zz100000100010nnnnnddddd") //INST(CMLE_1, "CMLE (zero)", "01111110zz100000100110nnnnnddddd") -//INST(NEG_1, "NEG (vector)", "01111110zz100000101110nnnnnddddd") +INST(NEG_1, "NEG (vector)", "01111110zz100000101110nnnnnddddd") //INST(SQXTUN_1, "SQXTUN, SQXTUN2", "01111110zz100001001010nnnnnddddd") //INST(UQXTN_1, "UQXTN, UQXTN2", "01111110zz100001010010nnnnnddddd") //INST(FCVTXN_1, "FCVTXN, FCVTXN2", "011111100z100001011010nnnnnddddd") diff --git a/src/frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp b/src/frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp index dab547f7..559732a7 100644 --- a/src/frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp +++ b/src/frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp @@ -8,6 +8,18 @@ namespace Dynarmic::A64 { +bool TranslatorVisitor::NEG_1(Imm<2> size, Vec Vn, Vec Vd) { + if (size != 0b11) { + return ReservedValue(); + } + + const IR::U64 operand = V_scalar(64, Vn); + const IR::U64 result = ir.Sub(ir.Imm64(0), operand); + + V_scalar(64, Vd, result); + return true; +} + bool TranslatorVisitor::UCVTF_int_2(bool sz, Vec Vn, Vec Vd) { const auto esize = sz ? 64 : 32;