From 9a097e307f6fd4dde81ce44b33ab4de646f385da Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 3 May 2019 10:57:26 -0400 Subject: [PATCH] A32: Implement the ARM-mode variant of SEVL --- include/dynarmic/A32/config.h | 2 ++ include/dynarmic/A64/config.h | 2 +- src/frontend/A32/decoder/arm.inc | 1 + src/frontend/A32/disassembler/disassembler_arm.cpp | 3 +++ src/frontend/A32/translate/translate_arm/hint.cpp | 4 ++++ src/frontend/A32/translate/translate_arm/translate_arm.h | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/dynarmic/A32/config.h b/include/dynarmic/A32/config.h index c0bda863..1857c1bb 100644 --- a/include/dynarmic/A32/config.h +++ b/include/dynarmic/A32/config.h @@ -26,6 +26,8 @@ enum class Exception { UnpredictableInstruction, /// A SEV instruction was executed. The event register of all PEs should be set. SendEvent, + /// A SEVL instruction was executed. The event register of the current PE should be set. + SendEventLocal, /// A WFI instruction was executed. You may now enter a low-power state. WaitForInterrupt, /// A WFE instruction was executed. You may now enter a low-power state if the event register is clear. diff --git a/include/dynarmic/A64/config.h b/include/dynarmic/A64/config.h index f1f6c305..425004b5 100644 --- a/include/dynarmic/A64/config.h +++ b/include/dynarmic/A64/config.h @@ -34,7 +34,7 @@ enum class Exception { WaitForEvent, /// A SEV instruction was executed. The event register of all PEs should be set. SendEvent, - /// A SEV instruction was executed. The event register of the current PE should be set. + /// A SEVL instruction was executed. The event register of the current PE should be set. SendEventLocal, /// A YIELD instruction was executed. Yield, diff --git a/src/frontend/A32/decoder/arm.inc b/src/frontend/A32/decoder/arm.inc index 3017f97d..b131e39d 100644 --- a/src/frontend/A32/decoder/arm.inc +++ b/src/frontend/A32/decoder/arm.inc @@ -97,6 +97,7 @@ INST(arm_UXTAH, "UXTAH", "cccc01101111nnnnddddrr000111mmmm INST(arm_PLD_imm, "PLD (imm)", "11110101uz01nnnn1111iiiiiiiiiiii") // v5E for PLD; v7 for PLDW INST(arm_PLD_reg, "PLD (reg)", "11110111uz01nnnn1111iiiiitt0mmmm") // v5E for PLD; v7 for PLDW INST(arm_SEV, "SEV", "----0011001000001111000000000100") // v6K +INST(arm_SEVL, "SEVL", "----0011001000001111000000000101") // v8 INST(arm_WFE, "WFE", "----0011001000001111000000000010") // v6K INST(arm_WFI, "WFI", "----0011001000001111000000000011") // v6K INST(arm_YIELD, "YIELD", "----0011001000001111000000000001") // v6K diff --git a/src/frontend/A32/disassembler/disassembler_arm.cpp b/src/frontend/A32/disassembler/disassembler_arm.cpp index 42bbcf50..3ba0edca 100644 --- a/src/frontend/A32/disassembler/disassembler_arm.cpp +++ b/src/frontend/A32/disassembler/disassembler_arm.cpp @@ -451,6 +451,9 @@ public: std::string arm_SEV() { return "sev"; } + std::string arm_SEVL() { + return "sevl"; + } std::string arm_WFE() { return "wfe"; } diff --git a/src/frontend/A32/translate/translate_arm/hint.cpp b/src/frontend/A32/translate/translate_arm/hint.cpp index 8a098359..546a3f70 100644 --- a/src/frontend/A32/translate/translate_arm/hint.cpp +++ b/src/frontend/A32/translate/translate_arm/hint.cpp @@ -33,6 +33,10 @@ bool ArmTranslatorVisitor::arm_SEV() { return RaiseException(Exception::SendEvent); } +bool ArmTranslatorVisitor::arm_SEVL() { + return RaiseException(Exception::SendEventLocal); +} + bool ArmTranslatorVisitor::arm_WFE() { return RaiseException(Exception::WaitForEvent); } diff --git a/src/frontend/A32/translate/translate_arm/translate_arm.h b/src/frontend/A32/translate/translate_arm/translate_arm.h index 5f941cc1..ddfd1850 100644 --- a/src/frontend/A32/translate/translate_arm/translate_arm.h +++ b/src/frontend/A32/translate/translate_arm/translate_arm.h @@ -167,6 +167,7 @@ struct ArmTranslatorVisitor final { bool arm_PLD_imm(bool add, bool R, Reg n, Imm<12> imm12); bool arm_PLD_reg(bool add, bool R, Reg n, Imm<5> imm5, ShiftType shift, Reg m); bool arm_SEV(); + bool arm_SEVL(); bool arm_WFE(); bool arm_WFI(); bool arm_YIELD();