diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c195f972..909dd394 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -98,6 +98,7 @@ add_library(dynarmic frontend/A64/translate/impl/simd_copy.cpp frontend/A64/translate/impl/simd_modified_immediate.cpp frontend/A64/translate/impl/simd_permute.cpp + frontend/A64/translate/impl/simd_scalar_pairwise.cpp frontend/A64/translate/impl/simd_scalar_three_same.cpp frontend/A64/translate/impl/simd_shift_by_immediate.cpp frontend/A64/translate/impl/simd_three_same.cpp diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index 90b60489..e280b88f 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -422,7 +422,7 @@ INST(DUP_elt_1, "DUP (element)", "01011 //INST(FCVTXN_1, "FCVTXN, FCVTXN2", "011111100z100001011010nnnnnddddd") // Data Processing - FP and SIMD - SIMD Scalar pairwise -//INST(ADDP_pair, "ADDP (scalar)", "01011110zz110001101110nnnnnddddd") +INST(ADDP_pair, "ADDP (scalar)", "01011110zz110001101110nnnnnddddd") //INST(FMAXNMP_pair_1, "FMAXNMP (scalar)", "0101111000110000110010nnnnnddddd") //INST(FMAXNMP_pair_2, "FMAXNMP (scalar)", "011111100z110000110010nnnnnddddd") //INST(FADDP_pair_1, "FADDP (scalar)", "0101111000110000110110nnnnnddddd") diff --git a/src/frontend/A64/translate/impl/simd_scalar_pairwise.cpp b/src/frontend/A64/translate/impl/simd_scalar_pairwise.cpp new file mode 100644 index 00000000..aa7dae0d --- /dev/null +++ b/src/frontend/A64/translate/impl/simd_scalar_pairwise.cpp @@ -0,0 +1,25 @@ +/* This file is part of the dynarmic project. + * Copyright (c) 2018 MerryMage + * This software may be used and distributed according to the terms of the GNU + * General Public License version 2 or any later version. + */ + +#include "frontend/A64/translate/impl/impl.h" + +namespace Dynarmic { +namespace A64 { + +bool TranslatorVisitor::ADDP_pair(Imm<2> size, Vec Vn, Vec Vd) { + if (size != 0b11) { + return ReservedValue(); + } + + const IR::U64 operand1 = ir.VectorGetElement(64, V(128, Vn), 0); + const IR::U64 operand2 = ir.VectorGetElement(64, V(128, Vn), 1); + const IR::U128 result = ir.ZeroExtendToQuad(ir.Add(operand1, operand2)); + V(128, Vd, result); + return true; +} + +} // namespace A64 +} // namespace Dynarmic