diff --git a/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index da72bc22d4..385ab7d42e 100644 --- a/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/External/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -26,33 +26,7 @@ desc: Handles x86/64 ops to IR, no-pf opt, local-flags opt namespace FEXCore::IR { -auto OpToIndex = [](uint8_t Op) constexpr -> uint8_t { - switch (Op) { - // Group 1 - case 0x80: return 0; - case 0x81: return 1; - case 0x82: return 2; - case 0x83: return 3; - // Group 2 - case 0xC0: return 0; - case 0xC1: return 1; - case 0xD0: return 2; - case 0xD1: return 3; - case 0xD2: return 4; - case 0xD3: return 5; - // Group 3 - case 0xF6: return 0; - case 0xF7: return 1; - // Group 4 - case 0xFE: return 0; - // Group 5 - case 0xFF: return 0; - // Group 11 - case 0xC6: return 0; - case 0xC7: return 1; - } - return 0; -}; +using X86Tables::OpToIndex; #define OpcodeArgs [[maybe_unused]] FEXCore::X86Tables::DecodedOp Op diff --git a/Source/Tests/UnitTestGenerator.cpp b/Source/Tests/UnitTestGenerator.cpp index 3f84c925a5..4fb8d4d1a0 100644 --- a/Source/Tests/UnitTestGenerator.cpp +++ b/Source/Tests/UnitTestGenerator.cpp @@ -23,6 +23,8 @@ desc: Brute forces generation of tests for x86/64, incomplete, unused right now #include #include +using FEXCore::X86Tables::OpToIndex; + constexpr std::array, 3> Disp8Ranges = {{ {static_cast(-16), 16}, {static_cast(-128), static_cast(-112)}, @@ -79,34 +81,6 @@ uint32_t GetModRMMapping(uint32_t Register) { return Register; }; -auto OpToIndex = [](uint8_t Op) constexpr -> uint8_t { - switch (Op) { - // Group 1 - case 0x80: return 0; - case 0x81: return 1; - case 0x82: return 2; - case 0x83: return 3; - // Group 2 - case 0xC0: return 0; - case 0xC1: return 1; - case 0xD0: return 2; - case 0xD1: return 3; - case 0xD2: return 4; - case 0xD3: return 5; - // Group 3 - case 0xF6: return 0; - case 0xF7: return 1; - // Group 4 - case 0xFE: return 0; - // Group 5 - case 0xFF: return 0; - // Group 11 - case 0xC6: return 0; - case 0xC7: return 1; - } - return 0; -}; - auto PrimaryIndexToOp = [](uint16_t Op) constexpr -> uint32_t { #define OPD(group, prefix, Reg) ((((group) - FEXCore::X86Tables::TYPE_GROUP_1) << 6) | (prefix) << 3 | (Reg)) switch (Op & ~0b111) {