From cf81f04ed3ae7ccadc5513d3ead27fa9bf3443fa Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 3 Apr 2018 08:12:13 -0400 Subject: [PATCH] A64: Implement RAX1 --- src/CMakeLists.txt | 1 + src/frontend/A64/decoder/a64.inc | 2 +- .../A64/translate/impl/simd_sha512.cpp | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/frontend/A64/translate/impl/simd_sha512.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 48237161..1e48bd65 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -108,6 +108,7 @@ add_library(dynarmic 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 + frontend/A64/translate/impl/simd_sha512.cpp frontend/A64/translate/impl/simd_shift_by_immediate.cpp frontend/A64/translate/impl/simd_three_different.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 d149bb52..ed7d77b3 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -859,7 +859,7 @@ INST(USHLL, "USHLL, USHLL2", "0Q101 //INST(SHA512H, "SHA512H", "11001110011mmmmm100000nnnnnddddd") //INST(SHA512H2, "SHA512H2", "11001110011mmmmm100001nnnnnddddd") //INST(SHA512SU1, "SHA512SU1", "11001110011mmmmm100010nnnnnddddd") -//INST(RAX1, "RAX1", "11001110011mmmmm100011nnnnnddddd") +INST(RAX1, "RAX1", "11001110011mmmmm100011nnnnnddddd") //INST(SM3PARTW1, "SM3PARTW1", "11001110011mmmmm110000nnnnnddddd") //INST(SM3PARTW2, "SM3PARTW2", "11001110011mmmmm110001nnnnnddddd") //INST(SM4EKEY, "SM4EKEY", "11001110011mmmmm110010nnnnnddddd") diff --git a/src/frontend/A64/translate/impl/simd_sha512.cpp b/src/frontend/A64/translate/impl/simd_sha512.cpp new file mode 100644 index 00000000..4ccb86c7 --- /dev/null +++ b/src/frontend/A64/translate/impl/simd_sha512.cpp @@ -0,0 +1,23 @@ +/* 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::RAX1(Vec Vm, Vec Vn, Vec Vd) { + const IR::U128 m = ir.GetQ(Vm); + const IR::U128 n = ir.GetQ(Vn); + + const IR::U128 rotated_m = ir.VectorOr(ir.VectorLogicalShiftLeft(64, m, 1), + ir.VectorLogicalShiftRight(64, m, 63)); + const IR::U128 result = ir.VectorEor(n, rotated_m); + + ir.SetQ(Vd, result); + return true; +} + +} // namespace Dynarmic::A64