diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 56fdcb1a..48237161 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -101,6 +101,7 @@ add_library(dynarmic frontend/A64/translate/impl/simd_aes.cpp frontend/A64/translate/impl/simd_copy.cpp frontend/A64/translate/impl/simd_crypto_four_register.cpp + frontend/A64/translate/impl/simd_extract.cpp frontend/A64/translate/impl/simd_modified_immediate.cpp frontend/A64/translate/impl/simd_permute.cpp frontend/A64/translate/impl/simd_scalar_pairwise.cpp diff --git a/src/frontend/A64/translate/impl/simd_extract.cpp b/src/frontend/A64/translate/impl/simd_extract.cpp new file mode 100644 index 00000000..70c58de0 --- /dev/null +++ b/src/frontend/A64/translate/impl/simd_extract.cpp @@ -0,0 +1,28 @@ +/* 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::EXT(bool Q, Vec Vm, Imm<4> imm4, Vec Vn, Vec Vd) { + if (!Q && imm4.Bit<3>()) { + return UnallocatedEncoding(); + } + + const size_t datasize = Q ? 128 : 64; + const size_t position = imm4.ZeroExtend() << 3; + + const IR::U128 lo = V(datasize, Vn); + const IR::U128 hi = V(datasize, Vm); + const IR::U128 result = ir.VectorExtract(lo, hi, position); + + V(datasize, Vd, result); + + return true; +} + +} // namespace Dynarmic::A64