From 9935f3aa28f35fc9a604a87259fdc7934b394054 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 3 May 2019 11:00:03 -0400 Subject: [PATCH] A32: Implement Thumb-1 variant of SEVL While we're at it, also add the Thumb-2 encoding to the encoding table to make sure it isn't forgotten about in the future. --- src/frontend/A32/decoder/thumb16.h | 1 + src/frontend/A32/decoder/thumb32.h | 1 + src/frontend/A32/disassembler/disassembler_thumb.cpp | 4 ++++ src/frontend/A32/translate/translate_thumb.cpp | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/src/frontend/A32/decoder/thumb16.h b/src/frontend/A32/decoder/thumb16.h index cdc6834e..e93a7556 100644 --- a/src/frontend/A32/decoder/thumb16.h +++ b/src/frontend/A32/decoder/thumb16.h @@ -90,6 +90,7 @@ std::optional>> DecodeThumb16(u16 // Hint instructions INST(&V::thumb16_NOP, "NOP", "1011111100000000"), // v6T2 INST(&V::thumb16_SEV, "SEV", "1011111101000000"), // v7 + INST(&V::thumb16_SEVL, "SEVL", "1011111101010000"), // v8 INST(&V::thumb16_WFE, "WFE", "1011111100100000"), // v7 INST(&V::thumb16_WFI, "WFI", "1011111100110000"), // v7 INST(&V::thumb16_YIELD, "YIELD", "1011111100010000"), // v7 diff --git a/src/frontend/A32/decoder/thumb32.h b/src/frontend/A32/decoder/thumb32.h index 88fc2be6..55f6d2bb 100644 --- a/src/frontend/A32/decoder/thumb32.h +++ b/src/frontend/A32/decoder/thumb32.h @@ -127,6 +127,7 @@ std::optional>> DecodeThumb32(u32 //INST(&V::thumb32_WFE, "WFE", "111100111010----10-0-00000000010"), //INST(&V::thumb32_WFI, "WFI", "111100111010----10-0-00000000011"), //INST(&V::thumb32_SEV, "SEV", "111100111010----10-0-00000000100"), + //INST(&V::thumb32_SEVL, "SEVL", "111100111010----10-0-00000000101"), //INST(&V::thumb32_DBG, "DBG", "111100111010----10-0-0001111----"), //INST(&V::thumb32_CPS, "CPS", "111100111010----10-0------------"), diff --git a/src/frontend/A32/disassembler/disassembler_thumb.cpp b/src/frontend/A32/disassembler/disassembler_thumb.cpp index a496abc2..a53475db 100644 --- a/src/frontend/A32/disassembler/disassembler_thumb.cpp +++ b/src/frontend/A32/disassembler/disassembler_thumb.cpp @@ -254,6 +254,10 @@ public: return "sev"; } + std::string thumb16_SEVL() { + return "sevl"; + } + std::string thumb16_WFE() { return "wfe"; } diff --git a/src/frontend/A32/translate/translate_thumb.cpp b/src/frontend/A32/translate/translate_thumb.cpp index 9ecadbfa..fae7ccf5 100644 --- a/src/frontend/A32/translate/translate_thumb.cpp +++ b/src/frontend/A32/translate/translate_thumb.cpp @@ -684,6 +684,11 @@ struct ThumbTranslatorVisitor final { return RaiseException(Exception::SendEvent); } + // SEVL + bool thumb16_SEVL() { + return RaiseException(Exception::SendEventLocal); + } + // WFE bool thumb16_WFE() { return RaiseException(Exception::WaitForEvent);