A64: Implement EXT
This commit is contained in:
parent
3472f371df
commit
78a047f0f9
2 changed files with 29 additions and 0 deletions
|
@ -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
|
||||
|
|
28
src/frontend/A64/translate/impl/simd_extract.cpp
Normal file
28
src/frontend/A64/translate/impl/simd_extract.cpp
Normal file
|
@ -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<size_t>() << 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
|
Loading…
Reference in a new issue