From aaa19acbd0f8911a8efacb33a6d9c1e82274e406 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 24 May 2020 15:18:03 +0100 Subject: [PATCH] DSP/Interpreter: simplify opcode table by masking --- .../Core/DSP/Interpreter/DSPIntTables.cpp | 104 ++---------------- 1 file changed, 7 insertions(+), 97 deletions(-) diff --git a/Source/Core/Core/DSP/Interpreter/DSPIntTables.cpp b/Source/Core/Core/DSP/Interpreter/DSPIntTables.cpp index c3364e1c42..32035f9172 100644 --- a/Source/Core/Core/DSP/Interpreter/DSPIntTables.cpp +++ b/Source/Core/Core/DSP/Interpreter/DSPIntTables.cpp @@ -21,7 +21,7 @@ struct InterpreterOpInfo }; // clang-format off -constexpr std::array s_opcodes +constexpr std::array s_opcodes {{ {0x0000, 0xfffc, nop}, @@ -32,109 +32,19 @@ constexpr std::array s_opcodes {0x0021, 0xffff, halt}, - {0x02d0, 0xffff, ret}, - {0x02d1, 0xffff, ret}, - {0x02d2, 0xffff, ret}, - {0x02d3, 0xffff, ret}, - {0x02d4, 0xffff, ret}, - {0x02d5, 0xffff, ret}, - {0x02d6, 0xffff, ret}, - {0x02d7, 0xffff, ret}, - {0x02d8, 0xffff, ret}, - {0x02d9, 0xffff, ret}, - {0x02da, 0xffff, ret}, - {0x02db, 0xffff, ret}, - {0x02dc, 0xffff, ret}, - {0x02dd, 0xffff, ret}, - {0x02de, 0xffff, ret}, - {0x02df, 0xffff, ret}, + {0x02d0, 0xfff0, ret}, {0x02ff, 0xffff, rti}, - {0x02b0, 0xffff, call}, - {0x02b1, 0xffff, call}, - {0x02b2, 0xffff, call}, - {0x02b3, 0xffff, call}, - {0x02b4, 0xffff, call}, - {0x02b5, 0xffff, call}, - {0x02b6, 0xffff, call}, - {0x02b7, 0xffff, call}, - {0x02b8, 0xffff, call}, - {0x02b9, 0xffff, call}, - {0x02ba, 0xffff, call}, - {0x02bb, 0xffff, call}, - {0x02bc, 0xffff, call}, - {0x02bd, 0xffff, call}, - {0x02be, 0xffff, call}, - {0x02bf, 0xffff, call}, + {0x02b0, 0xfff0, call}, - {0x0270, 0xffff, ifcc}, - {0x0271, 0xffff, ifcc}, - {0x0272, 0xffff, ifcc}, - {0x0273, 0xffff, ifcc}, - {0x0274, 0xffff, ifcc}, - {0x0275, 0xffff, ifcc}, - {0x0276, 0xffff, ifcc}, - {0x0277, 0xffff, ifcc}, - {0x0278, 0xffff, ifcc}, - {0x0279, 0xffff, ifcc}, - {0x027a, 0xffff, ifcc}, - {0x027b, 0xffff, ifcc}, - {0x027c, 0xffff, ifcc}, - {0x027d, 0xffff, ifcc}, - {0x027e, 0xffff, ifcc}, - {0x027f, 0xffff, ifcc}, + {0x0270, 0xfff0, ifcc}, - {0x0290, 0xffff, jcc}, - {0x0291, 0xffff, jcc}, - {0x0292, 0xffff, jcc}, - {0x0293, 0xffff, jcc}, - {0x0294, 0xffff, jcc}, - {0x0295, 0xffff, jcc}, - {0x0296, 0xffff, jcc}, - {0x0297, 0xffff, jcc}, - {0x0298, 0xffff, jcc}, - {0x0299, 0xffff, jcc}, - {0x029a, 0xffff, jcc}, - {0x029b, 0xffff, jcc}, - {0x029c, 0xffff, jcc}, - {0x029d, 0xffff, jcc}, - {0x029e, 0xffff, jcc}, - {0x029f, 0xffff, jcc}, + {0x0290, 0xfff0, jcc}, - {0x1700, 0xff1f, jmprcc}, - {0x1701, 0xff1f, jmprcc}, - {0x1702, 0xff1f, jmprcc}, - {0x1703, 0xff1f, jmprcc}, - {0x1704, 0xff1f, jmprcc}, - {0x1705, 0xff1f, jmprcc}, - {0x1706, 0xff1f, jmprcc}, - {0x1707, 0xff1f, jmprcc}, - {0x1708, 0xff1f, jmprcc}, - {0x1709, 0xff1f, jmprcc}, - {0x170a, 0xff1f, jmprcc}, - {0x170b, 0xff1f, jmprcc}, - {0x170c, 0xff1f, jmprcc}, - {0x170d, 0xff1f, jmprcc}, - {0x170e, 0xff1f, jmprcc}, - {0x170f, 0xff1f, jmprcc}, + {0x1700, 0xff10, jmprcc}, - {0x1710, 0xff1f, callr}, - {0x1711, 0xff1f, callr}, - {0x1712, 0xff1f, callr}, - {0x1713, 0xff1f, callr}, - {0x1714, 0xff1f, callr}, - {0x1715, 0xff1f, callr}, - {0x1716, 0xff1f, callr}, - {0x1717, 0xff1f, callr}, - {0x1718, 0xff1f, callr}, - {0x1719, 0xff1f, callr}, - {0x171a, 0xff1f, callr}, - {0x171b, 0xff1f, callr}, - {0x171c, 0xff1f, callr}, - {0x171d, 0xff1f, callr}, - {0x171e, 0xff1f, callr}, - {0x171f, 0xff1f, callr}, + {0x1710, 0xff10, callr}, {0x1200, 0xff00, sbclr}, {0x1300, 0xff00, sbset},