diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index be49a49c..945d2f35 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -106,6 +106,7 @@ add_library(dynarmic 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_shift_by_immediate.cpp frontend/A64/translate/impl/simd_scalar_three_same.cpp frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp frontend/A64/translate/impl/simd_sha.cpp diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index 8f6411cb..170e3753 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -471,7 +471,7 @@ INST(SUB_1, "SUB (vector)", "01111 //INST(SSRA_1, "SSRA", "010111110IIIIiii000101nnnnnddddd") //INST(SRSHR_1, "SRSHR", "010111110IIIIiii001001nnnnnddddd") //INST(SRSRA_1, "SRSRA", "010111110IIIIiii001101nnnnnddddd") -//INST(SHL_1, "SHL", "010111110IIIIiii010101nnnnnddddd") +INST(SHL_1, "SHL", "010111110IIIIiii010101nnnnnddddd") //INST(SQSHL_imm_1, "SQSHL (immediate)", "010111110IIIIiii011101nnnnnddddd") //INST(SQSHRN_1, "SQSHRN, SQSHRN2", "010111110IIIIiii100101nnnnnddddd") //INST(SQRSHRN_1, "SQRSHRN, SQRSHRN2", "010111110IIIIiii100111nnnnnddddd") diff --git a/src/frontend/A64/translate/impl/simd_scalar_shift_by_immediate.cpp b/src/frontend/A64/translate/impl/simd_scalar_shift_by_immediate.cpp new file mode 100644 index 00000000..4d632219 --- /dev/null +++ b/src/frontend/A64/translate/impl/simd_scalar_shift_by_immediate.cpp @@ -0,0 +1,26 @@ +/* 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::A64 { + +bool TranslatorVisitor::SHL_1(Imm<4> immh, Imm<3> immb, Vec Vn, Vec Vd) { + if (!immh.Bit<3>()) { + return ReservedValue(); + } + + const size_t esize = 64; + const u8 shift_amount = static_cast(concatenate(immh, immb).ZeroExtend() - esize); + + const IR::U64 operand = V_scalar(esize, Vn); + const IR::U64 result = ir.LogicalShiftLeft(operand, ir.Imm8(shift_amount)); + + V_scalar(esize, Vd, result); + return true; +} + +} // namespace Dynarmic::A64