From ae5dbcbed6d279351f3479c5534c612f0f2624bd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 21 Jan 2018 19:50:31 -0500 Subject: [PATCH] A64: Implement HINT, NOP, YIELD, WFE, WFI, SEV, and SEVL Truly the most difficult A64 instructions to implement. --- src/CMakeLists.txt | 1 + src/frontend/A64/decoder/a64.inc | 14 ++++---- src/frontend/A64/translate/impl/system.cpp | 41 ++++++++++++++++++++++ 3 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 src/frontend/A64/translate/impl/system.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 09438116..1c7387bf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -75,6 +75,7 @@ add_library(dynarmic frontend/A64/translate/impl/load_store_register_pair.cpp frontend/A64/translate/impl/move_wide.cpp frontend/A64/translate/impl/simd_three_same.cpp + frontend/A64/translate/impl/system.cpp frontend/A64/translate/translate.cpp frontend/A64/translate/translate.h frontend/A64/types.cpp diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index be0f0cb7..fceda5a0 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -42,13 +42,13 @@ INST(SVC, "SVC", "11010 // System //INST(MSR_imm, "MSR (immediate)", "1101010100000ooo0100MMMMooo11111") -//INST(HINT, "HINT", "11010101000000110010MMMMooo11111") -//INST(NOP, "NOP", "11010101000000110010000000011111") -//INST(YIELD, "YIELD", "11010101000000110010000000111111") -//INST(WFE, "WFE", "11010101000000110010000001011111") -//INST(WFI, "WFI", "11010101000000110010000001111111") -//INST(SEV, "SEV", "11010101000000110010000010011111") -//INST(SEVL, "SEVL", "11010101000000110010000010111111") +INST(HINT, "HINT", "11010101000000110010MMMMooo11111") +INST(NOP, "NOP", "11010101000000110010000000011111") +INST(YIELD, "YIELD", "11010101000000110010000000111111") +INST(WFE, "WFE", "11010101000000110010000001011111") +INST(WFI, "WFI", "11010101000000110010000001111111") +INST(SEV, "SEV", "11010101000000110010000010011111") +INST(SEVL, "SEVL", "11010101000000110010000010111111") //INST(XPAC_1, "XPACD, XPACI, XPACLRI", "110110101100000101000D11111ddddd") //INST(XPAC_2, "XPACD, XPACI, XPACLRI", "11010101000000110010000011111111") //INST(PACIA_1, "PACIA, PACIA1716, PACIASP, PACIAZ, PACIZA", "110110101100000100Z000nnnnnddddd") diff --git a/src/frontend/A64/translate/impl/system.cpp b/src/frontend/A64/translate/impl/system.cpp new file mode 100644 index 00000000..0d420302 --- /dev/null +++ b/src/frontend/A64/translate/impl/system.cpp @@ -0,0 +1,41 @@ +/* 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::HINT([[maybe_unused]] Imm<4> CRm, [[maybe_unused]] Imm<3> op2) { + return true; +} + +bool TranslatorVisitor::NOP() { + return true; +} + +bool TranslatorVisitor::YIELD() { + return true; +} + +bool TranslatorVisitor::WFE() { + return true; +} + +bool TranslatorVisitor::WFI() { + return true; +} + +bool TranslatorVisitor::SEV() { + return true; +} + +bool TranslatorVisitor::SEVL() { + return true; +} + +} // namespace A64 +} // namespace Dynarmic