diff options
author | MerryMage <[email protected]> | 2016-07-14 15:01:30 +0100 |
---|---|---|
committer | MerryMage <[email protected]> | 2016-07-14 15:01:30 +0100 |
commit | 63242924fcf5f027d82db8b90fdc149c10a43205 (patch) | |
tree | 19900e11b0c4ec01c37302cc8182bb904bcb11f4 | |
parent | 181f78f36e2ab33b49fb22656929c109e0663735 (diff) | |
download | dynarmic-63242924fcf5f027d82db8b90fdc149c10a43205.tar.gz dynarmic-63242924fcf5f027d82db8b90fdc149c10a43205.zip |
Implement thumb16_SVC
-rw-r--r-- | src/frontend/decoder/thumb16.h | 4 | ||||
-rw-r--r-- | src/frontend/disassembler/disassembler_thumb.cpp | 4 | ||||
-rw-r--r-- | src/frontend/translate/translate_thumb.cpp | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/frontend/decoder/thumb16.h b/src/frontend/decoder/thumb16.h index c2565818..35f8845f 100644 --- a/src/frontend/decoder/thumb16.h +++ b/src/frontend/decoder/thumb16.h @@ -56,7 +56,7 @@ private: }; template <typename V> -const std::array<Thumb16Matcher<V>, 35> g_thumb16_instruction_table = { +const std::array<Thumb16Matcher<V>, 36> g_thumb16_instruction_table = { #define INST(fn, name, bitstring) detail::detail<Thumb16Matcher, u16, 16>::GetMatcher<decltype(fn), fn>(name, bitstring) @@ -140,7 +140,7 @@ const std::array<Thumb16Matcher<V>, 35> g_thumb16_instruction_table = { //INST(&V::thumb16_BX, "BX (reg)", "010001110mmmm000"), // v4T //INST(&V::thumb16_BLX, "BLX (reg)", "010001111mmmm000"), // v5T INST(&V::thumb16_UDF, "UDF", "11011110--------"), - //INST(&V::thumb16_SWI, "SWI", "11011111xxxxxxxx"), + INST(&V::thumb16_SVC, "SVC", "11011111xxxxxxxx"), //INST(&V::thumb16_B_cond, "B (cond)", "1101ccccxxxxxxxx"), //INST(&V::thumb16_B_imm, "B (imm)", "11100xxxxxxxxxxx"), //INST(&V::thumb16_BLX_suffix, "BLX (imm, suffix)", "11101xxxxxxxxxx0"), diff --git a/src/frontend/disassembler/disassembler_thumb.cpp b/src/frontend/disassembler/disassembler_thumb.cpp index d2ee495d..e17fe8b2 100644 --- a/src/frontend/disassembler/disassembler_thumb.cpp +++ b/src/frontend/disassembler/disassembler_thumb.cpp @@ -247,6 +247,10 @@ public: std::string thumb16_UDF() { return Common::StringFromFormat("udf"); } + + std::string thumb16_SVC(Imm8 imm8) { + return Common::StringFromFormat("svc #%u", imm8); + } }; std::string DisassembleThumb16(u16 instruction) { diff --git a/src/frontend/translate/translate_thumb.cpp b/src/frontend/translate/translate_thumb.cpp index e097d2da..7c777244 100644 --- a/src/frontend/translate/translate_thumb.cpp +++ b/src/frontend/translate/translate_thumb.cpp @@ -443,6 +443,13 @@ struct ThumbTranslatorVisitor final { bool thumb16_UDF() { return TranslateThisInstruction(); } + + bool thumb16_SVC(Imm8 imm8) { + u32 imm32 = imm8; + // SVC #<imm8> + ir.CallSupervisor(ir.Imm32(imm32)); + return false; + } }; enum class ThumbInstSize { |