From 51b526e4536076e43e4bd691779f6deb333b07eb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 6 Mar 2019 13:56:04 -0500 Subject: [PATCH] A64: Implement CFINV --- src/CMakeLists.txt | 1 + src/frontend/A64/decoder/a64.inc | 2 +- .../impl/system_flag_manipulation.cpp | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/frontend/A64/translate/impl/system_flag_manipulation.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c9ef4fcb..da59d6f5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -175,6 +175,7 @@ add_library(dynarmic frontend/A64/translate/impl/simd_vector_x_indexed_element.cpp frontend/A64/translate/impl/sys_dc.cpp frontend/A64/translate/impl/system.cpp + frontend/A64/translate/impl/system_flag_manipulation.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 ae47ff0e..328d4e13 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -81,7 +81,7 @@ INST(MSR_reg, "MSR (register)", "11010 INST(MRS, "MRS", "110101010011poooNNNNMMMMooottttt") // System - Flag manipulation instructions -//INST(CFINV, "CFINV", "11010101000000000100000000011111") // ARMv8.4 +INST(CFINV, "CFINV", "11010101000000000100000000011111") // ARMv8.4 //INST(RMIF, "RMIF", "10111010000iiiiii00001nnnnn0IIII") // ARMv8.4 //INST(SETF8, "SETF8", "0011101000000000000010nnnnn01101") // ARMv8.4 //INST(SETF16, "SETF16", "0011101000000000010010nnnnn01101") // ARMv8.4 diff --git a/src/frontend/A64/translate/impl/system_flag_manipulation.cpp b/src/frontend/A64/translate/impl/system_flag_manipulation.cpp new file mode 100644 index 00000000..0ce291ff --- /dev/null +++ b/src/frontend/A64/translate/impl/system_flag_manipulation.cpp @@ -0,0 +1,19 @@ +/* This file is part of the dynarmic project. + * Copyright (c) 2019 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::CFINV() { + const IR::U32 nzcv = ir.GetNZCVRaw(); + const IR::U32 result = ir.Eor(nzcv, ir.Imm32(0x20000000)); + + ir.SetNZCVRaw(result); + return true; +} + +} // namespace Dynarmic::A64