diff options
Diffstat (limited to '3rdparty/asmjit/test/asmjit_test_opcode.cpp')
-rw-r--r-- | 3rdparty/asmjit/test/asmjit_test_opcode.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/3rdparty/asmjit/test/asmjit_test_opcode.cpp b/3rdparty/asmjit/test/asmjit_test_opcode.cpp index 908435beb00..d61a6e4bc29 100644 --- a/3rdparty/asmjit/test/asmjit_test_opcode.cpp +++ b/3rdparty/asmjit/test/asmjit_test_opcode.cpp @@ -21,9 +21,11 @@ // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. +// ---------------------------------------------------------------------------- // This file is used to test opcodes generated by AsmJit. Output can be // disassembled in your IDE or by your favorite disassembler. Instructions // are grouped by category and then sorted alphabetically. +// ---------------------------------------------------------------------------- #include <asmjit/x86.h> #include <stdio.h> @@ -34,21 +36,21 @@ using namespace asmjit; struct OpcodeDumpInfo { - uint32_t archId; + uint32_t arch; bool useRex1; bool useRex2; }; -static const char* archIdToString(uint32_t archId) { - switch (archId) { - case ArchInfo::kIdNone: return "None"; - case ArchInfo::kIdX86 : return "X86"; - case ArchInfo::kIdX64 : return "X64"; - case ArchInfo::kIdA32 : return "A32"; - case ArchInfo::kIdA64 : return "A64"; - - default: - return "<unknown>"; +static const char* archToString(uint32_t arch) noexcept { + switch (arch & ~Environment::kArchBigEndianMask) { + case Environment::kArchX86 : return "X86"; + case Environment::kArchX64 : return "X64"; + case Environment::kArchARM : return "ARM"; + case Environment::kArchThumb : return "Thumb"; + case Environment::kArchAArch64 : return "AArch64"; + case Environment::kArchMIPS_LE : return "MIPS"; + case Environment::kArchMIPS64_LE: return "MIPS64"; + default: return "Unknown"; } } @@ -65,23 +67,23 @@ int main() { TestErrorHandler eh; OpcodeDumpInfo infoList[] = { - { ArchInfo::kIdX86, false, false }, - { ArchInfo::kIdX64, false, false }, - { ArchInfo::kIdX64, false, true }, - { ArchInfo::kIdX64, true , false }, - { ArchInfo::kIdX64, true , true } + { Environment::kArchX86, false, false }, + { Environment::kArchX64, false, false }, + { Environment::kArchX64, false, true }, + { Environment::kArchX64, true , false }, + { Environment::kArchX64, true , true } }; for (uint32_t i = 0; i < ASMJIT_ARRAY_SIZE(infoList); i++) { const OpcodeDumpInfo& info = infoList[i]; printf("Opcodes [ARCH=%s REX1=%s REX2=%s]\n", - archIdToString(info.archId), + archToString(info.arch), info.useRex1 ? "true" : "false", info.useRex2 ? "true" : "false"); CodeHolder code; - code.init(CodeInfo(info.archId)); + code.init(Environment(info.arch)); code.setErrorHandler(&eh); #ifndef ASMJIT_NO_LOGGING @@ -95,7 +97,7 @@ int main() { // If this is the host architecture the code generated can be executed // for debugging purposes (the first instruction is ret anyway). - if (code.archId() == ArchInfo::kIdHost) { + if (code.arch() == Environment::kArchHost) { JitRuntime runtime; VoidFunc p; |