From 9255a9c6a127a0f2d394c5592bff0dc73435bf0a Mon Sep 17 00:00:00 2001 From: flobernd Date: Fri, 24 Oct 2014 23:11:16 +0200 Subject: [PATCH] Initial commit --- Disassembler Test/Disassembler Test.cpp | 109 + Disassembler Test/Disassembler Test.vcxproj | 160 + .../Disassembler Test.vcxproj.filters | 6 + README.md | 25 +- Table Generator/PugiXML/pugiconfig.hpp | 72 + Table Generator/PugiXML/pugixml.cpp | 10639 ++++++++++++++++ Table Generator/PugiXML/pugixml.hpp | 1332 ++ Table Generator/Table Generator.cpp | 8 + Table Generator/Table Generator.vcxproj | 155 + .../Table Generator.vcxproj.filters | 6 + Verteron Disassembler Engine.sln | 48 + Verteron Disassembler Engine/VXDisassembler.h | 35 + .../VXDisassemblerTypes.h | 450 + .../VXInstructionDecoder.cpp | 1234 ++ .../VXInstructionDecoder.h | 398 + .../VXInstructionFormatter.cpp | 452 + .../VXInstructionFormatter.h | 212 + .../VXOpcodeTable.cpp | 10195 +++++++++++++++ Verteron Disassembler Engine/VXOpcodeTable.h | 1686 +++ .../VXSymbolResolver.cpp | 88 + .../VXSymbolResolver.h | 119 + .../Verteron Disassembler Engine.vcxproj | 155 + ...rteron Disassembler Engine.vcxproj.filters | 17 + 23 files changed, 27599 insertions(+), 2 deletions(-) create mode 100644 Disassembler Test/Disassembler Test.cpp create mode 100644 Disassembler Test/Disassembler Test.vcxproj create mode 100644 Disassembler Test/Disassembler Test.vcxproj.filters create mode 100644 Table Generator/PugiXML/pugiconfig.hpp create mode 100644 Table Generator/PugiXML/pugixml.cpp create mode 100644 Table Generator/PugiXML/pugixml.hpp create mode 100644 Table Generator/Table Generator.cpp create mode 100644 Table Generator/Table Generator.vcxproj create mode 100644 Table Generator/Table Generator.vcxproj.filters create mode 100644 Verteron Disassembler Engine.sln create mode 100644 Verteron Disassembler Engine/VXDisassembler.h create mode 100644 Verteron Disassembler Engine/VXDisassemblerTypes.h create mode 100644 Verteron Disassembler Engine/VXInstructionDecoder.cpp create mode 100644 Verteron Disassembler Engine/VXInstructionDecoder.h create mode 100644 Verteron Disassembler Engine/VXInstructionFormatter.cpp create mode 100644 Verteron Disassembler Engine/VXInstructionFormatter.h create mode 100644 Verteron Disassembler Engine/VXOpcodeTable.cpp create mode 100644 Verteron Disassembler Engine/VXOpcodeTable.h create mode 100644 Verteron Disassembler Engine/VXSymbolResolver.cpp create mode 100644 Verteron Disassembler Engine/VXSymbolResolver.h create mode 100644 Verteron Disassembler Engine/Verteron Disassembler Engine.vcxproj create mode 100644 Verteron Disassembler Engine/Verteron Disassembler Engine.vcxproj.filters diff --git a/Disassembler Test/Disassembler Test.cpp b/Disassembler Test/Disassembler Test.cpp new file mode 100644 index 0000000..3552c99 --- /dev/null +++ b/Disassembler Test/Disassembler Test.cpp @@ -0,0 +1,109 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 24. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#include +#include +#include +#include +#include "VXDisassembler.h" + +using namespace Verteron; +using namespace Disassembler; + +int _tmain(int argc, _TCHAR* argv[]) +{ + uint8_t data32[] = + { + 0x8B, 0xFF, 0x55, 0x8B, 0xEC, 0x6A, 0xFE, 0x68, 0xD8, 0x18, 0x09, 0x77, 0x68, 0x85, 0xD2, + 0x09, 0x77, 0x64, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x50, 0x83, 0xEC, 0x14, 0x53, 0x56, 0x57, + 0xA1, 0x68, 0xEE, 0x13, 0x77, 0x31, 0x45, 0xF8, 0x33, 0xC5, 0x50, 0x8D, 0x45, 0xF0, 0x64, + 0xA3, 0x00, 0x00, 0x00, 0x00, 0x89, 0x65, 0xE8, 0xC7, 0x45, 0xFC, 0x00, 0x00, 0x00, 0x00, + 0x8B, 0x5D, 0x08, 0xF6, 0xC3, 0x04, 0x0F, 0x85, 0x57, 0x74, 0x00, 0x00, 0x53, 0x6A, 0x00, + 0xFF, 0x35, 0xA0, 0xE3, 0x13, 0x77, 0xFF, 0x15, 0x00, 0x10, 0x14, 0x77, 0x85, 0xC0, 0x0F, + 0x84, 0xC6, 0x48, 0x04, 0x00, 0xC7, 0x45, 0x08, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x45, 0xFC, + 0xFE, 0xFF, 0xFF, 0xFF, 0x33, 0xC0, 0x8B, 0x4D, 0xF0, 0x64, 0x89, 0x0D, 0x00, 0x00, 0x00, + 0x00, 0x59, 0x5F, 0x5E, 0x5B, 0x8B, 0xE5, 0x5D, 0xC2, 0x04, 0x00 + }; + uint8_t data64[] = + { + 0x48, 0x89, 0x5C, 0x24, 0x10, 0x48, 0x89, 0x74, 0x24, 0x18, 0x89, 0x4C, 0x24, 0x08, 0x57, + 0x41, 0x54, 0x41, 0x55, 0x41, 0x56, 0x41, 0x57, 0x48, 0x83, 0xEC, 0x40, 0x4C, 0x8B, 0xF2, + 0x8B, 0xD9, 0x48, 0xC7, 0x44, 0x24, 0x20, 0x00, 0x00, 0x00, 0x00, 0x33, 0xF6, 0x48, 0x89, + 0x74, 0x24, 0x30, 0x45, 0x33, 0xFF, 0xF7, 0xC1, 0x8D, 0xF0, 0xFF, 0xFF, 0x0F, 0x85, 0xAA, + 0x53, 0x08, 0x00, 0xF6, 0xC1, 0x40, 0x8B, 0xFE, 0x41, 0xBD, 0x08, 0x00, 0x00, 0x00, 0x41, + 0x0F, 0x45, 0xFD, 0xF6, 0xC1, 0x02, 0x48, 0x8B, 0x0D, 0x10, 0xD4, 0x0E, 0x00, 0x0F, 0x85, + 0x40, 0xE1, 0x01, 0x00, 0x8B, 0x15, 0x4C, 0xD5, 0x0E, 0x00, 0x81, 0xC2, 0x00, 0x00, 0x14, + 0x00, 0x0B, 0xD7, 0x4D, 0x8B, 0xC6, 0xFF, 0x15, 0x3B, 0x2F, 0x10, 0x00, 0x48, 0x8B, 0xD8, + 0x48, 0x85, 0xC0, 0x0F, 0x84, 0x93, 0x78, 0x0A, 0x00, 0x48, 0x8B, 0xC3, 0x48, 0x8B, 0x5C, + 0x24, 0x78, 0x48, 0x8B, 0xB4, 0x24, 0x80, 0x00, 0x00, 0x00, 0x48, 0x83, 0xC4, 0x40, 0x41, + 0x5F, 0x41, 0x5E, 0x41, 0x5D, 0x41, 0x5C, 0x5F, 0xC3 + }; + + VXInstructionInfo info; + VXIntelInstructionFormatter formatter; + VXInstructionDecoder decoder32(&data32[0], sizeof(data32), VXDisassemblerMode::M32BIT); + VXInstructionDecoder decoder64(&data64[0], sizeof(data64), VXDisassemblerMode::M64BIT); + + decoder32.setInstructionPointer(0x77091852); + std::cout << "32 bit test ..." << std::endl << std::endl; + while (decoder32.decodeNextInstruction(info)) + { + std::cout << std::hex << std::setw(8) << std::setfill('0') << std::uppercase + << info.instructionPointer << " "; + if (info.flags & IF_ERROR_MASK) + { + std::cout << "db " << std::setw(2) << info.instructionBytes[0]; + } else + { + std::cout << formatter.formatInstruction(info) << std::endl; + } + } + + std::cout << std::endl; + + decoder64.setInstructionPointer(0x00007FFA39A81930ull); + std::cout << "64 bit test ..." << std::endl << std::endl; + while (decoder64.decodeNextInstruction(info)) + { + std::cout << std::hex << std::setw(16) << std::setfill('0') << std::uppercase + << info.instructionPointer << " "; + if (info.flags & IF_ERROR_MASK) + { + std::cout << "db " << std::setw(2) << info.instructionBytes[0]; + } else + { + std::cout << formatter.formatInstruction(info) << std::endl; + } + } + + std::cin.get(); + return 0; +} diff --git a/Disassembler Test/Disassembler Test.vcxproj b/Disassembler Test/Disassembler Test.vcxproj new file mode 100644 index 0000000..58bf98f --- /dev/null +++ b/Disassembler Test/Disassembler Test.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3} + Win32Proj + DisassemblerTest + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + ..\Verteron Disassembler Engine\;$(IncludePath) + + + true + ..\Verteron Disassembler Engine\;$(IncludePath) + + + false + ..\Verteron Disassembler Engine\;$(IncludePath) + + + false + ..\Verteron Disassembler Engine\;$(IncludePath) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + {e9860351-f9ea-4d1b-8ae4-188e3212574a} + + + + + + \ No newline at end of file diff --git a/Disassembler Test/Disassembler Test.vcxproj.filters b/Disassembler Test/Disassembler Test.vcxproj.filters new file mode 100644 index 0000000..9f8ee9d --- /dev/null +++ b/Disassembler Test/Disassembler Test.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 95852e0..b62f4a0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,25 @@ -verteron-disassembler-engine -============================ +Verteron Disassembler Engine (VDE) +================================== Fast and lightweight x86/x86-64 disassembler library. + +## Features ## + +- Supports all x86 and x86-64 (AMD64) General purpose and System instructions. +- Supported ISA extensions: + - MMX, FPU (x87), AMD 3DNow + - SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AES, + - AMD-V, INTEL-VMX, SMX +- Optimized for high performance +- Very small overhead compared to other common disassembler libraries + - Only 44.00 KiB (64 bit: 47.00 KiB) for the decoder and 62.00 KiB (64 bit: 69.50 KiB) with the optional formatting functionality +- Abstract formatter and symbol-resolver classes for custom syntax implementations. + - Intel syntax is implemented by default + +## Compilation ## + +- While VDE supports other compilers in theory, compilation has not been tested with any other compiler than MSVC12 (Visual Studio 2013) +- Multi-compiler support might be added in the future + +## License ## +Verteron Disassembler Engine is licensed under the MIT License. Dependencies are under their respective licenses. diff --git a/Table Generator/PugiXML/pugiconfig.hpp b/Table Generator/PugiXML/pugiconfig.hpp new file mode 100644 index 0000000..56f1d22 --- /dev/null +++ b/Table Generator/PugiXML/pugiconfig.hpp @@ -0,0 +1,72 @@ +/** + * pugixml parser - version 1.4 + * -------------------------------------------------------- + * Copyright (C) 2006-2014, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) + * Report bugs and download new versions at http://pugixml.org/ + * + * This library is distributed under the MIT License. See notice at the end + * of this file. + * + * This work is based on the pugxml parser, which is: + * Copyright (C) 2003, by Kristen Wegner (kristen@tima.net) + */ + +#ifndef HEADER_PUGICONFIG_HPP +#define HEADER_PUGICONFIG_HPP + +// Uncomment this to enable wchar_t mode +// #define PUGIXML_WCHAR_MODE + +// Uncomment this to disable XPath +// #define PUGIXML_NO_XPATH + +// Uncomment this to disable STL +// #define PUGIXML_NO_STL + +// Uncomment this to disable exceptions +// #define PUGIXML_NO_EXCEPTIONS + +// Set this to control attributes for public classes/functions, i.e.: +// #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL +// #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL +// #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall +// In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead + +// Tune these constants to adjust memory-related behavior +// #define PUGIXML_MEMORY_PAGE_SIZE 32768 +// #define PUGIXML_MEMORY_OUTPUT_STACK 10240 +// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096 + +// Uncomment this to switch to header-only version +// #define PUGIXML_HEADER_ONLY +// #include "pugixml.cpp" + +// Uncomment this to enable long long support +// #define PUGIXML_HAS_LONG_LONG + +#endif + +/** + * Copyright (c) 2006-2014 Arseny Kapoulkine + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ diff --git a/Table Generator/PugiXML/pugixml.cpp b/Table Generator/PugiXML/pugixml.cpp new file mode 100644 index 0000000..754f92f --- /dev/null +++ b/Table Generator/PugiXML/pugixml.cpp @@ -0,0 +1,10639 @@ +/** + * pugixml parser - version 1.4 + * -------------------------------------------------------- + * Copyright (C) 2006-2014, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) + * Report bugs and download new versions at http://pugixml.org/ + * + * This library is distributed under the MIT License. See notice at the end + * of this file. + * + * This work is based on the pugxml parser, which is: + * Copyright (C) 2003, by Kristen Wegner (kristen@tima.net) + */ + +#ifndef SOURCE_PUGIXML_CPP +#define SOURCE_PUGIXML_CPP + +#include "pugixml.hpp" + +#include +#include +#include +#include + +#ifdef PUGIXML_WCHAR_MODE +# include +#endif + +#ifndef PUGIXML_NO_XPATH +# include +# include +# ifdef PUGIXML_NO_EXCEPTIONS +# include +# endif +#endif + +#ifndef PUGIXML_NO_STL +# include +# include +# include +#endif + +// For placement new +#include + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4127) // conditional expression is constant +# pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +# pragma warning(disable: 4611) // interaction between '_setjmp' and C++ object destruction is non-portable +# pragma warning(disable: 4702) // unreachable code +# pragma warning(disable: 4996) // this function or variable may be unsafe +# pragma warning(disable: 4793) // function compiled as native: presence of '_setjmp' makes a function unmanaged +#endif + +#ifdef __INTEL_COMPILER +# pragma warning(disable: 177) // function was declared but never referenced +# pragma warning(disable: 279) // controlling expression is constant +# pragma warning(disable: 1478 1786) // function was declared "deprecated" +# pragma warning(disable: 1684) // conversion from pointer to same-sized integral type +#endif + +#if defined(__BORLANDC__) && defined(PUGIXML_HEADER_ONLY) +# pragma warn -8080 // symbol is declared but never used; disabling this inside push/pop bracket does not make the warning go away +#endif + +#ifdef __BORLANDC__ +# pragma option push +# pragma warn -8008 // condition is always false +# pragma warn -8066 // unreachable code +#endif + +#ifdef __SNC__ +// Using diag_push/diag_pop does not disable the warnings inside templates due to a compiler bug +# pragma diag_suppress=178 // function was declared but never referenced +# pragma diag_suppress=237 // controlling expression is constant +#endif + +// Inlining controls +#if defined(_MSC_VER) && _MSC_VER >= 1300 +# define PUGI__NO_INLINE __declspec(noinline) +#elif defined(__GNUC__) +# define PUGI__NO_INLINE __attribute__((noinline)) +#else +# define PUGI__NO_INLINE +#endif + +// Simple static assertion +#define PUGI__STATIC_ASSERT(cond) { static const char condition_failed[(cond) ? 1 : -1] = {0}; (void)condition_failed[0]; } + +// Digital Mars C++ bug workaround for passing char loaded from memory via stack +#ifdef __DMC__ +# define PUGI__DMC_VOLATILE volatile +#else +# define PUGI__DMC_VOLATILE +#endif + +// Borland C++ bug workaround for not defining ::memcpy depending on header include order (can't always use std::memcpy because some compilers don't have it at all) +#if defined(__BORLANDC__) && !defined(__MEM_H_USING_LIST) +using std::memcpy; +using std::memmove; +#endif + +// In some environments MSVC is a compiler but the CRT lacks certain MSVC-specific features +#if defined(_MSC_VER) && !defined(__S3E__) +# define PUGI__MSVC_CRT_VERSION _MSC_VER +#endif + +#ifdef PUGIXML_HEADER_ONLY +# define PUGI__NS_BEGIN namespace pugi { namespace impl { +# define PUGI__NS_END } } +# define PUGI__FN inline +# define PUGI__FN_NO_INLINE inline +#else +# if defined(_MSC_VER) && _MSC_VER < 1300 // MSVC6 seems to have an amusing bug with anonymous namespaces inside namespaces +# define PUGI__NS_BEGIN namespace pugi { namespace impl { +# define PUGI__NS_END } } +# else +# define PUGI__NS_BEGIN namespace pugi { namespace impl { namespace { +# define PUGI__NS_END } } } +# endif +# define PUGI__FN +# define PUGI__FN_NO_INLINE PUGI__NO_INLINE +#endif + +// uintptr_t +#if !defined(_MSC_VER) || _MSC_VER >= 1600 +# include +#else +# ifndef _UINTPTR_T_DEFINED +// No native uintptr_t in MSVC6 and in some WinCE versions +typedef size_t uintptr_t; +#define _UINTPTR_T_DEFINED +# endif +PUGI__NS_BEGIN + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +PUGI__NS_END +#endif + +// Memory allocation +PUGI__NS_BEGIN + PUGI__FN void* default_allocate(size_t size) + { + return malloc(size); + } + + PUGI__FN void default_deallocate(void* ptr) + { + free(ptr); + } + + template + struct xml_memory_management_function_storage + { + static allocation_function allocate; + static deallocation_function deallocate; + }; + + template allocation_function xml_memory_management_function_storage::allocate = default_allocate; + template deallocation_function xml_memory_management_function_storage::deallocate = default_deallocate; + + typedef xml_memory_management_function_storage xml_memory; +PUGI__NS_END + +// String utilities +PUGI__NS_BEGIN + // Get string length + PUGI__FN size_t strlength(const char_t* s) + { + assert(s); + + #ifdef PUGIXML_WCHAR_MODE + return wcslen(s); + #else + return strlen(s); + #endif + } + + // Compare two strings + PUGI__FN bool strequal(const char_t* src, const char_t* dst) + { + assert(src && dst); + + #ifdef PUGIXML_WCHAR_MODE + return wcscmp(src, dst) == 0; + #else + return strcmp(src, dst) == 0; + #endif + } + + // Compare lhs with [rhs_begin, rhs_end) + PUGI__FN bool strequalrange(const char_t* lhs, const char_t* rhs, size_t count) + { + for (size_t i = 0; i < count; ++i) + if (lhs[i] != rhs[i]) + return false; + + return lhs[count] == 0; + } + + // Get length of wide string, even if CRT lacks wide character support + PUGI__FN size_t strlength_wide(const wchar_t* s) + { + assert(s); + + #ifdef PUGIXML_WCHAR_MODE + return wcslen(s); + #else + const wchar_t* end = s; + while (*end) end++; + return static_cast(end - s); + #endif + } + +#ifdef PUGIXML_WCHAR_MODE + // Convert string to wide string, assuming all symbols are ASCII + PUGI__FN void widen_ascii(wchar_t* dest, const char* source) + { + for (const char* i = source; *i; ++i) *dest++ = *i; + *dest = 0; + } +#endif +PUGI__NS_END + +#if !defined(PUGIXML_NO_STL) || !defined(PUGIXML_NO_XPATH) +// auto_ptr-like buffer holder for exception recovery +PUGI__NS_BEGIN + struct buffer_holder + { + void* data; + void (*deleter)(void*); + + buffer_holder(void* data_, void (*deleter_)(void*)): data(data_), deleter(deleter_) + { + } + + ~buffer_holder() + { + if (data) deleter(data); + } + + void* release() + { + void* result = data; + data = 0; + return result; + } + }; +PUGI__NS_END +#endif + +PUGI__NS_BEGIN + static const size_t xml_memory_page_size = + #ifdef PUGIXML_MEMORY_PAGE_SIZE + PUGIXML_MEMORY_PAGE_SIZE + #else + 32768 + #endif + ; + + static const uintptr_t xml_memory_page_alignment = 32; + static const uintptr_t xml_memory_page_pointer_mask = ~(xml_memory_page_alignment - 1); + static const uintptr_t xml_memory_page_name_allocated_mask = 16; + static const uintptr_t xml_memory_page_value_allocated_mask = 8; + static const uintptr_t xml_memory_page_type_mask = 7; + + struct xml_allocator; + + struct xml_memory_page + { + static xml_memory_page* construct(void* memory) + { + if (!memory) return 0; //$ redundant, left for performance + + xml_memory_page* result = static_cast(memory); + + result->allocator = 0; + result->memory = 0; + result->prev = 0; + result->next = 0; + result->busy_size = 0; + result->freed_size = 0; + + return result; + } + + xml_allocator* allocator; + + void* memory; + + xml_memory_page* prev; + xml_memory_page* next; + + size_t busy_size; + size_t freed_size; + + char data[1]; + }; + + struct xml_memory_string_header + { + uint16_t page_offset; // offset from page->data + uint16_t full_size; // 0 if string occupies whole page + }; + + struct xml_allocator + { + xml_allocator(xml_memory_page* root): _root(root), _busy_size(root->busy_size) + { + } + + xml_memory_page* allocate_page(size_t data_size) + { + size_t size = offsetof(xml_memory_page, data) + data_size; + + // allocate block with some alignment, leaving memory for worst-case padding + void* memory = xml_memory::allocate(size + xml_memory_page_alignment); + if (!memory) return 0; + + // align upwards to page boundary + void* page_memory = reinterpret_cast((reinterpret_cast(memory) + (xml_memory_page_alignment - 1)) & ~(xml_memory_page_alignment - 1)); + + // prepare page structure + xml_memory_page* page = xml_memory_page::construct(page_memory); + assert(page); + + page->memory = memory; + page->allocator = _root->allocator; + + return page; + } + + static void deallocate_page(xml_memory_page* page) + { + xml_memory::deallocate(page->memory); + } + + void* allocate_memory_oob(size_t size, xml_memory_page*& out_page); + + void* allocate_memory(size_t size, xml_memory_page*& out_page) + { + if (_busy_size + size > xml_memory_page_size) return allocate_memory_oob(size, out_page); + + void* buf = _root->data + _busy_size; + + _busy_size += size; + + out_page = _root; + + return buf; + } + + void deallocate_memory(void* ptr, size_t size, xml_memory_page* page) + { + if (page == _root) page->busy_size = _busy_size; + + assert(ptr >= page->data && ptr < page->data + page->busy_size); + (void)!ptr; + + page->freed_size += size; + assert(page->freed_size <= page->busy_size); + + if (page->freed_size == page->busy_size) + { + if (page->next == 0) + { + assert(_root == page); + + // top page freed, just reset sizes + page->busy_size = page->freed_size = 0; + _busy_size = 0; + } + else + { + assert(_root != page); + assert(page->prev); + + // remove from the list + page->prev->next = page->next; + page->next->prev = page->prev; + + // deallocate + deallocate_page(page); + } + } + } + + char_t* allocate_string(size_t length) + { + // allocate memory for string and header block + size_t size = sizeof(xml_memory_string_header) + length * sizeof(char_t); + + // round size up to pointer alignment boundary + size_t full_size = (size + (sizeof(void*) - 1)) & ~(sizeof(void*) - 1); + + xml_memory_page* page; + xml_memory_string_header* header = static_cast(allocate_memory(full_size, page)); + + if (!header) return 0; + + // setup header + ptrdiff_t page_offset = reinterpret_cast(header) - page->data; + + assert(page_offset >= 0 && page_offset < (1 << 16)); + header->page_offset = static_cast(page_offset); + + // full_size == 0 for large strings that occupy the whole page + assert(full_size < (1 << 16) || (page->busy_size == full_size && page_offset == 0)); + header->full_size = static_cast(full_size < (1 << 16) ? full_size : 0); + + // round-trip through void* to avoid 'cast increases required alignment of target type' warning + // header is guaranteed a pointer-sized alignment, which should be enough for char_t + return static_cast(static_cast(header + 1)); + } + + void deallocate_string(char_t* string) + { + // this function casts pointers through void* to avoid 'cast increases required alignment of target type' warnings + // we're guaranteed the proper (pointer-sized) alignment on the input string if it was allocated via allocate_string + + // get header + xml_memory_string_header* header = static_cast(static_cast(string)) - 1; + + // deallocate + size_t page_offset = offsetof(xml_memory_page, data) + header->page_offset; + xml_memory_page* page = reinterpret_cast(static_cast(reinterpret_cast(header) - page_offset)); + + // if full_size == 0 then this string occupies the whole page + size_t full_size = header->full_size == 0 ? page->busy_size : header->full_size; + + deallocate_memory(header, full_size, page); + } + + xml_memory_page* _root; + size_t _busy_size; + }; + + PUGI__FN_NO_INLINE void* xml_allocator::allocate_memory_oob(size_t size, xml_memory_page*& out_page) + { + const size_t large_allocation_threshold = xml_memory_page_size / 4; + + xml_memory_page* page = allocate_page(size <= large_allocation_threshold ? xml_memory_page_size : size); + out_page = page; + + if (!page) return 0; + + if (size <= large_allocation_threshold) + { + _root->busy_size = _busy_size; + + // insert page at the end of linked list + page->prev = _root; + _root->next = page; + _root = page; + + _busy_size = size; + } + else + { + // insert page before the end of linked list, so that it is deleted as soon as possible + // the last page is not deleted even if it's empty (see deallocate_memory) + assert(_root->prev); + + page->prev = _root->prev; + page->next = _root; + + _root->prev->next = page; + _root->prev = page; + } + + // allocate inside page + page->busy_size = size; + + return page->data; + } +PUGI__NS_END + +namespace pugi +{ + /// A 'name=value' XML attribute structure. + struct xml_attribute_struct + { + /// Default ctor + xml_attribute_struct(impl::xml_memory_page* page): header(reinterpret_cast(page)), name(0), value(0), prev_attribute_c(0), next_attribute(0) + { + } + + uintptr_t header; + + char_t* name; ///< Pointer to attribute name. + char_t* value; ///< Pointer to attribute value. + + xml_attribute_struct* prev_attribute_c; ///< Previous attribute (cyclic list) + xml_attribute_struct* next_attribute; ///< Next attribute + }; + + /// An XML document tree node. + struct xml_node_struct + { + /// Default ctor + /// \param type - node type + xml_node_struct(impl::xml_memory_page* page, xml_node_type type): header(reinterpret_cast(page) | (type - 1)), parent(0), name(0), value(0), first_child(0), prev_sibling_c(0), next_sibling(0), first_attribute(0) + { + } + + uintptr_t header; + + xml_node_struct* parent; ///< Pointer to parent + + char_t* name; ///< Pointer to element name. + char_t* value; ///< Pointer to any associated string data. + + xml_node_struct* first_child; ///< First child + + xml_node_struct* prev_sibling_c; ///< Left brother (cyclic list) + xml_node_struct* next_sibling; ///< Right brother + + xml_attribute_struct* first_attribute; ///< First attribute + }; +} + +PUGI__NS_BEGIN + struct xml_extra_buffer + { + char_t* buffer; + xml_extra_buffer* next; + }; + + struct xml_document_struct: public xml_node_struct, public xml_allocator + { + xml_document_struct(xml_memory_page* page): xml_node_struct(page, node_document), xml_allocator(page), buffer(0), extra_buffers(0) + { + } + + const char_t* buffer; + + xml_extra_buffer* extra_buffers; + }; + + inline xml_allocator& get_allocator(const xml_node_struct* node) + { + assert(node); + + return *reinterpret_cast(node->header & xml_memory_page_pointer_mask)->allocator; + } +PUGI__NS_END + +// Low-level DOM operations +PUGI__NS_BEGIN + inline xml_attribute_struct* allocate_attribute(xml_allocator& alloc) + { + xml_memory_page* page; + void* memory = alloc.allocate_memory(sizeof(xml_attribute_struct), page); + + return new (memory) xml_attribute_struct(page); + } + + inline xml_node_struct* allocate_node(xml_allocator& alloc, xml_node_type type) + { + xml_memory_page* page; + void* memory = alloc.allocate_memory(sizeof(xml_node_struct), page); + + return new (memory) xml_node_struct(page, type); + } + + inline void destroy_attribute(xml_attribute_struct* a, xml_allocator& alloc) + { + uintptr_t header = a->header; + + if (header & impl::xml_memory_page_name_allocated_mask) alloc.deallocate_string(a->name); + if (header & impl::xml_memory_page_value_allocated_mask) alloc.deallocate_string(a->value); + + alloc.deallocate_memory(a, sizeof(xml_attribute_struct), reinterpret_cast(header & xml_memory_page_pointer_mask)); + } + + inline void destroy_node(xml_node_struct* n, xml_allocator& alloc) + { + uintptr_t header = n->header; + + if (header & impl::xml_memory_page_name_allocated_mask) alloc.deallocate_string(n->name); + if (header & impl::xml_memory_page_value_allocated_mask) alloc.deallocate_string(n->value); + + for (xml_attribute_struct* attr = n->first_attribute; attr; ) + { + xml_attribute_struct* next = attr->next_attribute; + + destroy_attribute(attr, alloc); + + attr = next; + } + + for (xml_node_struct* child = n->first_child; child; ) + { + xml_node_struct* next = child->next_sibling; + + destroy_node(child, alloc); + + child = next; + } + + alloc.deallocate_memory(n, sizeof(xml_node_struct), reinterpret_cast(header & xml_memory_page_pointer_mask)); + } + + PUGI__FN_NO_INLINE xml_node_struct* append_node(xml_node_struct* node, xml_allocator& alloc, xml_node_type type = node_element) + { + xml_node_struct* child = allocate_node(alloc, type); + if (!child) return 0; + + child->parent = node; + + xml_node_struct* first_child = node->first_child; + + if (first_child) + { + xml_node_struct* last_child = first_child->prev_sibling_c; + + last_child->next_sibling = child; + child->prev_sibling_c = last_child; + first_child->prev_sibling_c = child; + } + else + { + node->first_child = child; + child->prev_sibling_c = child; + } + + return child; + } + + PUGI__FN_NO_INLINE xml_attribute_struct* append_attribute_ll(xml_node_struct* node, xml_allocator& alloc) + { + xml_attribute_struct* a = allocate_attribute(alloc); + if (!a) return 0; + + xml_attribute_struct* first_attribute = node->first_attribute; + + if (first_attribute) + { + xml_attribute_struct* last_attribute = first_attribute->prev_attribute_c; + + last_attribute->next_attribute = a; + a->prev_attribute_c = last_attribute; + first_attribute->prev_attribute_c = a; + } + else + { + node->first_attribute = a; + a->prev_attribute_c = a; + } + + return a; + } +PUGI__NS_END + +// Helper classes for code generation +PUGI__NS_BEGIN + struct opt_false + { + enum { value = 0 }; + }; + + struct opt_true + { + enum { value = 1 }; + }; +PUGI__NS_END + +// Unicode utilities +PUGI__NS_BEGIN + inline uint16_t endian_swap(uint16_t value) + { + return static_cast(((value & 0xff) << 8) | (value >> 8)); + } + + inline uint32_t endian_swap(uint32_t value) + { + return ((value & 0xff) << 24) | ((value & 0xff00) << 8) | ((value & 0xff0000) >> 8) | (value >> 24); + } + + struct utf8_counter + { + typedef size_t value_type; + + static value_type low(value_type result, uint32_t ch) + { + // U+0000..U+007F + if (ch < 0x80) return result + 1; + // U+0080..U+07FF + else if (ch < 0x800) return result + 2; + // U+0800..U+FFFF + else return result + 3; + } + + static value_type high(value_type result, uint32_t) + { + // U+10000..U+10FFFF + return result + 4; + } + }; + + struct utf8_writer + { + typedef uint8_t* value_type; + + static value_type low(value_type result, uint32_t ch) + { + // U+0000..U+007F + if (ch < 0x80) + { + *result = static_cast(ch); + return result + 1; + } + // U+0080..U+07FF + else if (ch < 0x800) + { + result[0] = static_cast(0xC0 | (ch >> 6)); + result[1] = static_cast(0x80 | (ch & 0x3F)); + return result + 2; + } + // U+0800..U+FFFF + else + { + result[0] = static_cast(0xE0 | (ch >> 12)); + result[1] = static_cast(0x80 | ((ch >> 6) & 0x3F)); + result[2] = static_cast(0x80 | (ch & 0x3F)); + return result + 3; + } + } + + static value_type high(value_type result, uint32_t ch) + { + // U+10000..U+10FFFF + result[0] = static_cast(0xF0 | (ch >> 18)); + result[1] = static_cast(0x80 | ((ch >> 12) & 0x3F)); + result[2] = static_cast(0x80 | ((ch >> 6) & 0x3F)); + result[3] = static_cast(0x80 | (ch & 0x3F)); + return result + 4; + } + + static value_type any(value_type result, uint32_t ch) + { + return (ch < 0x10000) ? low(result, ch) : high(result, ch); + } + }; + + struct utf16_counter + { + typedef size_t value_type; + + static value_type low(value_type result, uint32_t) + { + return result + 1; + } + + static value_type high(value_type result, uint32_t) + { + return result + 2; + } + }; + + struct utf16_writer + { + typedef uint16_t* value_type; + + static value_type low(value_type result, uint32_t ch) + { + *result = static_cast(ch); + + return result + 1; + } + + static value_type high(value_type result, uint32_t ch) + { + uint32_t msh = static_cast(ch - 0x10000) >> 10; + uint32_t lsh = static_cast(ch - 0x10000) & 0x3ff; + + result[0] = static_cast(0xD800 + msh); + result[1] = static_cast(0xDC00 + lsh); + + return result + 2; + } + + static value_type any(value_type result, uint32_t ch) + { + return (ch < 0x10000) ? low(result, ch) : high(result, ch); + } + }; + + struct utf32_counter + { + typedef size_t value_type; + + static value_type low(value_type result, uint32_t) + { + return result + 1; + } + + static value_type high(value_type result, uint32_t) + { + return result + 1; + } + }; + + struct utf32_writer + { + typedef uint32_t* value_type; + + static value_type low(value_type result, uint32_t ch) + { + *result = ch; + + return result + 1; + } + + static value_type high(value_type result, uint32_t ch) + { + *result = ch; + + return result + 1; + } + + static value_type any(value_type result, uint32_t ch) + { + *result = ch; + + return result + 1; + } + }; + + struct latin1_writer + { + typedef uint8_t* value_type; + + static value_type low(value_type result, uint32_t ch) + { + *result = static_cast(ch > 255 ? '?' : ch); + + return result + 1; + } + + static value_type high(value_type result, uint32_t ch) + { + (void)ch; + + *result = '?'; + + return result + 1; + } + }; + + template struct wchar_selector; + + template <> struct wchar_selector<2> + { + typedef uint16_t type; + typedef utf16_counter counter; + typedef utf16_writer writer; + }; + + template <> struct wchar_selector<4> + { + typedef uint32_t type; + typedef utf32_counter counter; + typedef utf32_writer writer; + }; + + typedef wchar_selector::counter wchar_counter; + typedef wchar_selector::writer wchar_writer; + + template struct utf_decoder + { + static inline typename Traits::value_type decode_utf8_block(const uint8_t* data, size_t size, typename Traits::value_type result) + { + const uint8_t utf8_byte_mask = 0x3f; + + while (size) + { + uint8_t lead = *data; + + // 0xxxxxxx -> U+0000..U+007F + if (lead < 0x80) + { + result = Traits::low(result, lead); + data += 1; + size -= 1; + + // process aligned single-byte (ascii) blocks + if ((reinterpret_cast(data) & 3) == 0) + { + // round-trip through void* to silence 'cast increases required alignment of target type' warnings + while (size >= 4 && (*static_cast(static_cast(data)) & 0x80808080) == 0) + { + result = Traits::low(result, data[0]); + result = Traits::low(result, data[1]); + result = Traits::low(result, data[2]); + result = Traits::low(result, data[3]); + data += 4; + size -= 4; + } + } + } + // 110xxxxx -> U+0080..U+07FF + else if (static_cast(lead - 0xC0) < 0x20 && size >= 2 && (data[1] & 0xc0) == 0x80) + { + result = Traits::low(result, ((lead & ~0xC0) << 6) | (data[1] & utf8_byte_mask)); + data += 2; + size -= 2; + } + // 1110xxxx -> U+0800-U+FFFF + else if (static_cast(lead - 0xE0) < 0x10 && size >= 3 && (data[1] & 0xc0) == 0x80 && (data[2] & 0xc0) == 0x80) + { + result = Traits::low(result, ((lead & ~0xE0) << 12) | ((data[1] & utf8_byte_mask) << 6) | (data[2] & utf8_byte_mask)); + data += 3; + size -= 3; + } + // 11110xxx -> U+10000..U+10FFFF + else if (static_cast(lead - 0xF0) < 0x08 && size >= 4 && (data[1] & 0xc0) == 0x80 && (data[2] & 0xc0) == 0x80 && (data[3] & 0xc0) == 0x80) + { + result = Traits::high(result, ((lead & ~0xF0) << 18) | ((data[1] & utf8_byte_mask) << 12) | ((data[2] & utf8_byte_mask) << 6) | (data[3] & utf8_byte_mask)); + data += 4; + size -= 4; + } + // 10xxxxxx or 11111xxx -> invalid + else + { + data += 1; + size -= 1; + } + } + + return result; + } + + static inline typename Traits::value_type decode_utf16_block(const uint16_t* data, size_t size, typename Traits::value_type result) + { + const uint16_t* end = data + size; + + while (data < end) + { + unsigned int lead = opt_swap::value ? endian_swap(*data) : *data; + + // U+0000..U+D7FF + if (lead < 0xD800) + { + result = Traits::low(result, lead); + data += 1; + } + // U+E000..U+FFFF + else if (static_cast(lead - 0xE000) < 0x2000) + { + result = Traits::low(result, lead); + data += 1; + } + // surrogate pair lead + else if (static_cast(lead - 0xD800) < 0x400 && data + 1 < end) + { + uint16_t next = opt_swap::value ? endian_swap(data[1]) : data[1]; + + if (static_cast(next - 0xDC00) < 0x400) + { + result = Traits::high(result, 0x10000 + ((lead & 0x3ff) << 10) + (next & 0x3ff)); + data += 2; + } + else + { + data += 1; + } + } + else + { + data += 1; + } + } + + return result; + } + + static inline typename Traits::value_type decode_utf32_block(const uint32_t* data, size_t size, typename Traits::value_type result) + { + const uint32_t* end = data + size; + + while (data < end) + { + uint32_t lead = opt_swap::value ? endian_swap(*data) : *data; + + // U+0000..U+FFFF + if (lead < 0x10000) + { + result = Traits::low(result, lead); + data += 1; + } + // U+10000..U+10FFFF + else + { + result = Traits::high(result, lead); + data += 1; + } + } + + return result; + } + + static inline typename Traits::value_type decode_latin1_block(const uint8_t* data, size_t size, typename Traits::value_type result) + { + for (size_t i = 0; i < size; ++i) + { + result = Traits::low(result, data[i]); + } + + return result; + } + + static inline typename Traits::value_type decode_wchar_block_impl(const uint16_t* data, size_t size, typename Traits::value_type result) + { + return decode_utf16_block(data, size, result); + } + + static inline typename Traits::value_type decode_wchar_block_impl(const uint32_t* data, size_t size, typename Traits::value_type result) + { + return decode_utf32_block(data, size, result); + } + + static inline typename Traits::value_type decode_wchar_block(const wchar_t* data, size_t size, typename Traits::value_type result) + { + return decode_wchar_block_impl(reinterpret_cast::type*>(data), size, result); + } + }; + + template PUGI__FN void convert_utf_endian_swap(T* result, const T* data, size_t length) + { + for (size_t i = 0; i < length; ++i) result[i] = endian_swap(data[i]); + } + +#ifdef PUGIXML_WCHAR_MODE + PUGI__FN void convert_wchar_endian_swap(wchar_t* result, const wchar_t* data, size_t length) + { + for (size_t i = 0; i < length; ++i) result[i] = static_cast(endian_swap(static_cast::type>(data[i]))); + } +#endif +PUGI__NS_END + +PUGI__NS_BEGIN + enum chartype_t + { + ct_parse_pcdata = 1, // \0, &, \r, < + ct_parse_attr = 2, // \0, &, \r, ', " + ct_parse_attr_ws = 4, // \0, &, \r, ', ", \n, tab + ct_space = 8, // \r, \n, space, tab + ct_parse_cdata = 16, // \0, ], >, \r + ct_parse_comment = 32, // \0, -, >, \r + ct_symbol = 64, // Any symbol > 127, a-z, A-Z, 0-9, _, :, -, . + ct_start_symbol = 128 // Any symbol > 127, a-z, A-Z, _, : + }; + + static const unsigned char chartype_table[256] = + { + 55, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 63, 0, 0, // 0-15 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16-31 + 8, 0, 6, 0, 0, 0, 7, 6, 0, 0, 0, 0, 0, 96, 64, 0, // 32-47 + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 192, 0, 1, 0, 48, 0, // 48-63 + 0, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, // 64-79 + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 0, 0, 16, 0, 192, // 80-95 + 0, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, // 96-111 + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 0, 0, 0, 0, 0, // 112-127 + + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, // 128+ + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192 + }; + + enum chartypex_t + { + ctx_special_pcdata = 1, // Any symbol >= 0 and < 32 (except \t, \r, \n), &, <, > + ctx_special_attr = 2, // Any symbol >= 0 and < 32 (except \t), &, <, >, " + ctx_start_symbol = 4, // Any symbol > 127, a-z, A-Z, _ + ctx_digit = 8, // 0-9 + ctx_symbol = 16 // Any symbol > 127, a-z, A-Z, 0-9, _, -, . + }; + + static const unsigned char chartypex_table[256] = + { + 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 2, 3, 3, 2, 3, 3, // 0-15 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 16-31 + 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 16, 16, 0, // 32-47 + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 0, 3, 0, 3, 0, // 48-63 + + 0, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // 64-79 + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 20, // 80-95 + 0, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // 96-111 + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, // 112-127 + + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // 128+ + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 + }; + +#ifdef PUGIXML_WCHAR_MODE + #define PUGI__IS_CHARTYPE_IMPL(c, ct, table) ((static_cast(c) < 128 ? table[static_cast(c)] : table[128]) & (ct)) +#else + #define PUGI__IS_CHARTYPE_IMPL(c, ct, table) (table[static_cast(c)] & (ct)) +#endif + + #define PUGI__IS_CHARTYPE(c, ct) PUGI__IS_CHARTYPE_IMPL(c, ct, chartype_table) + #define PUGI__IS_CHARTYPEX(c, ct) PUGI__IS_CHARTYPE_IMPL(c, ct, chartypex_table) + + PUGI__FN bool is_little_endian() + { + unsigned int ui = 1; + + return *reinterpret_cast(&ui) == 1; + } + + PUGI__FN xml_encoding get_wchar_encoding() + { + PUGI__STATIC_ASSERT(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4); + + if (sizeof(wchar_t) == 2) + return is_little_endian() ? encoding_utf16_le : encoding_utf16_be; + else + return is_little_endian() ? encoding_utf32_le : encoding_utf32_be; + } + + PUGI__FN xml_encoding guess_buffer_encoding(uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3) + { + // look for BOM in first few bytes + if (d0 == 0 && d1 == 0 && d2 == 0xfe && d3 == 0xff) return encoding_utf32_be; + if (d0 == 0xff && d1 == 0xfe && d2 == 0 && d3 == 0) return encoding_utf32_le; + if (d0 == 0xfe && d1 == 0xff) return encoding_utf16_be; + if (d0 == 0xff && d1 == 0xfe) return encoding_utf16_le; + if (d0 == 0xef && d1 == 0xbb && d2 == 0xbf) return encoding_utf8; + + // look for <, (contents); + + PUGI__DMC_VOLATILE uint8_t d0 = data[0], d1 = data[1], d2 = data[2], d3 = data[3]; + + return guess_buffer_encoding(d0, d1, d2, d3); + } + + PUGI__FN bool get_mutable_buffer(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) + { + size_t length = size / sizeof(char_t); + + if (is_mutable) + { + out_buffer = static_cast(const_cast(contents)); + out_length = length; + } + else + { + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + memcpy(buffer, contents, length * sizeof(char_t)); + buffer[length] = 0; + + out_buffer = buffer; + out_length = length + 1; + } + + return true; + } + +#ifdef PUGIXML_WCHAR_MODE + PUGI__FN bool need_endian_swap_utf(xml_encoding le, xml_encoding re) + { + return (le == encoding_utf16_be && re == encoding_utf16_le) || (le == encoding_utf16_le && re == encoding_utf16_be) || + (le == encoding_utf32_be && re == encoding_utf32_le) || (le == encoding_utf32_le && re == encoding_utf32_be); + } + + PUGI__FN bool convert_buffer_endian_swap(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) + { + const char_t* data = static_cast(contents); + size_t length = size / sizeof(char_t); + + if (is_mutable) + { + char_t* buffer = const_cast(data); + + convert_wchar_endian_swap(buffer, data, length); + + out_buffer = buffer; + out_length = length; + } + else + { + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + convert_wchar_endian_swap(buffer, data, length); + buffer[length] = 0; + + out_buffer = buffer; + out_length = length + 1; + } + + return true; + } + + PUGI__FN bool convert_buffer_utf8(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size) + { + const uint8_t* data = static_cast(contents); + size_t data_length = size; + + // first pass: get length in wchar_t units + size_t length = utf_decoder::decode_utf8_block(data, data_length, 0); + + // allocate buffer of suitable length + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + // second pass: convert utf8 input to wchar_t + wchar_writer::value_type obegin = reinterpret_cast(buffer); + wchar_writer::value_type oend = utf_decoder::decode_utf8_block(data, data_length, obegin); + + assert(oend == obegin + length); + *oend = 0; + + out_buffer = buffer; + out_length = length + 1; + + return true; + } + + template PUGI__FN bool convert_buffer_utf16(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) + { + const uint16_t* data = static_cast(contents); + size_t data_length = size / sizeof(uint16_t); + + // first pass: get length in wchar_t units + size_t length = utf_decoder::decode_utf16_block(data, data_length, 0); + + // allocate buffer of suitable length + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + // second pass: convert utf16 input to wchar_t + wchar_writer::value_type obegin = reinterpret_cast(buffer); + wchar_writer::value_type oend = utf_decoder::decode_utf16_block(data, data_length, obegin); + + assert(oend == obegin + length); + *oend = 0; + + out_buffer = buffer; + out_length = length + 1; + + return true; + } + + template PUGI__FN bool convert_buffer_utf32(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) + { + const uint32_t* data = static_cast(contents); + size_t data_length = size / sizeof(uint32_t); + + // first pass: get length in wchar_t units + size_t length = utf_decoder::decode_utf32_block(data, data_length, 0); + + // allocate buffer of suitable length + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + // second pass: convert utf32 input to wchar_t + wchar_writer::value_type obegin = reinterpret_cast(buffer); + wchar_writer::value_type oend = utf_decoder::decode_utf32_block(data, data_length, obegin); + + assert(oend == obegin + length); + *oend = 0; + + out_buffer = buffer; + out_length = length + 1; + + return true; + } + + PUGI__FN bool convert_buffer_latin1(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size) + { + const uint8_t* data = static_cast(contents); + size_t data_length = size; + + // get length in wchar_t units + size_t length = data_length; + + // allocate buffer of suitable length + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + // convert latin1 input to wchar_t + wchar_writer::value_type obegin = reinterpret_cast(buffer); + wchar_writer::value_type oend = utf_decoder::decode_latin1_block(data, data_length, obegin); + + assert(oend == obegin + length); + *oend = 0; + + out_buffer = buffer; + out_length = length + 1; + + return true; + } + + PUGI__FN bool convert_buffer(char_t*& out_buffer, size_t& out_length, xml_encoding encoding, const void* contents, size_t size, bool is_mutable) + { + // get native encoding + xml_encoding wchar_encoding = get_wchar_encoding(); + + // fast path: no conversion required + if (encoding == wchar_encoding) return get_mutable_buffer(out_buffer, out_length, contents, size, is_mutable); + + // only endian-swapping is required + if (need_endian_swap_utf(encoding, wchar_encoding)) return convert_buffer_endian_swap(out_buffer, out_length, contents, size, is_mutable); + + // source encoding is utf8 + if (encoding == encoding_utf8) return convert_buffer_utf8(out_buffer, out_length, contents, size); + + // source encoding is utf16 + if (encoding == encoding_utf16_be || encoding == encoding_utf16_le) + { + xml_encoding native_encoding = is_little_endian() ? encoding_utf16_le : encoding_utf16_be; + + return (native_encoding == encoding) ? + convert_buffer_utf16(out_buffer, out_length, contents, size, opt_false()) : + convert_buffer_utf16(out_buffer, out_length, contents, size, opt_true()); + } + + // source encoding is utf32 + if (encoding == encoding_utf32_be || encoding == encoding_utf32_le) + { + xml_encoding native_encoding = is_little_endian() ? encoding_utf32_le : encoding_utf32_be; + + return (native_encoding == encoding) ? + convert_buffer_utf32(out_buffer, out_length, contents, size, opt_false()) : + convert_buffer_utf32(out_buffer, out_length, contents, size, opt_true()); + } + + // source encoding is latin1 + if (encoding == encoding_latin1) return convert_buffer_latin1(out_buffer, out_length, contents, size); + + assert(!"Invalid encoding"); + return false; + } +#else + template PUGI__FN bool convert_buffer_utf16(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) + { + const uint16_t* data = static_cast(contents); + size_t data_length = size / sizeof(uint16_t); + + // first pass: get length in utf8 units + size_t length = utf_decoder::decode_utf16_block(data, data_length, 0); + + // allocate buffer of suitable length + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + // second pass: convert utf16 input to utf8 + uint8_t* obegin = reinterpret_cast(buffer); + uint8_t* oend = utf_decoder::decode_utf16_block(data, data_length, obegin); + + assert(oend == obegin + length); + *oend = 0; + + out_buffer = buffer; + out_length = length + 1; + + return true; + } + + template PUGI__FN bool convert_buffer_utf32(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) + { + const uint32_t* data = static_cast(contents); + size_t data_length = size / sizeof(uint32_t); + + // first pass: get length in utf8 units + size_t length = utf_decoder::decode_utf32_block(data, data_length, 0); + + // allocate buffer of suitable length + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + // second pass: convert utf32 input to utf8 + uint8_t* obegin = reinterpret_cast(buffer); + uint8_t* oend = utf_decoder::decode_utf32_block(data, data_length, obegin); + + assert(oend == obegin + length); + *oend = 0; + + out_buffer = buffer; + out_length = length + 1; + + return true; + } + + PUGI__FN size_t get_latin1_7bit_prefix_length(const uint8_t* data, size_t size) + { + for (size_t i = 0; i < size; ++i) + if (data[i] > 127) + return i; + + return size; + } + + PUGI__FN bool convert_buffer_latin1(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) + { + const uint8_t* data = static_cast(contents); + size_t data_length = size; + + // get size of prefix that does not need utf8 conversion + size_t prefix_length = get_latin1_7bit_prefix_length(data, data_length); + assert(prefix_length <= data_length); + + const uint8_t* postfix = data + prefix_length; + size_t postfix_length = data_length - prefix_length; + + // if no conversion is needed, just return the original buffer + if (postfix_length == 0) return get_mutable_buffer(out_buffer, out_length, contents, size, is_mutable); + + // first pass: get length in utf8 units + size_t length = prefix_length + utf_decoder::decode_latin1_block(postfix, postfix_length, 0); + + // allocate buffer of suitable length + char_t* buffer = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!buffer) return false; + + // second pass: convert latin1 input to utf8 + memcpy(buffer, data, prefix_length); + + uint8_t* obegin = reinterpret_cast(buffer); + uint8_t* oend = utf_decoder::decode_latin1_block(postfix, postfix_length, obegin + prefix_length); + + assert(oend == obegin + length); + *oend = 0; + + out_buffer = buffer; + out_length = length + 1; + + return true; + } + + PUGI__FN bool convert_buffer(char_t*& out_buffer, size_t& out_length, xml_encoding encoding, const void* contents, size_t size, bool is_mutable) + { + // fast path: no conversion required + if (encoding == encoding_utf8) return get_mutable_buffer(out_buffer, out_length, contents, size, is_mutable); + + // source encoding is utf16 + if (encoding == encoding_utf16_be || encoding == encoding_utf16_le) + { + xml_encoding native_encoding = is_little_endian() ? encoding_utf16_le : encoding_utf16_be; + + return (native_encoding == encoding) ? + convert_buffer_utf16(out_buffer, out_length, contents, size, opt_false()) : + convert_buffer_utf16(out_buffer, out_length, contents, size, opt_true()); + } + + // source encoding is utf32 + if (encoding == encoding_utf32_be || encoding == encoding_utf32_le) + { + xml_encoding native_encoding = is_little_endian() ? encoding_utf32_le : encoding_utf32_be; + + return (native_encoding == encoding) ? + convert_buffer_utf32(out_buffer, out_length, contents, size, opt_false()) : + convert_buffer_utf32(out_buffer, out_length, contents, size, opt_true()); + } + + // source encoding is latin1 + if (encoding == encoding_latin1) return convert_buffer_latin1(out_buffer, out_length, contents, size, is_mutable); + + assert(!"Invalid encoding"); + return false; + } +#endif + + PUGI__FN size_t as_utf8_begin(const wchar_t* str, size_t length) + { + // get length in utf8 characters + return utf_decoder::decode_wchar_block(str, length, 0); + } + + PUGI__FN void as_utf8_end(char* buffer, size_t size, const wchar_t* str, size_t length) + { + // convert to utf8 + uint8_t* begin = reinterpret_cast(buffer); + uint8_t* end = utf_decoder::decode_wchar_block(str, length, begin); + + assert(begin + size == end); + (void)!end; + + // zero-terminate + buffer[size] = 0; + } + +#ifndef PUGIXML_NO_STL + PUGI__FN std::string as_utf8_impl(const wchar_t* str, size_t length) + { + // first pass: get length in utf8 characters + size_t size = as_utf8_begin(str, length); + + // allocate resulting string + std::string result; + result.resize(size); + + // second pass: convert to utf8 + if (size > 0) as_utf8_end(&result[0], size, str, length); + + return result; + } + + PUGI__FN std::basic_string as_wide_impl(const char* str, size_t size) + { + const uint8_t* data = reinterpret_cast(str); + + // first pass: get length in wchar_t units + size_t length = utf_decoder::decode_utf8_block(data, size, 0); + + // allocate resulting string + std::basic_string result; + result.resize(length); + + // second pass: convert to wchar_t + if (length > 0) + { + wchar_writer::value_type begin = reinterpret_cast(&result[0]); + wchar_writer::value_type end = utf_decoder::decode_utf8_block(data, size, begin); + + assert(begin + length == end); + (void)!end; + } + + return result; + } +#endif + + inline bool strcpy_insitu_allow(size_t length, uintptr_t allocated, char_t* target) + { + assert(target); + size_t target_length = strlength(target); + + // always reuse document buffer memory if possible + if (!allocated) return target_length >= length; + + // reuse heap memory if waste is not too great + const size_t reuse_threshold = 32; + + return target_length >= length && (target_length < reuse_threshold || target_length - length < target_length / 2); + } + + PUGI__FN bool strcpy_insitu(char_t*& dest, uintptr_t& header, uintptr_t header_mask, const char_t* source) + { + assert(header); + + size_t source_length = strlength(source); + + if (source_length == 0) + { + // empty string and null pointer are equivalent, so just deallocate old memory + xml_allocator* alloc = reinterpret_cast(header & xml_memory_page_pointer_mask)->allocator; + + if (header & header_mask) alloc->deallocate_string(dest); + + // mark the string as not allocated + dest = 0; + header &= ~header_mask; + + return true; + } + else if (dest && strcpy_insitu_allow(source_length, header & header_mask, dest)) + { + // we can reuse old buffer, so just copy the new data (including zero terminator) + memcpy(dest, source, (source_length + 1) * sizeof(char_t)); + + return true; + } + else + { + xml_allocator* alloc = reinterpret_cast(header & xml_memory_page_pointer_mask)->allocator; + + // allocate new buffer + char_t* buf = alloc->allocate_string(source_length + 1); + if (!buf) return false; + + // copy the string (including zero terminator) + memcpy(buf, source, (source_length + 1) * sizeof(char_t)); + + // deallocate old buffer (*after* the above to protect against overlapping memory and/or allocation failures) + if (header & header_mask) alloc->deallocate_string(dest); + + // the string is now allocated, so set the flag + dest = buf; + header |= header_mask; + + return true; + } + } + + struct gap + { + char_t* end; + size_t size; + + gap(): end(0), size(0) + { + } + + // Push new gap, move s count bytes further (skipping the gap). + // Collapse previous gap. + void push(char_t*& s, size_t count) + { + if (end) // there was a gap already; collapse it + { + // Move [old_gap_end, new_gap_start) to [old_gap_start, ...) + assert(s >= end); + memmove(end - size, end, reinterpret_cast(s) - reinterpret_cast(end)); + } + + s += count; // end of current gap + + // "merge" two gaps + end = s; + size += count; + } + + // Collapse all gaps, return past-the-end pointer + char_t* flush(char_t* s) + { + if (end) + { + // Move [old_gap_end, current_pos) to [old_gap_start, ...) + assert(s >= end); + memmove(end - size, end, reinterpret_cast(s) - reinterpret_cast(end)); + + return s - size; + } + else return s; + } + }; + + PUGI__FN char_t* strconv_escape(char_t* s, gap& g) + { + char_t* stre = s + 1; + + switch (*stre) + { + case '#': // &#... + { + unsigned int ucsc = 0; + + if (stre[1] == 'x') // &#x... (hex code) + { + stre += 2; + + char_t ch = *stre; + + if (ch == ';') return stre; + + for (;;) + { + if (static_cast(ch - '0') <= 9) + ucsc = 16 * ucsc + (ch - '0'); + else if (static_cast((ch | ' ') - 'a') <= 5) + ucsc = 16 * ucsc + ((ch | ' ') - 'a' + 10); + else if (ch == ';') + break; + else // cancel + return stre; + + ch = *++stre; + } + + ++stre; + } + else // &#... (dec code) + { + char_t ch = *++stre; + + if (ch == ';') return stre; + + for (;;) + { + if (static_cast(static_cast(ch) - '0') <= 9) + ucsc = 10 * ucsc + (ch - '0'); + else if (ch == ';') + break; + else // cancel + return stre; + + ch = *++stre; + } + + ++stre; + } + + #ifdef PUGIXML_WCHAR_MODE + s = reinterpret_cast(wchar_writer::any(reinterpret_cast(s), ucsc)); + #else + s = reinterpret_cast(utf8_writer::any(reinterpret_cast(s), ucsc)); + #endif + + g.push(s, stre - s); + return stre; + } + + case 'a': // &a + { + ++stre; + + if (*stre == 'm') // &am + { + if (*++stre == 'p' && *++stre == ';') // & + { + *s++ = '&'; + ++stre; + + g.push(s, stre - s); + return stre; + } + } + else if (*stre == 'p') // &ap + { + if (*++stre == 'o' && *++stre == 's' && *++stre == ';') // ' + { + *s++ = '\''; + ++stre; + + g.push(s, stre - s); + return stre; + } + } + break; + } + + case 'g': // &g + { + if (*++stre == 't' && *++stre == ';') // > + { + *s++ = '>'; + ++stre; + + g.push(s, stre - s); + return stre; + } + break; + } + + case 'l': // &l + { + if (*++stre == 't' && *++stre == ';') // < + { + *s++ = '<'; + ++stre; + + g.push(s, stre - s); + return stre; + } + break; + } + + case 'q': // &q + { + if (*++stre == 'u' && *++stre == 'o' && *++stre == 't' && *++stre == ';') // " + { + *s++ = '"'; + ++stre; + + g.push(s, stre - s); + return stre; + } + break; + } + + default: + break; + } + + return stre; + } + + // Utility macro for last character handling + #define ENDSWITH(c, e) ((c) == (e) || ((c) == 0 && endch == (e))) + + PUGI__FN char_t* strconv_comment(char_t* s, char_t endch) + { + gap g; + + while (true) + { + while (!PUGI__IS_CHARTYPE(*s, ct_parse_comment)) ++s; + + if (*s == '\r') // Either a single 0x0d or 0x0d 0x0a pair + { + *s++ = '\n'; // replace first one with 0x0a + + if (*s == '\n') g.push(s, 1); + } + else if (s[0] == '-' && s[1] == '-' && ENDSWITH(s[2], '>')) // comment ends here + { + *g.flush(s) = 0; + + return s + (s[2] == '>' ? 3 : 2); + } + else if (*s == 0) + { + return 0; + } + else ++s; + } + } + + PUGI__FN char_t* strconv_cdata(char_t* s, char_t endch) + { + gap g; + + while (true) + { + while (!PUGI__IS_CHARTYPE(*s, ct_parse_cdata)) ++s; + + if (*s == '\r') // Either a single 0x0d or 0x0d 0x0a pair + { + *s++ = '\n'; // replace first one with 0x0a + + if (*s == '\n') g.push(s, 1); + } + else if (s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')) // CDATA ends here + { + *g.flush(s) = 0; + + return s + 1; + } + else if (*s == 0) + { + return 0; + } + else ++s; + } + } + + typedef char_t* (*strconv_pcdata_t)(char_t*); + + template struct strconv_pcdata_impl + { + static char_t* parse(char_t* s) + { + gap g; + + char_t* begin = s; + + while (true) + { + while (!PUGI__IS_CHARTYPE(*s, ct_parse_pcdata)) ++s; + + if (*s == '<') // PCDATA ends here + { + char_t* end = g.flush(s); + + if (opt_trim::value) + while (end > begin && PUGI__IS_CHARTYPE(end[-1], ct_space)) + --end; + + *end = 0; + + return s + 1; + } + else if (opt_eol::value && *s == '\r') // Either a single 0x0d or 0x0d 0x0a pair + { + *s++ = '\n'; // replace first one with 0x0a + + if (*s == '\n') g.push(s, 1); + } + else if (opt_escape::value && *s == '&') + { + s = strconv_escape(s, g); + } + else if (*s == 0) + { + char_t* end = g.flush(s); + + if (opt_trim::value) + while (end > begin && PUGI__IS_CHARTYPE(end[-1], ct_space)) + --end; + + *end = 0; + + return s; + } + else ++s; + } + } + }; + + PUGI__FN strconv_pcdata_t get_strconv_pcdata(unsigned int optmask) + { + PUGI__STATIC_ASSERT(parse_escapes == 0x10 && parse_eol == 0x20 && parse_trim_pcdata == 0x0800); + + switch (((optmask >> 4) & 3) | ((optmask >> 9) & 4)) // get bitmask for flags (eol escapes trim) + { + case 0: return strconv_pcdata_impl::parse; + case 1: return strconv_pcdata_impl::parse; + case 2: return strconv_pcdata_impl::parse; + case 3: return strconv_pcdata_impl::parse; + case 4: return strconv_pcdata_impl::parse; + case 5: return strconv_pcdata_impl::parse; + case 6: return strconv_pcdata_impl::parse; + case 7: return strconv_pcdata_impl::parse; + default: assert(false); return 0; // should not get here + } + } + + typedef char_t* (*strconv_attribute_t)(char_t*, char_t); + + template struct strconv_attribute_impl + { + static char_t* parse_wnorm(char_t* s, char_t end_quote) + { + gap g; + + // trim leading whitespaces + if (PUGI__IS_CHARTYPE(*s, ct_space)) + { + char_t* str = s; + + do ++str; + while (PUGI__IS_CHARTYPE(*str, ct_space)); + + g.push(s, str - s); + } + + while (true) + { + while (!PUGI__IS_CHARTYPE(*s, ct_parse_attr_ws | ct_space)) ++s; + + if (*s == end_quote) + { + char_t* str = g.flush(s); + + do *str-- = 0; + while (PUGI__IS_CHARTYPE(*str, ct_space)); + + return s + 1; + } + else if (PUGI__IS_CHARTYPE(*s, ct_space)) + { + *s++ = ' '; + + if (PUGI__IS_CHARTYPE(*s, ct_space)) + { + char_t* str = s + 1; + while (PUGI__IS_CHARTYPE(*str, ct_space)) ++str; + + g.push(s, str - s); + } + } + else if (opt_escape::value && *s == '&') + { + s = strconv_escape(s, g); + } + else if (!*s) + { + return 0; + } + else ++s; + } + } + + static char_t* parse_wconv(char_t* s, char_t end_quote) + { + gap g; + + while (true) + { + while (!PUGI__IS_CHARTYPE(*s, ct_parse_attr_ws)) ++s; + + if (*s == end_quote) + { + *g.flush(s) = 0; + + return s + 1; + } + else if (PUGI__IS_CHARTYPE(*s, ct_space)) + { + if (*s == '\r') + { + *s++ = ' '; + + if (*s == '\n') g.push(s, 1); + } + else *s++ = ' '; + } + else if (opt_escape::value && *s == '&') + { + s = strconv_escape(s, g); + } + else if (!*s) + { + return 0; + } + else ++s; + } + } + + static char_t* parse_eol(char_t* s, char_t end_quote) + { + gap g; + + while (true) + { + while (!PUGI__IS_CHARTYPE(*s, ct_parse_attr)) ++s; + + if (*s == end_quote) + { + *g.flush(s) = 0; + + return s + 1; + } + else if (*s == '\r') + { + *s++ = '\n'; + + if (*s == '\n') g.push(s, 1); + } + else if (opt_escape::value && *s == '&') + { + s = strconv_escape(s, g); + } + else if (!*s) + { + return 0; + } + else ++s; + } + } + + static char_t* parse_simple(char_t* s, char_t end_quote) + { + gap g; + + while (true) + { + while (!PUGI__IS_CHARTYPE(*s, ct_parse_attr)) ++s; + + if (*s == end_quote) + { + *g.flush(s) = 0; + + return s + 1; + } + else if (opt_escape::value && *s == '&') + { + s = strconv_escape(s, g); + } + else if (!*s) + { + return 0; + } + else ++s; + } + } + }; + + PUGI__FN strconv_attribute_t get_strconv_attribute(unsigned int optmask) + { + PUGI__STATIC_ASSERT(parse_escapes == 0x10 && parse_eol == 0x20 && parse_wconv_attribute == 0x40 && parse_wnorm_attribute == 0x80); + + switch ((optmask >> 4) & 15) // get bitmask for flags (wconv wnorm eol escapes) + { + case 0: return strconv_attribute_impl::parse_simple; + case 1: return strconv_attribute_impl::parse_simple; + case 2: return strconv_attribute_impl::parse_eol; + case 3: return strconv_attribute_impl::parse_eol; + case 4: return strconv_attribute_impl::parse_wconv; + case 5: return strconv_attribute_impl::parse_wconv; + case 6: return strconv_attribute_impl::parse_wconv; + case 7: return strconv_attribute_impl::parse_wconv; + case 8: return strconv_attribute_impl::parse_wnorm; + case 9: return strconv_attribute_impl::parse_wnorm; + case 10: return strconv_attribute_impl::parse_wnorm; + case 11: return strconv_attribute_impl::parse_wnorm; + case 12: return strconv_attribute_impl::parse_wnorm; + case 13: return strconv_attribute_impl::parse_wnorm; + case 14: return strconv_attribute_impl::parse_wnorm; + case 15: return strconv_attribute_impl::parse_wnorm; + default: assert(false); return 0; // should not get here + } + } + + inline xml_parse_result make_parse_result(xml_parse_status status, ptrdiff_t offset = 0) + { + xml_parse_result result; + result.status = status; + result.offset = offset; + + return result; + } + + struct xml_parser + { + xml_allocator alloc; + char_t* error_offset; + xml_parse_status error_status; + + // Parser utilities. + #define PUGI__SKIPWS() { while (PUGI__IS_CHARTYPE(*s, ct_space)) ++s; } + #define PUGI__OPTSET(OPT) ( optmsk & (OPT) ) + #define PUGI__PUSHNODE(TYPE) { cursor = append_node(cursor, alloc, TYPE); if (!cursor) PUGI__THROW_ERROR(status_out_of_memory, s); } + #define PUGI__POPNODE() { cursor = cursor->parent; } + #define PUGI__SCANFOR(X) { while (*s != 0 && !(X)) ++s; } + #define PUGI__SCANWHILE(X) { while ((X)) ++s; } + #define PUGI__ENDSEG() { ch = *s; *s = 0; ++s; } + #define PUGI__THROW_ERROR(err, m) return error_offset = m, error_status = err, static_cast(0) + #define PUGI__CHECK_ERROR(err, m) { if (*s == 0) PUGI__THROW_ERROR(err, m); } + + xml_parser(const xml_allocator& alloc_): alloc(alloc_), error_offset(0), error_status(status_ok) + { + } + + // DOCTYPE consists of nested sections of the following possible types: + // , , "...", '...' + // + // + // First group can not contain nested groups + // Second group can contain nested groups of the same type + // Third group can contain all other groups + char_t* parse_doctype_primitive(char_t* s) + { + if (*s == '"' || *s == '\'') + { + // quoted string + char_t ch = *s++; + PUGI__SCANFOR(*s == ch); + if (!*s) PUGI__THROW_ERROR(status_bad_doctype, s); + + s++; + } + else if (s[0] == '<' && s[1] == '?') + { + // + s += 2; + PUGI__SCANFOR(s[0] == '?' && s[1] == '>'); // no need for ENDSWITH because ?> can't terminate proper doctype + if (!*s) PUGI__THROW_ERROR(status_bad_doctype, s); + + s += 2; + } + else if (s[0] == '<' && s[1] == '!' && s[2] == '-' && s[3] == '-') + { + s += 4; + PUGI__SCANFOR(s[0] == '-' && s[1] == '-' && s[2] == '>'); // no need for ENDSWITH because --> can't terminate proper doctype + if (!*s) PUGI__THROW_ERROR(status_bad_doctype, s); + + s += 4; + } + else PUGI__THROW_ERROR(status_bad_doctype, s); + + return s; + } + + char_t* parse_doctype_ignore(char_t* s) + { + assert(s[0] == '<' && s[1] == '!' && s[2] == '['); + s++; + + while (*s) + { + if (s[0] == '<' && s[1] == '!' && s[2] == '[') + { + // nested ignore section + s = parse_doctype_ignore(s); + if (!s) return s; + } + else if (s[0] == ']' && s[1] == ']' && s[2] == '>') + { + // ignore section end + s += 3; + + return s; + } + else s++; + } + + PUGI__THROW_ERROR(status_bad_doctype, s); + } + + char_t* parse_doctype_group(char_t* s, char_t endch, bool toplevel) + { + assert((s[0] == '<' || s[0] == 0) && s[1] == '!'); + s++; + + while (*s) + { + if (s[0] == '<' && s[1] == '!' && s[2] != '-') + { + if (s[2] == '[') + { + // ignore + s = parse_doctype_ignore(s); + if (!s) return s; + } + else + { + // some control group + s = parse_doctype_group(s, endch, false); + if (!s) return s; + + // skip > + assert(*s == '>'); + s++; + } + } + else if (s[0] == '<' || s[0] == '"' || s[0] == '\'') + { + // unknown tag (forbidden), or some primitive group + s = parse_doctype_primitive(s); + if (!s) return s; + } + else if (*s == '>') + { + return s; + } + else s++; + } + + if (!toplevel || endch != '>') PUGI__THROW_ERROR(status_bad_doctype, s); + + return s; + } + + char_t* parse_exclamation(char_t* s, xml_node_struct* cursor, unsigned int optmsk, char_t endch) + { + // parse node contents, starting with exclamation mark + ++s; + + if (*s == '-') // 'value = s; // Save the offset. + } + + if (PUGI__OPTSET(parse_eol) && PUGI__OPTSET(parse_comments)) + { + s = strconv_comment(s, endch); + + if (!s) PUGI__THROW_ERROR(status_bad_comment, cursor->value); + } + else + { + // Scan for terminating '-->'. + PUGI__SCANFOR(s[0] == '-' && s[1] == '-' && ENDSWITH(s[2], '>')); + PUGI__CHECK_ERROR(status_bad_comment, s); + + if (PUGI__OPTSET(parse_comments)) + *s = 0; // Zero-terminate this segment at the first terminating '-'. + + s += (s[2] == '>' ? 3 : 2); // Step over the '\0->'. + } + } + else PUGI__THROW_ERROR(status_bad_comment, s); + } + else if (*s == '[') + { + // 'value = s; // Save the offset. + + if (PUGI__OPTSET(parse_eol)) + { + s = strconv_cdata(s, endch); + + if (!s) PUGI__THROW_ERROR(status_bad_cdata, cursor->value); + } + else + { + // Scan for terminating ']]>'. + PUGI__SCANFOR(s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')); + PUGI__CHECK_ERROR(status_bad_cdata, s); + + *s++ = 0; // Zero-terminate this segment. + } + } + else // Flagged for discard, but we still have to scan for the terminator. + { + // Scan for terminating ']]>'. + PUGI__SCANFOR(s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')); + PUGI__CHECK_ERROR(status_bad_cdata, s); + + ++s; + } + + s += (s[1] == '>' ? 2 : 1); // Step over the last ']>'. + } + else PUGI__THROW_ERROR(status_bad_cdata, s); + } + else if (s[0] == 'D' && s[1] == 'O' && s[2] == 'C' && s[3] == 'T' && s[4] == 'Y' && s[5] == 'P' && ENDSWITH(s[6], 'E')) + { + s -= 2; + + if (cursor->parent) PUGI__THROW_ERROR(status_bad_doctype, s); + + char_t* mark = s + 9; + + s = parse_doctype_group(s, endch, true); + if (!s) return s; + + assert((*s == 0 && endch == '>') || *s == '>'); + if (*s) *s++ = 0; + + if (PUGI__OPTSET(parse_doctype)) + { + while (PUGI__IS_CHARTYPE(*mark, ct_space)) ++mark; + + PUGI__PUSHNODE(node_doctype); + + cursor->value = mark; + + PUGI__POPNODE(); + } + } + else if (*s == 0 && endch == '-') PUGI__THROW_ERROR(status_bad_comment, s); + else if (*s == 0 && endch == '[') PUGI__THROW_ERROR(status_bad_cdata, s); + else PUGI__THROW_ERROR(status_unrecognized_tag, s); + + return s; + } + + char_t* parse_question(char_t* s, xml_node_struct*& ref_cursor, unsigned int optmsk, char_t endch) + { + // load into registers + xml_node_struct* cursor = ref_cursor; + char_t ch = 0; + + // parse node contents, starting with question mark + ++s; + + // read PI target + char_t* target = s; + + if (!PUGI__IS_CHARTYPE(*s, ct_start_symbol)) PUGI__THROW_ERROR(status_bad_pi, s); + + PUGI__SCANWHILE(PUGI__IS_CHARTYPE(*s, ct_symbol)); + PUGI__CHECK_ERROR(status_bad_pi, s); + + // determine node type; stricmp / strcasecmp is not portable + bool declaration = (target[0] | ' ') == 'x' && (target[1] | ' ') == 'm' && (target[2] | ' ') == 'l' && target + 3 == s; + + if (declaration ? PUGI__OPTSET(parse_declaration) : PUGI__OPTSET(parse_pi)) + { + if (declaration) + { + // disallow non top-level declarations + if (cursor->parent) PUGI__THROW_ERROR(status_bad_pi, s); + + PUGI__PUSHNODE(node_declaration); + } + else + { + PUGI__PUSHNODE(node_pi); + } + + cursor->name = target; + + PUGI__ENDSEG(); + + // parse value/attributes + if (ch == '?') + { + // empty node + if (!ENDSWITH(*s, '>')) PUGI__THROW_ERROR(status_bad_pi, s); + s += (*s == '>'); + + PUGI__POPNODE(); + } + else if (PUGI__IS_CHARTYPE(ch, ct_space)) + { + PUGI__SKIPWS(); + + // scan for tag end + char_t* value = s; + + PUGI__SCANFOR(s[0] == '?' && ENDSWITH(s[1], '>')); + PUGI__CHECK_ERROR(status_bad_pi, s); + + if (declaration) + { + // replace ending ? with / so that 'element' terminates properly + *s = '/'; + + // we exit from this function with cursor at node_declaration, which is a signal to parse() to go to LOC_ATTRIBUTES + s = value; + } + else + { + // store value and step over > + cursor->value = value; + PUGI__POPNODE(); + + PUGI__ENDSEG(); + + s += (*s == '>'); + } + } + else PUGI__THROW_ERROR(status_bad_pi, s); + } + else + { + // scan for tag end + PUGI__SCANFOR(s[0] == '?' && ENDSWITH(s[1], '>')); + PUGI__CHECK_ERROR(status_bad_pi, s); + + s += (s[1] == '>' ? 2 : 1); + } + + // store from registers + ref_cursor = cursor; + + return s; + } + + char_t* parse_tree(char_t* s, xml_node_struct* root, unsigned int optmsk, char_t endch) + { + strconv_attribute_t strconv_attribute = get_strconv_attribute(optmsk); + strconv_pcdata_t strconv_pcdata = get_strconv_pcdata(optmsk); + + char_t ch = 0; + xml_node_struct* cursor = root; + char_t* mark = s; + + while (*s != 0) + { + if (*s == '<') + { + ++s; + + LOC_TAG: + if (PUGI__IS_CHARTYPE(*s, ct_start_symbol)) // '<#...' + { + PUGI__PUSHNODE(node_element); // Append a new node to the tree. + + cursor->name = s; + + PUGI__SCANWHILE(PUGI__IS_CHARTYPE(*s, ct_symbol)); // Scan for a terminator. + PUGI__ENDSEG(); // Save char in 'ch', terminate & step over. + + if (ch == '>') + { + // end of tag + } + else if (PUGI__IS_CHARTYPE(ch, ct_space)) + { + LOC_ATTRIBUTES: + while (true) + { + PUGI__SKIPWS(); // Eat any whitespace. + + if (PUGI__IS_CHARTYPE(*s, ct_start_symbol)) // <... #... + { + xml_attribute_struct* a = append_attribute_ll(cursor, alloc); // Make space for this attribute. + if (!a) PUGI__THROW_ERROR(status_out_of_memory, s); + + a->name = s; // Save the offset. + + PUGI__SCANWHILE(PUGI__IS_CHARTYPE(*s, ct_symbol)); // Scan for a terminator. + PUGI__CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance + + PUGI__ENDSEG(); // Save char in 'ch', terminate & step over. + PUGI__CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance + + if (PUGI__IS_CHARTYPE(ch, ct_space)) + { + PUGI__SKIPWS(); // Eat any whitespace. + PUGI__CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance + + ch = *s; + ++s; + } + + if (ch == '=') // '<... #=...' + { + PUGI__SKIPWS(); // Eat any whitespace. + + if (*s == '"' || *s == '\'') // '<... #="...' + { + ch = *s; // Save quote char to avoid breaking on "''" -or- '""'. + ++s; // Step over the quote. + a->value = s; // Save the offset. + + s = strconv_attribute(s, ch); + + if (!s) PUGI__THROW_ERROR(status_bad_attribute, a->value); + + // After this line the loop continues from the start; + // Whitespaces, / and > are ok, symbols and EOF are wrong, + // everything else will be detected + if (PUGI__IS_CHARTYPE(*s, ct_start_symbol)) PUGI__THROW_ERROR(status_bad_attribute, s); + } + else PUGI__THROW_ERROR(status_bad_attribute, s); + } + else PUGI__THROW_ERROR(status_bad_attribute, s); + } + else if (*s == '/') + { + ++s; + + if (*s == '>') + { + PUGI__POPNODE(); + s++; + break; + } + else if (*s == 0 && endch == '>') + { + PUGI__POPNODE(); + break; + } + else PUGI__THROW_ERROR(status_bad_start_element, s); + } + else if (*s == '>') + { + ++s; + + break; + } + else if (*s == 0 && endch == '>') + { + break; + } + else PUGI__THROW_ERROR(status_bad_start_element, s); + } + + // !!! + } + else if (ch == '/') // '<#.../' + { + if (!ENDSWITH(*s, '>')) PUGI__THROW_ERROR(status_bad_start_element, s); + + PUGI__POPNODE(); // Pop. + + s += (*s == '>'); + } + else if (ch == 0) + { + // we stepped over null terminator, backtrack & handle closing tag + --s; + + if (endch != '>') PUGI__THROW_ERROR(status_bad_start_element, s); + } + else PUGI__THROW_ERROR(status_bad_start_element, s); + } + else if (*s == '/') + { + ++s; + + char_t* name = cursor->name; + if (!name) PUGI__THROW_ERROR(status_end_element_mismatch, s); + + while (PUGI__IS_CHARTYPE(*s, ct_symbol)) + { + if (*s++ != *name++) PUGI__THROW_ERROR(status_end_element_mismatch, s); + } + + if (*name) + { + if (*s == 0 && name[0] == endch && name[1] == 0) PUGI__THROW_ERROR(status_bad_end_element, s); + else PUGI__THROW_ERROR(status_end_element_mismatch, s); + } + + PUGI__POPNODE(); // Pop. + + PUGI__SKIPWS(); + + if (*s == 0) + { + if (endch != '>') PUGI__THROW_ERROR(status_bad_end_element, s); + } + else + { + if (*s != '>') PUGI__THROW_ERROR(status_bad_end_element, s); + ++s; + } + } + else if (*s == '?') // 'header & xml_memory_page_type_mask) + 1 == node_declaration) goto LOC_ATTRIBUTES; + } + else if (*s == '!') // 'first_child) continue; + } + } + + if (!PUGI__OPTSET(parse_trim_pcdata)) + s = mark; + + if (cursor->parent || PUGI__OPTSET(parse_fragment)) + { + PUGI__PUSHNODE(node_pcdata); // Append a new node on the tree. + cursor->value = s; // Save the offset. + + s = strconv_pcdata(s); + + PUGI__POPNODE(); // Pop since this is a standalone. + + if (!*s) break; + } + else + { + PUGI__SCANFOR(*s == '<'); // '...<' + if (!*s) break; + + ++s; + } + + // We're after '<' + goto LOC_TAG; + } + } + + // check that last tag is closed + if (cursor != root) PUGI__THROW_ERROR(status_end_element_mismatch, s); + + return s; + } + + #ifdef PUGIXML_WCHAR_MODE + static char_t* parse_skip_bom(char_t* s) + { + unsigned int bom = 0xfeff; + return (s[0] == static_cast(bom)) ? s + 1 : s; + } + #else + static char_t* parse_skip_bom(char_t* s) + { + return (s[0] == '\xef' && s[1] == '\xbb' && s[2] == '\xbf') ? s + 3 : s; + } + #endif + + static bool has_element_node_siblings(xml_node_struct* node) + { + while (node) + { + xml_node_type type = static_cast((node->header & impl::xml_memory_page_type_mask) + 1); + if (type == node_element) return true; + + node = node->next_sibling; + } + + return false; + } + + static xml_parse_result parse(char_t* buffer, size_t length, xml_document_struct* xmldoc, xml_node_struct* root, unsigned int optmsk) + { + // allocator object is a part of document object + xml_allocator& alloc = *static_cast(xmldoc); + + // early-out for empty documents + if (length == 0) + return make_parse_result(PUGI__OPTSET(parse_fragment) ? status_ok : status_no_document_element); + + // get last child of the root before parsing + xml_node_struct* last_root_child = root->first_child ? root->first_child->prev_sibling_c : 0; + + // create parser on stack + xml_parser parser(alloc); + + // save last character and make buffer zero-terminated (speeds up parsing) + char_t endch = buffer[length - 1]; + buffer[length - 1] = 0; + + // skip BOM to make sure it does not end up as part of parse output + char_t* buffer_data = parse_skip_bom(buffer); + + // perform actual parsing + parser.parse_tree(buffer_data, root, optmsk, endch); + + // update allocator state + alloc = parser.alloc; + + xml_parse_result result = make_parse_result(parser.error_status, parser.error_offset ? parser.error_offset - buffer : 0); + assert(result.offset >= 0 && static_cast(result.offset) <= length); + + if (result) + { + // since we removed last character, we have to handle the only possible false positive (stray <) + if (endch == '<') + return make_parse_result(status_unrecognized_tag, length - 1); + + // check if there are any element nodes parsed + xml_node_struct* first_root_child_parsed = last_root_child ? last_root_child->next_sibling : root->first_child; + + if (!PUGI__OPTSET(parse_fragment) && !has_element_node_siblings(first_root_child_parsed)) + return make_parse_result(status_no_document_element, length - 1); + } + else + { + // roll back offset if it occurs on a null terminator in the source buffer + if (result.offset > 0 && static_cast(result.offset) == length - 1 && endch == 0) + result.offset--; + } + + return result; + } + }; + + // Output facilities + PUGI__FN xml_encoding get_write_native_encoding() + { + #ifdef PUGIXML_WCHAR_MODE + return get_wchar_encoding(); + #else + return encoding_utf8; + #endif + } + + PUGI__FN xml_encoding get_write_encoding(xml_encoding encoding) + { + // replace wchar encoding with utf implementation + if (encoding == encoding_wchar) return get_wchar_encoding(); + + // replace utf16 encoding with utf16 with specific endianness + if (encoding == encoding_utf16) return is_little_endian() ? encoding_utf16_le : encoding_utf16_be; + + // replace utf32 encoding with utf32 with specific endianness + if (encoding == encoding_utf32) return is_little_endian() ? encoding_utf32_le : encoding_utf32_be; + + // only do autodetection if no explicit encoding is requested + if (encoding != encoding_auto) return encoding; + + // assume utf8 encoding + return encoding_utf8; + } + +#ifdef PUGIXML_WCHAR_MODE + PUGI__FN size_t get_valid_length(const char_t* data, size_t length) + { + assert(length > 0); + + // discard last character if it's the lead of a surrogate pair + return (sizeof(wchar_t) == 2 && static_cast(static_cast(data[length - 1]) - 0xD800) < 0x400) ? length - 1 : length; + } + + PUGI__FN size_t convert_buffer_output(char_t* r_char, uint8_t* r_u8, uint16_t* r_u16, uint32_t* r_u32, const char_t* data, size_t length, xml_encoding encoding) + { + // only endian-swapping is required + if (need_endian_swap_utf(encoding, get_wchar_encoding())) + { + convert_wchar_endian_swap(r_char, data, length); + + return length * sizeof(char_t); + } + + // convert to utf8 + if (encoding == encoding_utf8) + { + uint8_t* dest = r_u8; + uint8_t* end = utf_decoder::decode_wchar_block(data, length, dest); + + return static_cast(end - dest); + } + + // convert to utf16 + if (encoding == encoding_utf16_be || encoding == encoding_utf16_le) + { + uint16_t* dest = r_u16; + + // convert to native utf16 + uint16_t* end = utf_decoder::decode_wchar_block(data, length, dest); + + // swap if necessary + xml_encoding native_encoding = is_little_endian() ? encoding_utf16_le : encoding_utf16_be; + + if (native_encoding != encoding) convert_utf_endian_swap(dest, dest, static_cast(end - dest)); + + return static_cast(end - dest) * sizeof(uint16_t); + } + + // convert to utf32 + if (encoding == encoding_utf32_be || encoding == encoding_utf32_le) + { + uint32_t* dest = r_u32; + + // convert to native utf32 + uint32_t* end = utf_decoder::decode_wchar_block(data, length, dest); + + // swap if necessary + xml_encoding native_encoding = is_little_endian() ? encoding_utf32_le : encoding_utf32_be; + + if (native_encoding != encoding) convert_utf_endian_swap(dest, dest, static_cast(end - dest)); + + return static_cast(end - dest) * sizeof(uint32_t); + } + + // convert to latin1 + if (encoding == encoding_latin1) + { + uint8_t* dest = r_u8; + uint8_t* end = utf_decoder::decode_wchar_block(data, length, dest); + + return static_cast(end - dest); + } + + assert(!"Invalid encoding"); + return 0; + } +#else + PUGI__FN size_t get_valid_length(const char_t* data, size_t length) + { + assert(length > 4); + + for (size_t i = 1; i <= 4; ++i) + { + uint8_t ch = static_cast(data[length - i]); + + // either a standalone character or a leading one + if ((ch & 0xc0) != 0x80) return length - i; + } + + // there are four non-leading characters at the end, sequence tail is broken so might as well process the whole chunk + return length; + } + + PUGI__FN size_t convert_buffer_output(char_t* /* r_char */, uint8_t* r_u8, uint16_t* r_u16, uint32_t* r_u32, const char_t* data, size_t length, xml_encoding encoding) + { + if (encoding == encoding_utf16_be || encoding == encoding_utf16_le) + { + uint16_t* dest = r_u16; + + // convert to native utf16 + uint16_t* end = utf_decoder::decode_utf8_block(reinterpret_cast(data), length, dest); + + // swap if necessary + xml_encoding native_encoding = is_little_endian() ? encoding_utf16_le : encoding_utf16_be; + + if (native_encoding != encoding) convert_utf_endian_swap(dest, dest, static_cast(end - dest)); + + return static_cast(end - dest) * sizeof(uint16_t); + } + + if (encoding == encoding_utf32_be || encoding == encoding_utf32_le) + { + uint32_t* dest = r_u32; + + // convert to native utf32 + uint32_t* end = utf_decoder::decode_utf8_block(reinterpret_cast(data), length, dest); + + // swap if necessary + xml_encoding native_encoding = is_little_endian() ? encoding_utf32_le : encoding_utf32_be; + + if (native_encoding != encoding) convert_utf_endian_swap(dest, dest, static_cast(end - dest)); + + return static_cast(end - dest) * sizeof(uint32_t); + } + + if (encoding == encoding_latin1) + { + uint8_t* dest = r_u8; + uint8_t* end = utf_decoder::decode_utf8_block(reinterpret_cast(data), length, dest); + + return static_cast(end - dest); + } + + assert(!"Invalid encoding"); + return 0; + } +#endif + + class xml_buffered_writer + { + xml_buffered_writer(const xml_buffered_writer&); + xml_buffered_writer& operator=(const xml_buffered_writer&); + + public: + xml_buffered_writer(xml_writer& writer_, xml_encoding user_encoding): writer(writer_), bufsize(0), encoding(get_write_encoding(user_encoding)) + { + PUGI__STATIC_ASSERT(bufcapacity >= 8); + } + + ~xml_buffered_writer() + { + flush(); + } + + void flush() + { + flush(buffer, bufsize); + bufsize = 0; + } + + void flush(const char_t* data, size_t size) + { + if (size == 0) return; + + // fast path, just write data + if (encoding == get_write_native_encoding()) + writer.write(data, size * sizeof(char_t)); + else + { + // convert chunk + size_t result = convert_buffer_output(scratch.data_char, scratch.data_u8, scratch.data_u16, scratch.data_u32, data, size, encoding); + assert(result <= sizeof(scratch)); + + // write data + writer.write(scratch.data_u8, result); + } + } + + void write(const char_t* data, size_t length) + { + if (bufsize + length > bufcapacity) + { + // flush the remaining buffer contents + flush(); + + // handle large chunks + if (length > bufcapacity) + { + if (encoding == get_write_native_encoding()) + { + // fast path, can just write data chunk + writer.write(data, length * sizeof(char_t)); + return; + } + + // need to convert in suitable chunks + while (length > bufcapacity) + { + // get chunk size by selecting such number of characters that are guaranteed to fit into scratch buffer + // and form a complete codepoint sequence (i.e. discard start of last codepoint if necessary) + size_t chunk_size = get_valid_length(data, bufcapacity); + + // convert chunk and write + flush(data, chunk_size); + + // iterate + data += chunk_size; + length -= chunk_size; + } + + // small tail is copied below + bufsize = 0; + } + } + + memcpy(buffer + bufsize, data, length * sizeof(char_t)); + bufsize += length; + } + + void write(const char_t* data) + { + write(data, strlength(data)); + } + + void write(char_t d0) + { + if (bufsize + 1 > bufcapacity) flush(); + + buffer[bufsize + 0] = d0; + bufsize += 1; + } + + void write(char_t d0, char_t d1) + { + if (bufsize + 2 > bufcapacity) flush(); + + buffer[bufsize + 0] = d0; + buffer[bufsize + 1] = d1; + bufsize += 2; + } + + void write(char_t d0, char_t d1, char_t d2) + { + if (bufsize + 3 > bufcapacity) flush(); + + buffer[bufsize + 0] = d0; + buffer[bufsize + 1] = d1; + buffer[bufsize + 2] = d2; + bufsize += 3; + } + + void write(char_t d0, char_t d1, char_t d2, char_t d3) + { + if (bufsize + 4 > bufcapacity) flush(); + + buffer[bufsize + 0] = d0; + buffer[bufsize + 1] = d1; + buffer[bufsize + 2] = d2; + buffer[bufsize + 3] = d3; + bufsize += 4; + } + + void write(char_t d0, char_t d1, char_t d2, char_t d3, char_t d4) + { + if (bufsize + 5 > bufcapacity) flush(); + + buffer[bufsize + 0] = d0; + buffer[bufsize + 1] = d1; + buffer[bufsize + 2] = d2; + buffer[bufsize + 3] = d3; + buffer[bufsize + 4] = d4; + bufsize += 5; + } + + void write(char_t d0, char_t d1, char_t d2, char_t d3, char_t d4, char_t d5) + { + if (bufsize + 6 > bufcapacity) flush(); + + buffer[bufsize + 0] = d0; + buffer[bufsize + 1] = d1; + buffer[bufsize + 2] = d2; + buffer[bufsize + 3] = d3; + buffer[bufsize + 4] = d4; + buffer[bufsize + 5] = d5; + bufsize += 6; + } + + // utf8 maximum expansion: x4 (-> utf32) + // utf16 maximum expansion: x2 (-> utf32) + // utf32 maximum expansion: x1 + enum + { + bufcapacitybytes = + #ifdef PUGIXML_MEMORY_OUTPUT_STACK + PUGIXML_MEMORY_OUTPUT_STACK + #else + 10240 + #endif + , + bufcapacity = bufcapacitybytes / (sizeof(char_t) + 4) + }; + + char_t buffer[bufcapacity]; + + union + { + uint8_t data_u8[4 * bufcapacity]; + uint16_t data_u16[2 * bufcapacity]; + uint32_t data_u32[bufcapacity]; + char_t data_char[bufcapacity]; + } scratch; + + xml_writer& writer; + size_t bufsize; + xml_encoding encoding; + }; + + PUGI__FN void text_output_escaped(xml_buffered_writer& writer, const char_t* s, chartypex_t type) + { + while (*s) + { + const char_t* prev = s; + + // While *s is a usual symbol + while (!PUGI__IS_CHARTYPEX(*s, type)) ++s; + + writer.write(prev, static_cast(s - prev)); + + switch (*s) + { + case 0: break; + case '&': + writer.write('&', 'a', 'm', 'p', ';'); + ++s; + break; + case '<': + writer.write('&', 'l', 't', ';'); + ++s; + break; + case '>': + writer.write('&', 'g', 't', ';'); + ++s; + break; + case '"': + writer.write('&', 'q', 'u', 'o', 't', ';'); + ++s; + break; + default: // s is not a usual symbol + { + unsigned int ch = static_cast(*s++); + assert(ch < 32); + + writer.write('&', '#', static_cast((ch / 10) + '0'), static_cast((ch % 10) + '0'), ';'); + } + } + } + } + + PUGI__FN void text_output(xml_buffered_writer& writer, const char_t* s, chartypex_t type, unsigned int flags) + { + if (flags & format_no_escapes) + writer.write(s); + else + text_output_escaped(writer, s, type); + } + + PUGI__FN void text_output_cdata(xml_buffered_writer& writer, const char_t* s) + { + do + { + writer.write('<', '!', '[', 'C', 'D'); + writer.write('A', 'T', 'A', '['); + + const char_t* prev = s; + + // look for ]]> sequence - we can't output it as is since it terminates CDATA + while (*s && !(s[0] == ']' && s[1] == ']' && s[2] == '>')) ++s; + + // skip ]] if we stopped at ]]>, > will go to the next CDATA section + if (*s) s += 2; + + writer.write(prev, static_cast(s - prev)); + + writer.write(']', ']', '>'); + } + while (*s); + } + + PUGI__FN void node_output_attributes(xml_buffered_writer& writer, const xml_node& node, unsigned int flags) + { + const char_t* default_name = PUGIXML_TEXT(":anonymous"); + + for (xml_attribute a = node.first_attribute(); a; a = a.next_attribute()) + { + writer.write(' '); + writer.write(a.name()[0] ? a.name() : default_name); + writer.write('=', '"'); + + text_output(writer, a.value(), ctx_special_attr, flags); + + writer.write('"'); + } + } + + PUGI__FN void node_output(xml_buffered_writer& writer, const xml_node& node, const char_t* indent, unsigned int flags, unsigned int depth) + { + const char_t* default_name = PUGIXML_TEXT(":anonymous"); + + if ((flags & format_indent) != 0 && (flags & format_raw) == 0) + for (unsigned int i = 0; i < depth; ++i) writer.write(indent); + + switch (node.type()) + { + case node_document: + { + for (xml_node n = node.first_child(); n; n = n.next_sibling()) + node_output(writer, n, indent, flags, depth); + break; + } + + case node_element: + { + const char_t* name = node.name()[0] ? node.name() : default_name; + + writer.write('<'); + writer.write(name); + + node_output_attributes(writer, node, flags); + + if (flags & format_raw) + { + if (!node.first_child()) + writer.write(' ', '/', '>'); + else + { + writer.write('>'); + + for (xml_node n = node.first_child(); n; n = n.next_sibling()) + node_output(writer, n, indent, flags, depth + 1); + + writer.write('<', '/'); + writer.write(name); + writer.write('>'); + } + } + else if (!node.first_child()) + writer.write(' ', '/', '>', '\n'); + else if (node.first_child() == node.last_child() && (node.first_child().type() == node_pcdata || node.first_child().type() == node_cdata)) + { + writer.write('>'); + + if (node.first_child().type() == node_pcdata) + text_output(writer, node.first_child().value(), ctx_special_pcdata, flags); + else + text_output_cdata(writer, node.first_child().value()); + + writer.write('<', '/'); + writer.write(name); + writer.write('>', '\n'); + } + else + { + writer.write('>', '\n'); + + for (xml_node n = node.first_child(); n; n = n.next_sibling()) + node_output(writer, n, indent, flags, depth + 1); + + if ((flags & format_indent) != 0 && (flags & format_raw) == 0) + for (unsigned int i = 0; i < depth; ++i) writer.write(indent); + + writer.write('<', '/'); + writer.write(name); + writer.write('>', '\n'); + } + + break; + } + + case node_pcdata: + text_output(writer, node.value(), ctx_special_pcdata, flags); + if ((flags & format_raw) == 0) writer.write('\n'); + break; + + case node_cdata: + text_output_cdata(writer, node.value()); + if ((flags & format_raw) == 0) writer.write('\n'); + break; + + case node_comment: + writer.write('<', '!', '-', '-'); + writer.write(node.value()); + writer.write('-', '-', '>'); + if ((flags & format_raw) == 0) writer.write('\n'); + break; + + case node_pi: + case node_declaration: + writer.write('<', '?'); + writer.write(node.name()[0] ? node.name() : default_name); + + if (node.type() == node_declaration) + { + node_output_attributes(writer, node, flags); + } + else if (node.value()[0]) + { + writer.write(' '); + writer.write(node.value()); + } + + writer.write('?', '>'); + if ((flags & format_raw) == 0) writer.write('\n'); + break; + + case node_doctype: + writer.write('<', '!', 'D', 'O', 'C'); + writer.write('T', 'Y', 'P', 'E'); + + if (node.value()[0]) + { + writer.write(' '); + writer.write(node.value()); + } + + writer.write('>'); + if ((flags & format_raw) == 0) writer.write('\n'); + break; + + default: + assert(!"Invalid node type"); + } + } + + inline bool has_declaration(const xml_node& node) + { + for (xml_node child = node.first_child(); child; child = child.next_sibling()) + { + xml_node_type type = child.type(); + + if (type == node_declaration) return true; + if (type == node_element) return false; + } + + return false; + } + + inline bool allow_insert_child(xml_node_type parent, xml_node_type child) + { + if (parent != node_document && parent != node_element) return false; + if (child == node_document || child == node_null) return false; + if (parent != node_document && (child == node_declaration || child == node_doctype)) return false; + + return true; + } + + PUGI__FN void recursive_copy_skip(xml_node& dest, const xml_node& source, const xml_node& skip) + { + assert(dest.type() == source.type()); + + switch (source.type()) + { + case node_element: + { + dest.set_name(source.name()); + + for (xml_attribute a = source.first_attribute(); a; a = a.next_attribute()) + dest.append_attribute(a.name()).set_value(a.value()); + + for (xml_node c = source.first_child(); c; c = c.next_sibling()) + { + if (c == skip) continue; + + xml_node cc = dest.append_child(c.type()); + assert(cc); + + recursive_copy_skip(cc, c, skip); + } + + break; + } + + case node_pcdata: + case node_cdata: + case node_comment: + case node_doctype: + dest.set_value(source.value()); + break; + + case node_pi: + dest.set_name(source.name()); + dest.set_value(source.value()); + break; + + case node_declaration: + { + dest.set_name(source.name()); + + for (xml_attribute a = source.first_attribute(); a; a = a.next_attribute()) + dest.append_attribute(a.name()).set_value(a.value()); + + break; + } + + default: + assert(!"Invalid node type"); + } + } + + inline bool is_text_node(xml_node_struct* node) + { + xml_node_type type = static_cast((node->header & impl::xml_memory_page_type_mask) + 1); + + return type == node_pcdata || type == node_cdata; + } + + // get value with conversion functions + PUGI__FN int get_integer_base(const char_t* value) + { + const char_t* s = value; + + while (PUGI__IS_CHARTYPE(*s, ct_space)) + s++; + + if (*s == '-') + s++; + + return (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) ? 16 : 10; + } + + PUGI__FN int get_value_int(const char_t* value, int def) + { + if (!value) return def; + + int base = get_integer_base(value); + + #ifdef PUGIXML_WCHAR_MODE + return static_cast(wcstol(value, 0, base)); + #else + return static_cast(strtol(value, 0, base)); + #endif + } + + PUGI__FN unsigned int get_value_uint(const char_t* value, unsigned int def) + { + if (!value) return def; + + int base = get_integer_base(value); + + #ifdef PUGIXML_WCHAR_MODE + return static_cast(wcstoul(value, 0, base)); + #else + return static_cast(strtoul(value, 0, base)); + #endif + } + + PUGI__FN double get_value_double(const char_t* value, double def) + { + if (!value) return def; + + #ifdef PUGIXML_WCHAR_MODE + return wcstod(value, 0); + #else + return strtod(value, 0); + #endif + } + + PUGI__FN float get_value_float(const char_t* value, float def) + { + if (!value) return def; + + #ifdef PUGIXML_WCHAR_MODE + return static_cast(wcstod(value, 0)); + #else + return static_cast(strtod(value, 0)); + #endif + } + + PUGI__FN bool get_value_bool(const char_t* value, bool def) + { + if (!value) return def; + + // only look at first char + char_t first = *value; + + // 1*, t* (true), T* (True), y* (yes), Y* (YES) + return (first == '1' || first == 't' || first == 'T' || first == 'y' || first == 'Y'); + } + +#ifdef PUGIXML_HAS_LONG_LONG + PUGI__FN long long get_value_llong(const char_t* value, long long def) + { + if (!value) return def; + + int base = get_integer_base(value); + + #ifdef PUGIXML_WCHAR_MODE + #ifdef PUGI__MSVC_CRT_VERSION + return _wcstoi64(value, 0, base); + #else + return wcstoll(value, 0, base); + #endif + #else + #ifdef PUGI__MSVC_CRT_VERSION + return _strtoi64(value, 0, base); + #else + return strtoll(value, 0, base); + #endif + #endif + } + + PUGI__FN unsigned long long get_value_ullong(const char_t* value, unsigned long long def) + { + if (!value) return def; + + int base = get_integer_base(value); + + #ifdef PUGIXML_WCHAR_MODE + #ifdef PUGI__MSVC_CRT_VERSION + return _wcstoui64(value, 0, base); + #else + return wcstoull(value, 0, base); + #endif + #else + #ifdef PUGI__MSVC_CRT_VERSION + return _strtoui64(value, 0, base); + #else + return strtoull(value, 0, base); + #endif + #endif + } +#endif + + // set value with conversion functions + PUGI__FN bool set_value_buffer(char_t*& dest, uintptr_t& header, uintptr_t header_mask, char (&buf)[128]) + { + #ifdef PUGIXML_WCHAR_MODE + char_t wbuf[128]; + impl::widen_ascii(wbuf, buf); + + return strcpy_insitu(dest, header, header_mask, wbuf); + #else + return strcpy_insitu(dest, header, header_mask, buf); + #endif + } + + PUGI__FN bool set_value_convert(char_t*& dest, uintptr_t& header, uintptr_t header_mask, int value) + { + char buf[128]; + sprintf(buf, "%d", value); + + return set_value_buffer(dest, header, header_mask, buf); + } + + PUGI__FN bool set_value_convert(char_t*& dest, uintptr_t& header, uintptr_t header_mask, unsigned int value) + { + char buf[128]; + sprintf(buf, "%u", value); + + return set_value_buffer(dest, header, header_mask, buf); + } + + PUGI__FN bool set_value_convert(char_t*& dest, uintptr_t& header, uintptr_t header_mask, double value) + { + char buf[128]; + sprintf(buf, "%g", value); + + return set_value_buffer(dest, header, header_mask, buf); + } + + PUGI__FN bool set_value_convert(char_t*& dest, uintptr_t& header, uintptr_t header_mask, bool value) + { + return strcpy_insitu(dest, header, header_mask, value ? PUGIXML_TEXT("true") : PUGIXML_TEXT("false")); + } + +#ifdef PUGIXML_HAS_LONG_LONG + PUGI__FN bool set_value_convert(char_t*& dest, uintptr_t& header, uintptr_t header_mask, long long value) + { + char buf[128]; + sprintf(buf, "%lld", value); + + return set_value_buffer(dest, header, header_mask, buf); + } + + PUGI__FN bool set_value_convert(char_t*& dest, uintptr_t& header, uintptr_t header_mask, unsigned long long value) + { + char buf[128]; + sprintf(buf, "%llu", value); + + return set_value_buffer(dest, header, header_mask, buf); + } +#endif + + // we need to get length of entire file to load it in memory; the only (relatively) sane way to do it is via seek/tell trick + PUGI__FN xml_parse_status get_file_size(FILE* file, size_t& out_result) + { + #if defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400 && !defined(_WIN32_WCE) + // there are 64-bit versions of fseek/ftell, let's use them + typedef __int64 length_type; + + _fseeki64(file, 0, SEEK_END); + length_type length = _ftelli64(file); + _fseeki64(file, 0, SEEK_SET); + #elif defined(__MINGW32__) && !defined(__NO_MINGW_LFS) && !defined(__STRICT_ANSI__) + // there are 64-bit versions of fseek/ftell, let's use them + typedef off64_t length_type; + + fseeko64(file, 0, SEEK_END); + length_type length = ftello64(file); + fseeko64(file, 0, SEEK_SET); + #else + // if this is a 32-bit OS, long is enough; if this is a unix system, long is 64-bit, which is enough; otherwise we can't do anything anyway. + typedef long length_type; + + fseek(file, 0, SEEK_END); + length_type length = ftell(file); + fseek(file, 0, SEEK_SET); + #endif + + // check for I/O errors + if (length < 0) return status_io_error; + + // check for overflow + size_t result = static_cast(length); + + if (static_cast(result) != length) return status_out_of_memory; + + // finalize + out_result = result; + + return status_ok; + } + + PUGI__FN size_t zero_terminate_buffer(void* buffer, size_t size, xml_encoding encoding) + { + // We only need to zero-terminate if encoding conversion does not do it for us + #ifdef PUGIXML_WCHAR_MODE + xml_encoding wchar_encoding = get_wchar_encoding(); + + if (encoding == wchar_encoding || need_endian_swap_utf(encoding, wchar_encoding)) + { + size_t length = size / sizeof(char_t); + + static_cast(buffer)[length] = 0; + return (length + 1) * sizeof(char_t); + } + #else + if (encoding == encoding_utf8) + { + static_cast(buffer)[size] = 0; + return size + 1; + } + #endif + + return size; + } + + PUGI__FN xml_parse_result load_file_impl(xml_document& doc, FILE* file, unsigned int options, xml_encoding encoding) + { + if (!file) return make_parse_result(status_file_not_found); + + // get file size (can result in I/O errors) + size_t size = 0; + xml_parse_status size_status = get_file_size(file, size); + + if (size_status != status_ok) + { + fclose(file); + return make_parse_result(size_status); + } + + size_t max_suffix_size = sizeof(char_t); + + // allocate buffer for the whole file + char* contents = static_cast(xml_memory::allocate(size + max_suffix_size)); + + if (!contents) + { + fclose(file); + return make_parse_result(status_out_of_memory); + } + + // read file in memory + size_t read_size = fread(contents, 1, size, file); + fclose(file); + + if (read_size != size) + { + xml_memory::deallocate(contents); + return make_parse_result(status_io_error); + } + + xml_encoding real_encoding = get_buffer_encoding(encoding, contents, size); + + return doc.load_buffer_inplace_own(contents, zero_terminate_buffer(contents, size, real_encoding), options, real_encoding); + } + +#ifndef PUGIXML_NO_STL + template struct xml_stream_chunk + { + static xml_stream_chunk* create() + { + void* memory = xml_memory::allocate(sizeof(xml_stream_chunk)); + + return new (memory) xml_stream_chunk(); + } + + static void destroy(void* ptr) + { + xml_stream_chunk* chunk = static_cast(ptr); + + // free chunk chain + while (chunk) + { + xml_stream_chunk* next = chunk->next; + xml_memory::deallocate(chunk); + chunk = next; + } + } + + xml_stream_chunk(): next(0), size(0) + { + } + + xml_stream_chunk* next; + size_t size; + + T data[xml_memory_page_size / sizeof(T)]; + }; + + template PUGI__FN xml_parse_status load_stream_data_noseek(std::basic_istream& stream, void** out_buffer, size_t* out_size) + { + buffer_holder chunks(0, xml_stream_chunk::destroy); + + // read file to a chunk list + size_t total = 0; + xml_stream_chunk* last = 0; + + while (!stream.eof()) + { + // allocate new chunk + xml_stream_chunk* chunk = xml_stream_chunk::create(); + if (!chunk) return status_out_of_memory; + + // append chunk to list + if (last) last = last->next = chunk; + else chunks.data = last = chunk; + + // read data to chunk + stream.read(chunk->data, static_cast(sizeof(chunk->data) / sizeof(T))); + chunk->size = static_cast(stream.gcount()) * sizeof(T); + + // read may set failbit | eofbit in case gcount() is less than read length, so check for other I/O errors + if (stream.bad() || (!stream.eof() && stream.fail())) return status_io_error; + + // guard against huge files (chunk size is small enough to make this overflow check work) + if (total + chunk->size < total) return status_out_of_memory; + total += chunk->size; + } + + size_t max_suffix_size = sizeof(char_t); + + // copy chunk list to a contiguous buffer + char* buffer = static_cast(xml_memory::allocate(total + max_suffix_size)); + if (!buffer) return status_out_of_memory; + + char* write = buffer; + + for (xml_stream_chunk* chunk = static_cast*>(chunks.data); chunk; chunk = chunk->next) + { + assert(write + chunk->size <= buffer + total); + memcpy(write, chunk->data, chunk->size); + write += chunk->size; + } + + assert(write == buffer + total); + + // return buffer + *out_buffer = buffer; + *out_size = total; + + return status_ok; + } + + template PUGI__FN xml_parse_status load_stream_data_seek(std::basic_istream& stream, void** out_buffer, size_t* out_size) + { + // get length of remaining data in stream + typename std::basic_istream::pos_type pos = stream.tellg(); + stream.seekg(0, std::ios::end); + std::streamoff length = stream.tellg() - pos; + stream.seekg(pos); + + if (stream.fail() || pos < 0) return status_io_error; + + // guard against huge files + size_t read_length = static_cast(length); + + if (static_cast(read_length) != length || length < 0) return status_out_of_memory; + + size_t max_suffix_size = sizeof(char_t); + + // read stream data into memory (guard against stream exceptions with buffer holder) + buffer_holder buffer(xml_memory::allocate(read_length * sizeof(T) + max_suffix_size), xml_memory::deallocate); + if (!buffer.data) return status_out_of_memory; + + stream.read(static_cast(buffer.data), static_cast(read_length)); + + // read may set failbit | eofbit in case gcount() is less than read_length (i.e. line ending conversion), so check for other I/O errors + if (stream.bad() || (!stream.eof() && stream.fail())) return status_io_error; + + // return buffer + size_t actual_length = static_cast(stream.gcount()); + assert(actual_length <= read_length); + + *out_buffer = buffer.release(); + *out_size = actual_length * sizeof(T); + + return status_ok; + } + + template PUGI__FN xml_parse_result load_stream_impl(xml_document& doc, std::basic_istream& stream, unsigned int options, xml_encoding encoding) + { + void* buffer = 0; + size_t size = 0; + xml_parse_status status = status_ok; + + // if stream has an error bit set, bail out (otherwise tellg() can fail and we'll clear error bits) + if (stream.fail()) return make_parse_result(status_io_error); + + // load stream to memory (using seek-based implementation if possible, since it's faster and takes less memory) + if (stream.tellg() < 0) + { + stream.clear(); // clear error flags that could be set by a failing tellg + status = load_stream_data_noseek(stream, &buffer, &size); + } + else + status = load_stream_data_seek(stream, &buffer, &size); + + if (status != status_ok) return make_parse_result(status); + + xml_encoding real_encoding = get_buffer_encoding(encoding, buffer, size); + + return doc.load_buffer_inplace_own(buffer, zero_terminate_buffer(buffer, size, real_encoding), options, real_encoding); + } +#endif + +#if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) || (defined(__MINGW32__) && !defined(__STRICT_ANSI__)) + PUGI__FN FILE* open_file_wide(const wchar_t* path, const wchar_t* mode) + { + return _wfopen(path, mode); + } +#else + PUGI__FN char* convert_path_heap(const wchar_t* str) + { + assert(str); + + // first pass: get length in utf8 characters + size_t length = strlength_wide(str); + size_t size = as_utf8_begin(str, length); + + // allocate resulting string + char* result = static_cast(xml_memory::allocate(size + 1)); + if (!result) return 0; + + // second pass: convert to utf8 + as_utf8_end(result, size, str, length); + + return result; + } + + PUGI__FN FILE* open_file_wide(const wchar_t* path, const wchar_t* mode) + { + // there is no standard function to open wide paths, so our best bet is to try utf8 path + char* path_utf8 = convert_path_heap(path); + if (!path_utf8) return 0; + + // convert mode to ASCII (we mirror _wfopen interface) + char mode_ascii[4] = {0}; + for (size_t i = 0; mode[i]; ++i) mode_ascii[i] = static_cast(mode[i]); + + // try to open the utf8 path + FILE* result = fopen(path_utf8, mode_ascii); + + // free dummy buffer + xml_memory::deallocate(path_utf8); + + return result; + } +#endif + + PUGI__FN bool save_file_impl(const xml_document& doc, FILE* file, const char_t* indent, unsigned int flags, xml_encoding encoding) + { + if (!file) return false; + + xml_writer_file writer(file); + doc.save(writer, indent, flags, encoding); + + int result = ferror(file); + + fclose(file); + + return result == 0; + } + + PUGI__FN xml_parse_result load_buffer_impl(xml_document_struct* doc, xml_node_struct* root, void* contents, size_t size, unsigned int options, xml_encoding encoding, bool is_mutable, bool own, char_t** out_buffer) + { + // check input buffer + assert(contents || size == 0); + + // get actual encoding + xml_encoding buffer_encoding = impl::get_buffer_encoding(encoding, contents, size); + + // get private buffer + char_t* buffer = 0; + size_t length = 0; + + if (!impl::convert_buffer(buffer, length, buffer_encoding, contents, size, is_mutable)) return impl::make_parse_result(status_out_of_memory); + + // delete original buffer if we performed a conversion + if (own && buffer != contents && contents) impl::xml_memory::deallocate(contents); + + // store buffer for offset_debug + doc->buffer = buffer; + + // parse + xml_parse_result res = impl::xml_parser::parse(buffer, length, doc, root, options); + + // remember encoding + res.encoding = buffer_encoding; + + // grab onto buffer if it's our buffer, user is responsible for deallocating contents himself + if (own || buffer != contents) *out_buffer = buffer; + + return res; + } +PUGI__NS_END + +namespace pugi +{ + PUGI__FN xml_writer_file::xml_writer_file(void* file_): file(file_) + { + } + + PUGI__FN void xml_writer_file::write(const void* data, size_t size) + { + size_t result = fwrite(data, 1, size, static_cast(file)); + (void)!result; // unfortunately we can't do proper error handling here + } + +#ifndef PUGIXML_NO_STL + PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream >& stream): narrow_stream(&stream), wide_stream(0) + { + } + + PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream >& stream): narrow_stream(0), wide_stream(&stream) + { + } + + PUGI__FN void xml_writer_stream::write(const void* data, size_t size) + { + if (narrow_stream) + { + assert(!wide_stream); + narrow_stream->write(reinterpret_cast(data), static_cast(size)); + } + else + { + assert(wide_stream); + assert(size % sizeof(wchar_t) == 0); + + wide_stream->write(reinterpret_cast(data), static_cast(size / sizeof(wchar_t))); + } + } +#endif + + PUGI__FN xml_tree_walker::xml_tree_walker(): _depth(0) + { + } + + PUGI__FN xml_tree_walker::~xml_tree_walker() + { + } + + PUGI__FN int xml_tree_walker::depth() const + { + return _depth; + } + + PUGI__FN bool xml_tree_walker::begin(xml_node&) + { + return true; + } + + PUGI__FN bool xml_tree_walker::end(xml_node&) + { + return true; + } + + PUGI__FN xml_attribute::xml_attribute(): _attr(0) + { + } + + PUGI__FN xml_attribute::xml_attribute(xml_attribute_struct* attr): _attr(attr) + { + } + + PUGI__FN static void unspecified_bool_xml_attribute(xml_attribute***) + { + } + + PUGI__FN xml_attribute::operator xml_attribute::unspecified_bool_type() const + { + return _attr ? unspecified_bool_xml_attribute : 0; + } + + PUGI__FN bool xml_attribute::operator!() const + { + return !_attr; + } + + PUGI__FN bool xml_attribute::operator==(const xml_attribute& r) const + { + return (_attr == r._attr); + } + + PUGI__FN bool xml_attribute::operator!=(const xml_attribute& r) const + { + return (_attr != r._attr); + } + + PUGI__FN bool xml_attribute::operator<(const xml_attribute& r) const + { + return (_attr < r._attr); + } + + PUGI__FN bool xml_attribute::operator>(const xml_attribute& r) const + { + return (_attr > r._attr); + } + + PUGI__FN bool xml_attribute::operator<=(const xml_attribute& r) const + { + return (_attr <= r._attr); + } + + PUGI__FN bool xml_attribute::operator>=(const xml_attribute& r) const + { + return (_attr >= r._attr); + } + + PUGI__FN xml_attribute xml_attribute::next_attribute() const + { + return _attr ? xml_attribute(_attr->next_attribute) : xml_attribute(); + } + + PUGI__FN xml_attribute xml_attribute::previous_attribute() const + { + return _attr && _attr->prev_attribute_c->next_attribute ? xml_attribute(_attr->prev_attribute_c) : xml_attribute(); + } + + PUGI__FN const char_t* xml_attribute::as_string(const char_t* def) const + { + return (_attr && _attr->value) ? _attr->value : def; + } + + PUGI__FN int xml_attribute::as_int(int def) const + { + return impl::get_value_int(_attr ? _attr->value : 0, def); + } + + PUGI__FN unsigned int xml_attribute::as_uint(unsigned int def) const + { + return impl::get_value_uint(_attr ? _attr->value : 0, def); + } + + PUGI__FN double xml_attribute::as_double(double def) const + { + return impl::get_value_double(_attr ? _attr->value : 0, def); + } + + PUGI__FN float xml_attribute::as_float(float def) const + { + return impl::get_value_float(_attr ? _attr->value : 0, def); + } + + PUGI__FN bool xml_attribute::as_bool(bool def) const + { + return impl::get_value_bool(_attr ? _attr->value : 0, def); + } + +#ifdef PUGIXML_HAS_LONG_LONG + PUGI__FN long long xml_attribute::as_llong(long long def) const + { + return impl::get_value_llong(_attr ? _attr->value : 0, def); + } + + PUGI__FN unsigned long long xml_attribute::as_ullong(unsigned long long def) const + { + return impl::get_value_ullong(_attr ? _attr->value : 0, def); + } +#endif + + PUGI__FN bool xml_attribute::empty() const + { + return !_attr; + } + + PUGI__FN const char_t* xml_attribute::name() const + { + return (_attr && _attr->name) ? _attr->name : PUGIXML_TEXT(""); + } + + PUGI__FN const char_t* xml_attribute::value() const + { + return (_attr && _attr->value) ? _attr->value : PUGIXML_TEXT(""); + } + + PUGI__FN size_t xml_attribute::hash_value() const + { + return static_cast(reinterpret_cast(_attr) / sizeof(xml_attribute_struct)); + } + + PUGI__FN xml_attribute_struct* xml_attribute::internal_object() const + { + return _attr; + } + + PUGI__FN xml_attribute& xml_attribute::operator=(const char_t* rhs) + { + set_value(rhs); + return *this; + } + + PUGI__FN xml_attribute& xml_attribute::operator=(int rhs) + { + set_value(rhs); + return *this; + } + + PUGI__FN xml_attribute& xml_attribute::operator=(unsigned int rhs) + { + set_value(rhs); + return *this; + } + + PUGI__FN xml_attribute& xml_attribute::operator=(double rhs) + { + set_value(rhs); + return *this; + } + + PUGI__FN xml_attribute& xml_attribute::operator=(bool rhs) + { + set_value(rhs); + return *this; + } + +#ifdef PUGIXML_HAS_LONG_LONG + PUGI__FN xml_attribute& xml_attribute::operator=(long long rhs) + { + set_value(rhs); + return *this; + } + + PUGI__FN xml_attribute& xml_attribute::operator=(unsigned long long rhs) + { + set_value(rhs); + return *this; + } +#endif + + PUGI__FN bool xml_attribute::set_name(const char_t* rhs) + { + if (!_attr) return false; + + return impl::strcpy_insitu(_attr->name, _attr->header, impl::xml_memory_page_name_allocated_mask, rhs); + } + + PUGI__FN bool xml_attribute::set_value(const char_t* rhs) + { + if (!_attr) return false; + + return impl::strcpy_insitu(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); + } + + PUGI__FN bool xml_attribute::set_value(int rhs) + { + if (!_attr) return false; + + return impl::set_value_convert(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); + } + + PUGI__FN bool xml_attribute::set_value(unsigned int rhs) + { + if (!_attr) return false; + + return impl::set_value_convert(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); + } + + PUGI__FN bool xml_attribute::set_value(double rhs) + { + if (!_attr) return false; + + return impl::set_value_convert(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); + } + + PUGI__FN bool xml_attribute::set_value(bool rhs) + { + if (!_attr) return false; + + return impl::set_value_convert(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); + } + +#ifdef PUGIXML_HAS_LONG_LONG + PUGI__FN bool xml_attribute::set_value(long long rhs) + { + if (!_attr) return false; + + return impl::set_value_convert(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); + } + + PUGI__FN bool xml_attribute::set_value(unsigned long long rhs) + { + if (!_attr) return false; + + return impl::set_value_convert(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); + } +#endif + +#ifdef __BORLANDC__ + PUGI__FN bool operator&&(const xml_attribute& lhs, bool rhs) + { + return (bool)lhs && rhs; + } + + PUGI__FN bool operator||(const xml_attribute& lhs, bool rhs) + { + return (bool)lhs || rhs; + } +#endif + + PUGI__FN xml_node::xml_node(): _root(0) + { + } + + PUGI__FN xml_node::xml_node(xml_node_struct* p): _root(p) + { + } + + PUGI__FN static void unspecified_bool_xml_node(xml_node***) + { + } + + PUGI__FN xml_node::operator xml_node::unspecified_bool_type() const + { + return _root ? unspecified_bool_xml_node : 0; + } + + PUGI__FN bool xml_node::operator!() const + { + return !_root; + } + + PUGI__FN xml_node::iterator xml_node::begin() const + { + return iterator(_root ? _root->first_child : 0, _root); + } + + PUGI__FN xml_node::iterator xml_node::end() const + { + return iterator(0, _root); + } + + PUGI__FN xml_node::attribute_iterator xml_node::attributes_begin() const + { + return attribute_iterator(_root ? _root->first_attribute : 0, _root); + } + + PUGI__FN xml_node::attribute_iterator xml_node::attributes_end() const + { + return attribute_iterator(0, _root); + } + + PUGI__FN xml_object_range xml_node::children() const + { + return xml_object_range(begin(), end()); + } + + PUGI__FN xml_object_range xml_node::children(const char_t* name_) const + { + return xml_object_range(xml_named_node_iterator(child(name_)._root, _root, name_), xml_named_node_iterator(0, _root, name_)); + } + + PUGI__FN xml_object_range xml_node::attributes() const + { + return xml_object_range(attributes_begin(), attributes_end()); + } + + PUGI__FN bool xml_node::operator==(const xml_node& r) const + { + return (_root == r._root); + } + + PUGI__FN bool xml_node::operator!=(const xml_node& r) const + { + return (_root != r._root); + } + + PUGI__FN bool xml_node::operator<(const xml_node& r) const + { + return (_root < r._root); + } + + PUGI__FN bool xml_node::operator>(const xml_node& r) const + { + return (_root > r._root); + } + + PUGI__FN bool xml_node::operator<=(const xml_node& r) const + { + return (_root <= r._root); + } + + PUGI__FN bool xml_node::operator>=(const xml_node& r) const + { + return (_root >= r._root); + } + + PUGI__FN bool xml_node::empty() const + { + return !_root; + } + + PUGI__FN const char_t* xml_node::name() const + { + return (_root && _root->name) ? _root->name : PUGIXML_TEXT(""); + } + + PUGI__FN xml_node_type xml_node::type() const + { + return _root ? static_cast((_root->header & impl::xml_memory_page_type_mask) + 1) : node_null; + } + + PUGI__FN const char_t* xml_node::value() const + { + return (_root && _root->value) ? _root->value : PUGIXML_TEXT(""); + } + + PUGI__FN xml_node xml_node::child(const char_t* name_) const + { + if (!_root) return xml_node(); + + for (xml_node_struct* i = _root->first_child; i; i = i->next_sibling) + if (i->name && impl::strequal(name_, i->name)) return xml_node(i); + + return xml_node(); + } + + PUGI__FN xml_attribute xml_node::attribute(const char_t* name_) const + { + if (!_root) return xml_attribute(); + + for (xml_attribute_struct* i = _root->first_attribute; i; i = i->next_attribute) + if (i->name && impl::strequal(name_, i->name)) + return xml_attribute(i); + + return xml_attribute(); + } + + PUGI__FN xml_node xml_node::next_sibling(const char_t* name_) const + { + if (!_root) return xml_node(); + + for (xml_node_struct* i = _root->next_sibling; i; i = i->next_sibling) + if (i->name && impl::strequal(name_, i->name)) return xml_node(i); + + return xml_node(); + } + + PUGI__FN xml_node xml_node::next_sibling() const + { + if (!_root) return xml_node(); + + if (_root->next_sibling) return xml_node(_root->next_sibling); + else return xml_node(); + } + + PUGI__FN xml_node xml_node::previous_sibling(const char_t* name_) const + { + if (!_root) return xml_node(); + + for (xml_node_struct* i = _root->prev_sibling_c; i->next_sibling; i = i->prev_sibling_c) + if (i->name && impl::strequal(name_, i->name)) return xml_node(i); + + return xml_node(); + } + + PUGI__FN xml_node xml_node::previous_sibling() const + { + if (!_root) return xml_node(); + + if (_root->prev_sibling_c->next_sibling) return xml_node(_root->prev_sibling_c); + else return xml_node(); + } + + PUGI__FN xml_node xml_node::parent() const + { + return _root ? xml_node(_root->parent) : xml_node(); + } + + PUGI__FN xml_node xml_node::root() const + { + if (!_root) return xml_node(); + + impl::xml_memory_page* page = reinterpret_cast(_root->header & impl::xml_memory_page_pointer_mask); + + return xml_node(static_cast(page->allocator)); + } + + PUGI__FN xml_text xml_node::text() const + { + return xml_text(_root); + } + + PUGI__FN const char_t* xml_node::child_value() const + { + if (!_root) return PUGIXML_TEXT(""); + + for (xml_node_struct* i = _root->first_child; i; i = i->next_sibling) + if (i->value && impl::is_text_node(i)) + return i->value; + + return PUGIXML_TEXT(""); + } + + PUGI__FN const char_t* xml_node::child_value(const char_t* name_) const + { + return child(name_).child_value(); + } + + PUGI__FN xml_attribute xml_node::first_attribute() const + { + return _root ? xml_attribute(_root->first_attribute) : xml_attribute(); + } + + PUGI__FN xml_attribute xml_node::last_attribute() const + { + return _root && _root->first_attribute ? xml_attribute(_root->first_attribute->prev_attribute_c) : xml_attribute(); + } + + PUGI__FN xml_node xml_node::first_child() const + { + return _root ? xml_node(_root->first_child) : xml_node(); + } + + PUGI__FN xml_node xml_node::last_child() const + { + return _root && _root->first_child ? xml_node(_root->first_child->prev_sibling_c) : xml_node(); + } + + PUGI__FN bool xml_node::set_name(const char_t* rhs) + { + switch (type()) + { + case node_pi: + case node_declaration: + case node_element: + return impl::strcpy_insitu(_root->name, _root->header, impl::xml_memory_page_name_allocated_mask, rhs); + + default: + return false; + } + } + + PUGI__FN bool xml_node::set_value(const char_t* rhs) + { + switch (type()) + { + case node_pi: + case node_cdata: + case node_pcdata: + case node_comment: + case node_doctype: + return impl::strcpy_insitu(_root->value, _root->header, impl::xml_memory_page_value_allocated_mask, rhs); + + default: + return false; + } + } + + PUGI__FN xml_attribute xml_node::append_attribute(const char_t* name_) + { + if (type() != node_element && type() != node_declaration) return xml_attribute(); + + xml_attribute a(impl::append_attribute_ll(_root, impl::get_allocator(_root))); + a.set_name(name_); + + return a; + } + + PUGI__FN xml_attribute xml_node::prepend_attribute(const char_t* name_) + { + if (type() != node_element && type() != node_declaration) return xml_attribute(); + + xml_attribute a(impl::allocate_attribute(impl::get_allocator(_root))); + if (!a) return xml_attribute(); + + a.set_name(name_); + + xml_attribute_struct* head = _root->first_attribute; + + if (head) + { + a._attr->prev_attribute_c = head->prev_attribute_c; + head->prev_attribute_c = a._attr; + } + else + a._attr->prev_attribute_c = a._attr; + + a._attr->next_attribute = head; + _root->first_attribute = a._attr; + + return a; + } + + PUGI__FN xml_attribute xml_node::insert_attribute_before(const char_t* name_, const xml_attribute& attr) + { + if ((type() != node_element && type() != node_declaration) || attr.empty()) return xml_attribute(); + + // check that attribute belongs to *this + xml_attribute_struct* cur = attr._attr; + + while (cur->prev_attribute_c->next_attribute) cur = cur->prev_attribute_c; + + if (cur != _root->first_attribute) return xml_attribute(); + + xml_attribute a(impl::allocate_attribute(impl::get_allocator(_root))); + if (!a) return xml_attribute(); + + a.set_name(name_); + + if (attr._attr->prev_attribute_c->next_attribute) + attr._attr->prev_attribute_c->next_attribute = a._attr; + else + _root->first_attribute = a._attr; + + a._attr->prev_attribute_c = attr._attr->prev_attribute_c; + a._attr->next_attribute = attr._attr; + attr._attr->prev_attribute_c = a._attr; + + return a; + } + + PUGI__FN xml_attribute xml_node::insert_attribute_after(const char_t* name_, const xml_attribute& attr) + { + if ((type() != node_element && type() != node_declaration) || attr.empty()) return xml_attribute(); + + // check that attribute belongs to *this + xml_attribute_struct* cur = attr._attr; + + while (cur->prev_attribute_c->next_attribute) cur = cur->prev_attribute_c; + + if (cur != _root->first_attribute) return xml_attribute(); + + xml_attribute a(impl::allocate_attribute(impl::get_allocator(_root))); + if (!a) return xml_attribute(); + + a.set_name(name_); + + if (attr._attr->next_attribute) + attr._attr->next_attribute->prev_attribute_c = a._attr; + else + _root->first_attribute->prev_attribute_c = a._attr; + + a._attr->next_attribute = attr._attr->next_attribute; + a._attr->prev_attribute_c = attr._attr; + attr._attr->next_attribute = a._attr; + + return a; + } + + PUGI__FN xml_attribute xml_node::append_copy(const xml_attribute& proto) + { + if (!proto) return xml_attribute(); + + xml_attribute result = append_attribute(proto.name()); + result.set_value(proto.value()); + + return result; + } + + PUGI__FN xml_attribute xml_node::prepend_copy(const xml_attribute& proto) + { + if (!proto) return xml_attribute(); + + xml_attribute result = prepend_attribute(proto.name()); + result.set_value(proto.value()); + + return result; + } + + PUGI__FN xml_attribute xml_node::insert_copy_after(const xml_attribute& proto, const xml_attribute& attr) + { + if (!proto) return xml_attribute(); + + xml_attribute result = insert_attribute_after(proto.name(), attr); + result.set_value(proto.value()); + + return result; + } + + PUGI__FN xml_attribute xml_node::insert_copy_before(const xml_attribute& proto, const xml_attribute& attr) + { + if (!proto) return xml_attribute(); + + xml_attribute result = insert_attribute_before(proto.name(), attr); + result.set_value(proto.value()); + + return result; + } + + PUGI__FN xml_node xml_node::append_child(xml_node_type type_) + { + if (!impl::allow_insert_child(this->type(), type_)) return xml_node(); + + xml_node n(impl::append_node(_root, impl::get_allocator(_root), type_)); + + if (type_ == node_declaration) n.set_name(PUGIXML_TEXT("xml")); + + return n; + } + + PUGI__FN xml_node xml_node::prepend_child(xml_node_type type_) + { + if (!impl::allow_insert_child(this->type(), type_)) return xml_node(); + + xml_node n(impl::allocate_node(impl::get_allocator(_root), type_)); + if (!n) return xml_node(); + + n._root->parent = _root; + + xml_node_struct* head = _root->first_child; + + if (head) + { + n._root->prev_sibling_c = head->prev_sibling_c; + head->prev_sibling_c = n._root; + } + else + n._root->prev_sibling_c = n._root; + + n._root->next_sibling = head; + _root->first_child = n._root; + + if (type_ == node_declaration) n.set_name(PUGIXML_TEXT("xml")); + + return n; + } + + PUGI__FN xml_node xml_node::insert_child_before(xml_node_type type_, const xml_node& node) + { + if (!impl::allow_insert_child(this->type(), type_)) return xml_node(); + if (!node._root || node._root->parent != _root) return xml_node(); + + xml_node n(impl::allocate_node(impl::get_allocator(_root), type_)); + if (!n) return xml_node(); + + n._root->parent = _root; + + if (node._root->prev_sibling_c->next_sibling) + node._root->prev_sibling_c->next_sibling = n._root; + else + _root->first_child = n._root; + + n._root->prev_sibling_c = node._root->prev_sibling_c; + n._root->next_sibling = node._root; + node._root->prev_sibling_c = n._root; + + if (type_ == node_declaration) n.set_name(PUGIXML_TEXT("xml")); + + return n; + } + + PUGI__FN xml_node xml_node::insert_child_after(xml_node_type type_, const xml_node& node) + { + if (!impl::allow_insert_child(this->type(), type_)) return xml_node(); + if (!node._root || node._root->parent != _root) return xml_node(); + + xml_node n(impl::allocate_node(impl::get_allocator(_root), type_)); + if (!n) return xml_node(); + + n._root->parent = _root; + + if (node._root->next_sibling) + node._root->next_sibling->prev_sibling_c = n._root; + else + _root->first_child->prev_sibling_c = n._root; + + n._root->next_sibling = node._root->next_sibling; + n._root->prev_sibling_c = node._root; + node._root->next_sibling = n._root; + + if (type_ == node_declaration) n.set_name(PUGIXML_TEXT("xml")); + + return n; + } + + PUGI__FN xml_node xml_node::append_child(const char_t* name_) + { + xml_node result = append_child(node_element); + + result.set_name(name_); + + return result; + } + + PUGI__FN xml_node xml_node::prepend_child(const char_t* name_) + { + xml_node result = prepend_child(node_element); + + result.set_name(name_); + + return result; + } + + PUGI__FN xml_node xml_node::insert_child_after(const char_t* name_, const xml_node& node) + { + xml_node result = insert_child_after(node_element, node); + + result.set_name(name_); + + return result; + } + + PUGI__FN xml_node xml_node::insert_child_before(const char_t* name_, const xml_node& node) + { + xml_node result = insert_child_before(node_element, node); + + result.set_name(name_); + + return result; + } + + PUGI__FN xml_node xml_node::append_copy(const xml_node& proto) + { + xml_node result = append_child(proto.type()); + + if (result) impl::recursive_copy_skip(result, proto, result); + + return result; + } + + PUGI__FN xml_node xml_node::prepend_copy(const xml_node& proto) + { + xml_node result = prepend_child(proto.type()); + + if (result) impl::recursive_copy_skip(result, proto, result); + + return result; + } + + PUGI__FN xml_node xml_node::insert_copy_after(const xml_node& proto, const xml_node& node) + { + xml_node result = insert_child_after(proto.type(), node); + + if (result) impl::recursive_copy_skip(result, proto, result); + + return result; + } + + PUGI__FN xml_node xml_node::insert_copy_before(const xml_node& proto, const xml_node& node) + { + xml_node result = insert_child_before(proto.type(), node); + + if (result) impl::recursive_copy_skip(result, proto, result); + + return result; + } + + PUGI__FN bool xml_node::remove_attribute(const char_t* name_) + { + return remove_attribute(attribute(name_)); + } + + PUGI__FN bool xml_node::remove_attribute(const xml_attribute& a) + { + if (!_root || !a._attr) return false; + + // check that attribute belongs to *this + xml_attribute_struct* attr = a._attr; + + while (attr->prev_attribute_c->next_attribute) attr = attr->prev_attribute_c; + + if (attr != _root->first_attribute) return false; + + if (a._attr->next_attribute) a._attr->next_attribute->prev_attribute_c = a._attr->prev_attribute_c; + else if (_root->first_attribute) _root->first_attribute->prev_attribute_c = a._attr->prev_attribute_c; + + if (a._attr->prev_attribute_c->next_attribute) a._attr->prev_attribute_c->next_attribute = a._attr->next_attribute; + else _root->first_attribute = a._attr->next_attribute; + + impl::destroy_attribute(a._attr, impl::get_allocator(_root)); + + return true; + } + + PUGI__FN bool xml_node::remove_child(const char_t* name_) + { + return remove_child(child(name_)); + } + + PUGI__FN bool xml_node::remove_child(const xml_node& n) + { + if (!_root || !n._root || n._root->parent != _root) return false; + + if (n._root->next_sibling) n._root->next_sibling->prev_sibling_c = n._root->prev_sibling_c; + else if (_root->first_child) _root->first_child->prev_sibling_c = n._root->prev_sibling_c; + + if (n._root->prev_sibling_c->next_sibling) n._root->prev_sibling_c->next_sibling = n._root->next_sibling; + else _root->first_child = n._root->next_sibling; + + impl::destroy_node(n._root, impl::get_allocator(_root)); + + return true; + } + + PUGI__FN xml_parse_result xml_node::append_buffer(const void* contents, size_t size, unsigned int options, xml_encoding encoding) + { + // append_buffer is only valid for elements/documents + if (!impl::allow_insert_child(type(), node_element)) return impl::make_parse_result(status_append_invalid_root); + + // get document node + impl::xml_document_struct* doc = static_cast(root()._root); + assert(doc); + + // get extra buffer element (we'll store the document fragment buffer there so that we can deallocate it later) + impl::xml_memory_page* page = 0; + impl::xml_extra_buffer* extra = static_cast(doc->allocate_memory(sizeof(impl::xml_extra_buffer), page)); + (void)page; + + if (!extra) return impl::make_parse_result(status_out_of_memory); + + // save name; name of the root has to be NULL before parsing - otherwise closing node mismatches will not be detected at the top level + char_t* rootname = _root->name; + _root->name = 0; + + // parse + char_t* buffer = 0; + xml_parse_result res = impl::load_buffer_impl(doc, _root, const_cast(contents), size, options, encoding, false, false, &buffer); + + // restore name + _root->name = rootname; + + // add extra buffer to the list + extra->buffer = buffer; + extra->next = doc->extra_buffers; + doc->extra_buffers = extra; + + return res; + } + + PUGI__FN xml_node xml_node::find_child_by_attribute(const char_t* name_, const char_t* attr_name, const char_t* attr_value) const + { + if (!_root) return xml_node(); + + for (xml_node_struct* i = _root->first_child; i; i = i->next_sibling) + if (i->name && impl::strequal(name_, i->name)) + { + for (xml_attribute_struct* a = i->first_attribute; a; a = a->next_attribute) + if (a->name && impl::strequal(attr_name, a->name) && impl::strequal(attr_value, a->value ? a->value : PUGIXML_TEXT(""))) + return xml_node(i); + } + + return xml_node(); + } + + PUGI__FN xml_node xml_node::find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const + { + if (!_root) return xml_node(); + + for (xml_node_struct* i = _root->first_child; i; i = i->next_sibling) + for (xml_attribute_struct* a = i->first_attribute; a; a = a->next_attribute) + if (a->name && impl::strequal(attr_name, a->name) && impl::strequal(attr_value, a->value ? a->value : PUGIXML_TEXT(""))) + return xml_node(i); + + return xml_node(); + } + +#ifndef PUGIXML_NO_STL + PUGI__FN string_t xml_node::path(char_t delimiter) const + { + xml_node cursor = *this; // Make a copy. + + string_t result = cursor.name(); + + while (cursor.parent()) + { + cursor = cursor.parent(); + + string_t temp = cursor.name(); + temp += delimiter; + temp += result; + result.swap(temp); + } + + return result; + } +#endif + + PUGI__FN xml_node xml_node::first_element_by_path(const char_t* path_, char_t delimiter) const + { + xml_node found = *this; // Current search context. + + if (!_root || !path_ || !path_[0]) return found; + + if (path_[0] == delimiter) + { + // Absolute path; e.g. '/foo/bar' + found = found.root(); + ++path_; + } + + const char_t* path_segment = path_; + + while (*path_segment == delimiter) ++path_segment; + + const char_t* path_segment_end = path_segment; + + while (*path_segment_end && *path_segment_end != delimiter) ++path_segment_end; + + if (path_segment == path_segment_end) return found; + + const char_t* next_segment = path_segment_end; + + while (*next_segment == delimiter) ++next_segment; + + if (*path_segment == '.' && path_segment + 1 == path_segment_end) + return found.first_element_by_path(next_segment, delimiter); + else if (*path_segment == '.' && *(path_segment+1) == '.' && path_segment + 2 == path_segment_end) + return found.parent().first_element_by_path(next_segment, delimiter); + else + { + for (xml_node_struct* j = found._root->first_child; j; j = j->next_sibling) + { + if (j->name && impl::strequalrange(j->name, path_segment, static_cast(path_segment_end - path_segment))) + { + xml_node subsearch = xml_node(j).first_element_by_path(next_segment, delimiter); + + if (subsearch) return subsearch; + } + } + + return xml_node(); + } + } + + PUGI__FN bool xml_node::traverse(xml_tree_walker& walker) + { + walker._depth = -1; + + xml_node arg_begin = *this; + if (!walker.begin(arg_begin)) return false; + + xml_node cur = first_child(); + + if (cur) + { + ++walker._depth; + + do + { + xml_node arg_for_each = cur; + if (!walker.for_each(arg_for_each)) + return false; + + if (cur.first_child()) + { + ++walker._depth; + cur = cur.first_child(); + } + else if (cur.next_sibling()) + cur = cur.next_sibling(); + else + { + // Borland C++ workaround + while (!cur.next_sibling() && cur != *this && !cur.parent().empty()) + { + --walker._depth; + cur = cur.parent(); + } + + if (cur != *this) + cur = cur.next_sibling(); + } + } + while (cur && cur != *this); + } + + assert(walker._depth == -1); + + xml_node arg_end = *this; + return walker.end(arg_end); + } + + PUGI__FN size_t xml_node::hash_value() const + { + return static_cast(reinterpret_cast(_root) / sizeof(xml_node_struct)); + } + + PUGI__FN xml_node_struct* xml_node::internal_object() const + { + return _root; + } + + PUGI__FN void xml_node::print(xml_writer& writer, const char_t* indent, unsigned int flags, xml_encoding encoding, unsigned int depth) const + { + if (!_root) return; + + impl::xml_buffered_writer buffered_writer(writer, encoding); + + impl::node_output(buffered_writer, *this, indent, flags, depth); + } + +#ifndef PUGIXML_NO_STL + PUGI__FN void xml_node::print(std::basic_ostream >& stream, const char_t* indent, unsigned int flags, xml_encoding encoding, unsigned int depth) const + { + xml_writer_stream writer(stream); + + print(writer, indent, flags, encoding, depth); + } + + PUGI__FN void xml_node::print(std::basic_ostream >& stream, const char_t* indent, unsigned int flags, unsigned int depth) const + { + xml_writer_stream writer(stream); + + print(writer, indent, flags, encoding_wchar, depth); + } +#endif + + PUGI__FN ptrdiff_t xml_node::offset_debug() const + { + xml_node_struct* r = root()._root; + + if (!r) return -1; + + const char_t* buffer = static_cast(r)->buffer; + + if (!buffer) return -1; + + switch (type()) + { + case node_document: + return 0; + + case node_element: + case node_declaration: + case node_pi: + return (_root->header & impl::xml_memory_page_name_allocated_mask) ? -1 : _root->name - buffer; + + case node_pcdata: + case node_cdata: + case node_comment: + case node_doctype: + return (_root->header & impl::xml_memory_page_value_allocated_mask) ? -1 : _root->value - buffer; + + default: + return -1; + } + } + +#ifdef __BORLANDC__ + PUGI__FN bool operator&&(const xml_node& lhs, bool rhs) + { + return (bool)lhs && rhs; + } + + PUGI__FN bool operator||(const xml_node& lhs, bool rhs) + { + return (bool)lhs || rhs; + } +#endif + + PUGI__FN xml_text::xml_text(xml_node_struct* root): _root(root) + { + } + + PUGI__FN xml_node_struct* xml_text::_data() const + { + if (!_root || impl::is_text_node(_root)) return _root; + + for (xml_node_struct* node = _root->first_child; node; node = node->next_sibling) + if (impl::is_text_node(node)) + return node; + + return 0; + } + + PUGI__FN xml_node_struct* xml_text::_data_new() + { + xml_node_struct* d = _data(); + if (d) return d; + + return xml_node(_root).append_child(node_pcdata).internal_object(); + } + + PUGI__FN xml_text::xml_text(): _root(0) + { + } + + PUGI__FN static void unspecified_bool_xml_text(xml_text***) + { + } + + PUGI__FN xml_text::operator xml_text::unspecified_bool_type() const + { + return _data() ? unspecified_bool_xml_text : 0; + } + + PUGI__FN bool xml_text::operator!() const + { + return !_data(); + } + + PUGI__FN bool xml_text::empty() const + { + return _data() == 0; + } + + PUGI__FN const char_t* xml_text::get() const + { + xml_node_struct* d = _data(); + + return (d && d->value) ? d->value : PUGIXML_TEXT(""); + } + + PUGI__FN const char_t* xml_text::as_string(const char_t* def) const + { + xml_node_struct* d = _data(); + + return (d && d->value) ? d->value : def; + } + + PUGI__FN int xml_text::as_int(int def) const + { + xml_node_struct* d = _data(); + + return impl::get_value_int(d ? d->value : 0, def); + } + + PUGI__FN unsigned int xml_text::as_uint(unsigned int def) const + { + xml_node_struct* d = _data(); + + return impl::get_value_uint(d ? d->value : 0, def); + } + + PUGI__FN double xml_text::as_double(double def) const + { + xml_node_struct* d = _data(); + + return impl::get_value_double(d ? d->value : 0, def); + } + + PUGI__FN float xml_text::as_float(float def) const + { + xml_node_struct* d = _data(); + + return impl::get_value_float(d ? d->value : 0, def); + } + + PUGI__FN bool xml_text::as_bool(bool def) const + { + xml_node_struct* d = _data(); + + return impl::get_value_bool(d ? d->value : 0, def); + } + +#ifdef PUGIXML_HAS_LONG_LONG + PUGI__FN long long xml_text::as_llong(long long def) const + { + xml_node_struct* d = _data(); + + return impl::get_value_llong(d ? d->value : 0, def); + } + + PUGI__FN unsigned long long xml_text::as_ullong(unsigned long long def) const + { + xml_node_struct* d = _data(); + + return impl::get_value_ullong(d ? d->value : 0, def); + } +#endif + + PUGI__FN bool xml_text::set(const char_t* rhs) + { + xml_node_struct* dn = _data_new(); + + return dn ? impl::strcpy_insitu(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; + } + + PUGI__FN bool xml_text::set(int rhs) + { + xml_node_struct* dn = _data_new(); + + return dn ? impl::set_value_convert(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; + } + + PUGI__FN bool xml_text::set(unsigned int rhs) + { + xml_node_struct* dn = _data_new(); + + return dn ? impl::set_value_convert(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; + } + + PUGI__FN bool xml_text::set(double rhs) + { + xml_node_struct* dn = _data_new(); + + return dn ? impl::set_value_convert(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; + } + + PUGI__FN bool xml_text::set(bool rhs) + { + xml_node_struct* dn = _data_new(); + + return dn ? impl::set_value_convert(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; + } + +#ifdef PUGIXML_HAS_LONG_LONG + PUGI__FN bool xml_text::set(long long rhs) + { + xml_node_struct* dn = _data_new(); + + return dn ? impl::set_value_convert(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; + } + + PUGI__FN bool xml_text::set(unsigned long long rhs) + { + xml_node_struct* dn = _data_new(); + + return dn ? impl::set_value_convert(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; + } +#endif + + PUGI__FN xml_text& xml_text::operator=(const char_t* rhs) + { + set(rhs); + return *this; + } + + PUGI__FN xml_text& xml_text::operator=(int rhs) + { + set(rhs); + return *this; + } + + PUGI__FN xml_text& xml_text::operator=(unsigned int rhs) + { + set(rhs); + return *this; + } + + PUGI__FN xml_text& xml_text::operator=(double rhs) + { + set(rhs); + return *this; + } + + PUGI__FN xml_text& xml_text::operator=(bool rhs) + { + set(rhs); + return *this; + } + +#ifdef PUGIXML_HAS_LONG_LONG + PUGI__FN xml_text& xml_text::operator=(long long rhs) + { + set(rhs); + return *this; + } + + PUGI__FN xml_text& xml_text::operator=(unsigned long long rhs) + { + set(rhs); + return *this; + } +#endif + + PUGI__FN xml_node xml_text::data() const + { + return xml_node(_data()); + } + +#ifdef __BORLANDC__ + PUGI__FN bool operator&&(const xml_text& lhs, bool rhs) + { + return (bool)lhs && rhs; + } + + PUGI__FN bool operator||(const xml_text& lhs, bool rhs) + { + return (bool)lhs || rhs; + } +#endif + + PUGI__FN xml_node_iterator::xml_node_iterator() + { + } + + PUGI__FN xml_node_iterator::xml_node_iterator(const xml_node& node): _wrap(node), _parent(node.parent()) + { + } + + PUGI__FN xml_node_iterator::xml_node_iterator(xml_node_struct* ref, xml_node_struct* parent): _wrap(ref), _parent(parent) + { + } + + PUGI__FN bool xml_node_iterator::operator==(const xml_node_iterator& rhs) const + { + return _wrap._root == rhs._wrap._root && _parent._root == rhs._parent._root; + } + + PUGI__FN bool xml_node_iterator::operator!=(const xml_node_iterator& rhs) const + { + return _wrap._root != rhs._wrap._root || _parent._root != rhs._parent._root; + } + + PUGI__FN xml_node& xml_node_iterator::operator*() const + { + assert(_wrap._root); + return _wrap; + } + + PUGI__FN xml_node* xml_node_iterator::operator->() const + { + assert(_wrap._root); + return const_cast(&_wrap); // BCC32 workaround + } + + PUGI__FN const xml_node_iterator& xml_node_iterator::operator++() + { + assert(_wrap._root); + _wrap._root = _wrap._root->next_sibling; + return *this; + } + + PUGI__FN xml_node_iterator xml_node_iterator::operator++(int) + { + xml_node_iterator temp = *this; + ++*this; + return temp; + } + + PUGI__FN const xml_node_iterator& xml_node_iterator::operator--() + { + _wrap = _wrap._root ? _wrap.previous_sibling() : _parent.last_child(); + return *this; + } + + PUGI__FN xml_node_iterator xml_node_iterator::operator--(int) + { + xml_node_iterator temp = *this; + --*this; + return temp; + } + + PUGI__FN xml_attribute_iterator::xml_attribute_iterator() + { + } + + PUGI__FN xml_attribute_iterator::xml_attribute_iterator(const xml_attribute& attr, const xml_node& parent): _wrap(attr), _parent(parent) + { + } + + PUGI__FN xml_attribute_iterator::xml_attribute_iterator(xml_attribute_struct* ref, xml_node_struct* parent): _wrap(ref), _parent(parent) + { + } + + PUGI__FN bool xml_attribute_iterator::operator==(const xml_attribute_iterator& rhs) const + { + return _wrap._attr == rhs._wrap._attr && _parent._root == rhs._parent._root; + } + + PUGI__FN bool xml_attribute_iterator::operator!=(const xml_attribute_iterator& rhs) const + { + return _wrap._attr != rhs._wrap._attr || _parent._root != rhs._parent._root; + } + + PUGI__FN xml_attribute& xml_attribute_iterator::operator*() const + { + assert(_wrap._attr); + return _wrap; + } + + PUGI__FN xml_attribute* xml_attribute_iterator::operator->() const + { + assert(_wrap._attr); + return const_cast(&_wrap); // BCC32 workaround + } + + PUGI__FN const xml_attribute_iterator& xml_attribute_iterator::operator++() + { + assert(_wrap._attr); + _wrap._attr = _wrap._attr->next_attribute; + return *this; + } + + PUGI__FN xml_attribute_iterator xml_attribute_iterator::operator++(int) + { + xml_attribute_iterator temp = *this; + ++*this; + return temp; + } + + PUGI__FN const xml_attribute_iterator& xml_attribute_iterator::operator--() + { + _wrap = _wrap._attr ? _wrap.previous_attribute() : _parent.last_attribute(); + return *this; + } + + PUGI__FN xml_attribute_iterator xml_attribute_iterator::operator--(int) + { + xml_attribute_iterator temp = *this; + --*this; + return temp; + } + + PUGI__FN xml_named_node_iterator::xml_named_node_iterator(): _name(0) + { + } + + PUGI__FN xml_named_node_iterator::xml_named_node_iterator(const xml_node& node, const char_t* name): _wrap(node), _parent(node.parent()), _name(name) + { + } + + PUGI__FN xml_named_node_iterator::xml_named_node_iterator(xml_node_struct* ref, xml_node_struct* parent, const char_t* name): _wrap(ref), _parent(parent), _name(name) + { + } + + PUGI__FN bool xml_named_node_iterator::operator==(const xml_named_node_iterator& rhs) const + { + return _wrap._root == rhs._wrap._root && _parent._root == rhs._parent._root; + } + + PUGI__FN bool xml_named_node_iterator::operator!=(const xml_named_node_iterator& rhs) const + { + return _wrap._root != rhs._wrap._root || _parent._root != rhs._parent._root; + } + + PUGI__FN xml_node& xml_named_node_iterator::operator*() const + { + assert(_wrap._root); + return _wrap; + } + + PUGI__FN xml_node* xml_named_node_iterator::operator->() const + { + assert(_wrap._root); + return const_cast(&_wrap); // BCC32 workaround + } + + PUGI__FN const xml_named_node_iterator& xml_named_node_iterator::operator++() + { + assert(_wrap._root); + _wrap = _wrap.next_sibling(_name); + return *this; + } + + PUGI__FN xml_named_node_iterator xml_named_node_iterator::operator++(int) + { + xml_named_node_iterator temp = *this; + ++*this; + return temp; + } + + PUGI__FN const xml_named_node_iterator& xml_named_node_iterator::operator--() + { + if (_wrap._root) + _wrap = _wrap.previous_sibling(_name); + else + { + _wrap = _parent.last_child(); + + if (!impl::strequal(_wrap.name(), _name)) + _wrap = _wrap.previous_sibling(_name); + } + + return *this; + } + + PUGI__FN xml_named_node_iterator xml_named_node_iterator::operator--(int) + { + xml_named_node_iterator temp = *this; + --*this; + return temp; + } + + PUGI__FN xml_parse_result::xml_parse_result(): status(status_internal_error), offset(0), encoding(encoding_auto) + { + } + + PUGI__FN xml_parse_result::operator bool() const + { + return status == status_ok; + } + + PUGI__FN const char* xml_parse_result::description() const + { + switch (status) + { + case status_ok: return "No error"; + + case status_file_not_found: return "File was not found"; + case status_io_error: return "Error reading from file/stream"; + case status_out_of_memory: return "Could not allocate memory"; + case status_internal_error: return "Internal error occurred"; + + case status_unrecognized_tag: return "Could not determine tag type"; + + case status_bad_pi: return "Error parsing document declaration/processing instruction"; + case status_bad_comment: return "Error parsing comment"; + case status_bad_cdata: return "Error parsing CDATA section"; + case status_bad_doctype: return "Error parsing document type declaration"; + case status_bad_pcdata: return "Error parsing PCDATA section"; + case status_bad_start_element: return "Error parsing start element tag"; + case status_bad_attribute: return "Error parsing element attribute"; + case status_bad_end_element: return "Error parsing end element tag"; + case status_end_element_mismatch: return "Start-end tags mismatch"; + + case status_append_invalid_root: return "Unable to append nodes: root is not an element or document"; + + case status_no_document_element: return "No document element found"; + + default: return "Unknown error"; + } + } + + PUGI__FN xml_document::xml_document(): _buffer(0) + { + create(); + } + + PUGI__FN xml_document::~xml_document() + { + destroy(); + } + + PUGI__FN void xml_document::reset() + { + destroy(); + create(); + } + + PUGI__FN void xml_document::reset(const xml_document& proto) + { + reset(); + + for (xml_node cur = proto.first_child(); cur; cur = cur.next_sibling()) + append_copy(cur); + } + + PUGI__FN void xml_document::create() + { + assert(!_root); + + // initialize sentinel page + PUGI__STATIC_ASSERT(sizeof(impl::xml_memory_page) + sizeof(impl::xml_document_struct) + impl::xml_memory_page_alignment <= sizeof(_memory)); + + // align upwards to page boundary + void* page_memory = reinterpret_cast((reinterpret_cast(_memory) + (impl::xml_memory_page_alignment - 1)) & ~(impl::xml_memory_page_alignment - 1)); + + // prepare page structure + impl::xml_memory_page* page = impl::xml_memory_page::construct(page_memory); + assert(page); + + page->busy_size = impl::xml_memory_page_size; + + // allocate new root + _root = new (page->data) impl::xml_document_struct(page); + _root->prev_sibling_c = _root; + + // setup sentinel page + page->allocator = static_cast(_root); + } + + PUGI__FN void xml_document::destroy() + { + assert(_root); + + // destroy static storage + if (_buffer) + { + impl::xml_memory::deallocate(_buffer); + _buffer = 0; + } + + // destroy extra buffers (note: no need to destroy linked list nodes, they're allocated using document allocator) + for (impl::xml_extra_buffer* extra = static_cast(_root)->extra_buffers; extra; extra = extra->next) + { + if (extra->buffer) impl::xml_memory::deallocate(extra->buffer); + } + + // destroy dynamic storage, leave sentinel page (it's in static memory) + impl::xml_memory_page* root_page = reinterpret_cast(_root->header & impl::xml_memory_page_pointer_mask); + assert(root_page && !root_page->prev && !root_page->memory); + + for (impl::xml_memory_page* page = root_page->next; page; ) + { + impl::xml_memory_page* next = page->next; + + impl::xml_allocator::deallocate_page(page); + + page = next; + } + + _root = 0; + } + +#ifndef PUGIXML_NO_STL + PUGI__FN xml_parse_result xml_document::load(std::basic_istream >& stream, unsigned int options, xml_encoding encoding) + { + reset(); + + return impl::load_stream_impl(*this, stream, options, encoding); + } + + PUGI__FN xml_parse_result xml_document::load(std::basic_istream >& stream, unsigned int options) + { + reset(); + + return impl::load_stream_impl(*this, stream, options, encoding_wchar); + } +#endif + + PUGI__FN xml_parse_result xml_document::load(const char_t* contents, unsigned int options) + { + // Force native encoding (skip autodetection) + #ifdef PUGIXML_WCHAR_MODE + xml_encoding encoding = encoding_wchar; + #else + xml_encoding encoding = encoding_utf8; + #endif + + return load_buffer(contents, impl::strlength(contents) * sizeof(char_t), options, encoding); + } + + PUGI__FN xml_parse_result xml_document::load_file(const char* path_, unsigned int options, xml_encoding encoding) + { + reset(); + + FILE* file = fopen(path_, "rb"); + + return impl::load_file_impl(*this, file, options, encoding); + } + + PUGI__FN xml_parse_result xml_document::load_file(const wchar_t* path_, unsigned int options, xml_encoding encoding) + { + reset(); + + FILE* file = impl::open_file_wide(path_, L"rb"); + + return impl::load_file_impl(*this, file, options, encoding); + } + + PUGI__FN xml_parse_result xml_document::load_buffer(const void* contents, size_t size, unsigned int options, xml_encoding encoding) + { + reset(); + + return impl::load_buffer_impl(static_cast(_root), _root, const_cast(contents), size, options, encoding, false, false, &_buffer); + } + + PUGI__FN xml_parse_result xml_document::load_buffer_inplace(void* contents, size_t size, unsigned int options, xml_encoding encoding) + { + reset(); + + return impl::load_buffer_impl(static_cast(_root), _root, contents, size, options, encoding, true, false, &_buffer); + } + + PUGI__FN xml_parse_result xml_document::load_buffer_inplace_own(void* contents, size_t size, unsigned int options, xml_encoding encoding) + { + reset(); + + return impl::load_buffer_impl(static_cast(_root), _root, contents, size, options, encoding, true, true, &_buffer); + } + + PUGI__FN void xml_document::save(xml_writer& writer, const char_t* indent, unsigned int flags, xml_encoding encoding) const + { + impl::xml_buffered_writer buffered_writer(writer, encoding); + + if ((flags & format_write_bom) && encoding != encoding_latin1) + { + // BOM always represents the codepoint U+FEFF, so just write it in native encoding + #ifdef PUGIXML_WCHAR_MODE + unsigned int bom = 0xfeff; + buffered_writer.write(static_cast(bom)); + #else + buffered_writer.write('\xef', '\xbb', '\xbf'); + #endif + } + + if (!(flags & format_no_declaration) && !impl::has_declaration(*this)) + { + buffered_writer.write(PUGIXML_TEXT("'); + if (!(flags & format_raw)) buffered_writer.write('\n'); + } + + impl::node_output(buffered_writer, *this, indent, flags, 0); + } + +#ifndef PUGIXML_NO_STL + PUGI__FN void xml_document::save(std::basic_ostream >& stream, const char_t* indent, unsigned int flags, xml_encoding encoding) const + { + xml_writer_stream writer(stream); + + save(writer, indent, flags, encoding); + } + + PUGI__FN void xml_document::save(std::basic_ostream >& stream, const char_t* indent, unsigned int flags) const + { + xml_writer_stream writer(stream); + + save(writer, indent, flags, encoding_wchar); + } +#endif + + PUGI__FN bool xml_document::save_file(const char* path_, const char_t* indent, unsigned int flags, xml_encoding encoding) const + { + FILE* file = fopen(path_, (flags & format_save_file_text) ? "w" : "wb"); + return impl::save_file_impl(*this, file, indent, flags, encoding); + } + + PUGI__FN bool xml_document::save_file(const wchar_t* path_, const char_t* indent, unsigned int flags, xml_encoding encoding) const + { + FILE* file = impl::open_file_wide(path_, (flags & format_save_file_text) ? L"w" : L"wb"); + return impl::save_file_impl(*this, file, indent, flags, encoding); + } + + PUGI__FN xml_node xml_document::document_element() const + { + assert(_root); + + for (xml_node_struct* i = _root->first_child; i; i = i->next_sibling) + if ((i->header & impl::xml_memory_page_type_mask) + 1 == node_element) + return xml_node(i); + + return xml_node(); + } + +#ifndef PUGIXML_NO_STL + PUGI__FN std::string PUGIXML_FUNCTION as_utf8(const wchar_t* str) + { + assert(str); + + return impl::as_utf8_impl(str, impl::strlength_wide(str)); + } + + PUGI__FN std::string PUGIXML_FUNCTION as_utf8(const std::basic_string& str) + { + return impl::as_utf8_impl(str.c_str(), str.size()); + } + + PUGI__FN std::basic_string PUGIXML_FUNCTION as_wide(const char* str) + { + assert(str); + + return impl::as_wide_impl(str, strlen(str)); + } + + PUGI__FN std::basic_string PUGIXML_FUNCTION as_wide(const std::string& str) + { + return impl::as_wide_impl(str.c_str(), str.size()); + } +#endif + + PUGI__FN void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate) + { + impl::xml_memory::allocate = allocate; + impl::xml_memory::deallocate = deallocate; + } + + PUGI__FN allocation_function PUGIXML_FUNCTION get_memory_allocation_function() + { + return impl::xml_memory::allocate; + } + + PUGI__FN deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function() + { + return impl::xml_memory::deallocate; + } +} + +#if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC)) +namespace std +{ + // Workarounds for (non-standard) iterator category detection for older versions (MSVC7/IC8 and earlier) + PUGI__FN std::bidirectional_iterator_tag _Iter_cat(const pugi::xml_node_iterator&) + { + return std::bidirectional_iterator_tag(); + } + + PUGI__FN std::bidirectional_iterator_tag _Iter_cat(const pugi::xml_attribute_iterator&) + { + return std::bidirectional_iterator_tag(); + } + + PUGI__FN std::bidirectional_iterator_tag _Iter_cat(const pugi::xml_named_node_iterator&) + { + return std::bidirectional_iterator_tag(); + } +} +#endif + +#if !defined(PUGIXML_NO_STL) && defined(__SUNPRO_CC) +namespace std +{ + // Workarounds for (non-standard) iterator category detection + PUGI__FN std::bidirectional_iterator_tag __iterator_category(const pugi::xml_node_iterator&) + { + return std::bidirectional_iterator_tag(); + } + + PUGI__FN std::bidirectional_iterator_tag __iterator_category(const pugi::xml_attribute_iterator&) + { + return std::bidirectional_iterator_tag(); + } + + PUGI__FN std::bidirectional_iterator_tag __iterator_category(const pugi::xml_named_node_iterator&) + { + return std::bidirectional_iterator_tag(); + } +} +#endif + +#ifndef PUGIXML_NO_XPATH + +// STL replacements +PUGI__NS_BEGIN + struct equal_to + { + template bool operator()(const T& lhs, const T& rhs) const + { + return lhs == rhs; + } + }; + + struct not_equal_to + { + template bool operator()(const T& lhs, const T& rhs) const + { + return lhs != rhs; + } + }; + + struct less + { + template bool operator()(const T& lhs, const T& rhs) const + { + return lhs < rhs; + } + }; + + struct less_equal + { + template bool operator()(const T& lhs, const T& rhs) const + { + return lhs <= rhs; + } + }; + + template void swap(T& lhs, T& rhs) + { + T temp = lhs; + lhs = rhs; + rhs = temp; + } + + template I min_element(I begin, I end, const Pred& pred) + { + I result = begin; + + for (I it = begin + 1; it != end; ++it) + if (pred(*it, *result)) + result = it; + + return result; + } + + template void reverse(I begin, I end) + { + while (end - begin > 1) swap(*begin++, *--end); + } + + template I unique(I begin, I end) + { + // fast skip head + while (end - begin > 1 && *begin != *(begin + 1)) begin++; + + if (begin == end) return begin; + + // last written element + I write = begin++; + + // merge unique elements + while (begin != end) + { + if (*begin != *write) + *++write = *begin++; + else + begin++; + } + + // past-the-end (write points to live element) + return write + 1; + } + + template void copy_backwards(I begin, I end, I target) + { + while (begin != end) *--target = *--end; + } + + template void insertion_sort(I begin, I end, const Pred& pred, T*) + { + assert(begin != end); + + for (I it = begin + 1; it != end; ++it) + { + T val = *it; + + if (pred(val, *begin)) + { + // move to front + copy_backwards(begin, it, it + 1); + *begin = val; + } + else + { + I hole = it; + + // move hole backwards + while (pred(val, *(hole - 1))) + { + *hole = *(hole - 1); + hole--; + } + + // fill hole with element + *hole = val; + } + } + } + + // std variant for elements with == + template void partition(I begin, I middle, I end, const Pred& pred, I* out_eqbeg, I* out_eqend) + { + I eqbeg = middle, eqend = middle + 1; + + // expand equal range + while (eqbeg != begin && *(eqbeg - 1) == *eqbeg) --eqbeg; + while (eqend != end && *eqend == *eqbeg) ++eqend; + + // process outer elements + I ltend = eqbeg, gtbeg = eqend; + + for (;;) + { + // find the element from the right side that belongs to the left one + for (; gtbeg != end; ++gtbeg) + if (!pred(*eqbeg, *gtbeg)) + { + if (*gtbeg == *eqbeg) swap(*gtbeg, *eqend++); + else break; + } + + // find the element from the left side that belongs to the right one + for (; ltend != begin; --ltend) + if (!pred(*(ltend - 1), *eqbeg)) + { + if (*eqbeg == *(ltend - 1)) swap(*(ltend - 1), *--eqbeg); + else break; + } + + // scanned all elements + if (gtbeg == end && ltend == begin) + { + *out_eqbeg = eqbeg; + *out_eqend = eqend; + return; + } + + // make room for elements by moving equal area + if (gtbeg == end) + { + if (--ltend != --eqbeg) swap(*ltend, *eqbeg); + swap(*eqbeg, *--eqend); + } + else if (ltend == begin) + { + if (eqend != gtbeg) swap(*eqbeg, *eqend); + ++eqend; + swap(*gtbeg++, *eqbeg++); + } + else swap(*gtbeg++, *--ltend); + } + } + + template void median3(I first, I middle, I last, const Pred& pred) + { + if (pred(*middle, *first)) swap(*middle, *first); + if (pred(*last, *middle)) swap(*last, *middle); + if (pred(*middle, *first)) swap(*middle, *first); + } + + template void median(I first, I middle, I last, const Pred& pred) + { + if (last - first <= 40) + { + // median of three for small chunks + median3(first, middle, last, pred); + } + else + { + // median of nine + size_t step = (last - first + 1) / 8; + + median3(first, first + step, first + 2 * step, pred); + median3(middle - step, middle, middle + step, pred); + median3(last - 2 * step, last - step, last, pred); + median3(first + step, middle, last - step, pred); + } + } + + template void sort(I begin, I end, const Pred& pred) + { + // sort large chunks + while (end - begin > 32) + { + // find median element + I middle = begin + (end - begin) / 2; + median(begin, middle, end - 1, pred); + + // partition in three chunks (< = >) + I eqbeg, eqend; + partition(begin, middle, end, pred, &eqbeg, &eqend); + + // loop on larger half + if (eqbeg - begin > end - eqend) + { + sort(eqend, end, pred); + end = eqbeg; + } + else + { + sort(begin, eqbeg, pred); + begin = eqend; + } + } + + // insertion sort small chunk + if (begin != end) insertion_sort(begin, end, pred, &*begin); + } +PUGI__NS_END + +// Allocator used for AST and evaluation stacks +PUGI__NS_BEGIN + struct xpath_memory_block + { + xpath_memory_block* next; + + char data[ + #ifdef PUGIXML_MEMORY_XPATH_PAGE_SIZE + PUGIXML_MEMORY_XPATH_PAGE_SIZE + #else + 4096 + #endif + ]; + }; + + class xpath_allocator + { + xpath_memory_block* _root; + size_t _root_size; + + public: + #ifdef PUGIXML_NO_EXCEPTIONS + jmp_buf* error_handler; + #endif + + xpath_allocator(xpath_memory_block* root, size_t root_size = 0): _root(root), _root_size(root_size) + { + #ifdef PUGIXML_NO_EXCEPTIONS + error_handler = 0; + #endif + } + + void* allocate_nothrow(size_t size) + { + const size_t block_capacity = sizeof(_root->data); + + // align size so that we're able to store pointers in subsequent blocks + size = (size + sizeof(void*) - 1) & ~(sizeof(void*) - 1); + + if (_root_size + size <= block_capacity) + { + void* buf = _root->data + _root_size; + _root_size += size; + return buf; + } + else + { + size_t block_data_size = (size > block_capacity) ? size : block_capacity; + size_t block_size = block_data_size + offsetof(xpath_memory_block, data); + + xpath_memory_block* block = static_cast(xml_memory::allocate(block_size)); + if (!block) return 0; + + block->next = _root; + + _root = block; + _root_size = size; + + return block->data; + } + } + + void* allocate(size_t size) + { + void* result = allocate_nothrow(size); + + if (!result) + { + #ifdef PUGIXML_NO_EXCEPTIONS + assert(error_handler); + longjmp(*error_handler, 1); + #else + throw std::bad_alloc(); + #endif + } + + return result; + } + + void* reallocate(void* ptr, size_t old_size, size_t new_size) + { + // align size so that we're able to store pointers in subsequent blocks + old_size = (old_size + sizeof(void*) - 1) & ~(sizeof(void*) - 1); + new_size = (new_size + sizeof(void*) - 1) & ~(sizeof(void*) - 1); + + // we can only reallocate the last object + assert(ptr == 0 || static_cast(ptr) + old_size == _root->data + _root_size); + + // adjust root size so that we have not allocated the object at all + bool only_object = (_root_size == old_size); + + if (ptr) _root_size -= old_size; + + // allocate a new version (this will obviously reuse the memory if possible) + void* result = allocate(new_size); + assert(result); + + // we have a new block + if (result != ptr && ptr) + { + // copy old data + assert(new_size >= old_size); + memcpy(result, ptr, old_size); + + // free the previous page if it had no other objects + if (only_object) + { + assert(_root->data == result); + assert(_root->next); + + xpath_memory_block* next = _root->next->next; + + if (next) + { + // deallocate the whole page, unless it was the first one + xml_memory::deallocate(_root->next); + _root->next = next; + } + } + } + + return result; + } + + void revert(const xpath_allocator& state) + { + // free all new pages + xpath_memory_block* cur = _root; + + while (cur != state._root) + { + xpath_memory_block* next = cur->next; + + xml_memory::deallocate(cur); + + cur = next; + } + + // restore state + _root = state._root; + _root_size = state._root_size; + } + + void release() + { + xpath_memory_block* cur = _root; + assert(cur); + + while (cur->next) + { + xpath_memory_block* next = cur->next; + + xml_memory::deallocate(cur); + + cur = next; + } + } + }; + + struct xpath_allocator_capture + { + xpath_allocator_capture(xpath_allocator* alloc): _target(alloc), _state(*alloc) + { + } + + ~xpath_allocator_capture() + { + _target->revert(_state); + } + + xpath_allocator* _target; + xpath_allocator _state; + }; + + struct xpath_stack + { + xpath_allocator* result; + xpath_allocator* temp; + }; + + struct xpath_stack_data + { + xpath_memory_block blocks[2]; + xpath_allocator result; + xpath_allocator temp; + xpath_stack stack; + + #ifdef PUGIXML_NO_EXCEPTIONS + jmp_buf error_handler; + #endif + + xpath_stack_data(): result(blocks + 0), temp(blocks + 1) + { + blocks[0].next = blocks[1].next = 0; + + stack.result = &result; + stack.temp = &temp; + + #ifdef PUGIXML_NO_EXCEPTIONS + result.error_handler = temp.error_handler = &error_handler; + #endif + } + + ~xpath_stack_data() + { + result.release(); + temp.release(); + } + }; +PUGI__NS_END + +// String class +PUGI__NS_BEGIN + class xpath_string + { + const char_t* _buffer; + bool _uses_heap; + + static char_t* duplicate_string(const char_t* string, size_t length, xpath_allocator* alloc) + { + char_t* result = static_cast(alloc->allocate((length + 1) * sizeof(char_t))); + assert(result); + + memcpy(result, string, length * sizeof(char_t)); + result[length] = 0; + + return result; + } + + static char_t* duplicate_string(const char_t* string, xpath_allocator* alloc) + { + return duplicate_string(string, strlength(string), alloc); + } + + public: + xpath_string(): _buffer(PUGIXML_TEXT("")), _uses_heap(false) + { + } + + explicit xpath_string(const char_t* str, xpath_allocator* alloc) + { + bool empty_ = (*str == 0); + + _buffer = empty_ ? PUGIXML_TEXT("") : duplicate_string(str, alloc); + _uses_heap = !empty_; + } + + explicit xpath_string(const char_t* str, bool use_heap): _buffer(str), _uses_heap(use_heap) + { + } + + xpath_string(const char_t* begin, const char_t* end, xpath_allocator* alloc) + { + assert(begin <= end); + + bool empty_ = (begin == end); + + _buffer = empty_ ? PUGIXML_TEXT("") : duplicate_string(begin, static_cast(end - begin), alloc); + _uses_heap = !empty_; + } + + void append(const xpath_string& o, xpath_allocator* alloc) + { + // skip empty sources + if (!*o._buffer) return; + + // fast append for constant empty target and constant source + if (!*_buffer && !_uses_heap && !o._uses_heap) + { + _buffer = o._buffer; + } + else + { + // need to make heap copy + size_t target_length = strlength(_buffer); + size_t source_length = strlength(o._buffer); + size_t result_length = target_length + source_length; + + // allocate new buffer + char_t* result = static_cast(alloc->reallocate(_uses_heap ? const_cast(_buffer) : 0, (target_length + 1) * sizeof(char_t), (result_length + 1) * sizeof(char_t))); + assert(result); + + // append first string to the new buffer in case there was no reallocation + if (!_uses_heap) memcpy(result, _buffer, target_length * sizeof(char_t)); + + // append second string to the new buffer + memcpy(result + target_length, o._buffer, source_length * sizeof(char_t)); + result[result_length] = 0; + + // finalize + _buffer = result; + _uses_heap = true; + } + } + + const char_t* c_str() const + { + return _buffer; + } + + size_t length() const + { + return strlength(_buffer); + } + + char_t* data(xpath_allocator* alloc) + { + // make private heap copy + if (!_uses_heap) + { + _buffer = duplicate_string(_buffer, alloc); + _uses_heap = true; + } + + return const_cast(_buffer); + } + + bool empty() const + { + return *_buffer == 0; + } + + bool operator==(const xpath_string& o) const + { + return strequal(_buffer, o._buffer); + } + + bool operator!=(const xpath_string& o) const + { + return !strequal(_buffer, o._buffer); + } + + bool uses_heap() const + { + return _uses_heap; + } + }; + + PUGI__FN xpath_string xpath_string_const(const char_t* str) + { + return xpath_string(str, false); + } +PUGI__NS_END + +PUGI__NS_BEGIN + PUGI__FN bool starts_with(const char_t* string, const char_t* pattern) + { + while (*pattern && *string == *pattern) + { + string++; + pattern++; + } + + return *pattern == 0; + } + + PUGI__FN const char_t* find_char(const char_t* s, char_t c) + { + #ifdef PUGIXML_WCHAR_MODE + return wcschr(s, c); + #else + return strchr(s, c); + #endif + } + + PUGI__FN const char_t* find_substring(const char_t* s, const char_t* p) + { + #ifdef PUGIXML_WCHAR_MODE + // MSVC6 wcsstr bug workaround (if s is empty it always returns 0) + return (*p == 0) ? s : wcsstr(s, p); + #else + return strstr(s, p); + #endif + } + + // Converts symbol to lower case, if it is an ASCII one + PUGI__FN char_t tolower_ascii(char_t ch) + { + return static_cast(ch - 'A') < 26 ? static_cast(ch | ' ') : ch; + } + + PUGI__FN xpath_string string_value(const xpath_node& na, xpath_allocator* alloc) + { + if (na.attribute()) + return xpath_string_const(na.attribute().value()); + else + { + const xml_node& n = na.node(); + + switch (n.type()) + { + case node_pcdata: + case node_cdata: + case node_comment: + case node_pi: + return xpath_string_const(n.value()); + + case node_document: + case node_element: + { + xpath_string result; + + xml_node cur = n.first_child(); + + while (cur && cur != n) + { + if (cur.type() == node_pcdata || cur.type() == node_cdata) + result.append(xpath_string_const(cur.value()), alloc); + + if (cur.first_child()) + cur = cur.first_child(); + else if (cur.next_sibling()) + cur = cur.next_sibling(); + else + { + while (!cur.next_sibling() && cur != n) + cur = cur.parent(); + + if (cur != n) cur = cur.next_sibling(); + } + } + + return result; + } + + default: + return xpath_string(); + } + } + } + + PUGI__FN unsigned int node_height(xml_node n) + { + unsigned int result = 0; + + while (n) + { + ++result; + n = n.parent(); + } + + return result; + } + + PUGI__FN bool node_is_before(xml_node ln, unsigned int lh, xml_node rn, unsigned int rh) + { + // normalize heights + for (unsigned int i = rh; i < lh; i++) ln = ln.parent(); + for (unsigned int j = lh; j < rh; j++) rn = rn.parent(); + + // one node is the ancestor of the other + if (ln == rn) return lh < rh; + + // find common ancestor + while (ln.parent() != rn.parent()) + { + ln = ln.parent(); + rn = rn.parent(); + } + + // there is no common ancestor (the shared parent is null), nodes are from different documents + if (!ln.parent()) return ln < rn; + + // determine sibling order + for (; ln; ln = ln.next_sibling()) + if (ln == rn) + return true; + + return false; + } + + PUGI__FN bool node_is_ancestor(xml_node parent, xml_node node) + { + while (node && node != parent) node = node.parent(); + + return parent && node == parent; + } + + PUGI__FN const void* document_order(const xpath_node& xnode) + { + xml_node_struct* node = xnode.node().internal_object(); + + if (node) + { + if (node->name && (node->header & xml_memory_page_name_allocated_mask) == 0) return node->name; + if (node->value && (node->header & xml_memory_page_value_allocated_mask) == 0) return node->value; + return 0; + } + + xml_attribute_struct* attr = xnode.attribute().internal_object(); + + if (attr) + { + if ((attr->header & xml_memory_page_name_allocated_mask) == 0) return attr->name; + if ((attr->header & xml_memory_page_value_allocated_mask) == 0) return attr->value; + return 0; + } + + return 0; + } + + struct document_order_comparator + { + bool operator()(const xpath_node& lhs, const xpath_node& rhs) const + { + // optimized document order based check + const void* lo = document_order(lhs); + const void* ro = document_order(rhs); + + if (lo && ro) return lo < ro; + + // slow comparison + xml_node ln = lhs.node(), rn = rhs.node(); + + // compare attributes + if (lhs.attribute() && rhs.attribute()) + { + // shared parent + if (lhs.parent() == rhs.parent()) + { + // determine sibling order + for (xml_attribute a = lhs.attribute(); a; a = a.next_attribute()) + if (a == rhs.attribute()) + return true; + + return false; + } + + // compare attribute parents + ln = lhs.parent(); + rn = rhs.parent(); + } + else if (lhs.attribute()) + { + // attributes go after the parent element + if (lhs.parent() == rhs.node()) return false; + + ln = lhs.parent(); + } + else if (rhs.attribute()) + { + // attributes go after the parent element + if (rhs.parent() == lhs.node()) return true; + + rn = rhs.parent(); + } + + if (ln == rn) return false; + + unsigned int lh = node_height(ln); + unsigned int rh = node_height(rn); + + return node_is_before(ln, lh, rn, rh); + } + }; + + struct duplicate_comparator + { + bool operator()(const xpath_node& lhs, const xpath_node& rhs) const + { + if (lhs.attribute()) return rhs.attribute() ? lhs.attribute() < rhs.attribute() : true; + else return rhs.attribute() ? false : lhs.node() < rhs.node(); + } + }; + + PUGI__FN double gen_nan() + { + #if defined(__STDC_IEC_559__) || ((FLT_RADIX - 0 == 2) && (FLT_MAX_EXP - 0 == 128) && (FLT_MANT_DIG - 0 == 24)) + union { float f; uint32_t i; } u[sizeof(float) == sizeof(uint32_t) ? 1 : -1]; + u[0].i = 0x7fc00000; + return u[0].f; + #else + // fallback + const volatile double zero = 0.0; + return zero / zero; + #endif + } + + PUGI__FN bool is_nan(double value) + { + #if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) + return !!_isnan(value); + #elif defined(fpclassify) && defined(FP_NAN) + return fpclassify(value) == FP_NAN; + #else + // fallback + const volatile double v = value; + return v != v; + #endif + } + + PUGI__FN const char_t* convert_number_to_string_special(double value) + { + #if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) + if (_finite(value)) return (value == 0) ? PUGIXML_TEXT("0") : 0; + if (_isnan(value)) return PUGIXML_TEXT("NaN"); + return value > 0 ? PUGIXML_TEXT("Infinity") : PUGIXML_TEXT("-Infinity"); + #elif defined(fpclassify) && defined(FP_NAN) && defined(FP_INFINITE) && defined(FP_ZERO) + switch (fpclassify(value)) + { + case FP_NAN: + return PUGIXML_TEXT("NaN"); + + case FP_INFINITE: + return value > 0 ? PUGIXML_TEXT("Infinity") : PUGIXML_TEXT("-Infinity"); + + case FP_ZERO: + return PUGIXML_TEXT("0"); + + default: + return 0; + } + #else + // fallback + const volatile double v = value; + + if (v == 0) return PUGIXML_TEXT("0"); + if (v != v) return PUGIXML_TEXT("NaN"); + if (v * 2 == v) return value > 0 ? PUGIXML_TEXT("Infinity") : PUGIXML_TEXT("-Infinity"); + return 0; + #endif + } + + PUGI__FN bool convert_number_to_boolean(double value) + { + return (value != 0 && !is_nan(value)); + } + + PUGI__FN void truncate_zeros(char* begin, char* end) + { + while (begin != end && end[-1] == '0') end--; + + *end = 0; + } + + // gets mantissa digits in the form of 0.xxxxx with 0. implied and the exponent +#if defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400 && !defined(_WIN32_WCE) + PUGI__FN void convert_number_to_mantissa_exponent(double value, char* buffer, size_t buffer_size, char** out_mantissa, int* out_exponent) + { + // get base values + int sign, exponent; + _ecvt_s(buffer, buffer_size, value, DBL_DIG + 1, &exponent, &sign); + + // truncate redundant zeros + truncate_zeros(buffer, buffer + strlen(buffer)); + + // fill results + *out_mantissa = buffer; + *out_exponent = exponent; + } +#else + PUGI__FN void convert_number_to_mantissa_exponent(double value, char* buffer, size_t buffer_size, char** out_mantissa, int* out_exponent) + { + // get a scientific notation value with IEEE DBL_DIG decimals + sprintf(buffer, "%.*e", DBL_DIG, value); + assert(strlen(buffer) < buffer_size); + (void)!buffer_size; + + // get the exponent (possibly negative) + char* exponent_string = strchr(buffer, 'e'); + assert(exponent_string); + + int exponent = atoi(exponent_string + 1); + + // extract mantissa string: skip sign + char* mantissa = buffer[0] == '-' ? buffer + 1 : buffer; + assert(mantissa[0] != '0' && mantissa[1] == '.'); + + // divide mantissa by 10 to eliminate integer part + mantissa[1] = mantissa[0]; + mantissa++; + exponent++; + + // remove extra mantissa digits and zero-terminate mantissa + truncate_zeros(mantissa, exponent_string); + + // fill results + *out_mantissa = mantissa; + *out_exponent = exponent; + } +#endif + + PUGI__FN xpath_string convert_number_to_string(double value, xpath_allocator* alloc) + { + // try special number conversion + const char_t* special = convert_number_to_string_special(value); + if (special) return xpath_string_const(special); + + // get mantissa + exponent form + char mantissa_buffer[32]; + + char* mantissa; + int exponent; + convert_number_to_mantissa_exponent(value, mantissa_buffer, sizeof(mantissa_buffer), &mantissa, &exponent); + + // allocate a buffer of suitable length for the number + size_t result_size = strlen(mantissa_buffer) + (exponent > 0 ? exponent : -exponent) + 4; + char_t* result = static_cast(alloc->allocate(sizeof(char_t) * result_size)); + assert(result); + + // make the number! + char_t* s = result; + + // sign + if (value < 0) *s++ = '-'; + + // integer part + if (exponent <= 0) + { + *s++ = '0'; + } + else + { + while (exponent > 0) + { + assert(*mantissa == 0 || static_cast(static_cast(*mantissa) - '0') <= 9); + *s++ = *mantissa ? *mantissa++ : '0'; + exponent--; + } + } + + // fractional part + if (*mantissa) + { + // decimal point + *s++ = '.'; + + // extra zeroes from negative exponent + while (exponent < 0) + { + *s++ = '0'; + exponent++; + } + + // extra mantissa digits + while (*mantissa) + { + assert(static_cast(*mantissa - '0') <= 9); + *s++ = *mantissa++; + } + } + + // zero-terminate + assert(s < result + result_size); + *s = 0; + + return xpath_string(result, true); + } + + PUGI__FN bool check_string_to_number_format(const char_t* string) + { + // parse leading whitespace + while (PUGI__IS_CHARTYPE(*string, ct_space)) ++string; + + // parse sign + if (*string == '-') ++string; + + if (!*string) return false; + + // if there is no integer part, there should be a decimal part with at least one digit + if (!PUGI__IS_CHARTYPEX(string[0], ctx_digit) && (string[0] != '.' || !PUGI__IS_CHARTYPEX(string[1], ctx_digit))) return false; + + // parse integer part + while (PUGI__IS_CHARTYPEX(*string, ctx_digit)) ++string; + + // parse decimal part + if (*string == '.') + { + ++string; + + while (PUGI__IS_CHARTYPEX(*string, ctx_digit)) ++string; + } + + // parse trailing whitespace + while (PUGI__IS_CHARTYPE(*string, ct_space)) ++string; + + return *string == 0; + } + + PUGI__FN double convert_string_to_number(const char_t* string) + { + // check string format + if (!check_string_to_number_format(string)) return gen_nan(); + + // parse string + #ifdef PUGIXML_WCHAR_MODE + return wcstod(string, 0); + #else + return atof(string); + #endif + } + + PUGI__FN bool convert_string_to_number_scratch(char_t (&buffer)[32], const char_t* begin, const char_t* end, double* out_result) + { + size_t length = static_cast(end - begin); + char_t* scratch = buffer; + + if (length >= sizeof(buffer) / sizeof(buffer[0])) + { + // need to make dummy on-heap copy + scratch = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!scratch) return false; + } + + // copy string to zero-terminated buffer and perform conversion + memcpy(scratch, begin, length * sizeof(char_t)); + scratch[length] = 0; + + *out_result = convert_string_to_number(scratch); + + // free dummy buffer + if (scratch != buffer) xml_memory::deallocate(scratch); + + return true; + } + + PUGI__FN double round_nearest(double value) + { + return floor(value + 0.5); + } + + PUGI__FN double round_nearest_nzero(double value) + { + // same as round_nearest, but returns -0 for [-0.5, -0] + // ceil is used to differentiate between +0 and -0 (we return -0 for [-0.5, -0] and +0 for +0) + return (value >= -0.5 && value <= 0) ? ceil(value) : floor(value + 0.5); + } + + PUGI__FN const char_t* qualified_name(const xpath_node& node) + { + return node.attribute() ? node.attribute().name() : node.node().name(); + } + + PUGI__FN const char_t* local_name(const xpath_node& node) + { + const char_t* name = qualified_name(node); + const char_t* p = find_char(name, ':'); + + return p ? p + 1 : name; + } + + struct namespace_uri_predicate + { + const char_t* prefix; + size_t prefix_length; + + namespace_uri_predicate(const char_t* name) + { + const char_t* pos = find_char(name, ':'); + + prefix = pos ? name : 0; + prefix_length = pos ? static_cast(pos - name) : 0; + } + + bool operator()(const xml_attribute& a) const + { + const char_t* name = a.name(); + + if (!starts_with(name, PUGIXML_TEXT("xmlns"))) return false; + + return prefix ? name[5] == ':' && strequalrange(name + 6, prefix, prefix_length) : name[5] == 0; + } + }; + + PUGI__FN const char_t* namespace_uri(const xml_node& node) + { + namespace_uri_predicate pred = node.name(); + + xml_node p = node; + + while (p) + { + xml_attribute a = p.find_attribute(pred); + + if (a) return a.value(); + + p = p.parent(); + } + + return PUGIXML_TEXT(""); + } + + PUGI__FN const char_t* namespace_uri(const xml_attribute& attr, const xml_node& parent) + { + namespace_uri_predicate pred = attr.name(); + + // Default namespace does not apply to attributes + if (!pred.prefix) return PUGIXML_TEXT(""); + + xml_node p = parent; + + while (p) + { + xml_attribute a = p.find_attribute(pred); + + if (a) return a.value(); + + p = p.parent(); + } + + return PUGIXML_TEXT(""); + } + + PUGI__FN const char_t* namespace_uri(const xpath_node& node) + { + return node.attribute() ? namespace_uri(node.attribute(), node.parent()) : namespace_uri(node.node()); + } + + PUGI__FN void normalize_space(char_t* buffer) + { + char_t* write = buffer; + + for (char_t* it = buffer; *it; ) + { + char_t ch = *it++; + + if (PUGI__IS_CHARTYPE(ch, ct_space)) + { + // replace whitespace sequence with single space + while (PUGI__IS_CHARTYPE(*it, ct_space)) it++; + + // avoid leading spaces + if (write != buffer) *write++ = ' '; + } + else *write++ = ch; + } + + // remove trailing space + if (write != buffer && PUGI__IS_CHARTYPE(write[-1], ct_space)) write--; + + // zero-terminate + *write = 0; + } + + PUGI__FN void translate(char_t* buffer, const char_t* from, const char_t* to) + { + size_t to_length = strlength(to); + + char_t* write = buffer; + + while (*buffer) + { + PUGI__DMC_VOLATILE char_t ch = *buffer++; + + const char_t* pos = find_char(from, ch); + + if (!pos) + *write++ = ch; // do not process + else if (static_cast(pos - from) < to_length) + *write++ = to[pos - from]; // replace + } + + // zero-terminate + *write = 0; + } + + struct xpath_variable_boolean: xpath_variable + { + xpath_variable_boolean(): value(false) + { + } + + bool value; + char_t name[1]; + }; + + struct xpath_variable_number: xpath_variable + { + xpath_variable_number(): value(0) + { + } + + double value; + char_t name[1]; + }; + + struct xpath_variable_string: xpath_variable + { + xpath_variable_string(): value(0) + { + } + + ~xpath_variable_string() + { + if (value) xml_memory::deallocate(value); + } + + char_t* value; + char_t name[1]; + }; + + struct xpath_variable_node_set: xpath_variable + { + xpath_node_set value; + char_t name[1]; + }; + + static const xpath_node_set dummy_node_set; + + PUGI__FN unsigned int hash_string(const char_t* str) + { + // Jenkins one-at-a-time hash (http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time) + unsigned int result = 0; + + while (*str) + { + result += static_cast(*str++); + result += result << 10; + result ^= result >> 6; + } + + result += result << 3; + result ^= result >> 11; + result += result << 15; + + return result; + } + + template PUGI__FN T* new_xpath_variable(const char_t* name) + { + size_t length = strlength(name); + if (length == 0) return 0; // empty variable names are invalid + + // $$ we can't use offsetof(T, name) because T is non-POD, so we just allocate additional length characters + void* memory = xml_memory::allocate(sizeof(T) + length * sizeof(char_t)); + if (!memory) return 0; + + T* result = new (memory) T(); + + memcpy(result->name, name, (length + 1) * sizeof(char_t)); + + return result; + } + + PUGI__FN xpath_variable* new_xpath_variable(xpath_value_type type, const char_t* name) + { + switch (type) + { + case xpath_type_node_set: + return new_xpath_variable(name); + + case xpath_type_number: + return new_xpath_variable(name); + + case xpath_type_string: + return new_xpath_variable(name); + + case xpath_type_boolean: + return new_xpath_variable(name); + + default: + return 0; + } + } + + template PUGI__FN void delete_xpath_variable(T* var) + { + var->~T(); + xml_memory::deallocate(var); + } + + PUGI__FN void delete_xpath_variable(xpath_value_type type, xpath_variable* var) + { + switch (type) + { + case xpath_type_node_set: + delete_xpath_variable(static_cast(var)); + break; + + case xpath_type_number: + delete_xpath_variable(static_cast(var)); + break; + + case xpath_type_string: + delete_xpath_variable(static_cast(var)); + break; + + case xpath_type_boolean: + delete_xpath_variable(static_cast(var)); + break; + + default: + assert(!"Invalid variable type"); + } + } + + PUGI__FN xpath_variable* get_variable_scratch(char_t (&buffer)[32], xpath_variable_set* set, const char_t* begin, const char_t* end) + { + size_t length = static_cast(end - begin); + char_t* scratch = buffer; + + if (length >= sizeof(buffer) / sizeof(buffer[0])) + { + // need to make dummy on-heap copy + scratch = static_cast(xml_memory::allocate((length + 1) * sizeof(char_t))); + if (!scratch) return 0; + } + + // copy string to zero-terminated buffer and perform lookup + memcpy(scratch, begin, length * sizeof(char_t)); + scratch[length] = 0; + + xpath_variable* result = set->get(scratch); + + // free dummy buffer + if (scratch != buffer) xml_memory::deallocate(scratch); + + return result; + } +PUGI__NS_END + +// Internal node set class +PUGI__NS_BEGIN + PUGI__FN xpath_node_set::type_t xpath_sort(xpath_node* begin, xpath_node* end, xpath_node_set::type_t type, bool rev) + { + xpath_node_set::type_t order = rev ? xpath_node_set::type_sorted_reverse : xpath_node_set::type_sorted; + + if (type == xpath_node_set::type_unsorted) + { + sort(begin, end, document_order_comparator()); + + type = xpath_node_set::type_sorted; + } + + if (type != order) reverse(begin, end); + + return order; + } + + PUGI__FN xpath_node xpath_first(const xpath_node* begin, const xpath_node* end, xpath_node_set::type_t type) + { + if (begin == end) return xpath_node(); + + switch (type) + { + case xpath_node_set::type_sorted: + return *begin; + + case xpath_node_set::type_sorted_reverse: + return *(end - 1); + + case xpath_node_set::type_unsorted: + return *min_element(begin, end, document_order_comparator()); + + default: + assert(!"Invalid node set type"); + return xpath_node(); + } + } + + class xpath_node_set_raw + { + xpath_node_set::type_t _type; + + xpath_node* _begin; + xpath_node* _end; + xpath_node* _eos; + + public: + xpath_node_set_raw(): _type(xpath_node_set::type_unsorted), _begin(0), _end(0), _eos(0) + { + } + + xpath_node* begin() const + { + return _begin; + } + + xpath_node* end() const + { + return _end; + } + + bool empty() const + { + return _begin == _end; + } + + size_t size() const + { + return static_cast(_end - _begin); + } + + xpath_node first() const + { + return xpath_first(_begin, _end, _type); + } + + void push_back(const xpath_node& node, xpath_allocator* alloc) + { + if (_end == _eos) + { + size_t capacity = static_cast(_eos - _begin); + + // get new capacity (1.5x rule) + size_t new_capacity = capacity + capacity / 2 + 1; + + // reallocate the old array or allocate a new one + xpath_node* data = static_cast(alloc->reallocate(_begin, capacity * sizeof(xpath_node), new_capacity * sizeof(xpath_node))); + assert(data); + + // finalize + _begin = data; + _end = data + capacity; + _eos = data + new_capacity; + } + + *_end++ = node; + } + + void append(const xpath_node* begin_, const xpath_node* end_, xpath_allocator* alloc) + { + size_t size_ = static_cast(_end - _begin); + size_t capacity = static_cast(_eos - _begin); + size_t count = static_cast(end_ - begin_); + + if (size_ + count > capacity) + { + // reallocate the old array or allocate a new one + xpath_node* data = static_cast(alloc->reallocate(_begin, capacity * sizeof(xpath_node), (size_ + count) * sizeof(xpath_node))); + assert(data); + + // finalize + _begin = data; + _end = data + size_; + _eos = data + size_ + count; + } + + memcpy(_end, begin_, count * sizeof(xpath_node)); + _end += count; + } + + void sort_do() + { + _type = xpath_sort(_begin, _end, _type, false); + } + + void truncate(xpath_node* pos) + { + assert(_begin <= pos && pos <= _end); + + _end = pos; + } + + void remove_duplicates() + { + if (_type == xpath_node_set::type_unsorted) + sort(_begin, _end, duplicate_comparator()); + + _end = unique(_begin, _end); + } + + xpath_node_set::type_t type() const + { + return _type; + } + + void set_type(xpath_node_set::type_t value) + { + _type = value; + } + }; +PUGI__NS_END + +PUGI__NS_BEGIN + struct xpath_context + { + xpath_node n; + size_t position, size; + + xpath_context(const xpath_node& n_, size_t position_, size_t size_): n(n_), position(position_), size(size_) + { + } + }; + + enum lexeme_t + { + lex_none = 0, + lex_equal, + lex_not_equal, + lex_less, + lex_greater, + lex_less_or_equal, + lex_greater_or_equal, + lex_plus, + lex_minus, + lex_multiply, + lex_union, + lex_var_ref, + lex_open_brace, + lex_close_brace, + lex_quoted_string, + lex_number, + lex_slash, + lex_double_slash, + lex_open_square_brace, + lex_close_square_brace, + lex_string, + lex_comma, + lex_axis_attribute, + lex_dot, + lex_double_dot, + lex_double_colon, + lex_eof + }; + + struct xpath_lexer_string + { + const char_t* begin; + const char_t* end; + + xpath_lexer_string(): begin(0), end(0) + { + } + + bool operator==(const char_t* other) const + { + size_t length = static_cast(end - begin); + + return strequalrange(other, begin, length); + } + }; + + class xpath_lexer + { + const char_t* _cur; + const char_t* _cur_lexeme_pos; + xpath_lexer_string _cur_lexeme_contents; + + lexeme_t _cur_lexeme; + + public: + explicit xpath_lexer(const char_t* query): _cur(query) + { + next(); + } + + const char_t* state() const + { + return _cur; + } + + void next() + { + const char_t* cur = _cur; + + while (PUGI__IS_CHARTYPE(*cur, ct_space)) ++cur; + + // save lexeme position for error reporting + _cur_lexeme_pos = cur; + + switch (*cur) + { + case 0: + _cur_lexeme = lex_eof; + break; + + case '>': + if (*(cur+1) == '=') + { + cur += 2; + _cur_lexeme = lex_greater_or_equal; + } + else + { + cur += 1; + _cur_lexeme = lex_greater; + } + break; + + case '<': + if (*(cur+1) == '=') + { + cur += 2; + _cur_lexeme = lex_less_or_equal; + } + else + { + cur += 1; + _cur_lexeme = lex_less; + } + break; + + case '!': + if (*(cur+1) == '=') + { + cur += 2; + _cur_lexeme = lex_not_equal; + } + else + { + _cur_lexeme = lex_none; + } + break; + + case '=': + cur += 1; + _cur_lexeme = lex_equal; + + break; + + case '+': + cur += 1; + _cur_lexeme = lex_plus; + + break; + + case '-': + cur += 1; + _cur_lexeme = lex_minus; + + break; + + case '*': + cur += 1; + _cur_lexeme = lex_multiply; + + break; + + case '|': + cur += 1; + _cur_lexeme = lex_union; + + break; + + case '$': + cur += 1; + + if (PUGI__IS_CHARTYPEX(*cur, ctx_start_symbol)) + { + _cur_lexeme_contents.begin = cur; + + while (PUGI__IS_CHARTYPEX(*cur, ctx_symbol)) cur++; + + if (cur[0] == ':' && PUGI__IS_CHARTYPEX(cur[1], ctx_symbol)) // qname + { + cur++; // : + + while (PUGI__IS_CHARTYPEX(*cur, ctx_symbol)) cur++; + } + + _cur_lexeme_contents.end = cur; + + _cur_lexeme = lex_var_ref; + } + else + { + _cur_lexeme = lex_none; + } + + break; + + case '(': + cur += 1; + _cur_lexeme = lex_open_brace; + + break; + + case ')': + cur += 1; + _cur_lexeme = lex_close_brace; + + break; + + case '[': + cur += 1; + _cur_lexeme = lex_open_square_brace; + + break; + + case ']': + cur += 1; + _cur_lexeme = lex_close_square_brace; + + break; + + case ',': + cur += 1; + _cur_lexeme = lex_comma; + + break; + + case '/': + if (*(cur+1) == '/') + { + cur += 2; + _cur_lexeme = lex_double_slash; + } + else + { + cur += 1; + _cur_lexeme = lex_slash; + } + break; + + case '.': + if (*(cur+1) == '.') + { + cur += 2; + _cur_lexeme = lex_double_dot; + } + else if (PUGI__IS_CHARTYPEX(*(cur+1), ctx_digit)) + { + _cur_lexeme_contents.begin = cur; // . + + ++cur; + + while (PUGI__IS_CHARTYPEX(*cur, ctx_digit)) cur++; + + _cur_lexeme_contents.end = cur; + + _cur_lexeme = lex_number; + } + else + { + cur += 1; + _cur_lexeme = lex_dot; + } + break; + + case '@': + cur += 1; + _cur_lexeme = lex_axis_attribute; + + break; + + case '"': + case '\'': + { + char_t terminator = *cur; + + ++cur; + + _cur_lexeme_contents.begin = cur; + while (*cur && *cur != terminator) cur++; + _cur_lexeme_contents.end = cur; + + if (!*cur) + _cur_lexeme = lex_none; + else + { + cur += 1; + _cur_lexeme = lex_quoted_string; + } + + break; + } + + case ':': + if (*(cur+1) == ':') + { + cur += 2; + _cur_lexeme = lex_double_colon; + } + else + { + _cur_lexeme = lex_none; + } + break; + + default: + if (PUGI__IS_CHARTYPEX(*cur, ctx_digit)) + { + _cur_lexeme_contents.begin = cur; + + while (PUGI__IS_CHARTYPEX(*cur, ctx_digit)) cur++; + + if (*cur == '.') + { + cur++; + + while (PUGI__IS_CHARTYPEX(*cur, ctx_digit)) cur++; + } + + _cur_lexeme_contents.end = cur; + + _cur_lexeme = lex_number; + } + else if (PUGI__IS_CHARTYPEX(*cur, ctx_start_symbol)) + { + _cur_lexeme_contents.begin = cur; + + while (PUGI__IS_CHARTYPEX(*cur, ctx_symbol)) cur++; + + if (cur[0] == ':') + { + if (cur[1] == '*') // namespace test ncname:* + { + cur += 2; // :* + } + else if (PUGI__IS_CHARTYPEX(cur[1], ctx_symbol)) // namespace test qname + { + cur++; // : + + while (PUGI__IS_CHARTYPEX(*cur, ctx_symbol)) cur++; + } + } + + _cur_lexeme_contents.end = cur; + + _cur_lexeme = lex_string; + } + else + { + _cur_lexeme = lex_none; + } + } + + _cur = cur; + } + + lexeme_t current() const + { + return _cur_lexeme; + } + + const char_t* current_pos() const + { + return _cur_lexeme_pos; + } + + const xpath_lexer_string& contents() const + { + assert(_cur_lexeme == lex_var_ref || _cur_lexeme == lex_number || _cur_lexeme == lex_string || _cur_lexeme == lex_quoted_string); + + return _cur_lexeme_contents; + } + }; + + enum ast_type_t + { + ast_unknown, + ast_op_or, // left or right + ast_op_and, // left and right + ast_op_equal, // left = right + ast_op_not_equal, // left != right + ast_op_less, // left < right + ast_op_greater, // left > right + ast_op_less_or_equal, // left <= right + ast_op_greater_or_equal, // left >= right + ast_op_add, // left + right + ast_op_subtract, // left - right + ast_op_multiply, // left * right + ast_op_divide, // left / right + ast_op_mod, // left % right + ast_op_negate, // left - right + ast_op_union, // left | right + ast_predicate, // apply predicate to set; next points to next predicate + ast_filter, // select * from left where right + ast_filter_posinv, // select * from left where right; proximity position invariant + ast_string_constant, // string constant + ast_number_constant, // number constant + ast_variable, // variable + ast_func_last, // last() + ast_func_position, // position() + ast_func_count, // count(left) + ast_func_id, // id(left) + ast_func_local_name_0, // local-name() + ast_func_local_name_1, // local-name(left) + ast_func_namespace_uri_0, // namespace-uri() + ast_func_namespace_uri_1, // namespace-uri(left) + ast_func_name_0, // name() + ast_func_name_1, // name(left) + ast_func_string_0, // string() + ast_func_string_1, // string(left) + ast_func_concat, // concat(left, right, siblings) + ast_func_starts_with, // starts_with(left, right) + ast_func_contains, // contains(left, right) + ast_func_substring_before, // substring-before(left, right) + ast_func_substring_after, // substring-after(left, right) + ast_func_substring_2, // substring(left, right) + ast_func_substring_3, // substring(left, right, third) + ast_func_string_length_0, // string-length() + ast_func_string_length_1, // string-length(left) + ast_func_normalize_space_0, // normalize-space() + ast_func_normalize_space_1, // normalize-space(left) + ast_func_translate, // translate(left, right, third) + ast_func_boolean, // boolean(left) + ast_func_not, // not(left) + ast_func_true, // true() + ast_func_false, // false() + ast_func_lang, // lang(left) + ast_func_number_0, // number() + ast_func_number_1, // number(left) + ast_func_sum, // sum(left) + ast_func_floor, // floor(left) + ast_func_ceiling, // ceiling(left) + ast_func_round, // round(left) + ast_step, // process set left with step + ast_step_root // select root node + }; + + enum axis_t + { + axis_ancestor, + axis_ancestor_or_self, + axis_attribute, + axis_child, + axis_descendant, + axis_descendant_or_self, + axis_following, + axis_following_sibling, + axis_namespace, + axis_parent, + axis_preceding, + axis_preceding_sibling, + axis_self + }; + + enum nodetest_t + { + nodetest_none, + nodetest_name, + nodetest_type_node, + nodetest_type_comment, + nodetest_type_pi, + nodetest_type_text, + nodetest_pi, + nodetest_all, + nodetest_all_in_namespace + }; + + template struct axis_to_type + { + static const axis_t axis; + }; + + template const axis_t axis_to_type::axis = N; + + class xpath_ast_node + { + private: + // node type + char _type; + char _rettype; + + // for ast_step / ast_predicate + char _axis; + char _test; + + // tree node structure + xpath_ast_node* _left; + xpath_ast_node* _right; + xpath_ast_node* _next; + + union + { + // value for ast_string_constant + const char_t* string; + // value for ast_number_constant + double number; + // variable for ast_variable + xpath_variable* variable; + // node test for ast_step (node name/namespace/node type/pi target) + const char_t* nodetest; + } _data; + + xpath_ast_node(const xpath_ast_node&); + xpath_ast_node& operator=(const xpath_ast_node&); + + template static bool compare_eq(xpath_ast_node* lhs, xpath_ast_node* rhs, const xpath_context& c, const xpath_stack& stack, const Comp& comp) + { + xpath_value_type lt = lhs->rettype(), rt = rhs->rettype(); + + if (lt != xpath_type_node_set && rt != xpath_type_node_set) + { + if (lt == xpath_type_boolean || rt == xpath_type_boolean) + return comp(lhs->eval_boolean(c, stack), rhs->eval_boolean(c, stack)); + else if (lt == xpath_type_number || rt == xpath_type_number) + return comp(lhs->eval_number(c, stack), rhs->eval_number(c, stack)); + else if (lt == xpath_type_string || rt == xpath_type_string) + { + xpath_allocator_capture cr(stack.result); + + xpath_string ls = lhs->eval_string(c, stack); + xpath_string rs = rhs->eval_string(c, stack); + + return comp(ls, rs); + } + } + else if (lt == xpath_type_node_set && rt == xpath_type_node_set) + { + xpath_allocator_capture cr(stack.result); + + xpath_node_set_raw ls = lhs->eval_node_set(c, stack); + xpath_node_set_raw rs = rhs->eval_node_set(c, stack); + + for (const xpath_node* li = ls.begin(); li != ls.end(); ++li) + for (const xpath_node* ri = rs.begin(); ri != rs.end(); ++ri) + { + xpath_allocator_capture cri(stack.result); + + if (comp(string_value(*li, stack.result), string_value(*ri, stack.result))) + return true; + } + + return false; + } + else + { + if (lt == xpath_type_node_set) + { + swap(lhs, rhs); + swap(lt, rt); + } + + if (lt == xpath_type_boolean) + return comp(lhs->eval_boolean(c, stack), rhs->eval_boolean(c, stack)); + else if (lt == xpath_type_number) + { + xpath_allocator_capture cr(stack.result); + + double l = lhs->eval_number(c, stack); + xpath_node_set_raw rs = rhs->eval_node_set(c, stack); + + for (const xpath_node* ri = rs.begin(); ri != rs.end(); ++ri) + { + xpath_allocator_capture cri(stack.result); + + if (comp(l, convert_string_to_number(string_value(*ri, stack.result).c_str()))) + return true; + } + + return false; + } + else if (lt == xpath_type_string) + { + xpath_allocator_capture cr(stack.result); + + xpath_string l = lhs->eval_string(c, stack); + xpath_node_set_raw rs = rhs->eval_node_set(c, stack); + + for (const xpath_node* ri = rs.begin(); ri != rs.end(); ++ri) + { + xpath_allocator_capture cri(stack.result); + + if (comp(l, string_value(*ri, stack.result))) + return true; + } + + return false; + } + } + + assert(!"Wrong types"); + return false; + } + + template static bool compare_rel(xpath_ast_node* lhs, xpath_ast_node* rhs, const xpath_context& c, const xpath_stack& stack, const Comp& comp) + { + xpath_value_type lt = lhs->rettype(), rt = rhs->rettype(); + + if (lt != xpath_type_node_set && rt != xpath_type_node_set) + return comp(lhs->eval_number(c, stack), rhs->eval_number(c, stack)); + else if (lt == xpath_type_node_set && rt == xpath_type_node_set) + { + xpath_allocator_capture cr(stack.result); + + xpath_node_set_raw ls = lhs->eval_node_set(c, stack); + xpath_node_set_raw rs = rhs->eval_node_set(c, stack); + + for (const xpath_node* li = ls.begin(); li != ls.end(); ++li) + { + xpath_allocator_capture cri(stack.result); + + double l = convert_string_to_number(string_value(*li, stack.result).c_str()); + + for (const xpath_node* ri = rs.begin(); ri != rs.end(); ++ri) + { + xpath_allocator_capture crii(stack.result); + + if (comp(l, convert_string_to_number(string_value(*ri, stack.result).c_str()))) + return true; + } + } + + return false; + } + else if (lt != xpath_type_node_set && rt == xpath_type_node_set) + { + xpath_allocator_capture cr(stack.result); + + double l = lhs->eval_number(c, stack); + xpath_node_set_raw rs = rhs->eval_node_set(c, stack); + + for (const xpath_node* ri = rs.begin(); ri != rs.end(); ++ri) + { + xpath_allocator_capture cri(stack.result); + + if (comp(l, convert_string_to_number(string_value(*ri, stack.result).c_str()))) + return true; + } + + return false; + } + else if (lt == xpath_type_node_set && rt != xpath_type_node_set) + { + xpath_allocator_capture cr(stack.result); + + xpath_node_set_raw ls = lhs->eval_node_set(c, stack); + double r = rhs->eval_number(c, stack); + + for (const xpath_node* li = ls.begin(); li != ls.end(); ++li) + { + xpath_allocator_capture cri(stack.result); + + if (comp(convert_string_to_number(string_value(*li, stack.result).c_str()), r)) + return true; + } + + return false; + } + else + { + assert(!"Wrong types"); + return false; + } + } + + void apply_predicate(xpath_node_set_raw& ns, size_t first, xpath_ast_node* expr, const xpath_stack& stack) + { + assert(ns.size() >= first); + + size_t i = 1; + size_t size = ns.size() - first; + + xpath_node* last = ns.begin() + first; + + // remove_if... or well, sort of + for (xpath_node* it = last; it != ns.end(); ++it, ++i) + { + xpath_context c(*it, i, size); + + if (expr->rettype() == xpath_type_number) + { + if (expr->eval_number(c, stack) == i) + *last++ = *it; + } + else if (expr->eval_boolean(c, stack)) + *last++ = *it; + } + + ns.truncate(last); + } + + void apply_predicates(xpath_node_set_raw& ns, size_t first, const xpath_stack& stack) + { + if (ns.size() == first) return; + + for (xpath_ast_node* pred = _right; pred; pred = pred->_next) + { + apply_predicate(ns, first, pred->_left, stack); + } + } + + void step_push(xpath_node_set_raw& ns, const xml_attribute& a, const xml_node& parent, xpath_allocator* alloc) + { + if (!a) return; + + const char_t* name = a.name(); + + // There are no attribute nodes corresponding to attributes that declare namespaces + // That is, "xmlns:..." or "xmlns" + if (starts_with(name, PUGIXML_TEXT("xmlns")) && (name[5] == 0 || name[5] == ':')) return; + + switch (_test) + { + case nodetest_name: + if (strequal(name, _data.nodetest)) ns.push_back(xpath_node(a, parent), alloc); + break; + + case nodetest_type_node: + case nodetest_all: + ns.push_back(xpath_node(a, parent), alloc); + break; + + case nodetest_all_in_namespace: + if (starts_with(name, _data.nodetest)) + ns.push_back(xpath_node(a, parent), alloc); + break; + + default: + ; + } + } + + void step_push(xpath_node_set_raw& ns, const xml_node& n, xpath_allocator* alloc) + { + if (!n) return; + + switch (_test) + { + case nodetest_name: + if (n.type() == node_element && strequal(n.name(), _data.nodetest)) ns.push_back(n, alloc); + break; + + case nodetest_type_node: + ns.push_back(n, alloc); + break; + + case nodetest_type_comment: + if (n.type() == node_comment) + ns.push_back(n, alloc); + break; + + case nodetest_type_text: + if (n.type() == node_pcdata || n.type() == node_cdata) + ns.push_back(n, alloc); + break; + + case nodetest_type_pi: + if (n.type() == node_pi) + ns.push_back(n, alloc); + break; + + case nodetest_pi: + if (n.type() == node_pi && strequal(n.name(), _data.nodetest)) + ns.push_back(n, alloc); + break; + + case nodetest_all: + if (n.type() == node_element) + ns.push_back(n, alloc); + break; + + case nodetest_all_in_namespace: + if (n.type() == node_element && starts_with(n.name(), _data.nodetest)) + ns.push_back(n, alloc); + break; + + default: + assert(!"Unknown axis"); + } + } + + template void step_fill(xpath_node_set_raw& ns, const xml_node& n, xpath_allocator* alloc, T) + { + const axis_t axis = T::axis; + + switch (axis) + { + case axis_attribute: + { + for (xml_attribute a = n.first_attribute(); a; a = a.next_attribute()) + step_push(ns, a, n, alloc); + + break; + } + + case axis_child: + { + for (xml_node c = n.first_child(); c; c = c.next_sibling()) + step_push(ns, c, alloc); + + break; + } + + case axis_descendant: + case axis_descendant_or_self: + { + if (axis == axis_descendant_or_self) + step_push(ns, n, alloc); + + xml_node cur = n.first_child(); + + while (cur && cur != n) + { + step_push(ns, cur, alloc); + + if (cur.first_child()) + cur = cur.first_child(); + else if (cur.next_sibling()) + cur = cur.next_sibling(); + else + { + while (!cur.next_sibling() && cur != n) + cur = cur.parent(); + + if (cur != n) cur = cur.next_sibling(); + } + } + + break; + } + + case axis_following_sibling: + { + for (xml_node c = n.next_sibling(); c; c = c.next_sibling()) + step_push(ns, c, alloc); + + break; + } + + case axis_preceding_sibling: + { + for (xml_node c = n.previous_sibling(); c; c = c.previous_sibling()) + step_push(ns, c, alloc); + + break; + } + + case axis_following: + { + xml_node cur = n; + + // exit from this node so that we don't include descendants + while (cur && !cur.next_sibling()) cur = cur.parent(); + cur = cur.next_sibling(); + + for (;;) + { + step_push(ns, cur, alloc); + + if (cur.first_child()) + cur = cur.first_child(); + else if (cur.next_sibling()) + cur = cur.next_sibling(); + else + { + while (cur && !cur.next_sibling()) cur = cur.parent(); + cur = cur.next_sibling(); + + if (!cur) break; + } + } + + break; + } + + case axis_preceding: + { + xml_node cur = n; + + while (cur && !cur.previous_sibling()) cur = cur.parent(); + cur = cur.previous_sibling(); + + for (;;) + { + if (cur.last_child()) + cur = cur.last_child(); + else + { + // leaf node, can't be ancestor + step_push(ns, cur, alloc); + + if (cur.previous_sibling()) + cur = cur.previous_sibling(); + else + { + do + { + cur = cur.parent(); + if (!cur) break; + + if (!node_is_ancestor(cur, n)) step_push(ns, cur, alloc); + } + while (!cur.previous_sibling()); + + cur = cur.previous_sibling(); + + if (!cur) break; + } + } + } + + break; + } + + case axis_ancestor: + case axis_ancestor_or_self: + { + if (axis == axis_ancestor_or_self) + step_push(ns, n, alloc); + + xml_node cur = n.parent(); + + while (cur) + { + step_push(ns, cur, alloc); + + cur = cur.parent(); + } + + break; + } + + case axis_self: + { + step_push(ns, n, alloc); + + break; + } + + case axis_parent: + { + if (n.parent()) step_push(ns, n.parent(), alloc); + + break; + } + + default: + assert(!"Unimplemented axis"); + } + } + + template void step_fill(xpath_node_set_raw& ns, const xml_attribute& a, const xml_node& p, xpath_allocator* alloc, T v) + { + const axis_t axis = T::axis; + + switch (axis) + { + case axis_ancestor: + case axis_ancestor_or_self: + { + if (axis == axis_ancestor_or_self && _test == nodetest_type_node) // reject attributes based on principal node type test + step_push(ns, a, p, alloc); + + xml_node cur = p; + + while (cur) + { + step_push(ns, cur, alloc); + + cur = cur.parent(); + } + + break; + } + + case axis_descendant_or_self: + case axis_self: + { + if (_test == nodetest_type_node) // reject attributes based on principal node type test + step_push(ns, a, p, alloc); + + break; + } + + case axis_following: + { + xml_node cur = p; + + for (;;) + { + if (cur.first_child()) + cur = cur.first_child(); + else if (cur.next_sibling()) + cur = cur.next_sibling(); + else + { + while (cur && !cur.next_sibling()) cur = cur.parent(); + cur = cur.next_sibling(); + + if (!cur) break; + } + + step_push(ns, cur, alloc); + } + + break; + } + + case axis_parent: + { + step_push(ns, p, alloc); + + break; + } + + case axis_preceding: + { + // preceding:: axis does not include attribute nodes and attribute ancestors (they are the same as parent's ancestors), so we can reuse node preceding + step_fill(ns, p, alloc, v); + break; + } + + default: + assert(!"Unimplemented axis"); + } + } + + template xpath_node_set_raw step_do(const xpath_context& c, const xpath_stack& stack, T v) + { + const axis_t axis = T::axis; + bool attributes = (axis == axis_ancestor || axis == axis_ancestor_or_self || axis == axis_descendant_or_self || axis == axis_following || axis == axis_parent || axis == axis_preceding || axis == axis_self); + + xpath_node_set_raw ns; + ns.set_type((axis == axis_ancestor || axis == axis_ancestor_or_self || axis == axis_preceding || axis == axis_preceding_sibling) ? xpath_node_set::type_sorted_reverse : xpath_node_set::type_sorted); + + if (_left) + { + xpath_node_set_raw s = _left->eval_node_set(c, stack); + + // self axis preserves the original order + if (axis == axis_self) ns.set_type(s.type()); + + for (const xpath_node* it = s.begin(); it != s.end(); ++it) + { + size_t size = ns.size(); + + // in general, all axes generate elements in a particular order, but there is no order guarantee if axis is applied to two nodes + if (axis != axis_self && size != 0) ns.set_type(xpath_node_set::type_unsorted); + + if (it->node()) + step_fill(ns, it->node(), stack.result, v); + else if (attributes) + step_fill(ns, it->attribute(), it->parent(), stack.result, v); + + apply_predicates(ns, size, stack); + } + } + else + { + if (c.n.node()) + step_fill(ns, c.n.node(), stack.result, v); + else if (attributes) + step_fill(ns, c.n.attribute(), c.n.parent(), stack.result, v); + + apply_predicates(ns, 0, stack); + } + + // child, attribute and self axes always generate unique set of nodes + // for other axis, if the set stayed sorted, it stayed unique because the traversal algorithms do not visit the same node twice + if (axis != axis_child && axis != axis_attribute && axis != axis_self && ns.type() == xpath_node_set::type_unsorted) + ns.remove_duplicates(); + + return ns; + } + + public: + xpath_ast_node(ast_type_t type, xpath_value_type rettype_, const char_t* value): + _type(static_cast(type)), _rettype(static_cast(rettype_)), _axis(0), _test(0), _left(0), _right(0), _next(0) + { + assert(type == ast_string_constant); + _data.string = value; + } + + xpath_ast_node(ast_type_t type, xpath_value_type rettype_, double value): + _type(static_cast(type)), _rettype(static_cast(rettype_)), _axis(0), _test(0), _left(0), _right(0), _next(0) + { + assert(type == ast_number_constant); + _data.number = value; + } + + xpath_ast_node(ast_type_t type, xpath_value_type rettype_, xpath_variable* value): + _type(static_cast(type)), _rettype(static_cast(rettype_)), _axis(0), _test(0), _left(0), _right(0), _next(0) + { + assert(type == ast_variable); + _data.variable = value; + } + + xpath_ast_node(ast_type_t type, xpath_value_type rettype_, xpath_ast_node* left = 0, xpath_ast_node* right = 0): + _type(static_cast(type)), _rettype(static_cast(rettype_)), _axis(0), _test(0), _left(left), _right(right), _next(0) + { + } + + xpath_ast_node(ast_type_t type, xpath_ast_node* left, axis_t axis, nodetest_t test, const char_t* contents): + _type(static_cast(type)), _rettype(xpath_type_node_set), _axis(static_cast(axis)), _test(static_cast(test)), _left(left), _right(0), _next(0) + { + _data.nodetest = contents; + } + + void set_next(xpath_ast_node* value) + { + _next = value; + } + + void set_right(xpath_ast_node* value) + { + _right = value; + } + + bool eval_boolean(const xpath_context& c, const xpath_stack& stack) + { + switch (_type) + { + case ast_op_or: + return _left->eval_boolean(c, stack) || _right->eval_boolean(c, stack); + + case ast_op_and: + return _left->eval_boolean(c, stack) && _right->eval_boolean(c, stack); + + case ast_op_equal: + return compare_eq(_left, _right, c, stack, equal_to()); + + case ast_op_not_equal: + return compare_eq(_left, _right, c, stack, not_equal_to()); + + case ast_op_less: + return compare_rel(_left, _right, c, stack, less()); + + case ast_op_greater: + return compare_rel(_right, _left, c, stack, less()); + + case ast_op_less_or_equal: + return compare_rel(_left, _right, c, stack, less_equal()); + + case ast_op_greater_or_equal: + return compare_rel(_right, _left, c, stack, less_equal()); + + case ast_func_starts_with: + { + xpath_allocator_capture cr(stack.result); + + xpath_string lr = _left->eval_string(c, stack); + xpath_string rr = _right->eval_string(c, stack); + + return starts_with(lr.c_str(), rr.c_str()); + } + + case ast_func_contains: + { + xpath_allocator_capture cr(stack.result); + + xpath_string lr = _left->eval_string(c, stack); + xpath_string rr = _right->eval_string(c, stack); + + return find_substring(lr.c_str(), rr.c_str()) != 0; + } + + case ast_func_boolean: + return _left->eval_boolean(c, stack); + + case ast_func_not: + return !_left->eval_boolean(c, stack); + + case ast_func_true: + return true; + + case ast_func_false: + return false; + + case ast_func_lang: + { + if (c.n.attribute()) return false; + + xpath_allocator_capture cr(stack.result); + + xpath_string lang = _left->eval_string(c, stack); + + for (xml_node n = c.n.node(); n; n = n.parent()) + { + xml_attribute a = n.attribute(PUGIXML_TEXT("xml:lang")); + + if (a) + { + const char_t* value = a.value(); + + // strnicmp / strncasecmp is not portable + for (const char_t* lit = lang.c_str(); *lit; ++lit) + { + if (tolower_ascii(*lit) != tolower_ascii(*value)) return false; + ++value; + } + + return *value == 0 || *value == '-'; + } + } + + return false; + } + + case ast_variable: + { + assert(_rettype == _data.variable->type()); + + if (_rettype == xpath_type_boolean) + return _data.variable->get_boolean(); + + // fallthrough to type conversion + } + + default: + { + switch (_rettype) + { + case xpath_type_number: + return convert_number_to_boolean(eval_number(c, stack)); + + case xpath_type_string: + { + xpath_allocator_capture cr(stack.result); + + return !eval_string(c, stack).empty(); + } + + case xpath_type_node_set: + { + xpath_allocator_capture cr(stack.result); + + return !eval_node_set(c, stack).empty(); + } + + default: + assert(!"Wrong expression for return type boolean"); + return false; + } + } + } + } + + double eval_number(const xpath_context& c, const xpath_stack& stack) + { + switch (_type) + { + case ast_op_add: + return _left->eval_number(c, stack) + _right->eval_number(c, stack); + + case ast_op_subtract: + return _left->eval_number(c, stack) - _right->eval_number(c, stack); + + case ast_op_multiply: + return _left->eval_number(c, stack) * _right->eval_number(c, stack); + + case ast_op_divide: + return _left->eval_number(c, stack) / _right->eval_number(c, stack); + + case ast_op_mod: + return fmod(_left->eval_number(c, stack), _right->eval_number(c, stack)); + + case ast_op_negate: + return -_left->eval_number(c, stack); + + case ast_number_constant: + return _data.number; + + case ast_func_last: + return static_cast(c.size); + + case ast_func_position: + return static_cast(c.position); + + case ast_func_count: + { + xpath_allocator_capture cr(stack.result); + + return static_cast(_left->eval_node_set(c, stack).size()); + } + + case ast_func_string_length_0: + { + xpath_allocator_capture cr(stack.result); + + return static_cast(string_value(c.n, stack.result).length()); + } + + case ast_func_string_length_1: + { + xpath_allocator_capture cr(stack.result); + + return static_cast(_left->eval_string(c, stack).length()); + } + + case ast_func_number_0: + { + xpath_allocator_capture cr(stack.result); + + return convert_string_to_number(string_value(c.n, stack.result).c_str()); + } + + case ast_func_number_1: + return _left->eval_number(c, stack); + + case ast_func_sum: + { + xpath_allocator_capture cr(stack.result); + + double r = 0; + + xpath_node_set_raw ns = _left->eval_node_set(c, stack); + + for (const xpath_node* it = ns.begin(); it != ns.end(); ++it) + { + xpath_allocator_capture cri(stack.result); + + r += convert_string_to_number(string_value(*it, stack.result).c_str()); + } + + return r; + } + + case ast_func_floor: + { + double r = _left->eval_number(c, stack); + + return r == r ? floor(r) : r; + } + + case ast_func_ceiling: + { + double r = _left->eval_number(c, stack); + + return r == r ? ceil(r) : r; + } + + case ast_func_round: + return round_nearest_nzero(_left->eval_number(c, stack)); + + case ast_variable: + { + assert(_rettype == _data.variable->type()); + + if (_rettype == xpath_type_number) + return _data.variable->get_number(); + + // fallthrough to type conversion + } + + default: + { + switch (_rettype) + { + case xpath_type_boolean: + return eval_boolean(c, stack) ? 1 : 0; + + case xpath_type_string: + { + xpath_allocator_capture cr(stack.result); + + return convert_string_to_number(eval_string(c, stack).c_str()); + } + + case xpath_type_node_set: + { + xpath_allocator_capture cr(stack.result); + + return convert_string_to_number(eval_string(c, stack).c_str()); + } + + default: + assert(!"Wrong expression for return type number"); + return 0; + } + + } + } + } + + xpath_string eval_string_concat(const xpath_context& c, const xpath_stack& stack) + { + assert(_type == ast_func_concat); + + xpath_allocator_capture ct(stack.temp); + + // count the string number + size_t count = 1; + for (xpath_ast_node* nc = _right; nc; nc = nc->_next) count++; + + // gather all strings + xpath_string static_buffer[4]; + xpath_string* buffer = static_buffer; + + // allocate on-heap for large concats + if (count > sizeof(static_buffer) / sizeof(static_buffer[0])) + { + buffer = static_cast(stack.temp->allocate(count * sizeof(xpath_string))); + assert(buffer); + } + + // evaluate all strings to temporary stack + xpath_stack swapped_stack = {stack.temp, stack.result}; + + buffer[0] = _left->eval_string(c, swapped_stack); + + size_t pos = 1; + for (xpath_ast_node* n = _right; n; n = n->_next, ++pos) buffer[pos] = n->eval_string(c, swapped_stack); + assert(pos == count); + + // get total length + size_t length = 0; + for (size_t i = 0; i < count; ++i) length += buffer[i].length(); + + // create final string + char_t* result = static_cast(stack.result->allocate((length + 1) * sizeof(char_t))); + assert(result); + + char_t* ri = result; + + for (size_t j = 0; j < count; ++j) + for (const char_t* bi = buffer[j].c_str(); *bi; ++bi) + *ri++ = *bi; + + *ri = 0; + + return xpath_string(result, true); + } + + xpath_string eval_string(const xpath_context& c, const xpath_stack& stack) + { + switch (_type) + { + case ast_string_constant: + return xpath_string_const(_data.string); + + case ast_func_local_name_0: + { + xpath_node na = c.n; + + return xpath_string_const(local_name(na)); + } + + case ast_func_local_name_1: + { + xpath_allocator_capture cr(stack.result); + + xpath_node_set_raw ns = _left->eval_node_set(c, stack); + xpath_node na = ns.first(); + + return xpath_string_const(local_name(na)); + } + + case ast_func_name_0: + { + xpath_node na = c.n; + + return xpath_string_const(qualified_name(na)); + } + + case ast_func_name_1: + { + xpath_allocator_capture cr(stack.result); + + xpath_node_set_raw ns = _left->eval_node_set(c, stack); + xpath_node na = ns.first(); + + return xpath_string_const(qualified_name(na)); + } + + case ast_func_namespace_uri_0: + { + xpath_node na = c.n; + + return xpath_string_const(namespace_uri(na)); + } + + case ast_func_namespace_uri_1: + { + xpath_allocator_capture cr(stack.result); + + xpath_node_set_raw ns = _left->eval_node_set(c, stack); + xpath_node na = ns.first(); + + return xpath_string_const(namespace_uri(na)); + } + + case ast_func_string_0: + return string_value(c.n, stack.result); + + case ast_func_string_1: + return _left->eval_string(c, stack); + + case ast_func_concat: + return eval_string_concat(c, stack); + + case ast_func_substring_before: + { + xpath_allocator_capture cr(stack.temp); + + xpath_stack swapped_stack = {stack.temp, stack.result}; + + xpath_string s = _left->eval_string(c, swapped_stack); + xpath_string p = _right->eval_string(c, swapped_stack); + + const char_t* pos = find_substring(s.c_str(), p.c_str()); + + return pos ? xpath_string(s.c_str(), pos, stack.result) : xpath_string(); + } + + case ast_func_substring_after: + { + xpath_allocator_capture cr(stack.temp); + + xpath_stack swapped_stack = {stack.temp, stack.result}; + + xpath_string s = _left->eval_string(c, swapped_stack); + xpath_string p = _right->eval_string(c, swapped_stack); + + const char_t* pos = find_substring(s.c_str(), p.c_str()); + if (!pos) return xpath_string(); + + const char_t* result = pos + p.length(); + + return s.uses_heap() ? xpath_string(result, stack.result) : xpath_string_const(result); + } + + case ast_func_substring_2: + { + xpath_allocator_capture cr(stack.temp); + + xpath_stack swapped_stack = {stack.temp, stack.result}; + + xpath_string s = _left->eval_string(c, swapped_stack); + size_t s_length = s.length(); + + double first = round_nearest(_right->eval_number(c, stack)); + + if (is_nan(first)) return xpath_string(); // NaN + else if (first >= s_length + 1) return xpath_string(); + + size_t pos = first < 1 ? 1 : static_cast(first); + assert(1 <= pos && pos <= s_length + 1); + + const char_t* rbegin = s.c_str() + (pos - 1); + + return s.uses_heap() ? xpath_string(rbegin, stack.result) : xpath_string_const(rbegin); + } + + case ast_func_substring_3: + { + xpath_allocator_capture cr(stack.temp); + + xpath_stack swapped_stack = {stack.temp, stack.result}; + + xpath_string s = _left->eval_string(c, swapped_stack); + size_t s_length = s.length(); + + double first = round_nearest(_right->eval_number(c, stack)); + double last = first + round_nearest(_right->_next->eval_number(c, stack)); + + if (is_nan(first) || is_nan(last)) return xpath_string(); + else if (first >= s_length + 1) return xpath_string(); + else if (first >= last) return xpath_string(); + else if (last < 1) return xpath_string(); + + size_t pos = first < 1 ? 1 : static_cast(first); + size_t end = last >= s_length + 1 ? s_length + 1 : static_cast(last); + + assert(1 <= pos && pos <= end && end <= s_length + 1); + const char_t* rbegin = s.c_str() + (pos - 1); + const char_t* rend = s.c_str() + (end - 1); + + return (end == s_length + 1 && !s.uses_heap()) ? xpath_string_const(rbegin) : xpath_string(rbegin, rend, stack.result); + } + + case ast_func_normalize_space_0: + { + xpath_string s = string_value(c.n, stack.result); + + normalize_space(s.data(stack.result)); + + return s; + } + + case ast_func_normalize_space_1: + { + xpath_string s = _left->eval_string(c, stack); + + normalize_space(s.data(stack.result)); + + return s; + } + + case ast_func_translate: + { + xpath_allocator_capture cr(stack.temp); + + xpath_stack swapped_stack = {stack.temp, stack.result}; + + xpath_string s = _left->eval_string(c, stack); + xpath_string from = _right->eval_string(c, swapped_stack); + xpath_string to = _right->_next->eval_string(c, swapped_stack); + + translate(s.data(stack.result), from.c_str(), to.c_str()); + + return s; + } + + case ast_variable: + { + assert(_rettype == _data.variable->type()); + + if (_rettype == xpath_type_string) + return xpath_string_const(_data.variable->get_string()); + + // fallthrough to type conversion + } + + default: + { + switch (_rettype) + { + case xpath_type_boolean: + return xpath_string_const(eval_boolean(c, stack) ? PUGIXML_TEXT("true") : PUGIXML_TEXT("false")); + + case xpath_type_number: + return convert_number_to_string(eval_number(c, stack), stack.result); + + case xpath_type_node_set: + { + xpath_allocator_capture cr(stack.temp); + + xpath_stack swapped_stack = {stack.temp, stack.result}; + + xpath_node_set_raw ns = eval_node_set(c, swapped_stack); + return ns.empty() ? xpath_string() : string_value(ns.first(), stack.result); + } + + default: + assert(!"Wrong expression for return type string"); + return xpath_string(); + } + } + } + } + + xpath_node_set_raw eval_node_set(const xpath_context& c, const xpath_stack& stack) + { + switch (_type) + { + case ast_op_union: + { + xpath_allocator_capture cr(stack.temp); + + xpath_stack swapped_stack = {stack.temp, stack.result}; + + xpath_node_set_raw ls = _left->eval_node_set(c, swapped_stack); + xpath_node_set_raw rs = _right->eval_node_set(c, stack); + + // we can optimize merging two sorted sets, but this is a very rare operation, so don't bother + rs.set_type(xpath_node_set::type_unsorted); + + rs.append(ls.begin(), ls.end(), stack.result); + rs.remove_duplicates(); + + return rs; + } + + case ast_filter: + case ast_filter_posinv: + { + xpath_node_set_raw set = _left->eval_node_set(c, stack); + + // either expression is a number or it contains position() call; sort by document order + if (_type == ast_filter) set.sort_do(); + + apply_predicate(set, 0, _right, stack); + + return set; + } + + case ast_func_id: + return xpath_node_set_raw(); + + case ast_step: + { + switch (_axis) + { + case axis_ancestor: + return step_do(c, stack, axis_to_type()); + + case axis_ancestor_or_self: + return step_do(c, stack, axis_to_type()); + + case axis_attribute: + return step_do(c, stack, axis_to_type()); + + case axis_child: + return step_do(c, stack, axis_to_type()); + + case axis_descendant: + return step_do(c, stack, axis_to_type()); + + case axis_descendant_or_self: + return step_do(c, stack, axis_to_type()); + + case axis_following: + return step_do(c, stack, axis_to_type()); + + case axis_following_sibling: + return step_do(c, stack, axis_to_type()); + + case axis_namespace: + // namespaced axis is not supported + return xpath_node_set_raw(); + + case axis_parent: + return step_do(c, stack, axis_to_type()); + + case axis_preceding: + return step_do(c, stack, axis_to_type()); + + case axis_preceding_sibling: + return step_do(c, stack, axis_to_type()); + + case axis_self: + return step_do(c, stack, axis_to_type()); + + default: + assert(!"Unknown axis"); + return xpath_node_set_raw(); + } + } + + case ast_step_root: + { + assert(!_right); // root step can't have any predicates + + xpath_node_set_raw ns; + + ns.set_type(xpath_node_set::type_sorted); + + if (c.n.node()) ns.push_back(c.n.node().root(), stack.result); + else if (c.n.attribute()) ns.push_back(c.n.parent().root(), stack.result); + + return ns; + } + + case ast_variable: + { + assert(_rettype == _data.variable->type()); + + if (_rettype == xpath_type_node_set) + { + const xpath_node_set& s = _data.variable->get_node_set(); + + xpath_node_set_raw ns; + + ns.set_type(s.type()); + ns.append(s.begin(), s.end(), stack.result); + + return ns; + } + + // fallthrough to type conversion + } + + default: + assert(!"Wrong expression for return type node set"); + return xpath_node_set_raw(); + } + } + + bool is_posinv() + { + switch (_type) + { + case ast_func_position: + return false; + + case ast_string_constant: + case ast_number_constant: + case ast_variable: + return true; + + case ast_step: + case ast_step_root: + return true; + + case ast_predicate: + case ast_filter: + case ast_filter_posinv: + return true; + + default: + if (_left && !_left->is_posinv()) return false; + + for (xpath_ast_node* n = _right; n; n = n->_next) + if (!n->is_posinv()) return false; + + return true; + } + } + + xpath_value_type rettype() const + { + return static_cast(_rettype); + } + }; + + struct xpath_parser + { + xpath_allocator* _alloc; + xpath_lexer _lexer; + + const char_t* _query; + xpath_variable_set* _variables; + + xpath_parse_result* _result; + + char_t _scratch[32]; + + #ifdef PUGIXML_NO_EXCEPTIONS + jmp_buf _error_handler; + #endif + + void throw_error(const char* message) + { + _result->error = message; + _result->offset = _lexer.current_pos() - _query; + + #ifdef PUGIXML_NO_EXCEPTIONS + longjmp(_error_handler, 1); + #else + throw xpath_exception(*_result); + #endif + } + + void throw_error_oom() + { + #ifdef PUGIXML_NO_EXCEPTIONS + throw_error("Out of memory"); + #else + throw std::bad_alloc(); + #endif + } + + void* alloc_node() + { + void* result = _alloc->allocate_nothrow(sizeof(xpath_ast_node)); + + if (!result) throw_error_oom(); + + return result; + } + + const char_t* alloc_string(const xpath_lexer_string& value) + { + if (value.begin) + { + size_t length = static_cast(value.end - value.begin); + + char_t* c = static_cast(_alloc->allocate_nothrow((length + 1) * sizeof(char_t))); + if (!c) throw_error_oom(); + assert(c); // workaround for clang static analysis + + memcpy(c, value.begin, length * sizeof(char_t)); + c[length] = 0; + + return c; + } + else return 0; + } + + xpath_ast_node* parse_function_helper(ast_type_t type0, ast_type_t type1, size_t argc, xpath_ast_node* args[2]) + { + assert(argc <= 1); + + if (argc == 1 && args[0]->rettype() != xpath_type_node_set) throw_error("Function has to be applied to node set"); + + return new (alloc_node()) xpath_ast_node(argc == 0 ? type0 : type1, xpath_type_string, args[0]); + } + + xpath_ast_node* parse_function(const xpath_lexer_string& name, size_t argc, xpath_ast_node* args[2]) + { + switch (name.begin[0]) + { + case 'b': + if (name == PUGIXML_TEXT("boolean") && argc == 1) + return new (alloc_node()) xpath_ast_node(ast_func_boolean, xpath_type_boolean, args[0]); + + break; + + case 'c': + if (name == PUGIXML_TEXT("count") && argc == 1) + { + if (args[0]->rettype() != xpath_type_node_set) throw_error("Function has to be applied to node set"); + return new (alloc_node()) xpath_ast_node(ast_func_count, xpath_type_number, args[0]); + } + else if (name == PUGIXML_TEXT("contains") && argc == 2) + return new (alloc_node()) xpath_ast_node(ast_func_contains, xpath_type_boolean, args[0], args[1]); + else if (name == PUGIXML_TEXT("concat") && argc >= 2) + return new (alloc_node()) xpath_ast_node(ast_func_concat, xpath_type_string, args[0], args[1]); + else if (name == PUGIXML_TEXT("ceiling") && argc == 1) + return new (alloc_node()) xpath_ast_node(ast_func_ceiling, xpath_type_number, args[0]); + + break; + + case 'f': + if (name == PUGIXML_TEXT("false") && argc == 0) + return new (alloc_node()) xpath_ast_node(ast_func_false, xpath_type_boolean); + else if (name == PUGIXML_TEXT("floor") && argc == 1) + return new (alloc_node()) xpath_ast_node(ast_func_floor, xpath_type_number, args[0]); + + break; + + case 'i': + if (name == PUGIXML_TEXT("id") && argc == 1) + return new (alloc_node()) xpath_ast_node(ast_func_id, xpath_type_node_set, args[0]); + + break; + + case 'l': + if (name == PUGIXML_TEXT("last") && argc == 0) + return new (alloc_node()) xpath_ast_node(ast_func_last, xpath_type_number); + else if (name == PUGIXML_TEXT("lang") && argc == 1) + return new (alloc_node()) xpath_ast_node(ast_func_lang, xpath_type_boolean, args[0]); + else if (name == PUGIXML_TEXT("local-name") && argc <= 1) + return parse_function_helper(ast_func_local_name_0, ast_func_local_name_1, argc, args); + + break; + + case 'n': + if (name == PUGIXML_TEXT("name") && argc <= 1) + return parse_function_helper(ast_func_name_0, ast_func_name_1, argc, args); + else if (name == PUGIXML_TEXT("namespace-uri") && argc <= 1) + return parse_function_helper(ast_func_namespace_uri_0, ast_func_namespace_uri_1, argc, args); + else if (name == PUGIXML_TEXT("normalize-space") && argc <= 1) + return new (alloc_node()) xpath_ast_node(argc == 0 ? ast_func_normalize_space_0 : ast_func_normalize_space_1, xpath_type_string, args[0], args[1]); + else if (name == PUGIXML_TEXT("not") && argc == 1) + return new (alloc_node()) xpath_ast_node(ast_func_not, xpath_type_boolean, args[0]); + else if (name == PUGIXML_TEXT("number") && argc <= 1) + return new (alloc_node()) xpath_ast_node(argc == 0 ? ast_func_number_0 : ast_func_number_1, xpath_type_number, args[0]); + + break; + + case 'p': + if (name == PUGIXML_TEXT("position") && argc == 0) + return new (alloc_node()) xpath_ast_node(ast_func_position, xpath_type_number); + + break; + + case 'r': + if (name == PUGIXML_TEXT("round") && argc == 1) + return new (alloc_node()) xpath_ast_node(ast_func_round, xpath_type_number, args[0]); + + break; + + case 's': + if (name == PUGIXML_TEXT("string") && argc <= 1) + return new (alloc_node()) xpath_ast_node(argc == 0 ? ast_func_string_0 : ast_func_string_1, xpath_type_string, args[0]); + else if (name == PUGIXML_TEXT("string-length") && argc <= 1) + return new (alloc_node()) xpath_ast_node(argc == 0 ? ast_func_string_length_0 : ast_func_string_length_1, xpath_type_number, args[0]); + else if (name == PUGIXML_TEXT("starts-with") && argc == 2) + return new (alloc_node()) xpath_ast_node(ast_func_starts_with, xpath_type_boolean, args[0], args[1]); + else if (name == PUGIXML_TEXT("substring-before") && argc == 2) + return new (alloc_node()) xpath_ast_node(ast_func_substring_before, xpath_type_string, args[0], args[1]); + else if (name == PUGIXML_TEXT("substring-after") && argc == 2) + return new (alloc_node()) xpath_ast_node(ast_func_substring_after, xpath_type_string, args[0], args[1]); + else if (name == PUGIXML_TEXT("substring") && (argc == 2 || argc == 3)) + return new (alloc_node()) xpath_ast_node(argc == 2 ? ast_func_substring_2 : ast_func_substring_3, xpath_type_string, args[0], args[1]); + else if (name == PUGIXML_TEXT("sum") && argc == 1) + { + if (args[0]->rettype() != xpath_type_node_set) throw_error("Function has to be applied to node set"); + return new (alloc_node()) xpath_ast_node(ast_func_sum, xpath_type_number, args[0]); + } + + break; + + case 't': + if (name == PUGIXML_TEXT("translate") && argc == 3) + return new (alloc_node()) xpath_ast_node(ast_func_translate, xpath_type_string, args[0], args[1]); + else if (name == PUGIXML_TEXT("true") && argc == 0) + return new (alloc_node()) xpath_ast_node(ast_func_true, xpath_type_boolean); + + break; + + default: + break; + } + + throw_error("Unrecognized function or wrong parameter count"); + + return 0; + } + + axis_t parse_axis_name(const xpath_lexer_string& name, bool& specified) + { + specified = true; + + switch (name.begin[0]) + { + case 'a': + if (name == PUGIXML_TEXT("ancestor")) + return axis_ancestor; + else if (name == PUGIXML_TEXT("ancestor-or-self")) + return axis_ancestor_or_self; + else if (name == PUGIXML_TEXT("attribute")) + return axis_attribute; + + break; + + case 'c': + if (name == PUGIXML_TEXT("child")) + return axis_child; + + break; + + case 'd': + if (name == PUGIXML_TEXT("descendant")) + return axis_descendant; + else if (name == PUGIXML_TEXT("descendant-or-self")) + return axis_descendant_or_self; + + break; + + case 'f': + if (name == PUGIXML_TEXT("following")) + return axis_following; + else if (name == PUGIXML_TEXT("following-sibling")) + return axis_following_sibling; + + break; + + case 'n': + if (name == PUGIXML_TEXT("namespace")) + return axis_namespace; + + break; + + case 'p': + if (name == PUGIXML_TEXT("parent")) + return axis_parent; + else if (name == PUGIXML_TEXT("preceding")) + return axis_preceding; + else if (name == PUGIXML_TEXT("preceding-sibling")) + return axis_preceding_sibling; + + break; + + case 's': + if (name == PUGIXML_TEXT("self")) + return axis_self; + + break; + + default: + break; + } + + specified = false; + return axis_child; + } + + nodetest_t parse_node_test_type(const xpath_lexer_string& name) + { + switch (name.begin[0]) + { + case 'c': + if (name == PUGIXML_TEXT("comment")) + return nodetest_type_comment; + + break; + + case 'n': + if (name == PUGIXML_TEXT("node")) + return nodetest_type_node; + + break; + + case 'p': + if (name == PUGIXML_TEXT("processing-instruction")) + return nodetest_type_pi; + + break; + + case 't': + if (name == PUGIXML_TEXT("text")) + return nodetest_type_text; + + break; + + default: + break; + } + + return nodetest_none; + } + + // PrimaryExpr ::= VariableReference | '(' Expr ')' | Literal | Number | FunctionCall + xpath_ast_node* parse_primary_expression() + { + switch (_lexer.current()) + { + case lex_var_ref: + { + xpath_lexer_string name = _lexer.contents(); + + if (!_variables) + throw_error("Unknown variable: variable set is not provided"); + + xpath_variable* var = get_variable_scratch(_scratch, _variables, name.begin, name.end); + + if (!var) + throw_error("Unknown variable: variable set does not contain the given name"); + + _lexer.next(); + + return new (alloc_node()) xpath_ast_node(ast_variable, var->type(), var); + } + + case lex_open_brace: + { + _lexer.next(); + + xpath_ast_node* n = parse_expression(); + + if (_lexer.current() != lex_close_brace) + throw_error("Unmatched braces"); + + _lexer.next(); + + return n; + } + + case lex_quoted_string: + { + const char_t* value = alloc_string(_lexer.contents()); + + xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_string_constant, xpath_type_string, value); + _lexer.next(); + + return n; + } + + case lex_number: + { + double value = 0; + + if (!convert_string_to_number_scratch(_scratch, _lexer.contents().begin, _lexer.contents().end, &value)) + throw_error_oom(); + + xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_number_constant, xpath_type_number, value); + _lexer.next(); + + return n; + } + + case lex_string: + { + xpath_ast_node* args[2] = {0}; + size_t argc = 0; + + xpath_lexer_string function = _lexer.contents(); + _lexer.next(); + + xpath_ast_node* last_arg = 0; + + if (_lexer.current() != lex_open_brace) + throw_error("Unrecognized function call"); + _lexer.next(); + + if (_lexer.current() != lex_close_brace) + args[argc++] = parse_expression(); + + while (_lexer.current() != lex_close_brace) + { + if (_lexer.current() != lex_comma) + throw_error("No comma between function arguments"); + _lexer.next(); + + xpath_ast_node* n = parse_expression(); + + if (argc < 2) args[argc] = n; + else last_arg->set_next(n); + + argc++; + last_arg = n; + } + + _lexer.next(); + + return parse_function(function, argc, args); + } + + default: + throw_error("Unrecognizable primary expression"); + + return 0; + } + } + + // FilterExpr ::= PrimaryExpr | FilterExpr Predicate + // Predicate ::= '[' PredicateExpr ']' + // PredicateExpr ::= Expr + xpath_ast_node* parse_filter_expression() + { + xpath_ast_node* n = parse_primary_expression(); + + while (_lexer.current() == lex_open_square_brace) + { + _lexer.next(); + + xpath_ast_node* expr = parse_expression(); + + if (n->rettype() != xpath_type_node_set) throw_error("Predicate has to be applied to node set"); + + bool posinv = expr->rettype() != xpath_type_number && expr->is_posinv(); + + n = new (alloc_node()) xpath_ast_node(posinv ? ast_filter_posinv : ast_filter, xpath_type_node_set, n, expr); + + if (_lexer.current() != lex_close_square_brace) + throw_error("Unmatched square brace"); + + _lexer.next(); + } + + return n; + } + + // Step ::= AxisSpecifier NodeTest Predicate* | AbbreviatedStep + // AxisSpecifier ::= AxisName '::' | '@'? + // NodeTest ::= NameTest | NodeType '(' ')' | 'processing-instruction' '(' Literal ')' + // NameTest ::= '*' | NCName ':' '*' | QName + // AbbreviatedStep ::= '.' | '..' + xpath_ast_node* parse_step(xpath_ast_node* set) + { + if (set && set->rettype() != xpath_type_node_set) + throw_error("Step has to be applied to node set"); + + bool axis_specified = false; + axis_t axis = axis_child; // implied child axis + + if (_lexer.current() == lex_axis_attribute) + { + axis = axis_attribute; + axis_specified = true; + + _lexer.next(); + } + else if (_lexer.current() == lex_dot) + { + _lexer.next(); + + return new (alloc_node()) xpath_ast_node(ast_step, set, axis_self, nodetest_type_node, 0); + } + else if (_lexer.current() == lex_double_dot) + { + _lexer.next(); + + return new (alloc_node()) xpath_ast_node(ast_step, set, axis_parent, nodetest_type_node, 0); + } + + nodetest_t nt_type = nodetest_none; + xpath_lexer_string nt_name; + + if (_lexer.current() == lex_string) + { + // node name test + nt_name = _lexer.contents(); + _lexer.next(); + + // was it an axis name? + if (_lexer.current() == lex_double_colon) + { + // parse axis name + if (axis_specified) throw_error("Two axis specifiers in one step"); + + axis = parse_axis_name(nt_name, axis_specified); + + if (!axis_specified) throw_error("Unknown axis"); + + // read actual node test + _lexer.next(); + + if (_lexer.current() == lex_multiply) + { + nt_type = nodetest_all; + nt_name = xpath_lexer_string(); + _lexer.next(); + } + else if (_lexer.current() == lex_string) + { + nt_name = _lexer.contents(); + _lexer.next(); + } + else throw_error("Unrecognized node test"); + } + + if (nt_type == nodetest_none) + { + // node type test or processing-instruction + if (_lexer.current() == lex_open_brace) + { + _lexer.next(); + + if (_lexer.current() == lex_close_brace) + { + _lexer.next(); + + nt_type = parse_node_test_type(nt_name); + + if (nt_type == nodetest_none) throw_error("Unrecognized node type"); + + nt_name = xpath_lexer_string(); + } + else if (nt_name == PUGIXML_TEXT("processing-instruction")) + { + if (_lexer.current() != lex_quoted_string) + throw_error("Only literals are allowed as arguments to processing-instruction()"); + + nt_type = nodetest_pi; + nt_name = _lexer.contents(); + _lexer.next(); + + if (_lexer.current() != lex_close_brace) + throw_error("Unmatched brace near processing-instruction()"); + _lexer.next(); + } + else + throw_error("Unmatched brace near node type test"); + + } + // QName or NCName:* + else + { + if (nt_name.end - nt_name.begin > 2 && nt_name.end[-2] == ':' && nt_name.end[-1] == '*') // NCName:* + { + nt_name.end--; // erase * + + nt_type = nodetest_all_in_namespace; + } + else nt_type = nodetest_name; + } + } + } + else if (_lexer.current() == lex_multiply) + { + nt_type = nodetest_all; + _lexer.next(); + } + else throw_error("Unrecognized node test"); + + xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_step, set, axis, nt_type, alloc_string(nt_name)); + + xpath_ast_node* last = 0; + + while (_lexer.current() == lex_open_square_brace) + { + _lexer.next(); + + xpath_ast_node* expr = parse_expression(); + + xpath_ast_node* pred = new (alloc_node()) xpath_ast_node(ast_predicate, xpath_type_node_set, expr); + + if (_lexer.current() != lex_close_square_brace) + throw_error("Unmatched square brace"); + _lexer.next(); + + if (last) last->set_next(pred); + else n->set_right(pred); + + last = pred; + } + + return n; + } + + // RelativeLocationPath ::= Step | RelativeLocationPath '/' Step | RelativeLocationPath '//' Step + xpath_ast_node* parse_relative_location_path(xpath_ast_node* set) + { + xpath_ast_node* n = parse_step(set); + + while (_lexer.current() == lex_slash || _lexer.current() == lex_double_slash) + { + lexeme_t l = _lexer.current(); + _lexer.next(); + + if (l == lex_double_slash) + n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, 0); + + n = parse_step(n); + } + + return n; + } + + // LocationPath ::= RelativeLocationPath | AbsoluteLocationPath + // AbsoluteLocationPath ::= '/' RelativeLocationPath? | '//' RelativeLocationPath + xpath_ast_node* parse_location_path() + { + if (_lexer.current() == lex_slash) + { + _lexer.next(); + + xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_step_root, xpath_type_node_set); + + // relative location path can start from axis_attribute, dot, double_dot, multiply and string lexemes; any other lexeme means standalone root path + lexeme_t l = _lexer.current(); + + if (l == lex_string || l == lex_axis_attribute || l == lex_dot || l == lex_double_dot || l == lex_multiply) + return parse_relative_location_path(n); + else + return n; + } + else if (_lexer.current() == lex_double_slash) + { + _lexer.next(); + + xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_step_root, xpath_type_node_set); + n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, 0); + + return parse_relative_location_path(n); + } + + // else clause moved outside of if because of bogus warning 'control may reach end of non-void function being inlined' in gcc 4.0.1 + return parse_relative_location_path(0); + } + + // PathExpr ::= LocationPath + // | FilterExpr + // | FilterExpr '/' RelativeLocationPath + // | FilterExpr '//' RelativeLocationPath + // UnionExpr ::= PathExpr | UnionExpr '|' PathExpr + // UnaryExpr ::= UnionExpr | '-' UnaryExpr + xpath_ast_node* parse_path_or_unary_expression() + { + // Clarification. + // PathExpr begins with either LocationPath or FilterExpr. + // FilterExpr begins with PrimaryExpr + // PrimaryExpr begins with '$' in case of it being a variable reference, + // '(' in case of it being an expression, string literal, number constant or + // function call. + + if (_lexer.current() == lex_var_ref || _lexer.current() == lex_open_brace || + _lexer.current() == lex_quoted_string || _lexer.current() == lex_number || + _lexer.current() == lex_string) + { + if (_lexer.current() == lex_string) + { + // This is either a function call, or not - if not, we shall proceed with location path + const char_t* state = _lexer.state(); + + while (PUGI__IS_CHARTYPE(*state, ct_space)) ++state; + + if (*state != '(') return parse_location_path(); + + // This looks like a function call; however this still can be a node-test. Check it. + if (parse_node_test_type(_lexer.contents()) != nodetest_none) return parse_location_path(); + } + + xpath_ast_node* n = parse_filter_expression(); + + if (_lexer.current() == lex_slash || _lexer.current() == lex_double_slash) + { + lexeme_t l = _lexer.current(); + _lexer.next(); + + if (l == lex_double_slash) + { + if (n->rettype() != xpath_type_node_set) throw_error("Step has to be applied to node set"); + + n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, 0); + } + + // select from location path + return parse_relative_location_path(n); + } + + return n; + } + else if (_lexer.current() == lex_minus) + { + _lexer.next(); + + // precedence 7+ - only parses union expressions + xpath_ast_node* expr = parse_expression_rec(parse_path_or_unary_expression(), 7); + + return new (alloc_node()) xpath_ast_node(ast_op_negate, xpath_type_number, expr); + } + else + return parse_location_path(); + } + + struct binary_op_t + { + ast_type_t asttype; + xpath_value_type rettype; + int precedence; + + binary_op_t(): asttype(ast_unknown), rettype(xpath_type_none), precedence(0) + { + } + + binary_op_t(ast_type_t asttype_, xpath_value_type rettype_, int precedence_): asttype(asttype_), rettype(rettype_), precedence(precedence_) + { + } + + static binary_op_t parse(xpath_lexer& lexer) + { + switch (lexer.current()) + { + case lex_string: + if (lexer.contents() == PUGIXML_TEXT("or")) + return binary_op_t(ast_op_or, xpath_type_boolean, 1); + else if (lexer.contents() == PUGIXML_TEXT("and")) + return binary_op_t(ast_op_and, xpath_type_boolean, 2); + else if (lexer.contents() == PUGIXML_TEXT("div")) + return binary_op_t(ast_op_divide, xpath_type_number, 6); + else if (lexer.contents() == PUGIXML_TEXT("mod")) + return binary_op_t(ast_op_mod, xpath_type_number, 6); + else + return binary_op_t(); + + case lex_equal: + return binary_op_t(ast_op_equal, xpath_type_boolean, 3); + + case lex_not_equal: + return binary_op_t(ast_op_not_equal, xpath_type_boolean, 3); + + case lex_less: + return binary_op_t(ast_op_less, xpath_type_boolean, 4); + + case lex_greater: + return binary_op_t(ast_op_greater, xpath_type_boolean, 4); + + case lex_less_or_equal: + return binary_op_t(ast_op_less_or_equal, xpath_type_boolean, 4); + + case lex_greater_or_equal: + return binary_op_t(ast_op_greater_or_equal, xpath_type_boolean, 4); + + case lex_plus: + return binary_op_t(ast_op_add, xpath_type_number, 5); + + case lex_minus: + return binary_op_t(ast_op_subtract, xpath_type_number, 5); + + case lex_multiply: + return binary_op_t(ast_op_multiply, xpath_type_number, 6); + + case lex_union: + return binary_op_t(ast_op_union, xpath_type_node_set, 7); + + default: + return binary_op_t(); + } + } + }; + + xpath_ast_node* parse_expression_rec(xpath_ast_node* lhs, int limit) + { + binary_op_t op = binary_op_t::parse(_lexer); + + while (op.asttype != ast_unknown && op.precedence >= limit) + { + _lexer.next(); + + xpath_ast_node* rhs = parse_path_or_unary_expression(); + + binary_op_t nextop = binary_op_t::parse(_lexer); + + while (nextop.asttype != ast_unknown && nextop.precedence > op.precedence) + { + rhs = parse_expression_rec(rhs, nextop.precedence); + + nextop = binary_op_t::parse(_lexer); + } + + if (op.asttype == ast_op_union && (lhs->rettype() != xpath_type_node_set || rhs->rettype() != xpath_type_node_set)) + throw_error("Union operator has to be applied to node sets"); + + lhs = new (alloc_node()) xpath_ast_node(op.asttype, op.rettype, lhs, rhs); + + op = binary_op_t::parse(_lexer); + } + + return lhs; + } + + // Expr ::= OrExpr + // OrExpr ::= AndExpr | OrExpr 'or' AndExpr + // AndExpr ::= EqualityExpr | AndExpr 'and' EqualityExpr + // EqualityExpr ::= RelationalExpr + // | EqualityExpr '=' RelationalExpr + // | EqualityExpr '!=' RelationalExpr + // RelationalExpr ::= AdditiveExpr + // | RelationalExpr '<' AdditiveExpr + // | RelationalExpr '>' AdditiveExpr + // | RelationalExpr '<=' AdditiveExpr + // | RelationalExpr '>=' AdditiveExpr + // AdditiveExpr ::= MultiplicativeExpr + // | AdditiveExpr '+' MultiplicativeExpr + // | AdditiveExpr '-' MultiplicativeExpr + // MultiplicativeExpr ::= UnaryExpr + // | MultiplicativeExpr '*' UnaryExpr + // | MultiplicativeExpr 'div' UnaryExpr + // | MultiplicativeExpr 'mod' UnaryExpr + xpath_ast_node* parse_expression() + { + return parse_expression_rec(parse_path_or_unary_expression(), 0); + } + + xpath_parser(const char_t* query, xpath_variable_set* variables, xpath_allocator* alloc, xpath_parse_result* result): _alloc(alloc), _lexer(query), _query(query), _variables(variables), _result(result) + { + } + + xpath_ast_node* parse() + { + xpath_ast_node* result = parse_expression(); + + if (_lexer.current() != lex_eof) + { + // there are still unparsed tokens left, error + throw_error("Incorrect query"); + } + + return result; + } + + static xpath_ast_node* parse(const char_t* query, xpath_variable_set* variables, xpath_allocator* alloc, xpath_parse_result* result) + { + xpath_parser parser(query, variables, alloc, result); + + #ifdef PUGIXML_NO_EXCEPTIONS + int error = setjmp(parser._error_handler); + + return (error == 0) ? parser.parse() : 0; + #else + return parser.parse(); + #endif + } + }; + + struct xpath_query_impl + { + static xpath_query_impl* create() + { + void* memory = xml_memory::allocate(sizeof(xpath_query_impl)); + + return new (memory) xpath_query_impl(); + } + + static void destroy(void* ptr) + { + if (!ptr) return; + + // free all allocated pages + static_cast(ptr)->alloc.release(); + + // free allocator memory (with the first page) + xml_memory::deallocate(ptr); + } + + xpath_query_impl(): root(0), alloc(&block) + { + block.next = 0; + } + + xpath_ast_node* root; + xpath_allocator alloc; + xpath_memory_block block; + }; + + PUGI__FN xpath_string evaluate_string_impl(xpath_query_impl* impl, const xpath_node& n, xpath_stack_data& sd) + { + if (!impl) return xpath_string(); + + #ifdef PUGIXML_NO_EXCEPTIONS + if (setjmp(sd.error_handler)) return xpath_string(); + #endif + + xpath_context c(n, 1, 1); + + return impl->root->eval_string(c, sd.stack); + } +PUGI__NS_END + +namespace pugi +{ +#ifndef PUGIXML_NO_EXCEPTIONS + PUGI__FN xpath_exception::xpath_exception(const xpath_parse_result& result_): _result(result_) + { + assert(_result.error); + } + + PUGI__FN const char* xpath_exception::what() const throw() + { + return _result.error; + } + + PUGI__FN const xpath_parse_result& xpath_exception::result() const + { + return _result; + } +#endif + + PUGI__FN xpath_node::xpath_node() + { + } + + PUGI__FN xpath_node::xpath_node(const xml_node& node_): _node(node_) + { + } + + PUGI__FN xpath_node::xpath_node(const xml_attribute& attribute_, const xml_node& parent_): _node(attribute_ ? parent_ : xml_node()), _attribute(attribute_) + { + } + + PUGI__FN xml_node xpath_node::node() const + { + return _attribute ? xml_node() : _node; + } + + PUGI__FN xml_attribute xpath_node::attribute() const + { + return _attribute; + } + + PUGI__FN xml_node xpath_node::parent() const + { + return _attribute ? _node : _node.parent(); + } + + PUGI__FN static void unspecified_bool_xpath_node(xpath_node***) + { + } + + PUGI__FN xpath_node::operator xpath_node::unspecified_bool_type() const + { + return (_node || _attribute) ? unspecified_bool_xpath_node : 0; + } + + PUGI__FN bool xpath_node::operator!() const + { + return !(_node || _attribute); + } + + PUGI__FN bool xpath_node::operator==(const xpath_node& n) const + { + return _node == n._node && _attribute == n._attribute; + } + + PUGI__FN bool xpath_node::operator!=(const xpath_node& n) const + { + return _node != n._node || _attribute != n._attribute; + } + +#ifdef __BORLANDC__ + PUGI__FN bool operator&&(const xpath_node& lhs, bool rhs) + { + return (bool)lhs && rhs; + } + + PUGI__FN bool operator||(const xpath_node& lhs, bool rhs) + { + return (bool)lhs || rhs; + } +#endif + + PUGI__FN void xpath_node_set::_assign(const_iterator begin_, const_iterator end_) + { + assert(begin_ <= end_); + + size_t size_ = static_cast(end_ - begin_); + + if (size_ <= 1) + { + // deallocate old buffer + if (_begin != &_storage) impl::xml_memory::deallocate(_begin); + + // use internal buffer + if (begin_ != end_) _storage = *begin_; + + _begin = &_storage; + _end = &_storage + size_; + } + else + { + // make heap copy + xpath_node* storage = static_cast(impl::xml_memory::allocate(size_ * sizeof(xpath_node))); + + if (!storage) + { + #ifdef PUGIXML_NO_EXCEPTIONS + return; + #else + throw std::bad_alloc(); + #endif + } + + memcpy(storage, begin_, size_ * sizeof(xpath_node)); + + // deallocate old buffer + if (_begin != &_storage) impl::xml_memory::deallocate(_begin); + + // finalize + _begin = storage; + _end = storage + size_; + } + } + + PUGI__FN xpath_node_set::xpath_node_set(): _type(type_unsorted), _begin(&_storage), _end(&_storage) + { + } + + PUGI__FN xpath_node_set::xpath_node_set(const_iterator begin_, const_iterator end_, type_t type_): _type(type_), _begin(&_storage), _end(&_storage) + { + _assign(begin_, end_); + } + + PUGI__FN xpath_node_set::~xpath_node_set() + { + if (_begin != &_storage) impl::xml_memory::deallocate(_begin); + } + + PUGI__FN xpath_node_set::xpath_node_set(const xpath_node_set& ns): _type(ns._type), _begin(&_storage), _end(&_storage) + { + _assign(ns._begin, ns._end); + } + + PUGI__FN xpath_node_set& xpath_node_set::operator=(const xpath_node_set& ns) + { + if (this == &ns) return *this; + + _type = ns._type; + _assign(ns._begin, ns._end); + + return *this; + } + + PUGI__FN xpath_node_set::type_t xpath_node_set::type() const + { + return _type; + } + + PUGI__FN size_t xpath_node_set::size() const + { + return _end - _begin; + } + + PUGI__FN bool xpath_node_set::empty() const + { + return _begin == _end; + } + + PUGI__FN const xpath_node& xpath_node_set::operator[](size_t index) const + { + assert(index < size()); + return _begin[index]; + } + + PUGI__FN xpath_node_set::const_iterator xpath_node_set::begin() const + { + return _begin; + } + + PUGI__FN xpath_node_set::const_iterator xpath_node_set::end() const + { + return _end; + } + + PUGI__FN void xpath_node_set::sort(bool reverse) + { + _type = impl::xpath_sort(_begin, _end, _type, reverse); + } + + PUGI__FN xpath_node xpath_node_set::first() const + { + return impl::xpath_first(_begin, _end, _type); + } + + PUGI__FN xpath_parse_result::xpath_parse_result(): error("Internal error"), offset(0) + { + } + + PUGI__FN xpath_parse_result::operator bool() const + { + return error == 0; + } + + PUGI__FN const char* xpath_parse_result::description() const + { + return error ? error : "No error"; + } + + PUGI__FN xpath_variable::xpath_variable(): _type(xpath_type_none), _next(0) + { + } + + PUGI__FN const char_t* xpath_variable::name() const + { + switch (_type) + { + case xpath_type_node_set: + return static_cast(this)->name; + + case xpath_type_number: + return static_cast(this)->name; + + case xpath_type_string: + return static_cast(this)->name; + + case xpath_type_boolean: + return static_cast(this)->name; + + default: + assert(!"Invalid variable type"); + return 0; + } + } + + PUGI__FN xpath_value_type xpath_variable::type() const + { + return _type; + } + + PUGI__FN bool xpath_variable::get_boolean() const + { + return (_type == xpath_type_boolean) ? static_cast(this)->value : false; + } + + PUGI__FN double xpath_variable::get_number() const + { + return (_type == xpath_type_number) ? static_cast(this)->value : impl::gen_nan(); + } + + PUGI__FN const char_t* xpath_variable::get_string() const + { + const char_t* value = (_type == xpath_type_string) ? static_cast(this)->value : 0; + return value ? value : PUGIXML_TEXT(""); + } + + PUGI__FN const xpath_node_set& xpath_variable::get_node_set() const + { + return (_type == xpath_type_node_set) ? static_cast(this)->value : impl::dummy_node_set; + } + + PUGI__FN bool xpath_variable::set(bool value) + { + if (_type != xpath_type_boolean) return false; + + static_cast(this)->value = value; + return true; + } + + PUGI__FN bool xpath_variable::set(double value) + { + if (_type != xpath_type_number) return false; + + static_cast(this)->value = value; + return true; + } + + PUGI__FN bool xpath_variable::set(const char_t* value) + { + if (_type != xpath_type_string) return false; + + impl::xpath_variable_string* var = static_cast(this); + + // duplicate string + size_t size = (impl::strlength(value) + 1) * sizeof(char_t); + + char_t* copy = static_cast(impl::xml_memory::allocate(size)); + if (!copy) return false; + + memcpy(copy, value, size); + + // replace old string + if (var->value) impl::xml_memory::deallocate(var->value); + var->value = copy; + + return true; + } + + PUGI__FN bool xpath_variable::set(const xpath_node_set& value) + { + if (_type != xpath_type_node_set) return false; + + static_cast(this)->value = value; + return true; + } + + PUGI__FN xpath_variable_set::xpath_variable_set() + { + for (size_t i = 0; i < sizeof(_data) / sizeof(_data[0]); ++i) _data[i] = 0; + } + + PUGI__FN xpath_variable_set::~xpath_variable_set() + { + for (size_t i = 0; i < sizeof(_data) / sizeof(_data[0]); ++i) + { + xpath_variable* var = _data[i]; + + while (var) + { + xpath_variable* next = var->_next; + + impl::delete_xpath_variable(var->_type, var); + + var = next; + } + } + } + + PUGI__FN xpath_variable* xpath_variable_set::find(const char_t* name) const + { + const size_t hash_size = sizeof(_data) / sizeof(_data[0]); + size_t hash = impl::hash_string(name) % hash_size; + + // look for existing variable + for (xpath_variable* var = _data[hash]; var; var = var->_next) + if (impl::strequal(var->name(), name)) + return var; + + return 0; + } + + PUGI__FN xpath_variable* xpath_variable_set::add(const char_t* name, xpath_value_type type) + { + const size_t hash_size = sizeof(_data) / sizeof(_data[0]); + size_t hash = impl::hash_string(name) % hash_size; + + // look for existing variable + for (xpath_variable* var = _data[hash]; var; var = var->_next) + if (impl::strequal(var->name(), name)) + return var->type() == type ? var : 0; + + // add new variable + xpath_variable* result = impl::new_xpath_variable(type, name); + + if (result) + { + result->_type = type; + result->_next = _data[hash]; + + _data[hash] = result; + } + + return result; + } + + PUGI__FN bool xpath_variable_set::set(const char_t* name, bool value) + { + xpath_variable* var = add(name, xpath_type_boolean); + return var ? var->set(value) : false; + } + + PUGI__FN bool xpath_variable_set::set(const char_t* name, double value) + { + xpath_variable* var = add(name, xpath_type_number); + return var ? var->set(value) : false; + } + + PUGI__FN bool xpath_variable_set::set(const char_t* name, const char_t* value) + { + xpath_variable* var = add(name, xpath_type_string); + return var ? var->set(value) : false; + } + + PUGI__FN bool xpath_variable_set::set(const char_t* name, const xpath_node_set& value) + { + xpath_variable* var = add(name, xpath_type_node_set); + return var ? var->set(value) : false; + } + + PUGI__FN xpath_variable* xpath_variable_set::get(const char_t* name) + { + return find(name); + } + + PUGI__FN const xpath_variable* xpath_variable_set::get(const char_t* name) const + { + return find(name); + } + + PUGI__FN xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables): _impl(0) + { + impl::xpath_query_impl* qimpl = impl::xpath_query_impl::create(); + + if (!qimpl) + { + #ifdef PUGIXML_NO_EXCEPTIONS + _result.error = "Out of memory"; + #else + throw std::bad_alloc(); + #endif + } + else + { + impl::buffer_holder impl_holder(qimpl, impl::xpath_query_impl::destroy); + + qimpl->root = impl::xpath_parser::parse(query, variables, &qimpl->alloc, &_result); + + if (qimpl->root) + { + _impl = static_cast(impl_holder.release()); + _result.error = 0; + } + } + } + + PUGI__FN xpath_query::~xpath_query() + { + impl::xpath_query_impl::destroy(_impl); + } + + PUGI__FN xpath_value_type xpath_query::return_type() const + { + if (!_impl) return xpath_type_none; + + return static_cast(_impl)->root->rettype(); + } + + PUGI__FN bool xpath_query::evaluate_boolean(const xpath_node& n) const + { + if (!_impl) return false; + + impl::xpath_context c(n, 1, 1); + impl::xpath_stack_data sd; + + #ifdef PUGIXML_NO_EXCEPTIONS + if (setjmp(sd.error_handler)) return false; + #endif + + return static_cast(_impl)->root->eval_boolean(c, sd.stack); + } + + PUGI__FN double xpath_query::evaluate_number(const xpath_node& n) const + { + if (!_impl) return impl::gen_nan(); + + impl::xpath_context c(n, 1, 1); + impl::xpath_stack_data sd; + + #ifdef PUGIXML_NO_EXCEPTIONS + if (setjmp(sd.error_handler)) return impl::gen_nan(); + #endif + + return static_cast(_impl)->root->eval_number(c, sd.stack); + } + +#ifndef PUGIXML_NO_STL + PUGI__FN string_t xpath_query::evaluate_string(const xpath_node& n) const + { + impl::xpath_stack_data sd; + + return impl::evaluate_string_impl(static_cast(_impl), n, sd).c_str(); + } +#endif + + PUGI__FN size_t xpath_query::evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const + { + impl::xpath_stack_data sd; + + impl::xpath_string r = impl::evaluate_string_impl(static_cast(_impl), n, sd); + + size_t full_size = r.length() + 1; + + if (capacity > 0) + { + size_t size = (full_size < capacity) ? full_size : capacity; + assert(size > 0); + + memcpy(buffer, r.c_str(), (size - 1) * sizeof(char_t)); + buffer[size - 1] = 0; + } + + return full_size; + } + + PUGI__FN xpath_node_set xpath_query::evaluate_node_set(const xpath_node& n) const + { + if (!_impl) return xpath_node_set(); + + impl::xpath_ast_node* root = static_cast(_impl)->root; + + if (root->rettype() != xpath_type_node_set) + { + #ifdef PUGIXML_NO_EXCEPTIONS + return xpath_node_set(); + #else + xpath_parse_result res; + res.error = "Expression does not evaluate to node set"; + + throw xpath_exception(res); + #endif + } + + impl::xpath_context c(n, 1, 1); + impl::xpath_stack_data sd; + + #ifdef PUGIXML_NO_EXCEPTIONS + if (setjmp(sd.error_handler)) return xpath_node_set(); + #endif + + impl::xpath_node_set_raw r = root->eval_node_set(c, sd.stack); + + return xpath_node_set(r.begin(), r.end(), r.type()); + } + + PUGI__FN const xpath_parse_result& xpath_query::result() const + { + return _result; + } + + PUGI__FN static void unspecified_bool_xpath_query(xpath_query***) + { + } + + PUGI__FN xpath_query::operator xpath_query::unspecified_bool_type() const + { + return _impl ? unspecified_bool_xpath_query : 0; + } + + PUGI__FN bool xpath_query::operator!() const + { + return !_impl; + } + + PUGI__FN xpath_node xml_node::select_single_node(const char_t* query, xpath_variable_set* variables) const + { + xpath_query q(query, variables); + return select_single_node(q); + } + + PUGI__FN xpath_node xml_node::select_single_node(const xpath_query& query) const + { + xpath_node_set s = query.evaluate_node_set(*this); + return s.empty() ? xpath_node() : s.first(); + } + + PUGI__FN xpath_node_set xml_node::select_nodes(const char_t* query, xpath_variable_set* variables) const + { + xpath_query q(query, variables); + return select_nodes(q); + } + + PUGI__FN xpath_node_set xml_node::select_nodes(const xpath_query& query) const + { + return query.evaluate_node_set(*this); + } +} + +#endif + +#ifdef __BORLANDC__ +# pragma option pop +#endif + +// Intel C++ does not properly keep warning state for function templates, +// so popping warning state at the end of translation unit leads to warnings in the middle. +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) +# pragma warning(pop) +#endif + +// Undefine all local macros (makes sure we're not leaking macros in header-only mode) +#undef PUGI__NO_INLINE +#undef PUGI__STATIC_ASSERT +#undef PUGI__DMC_VOLATILE +#undef PUGI__MSVC_CRT_VERSION +#undef PUGI__NS_BEGIN +#undef PUGI__NS_END +#undef PUGI__FN +#undef PUGI__FN_NO_INLINE +#undef PUGI__IS_CHARTYPE_IMPL +#undef PUGI__IS_CHARTYPE +#undef PUGI__IS_CHARTYPEX +#undef PUGI__SKIPWS +#undef PUGI__OPTSET +#undef PUGI__PUSHNODE +#undef PUGI__POPNODE +#undef PUGI__SCANFOR +#undef PUGI__SCANWHILE +#undef PUGI__ENDSEG +#undef PUGI__THROW_ERROR +#undef PUGI__CHECK_ERROR + +#endif + +/** + * Copyright (c) 2006-2014 Arseny Kapoulkine + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ diff --git a/Table Generator/PugiXML/pugixml.hpp b/Table Generator/PugiXML/pugixml.hpp new file mode 100644 index 0000000..6fb99be --- /dev/null +++ b/Table Generator/PugiXML/pugixml.hpp @@ -0,0 +1,1332 @@ +/** + * pugixml parser - version 1.4 + * -------------------------------------------------------- + * Copyright (C) 2006-2014, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) + * Report bugs and download new versions at http://pugixml.org/ + * + * This library is distributed under the MIT License. See notice at the end + * of this file. + * + * This work is based on the pugxml parser, which is: + * Copyright (C) 2003, by Kristen Wegner (kristen@tima.net) + */ + +#ifndef PUGIXML_VERSION +// Define version macro; evaluates to major * 100 + minor so that it's safe to use in less-than comparisons +# define PUGIXML_VERSION 140 +#endif + +// Include user configuration file (this can define various configuration macros) +#include "pugiconfig.hpp" + +#ifndef HEADER_PUGIXML_HPP +#define HEADER_PUGIXML_HPP + +// Include stddef.h for size_t and ptrdiff_t +#include + +// Include exception header for XPath +#if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS) +# include +#endif + +// Include STL headers +#ifndef PUGIXML_NO_STL +# include +# include +# include +#endif + +// Macro for deprecated features +#ifndef PUGIXML_DEPRECATED +# if defined(__GNUC__) +# define PUGIXML_DEPRECATED __attribute__((deprecated)) +# elif defined(_MSC_VER) && _MSC_VER >= 1300 +# define PUGIXML_DEPRECATED __declspec(deprecated) +# else +# define PUGIXML_DEPRECATED +# endif +#endif + +// If no API is defined, assume default +#ifndef PUGIXML_API +# define PUGIXML_API +#endif + +// If no API for classes is defined, assume default +#ifndef PUGIXML_CLASS +# define PUGIXML_CLASS PUGIXML_API +#endif + +// If no API for functions is defined, assume default +#ifndef PUGIXML_FUNCTION +# define PUGIXML_FUNCTION PUGIXML_API +#endif + +// If the platform is known to have long long support, enable long long functions +#ifndef PUGIXML_HAS_LONG_LONG +# if defined(__cplusplus) && __cplusplus >= 201103 +# define PUGIXML_HAS_LONG_LONG +# elif defined(_MSC_VER) && _MSC_VER >= 1400 +# define PUGIXML_HAS_LONG_LONG +# endif +#endif + +// Character interface macros +#ifdef PUGIXML_WCHAR_MODE +# define PUGIXML_TEXT(t) L ## t +# define PUGIXML_CHAR wchar_t +#else +# define PUGIXML_TEXT(t) t +# define PUGIXML_CHAR char +#endif + +namespace pugi +{ + // Character type used for all internal storage and operations; depends on PUGIXML_WCHAR_MODE + typedef PUGIXML_CHAR char_t; + +#ifndef PUGIXML_NO_STL + // String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE + typedef std::basic_string, std::allocator > string_t; +#endif +} + +// The PugiXML namespace +namespace pugi +{ + // Tree node types + enum xml_node_type + { + node_null, // Empty (null) node handle + node_document, // A document tree's absolute root + node_element, // Element tag, i.e. '' + node_pcdata, // Plain character data, i.e. 'text' + node_cdata, // Character data, i.e. '' + node_comment, // Comment tag, i.e. '' + node_pi, // Processing instruction, i.e. '' + node_declaration, // Document declaration, i.e. '' + node_doctype // Document type declaration, i.e. '' + }; + + // Parsing options + + // Minimal parsing mode (equivalent to turning all other flags off). + // Only elements and PCDATA sections are added to the DOM tree, no text conversions are performed. + const unsigned int parse_minimal = 0x0000; + + // This flag determines if processing instructions (node_pi) are added to the DOM tree. This flag is off by default. + const unsigned int parse_pi = 0x0001; + + // This flag determines if comments (node_comment) are added to the DOM tree. This flag is off by default. + const unsigned int parse_comments = 0x0002; + + // This flag determines if CDATA sections (node_cdata) are added to the DOM tree. This flag is on by default. + const unsigned int parse_cdata = 0x0004; + + // This flag determines if plain character data (node_pcdata) that consist only of whitespace are added to the DOM tree. + // This flag is off by default; turning it on usually results in slower parsing and more memory consumption. + const unsigned int parse_ws_pcdata = 0x0008; + + // This flag determines if character and entity references are expanded during parsing. This flag is on by default. + const unsigned int parse_escapes = 0x0010; + + // This flag determines if EOL characters are normalized (converted to #xA) during parsing. This flag is on by default. + const unsigned int parse_eol = 0x0020; + + // This flag determines if attribute values are normalized using CDATA normalization rules during parsing. This flag is on by default. + const unsigned int parse_wconv_attribute = 0x0040; + + // This flag determines if attribute values are normalized using NMTOKENS normalization rules during parsing. This flag is off by default. + const unsigned int parse_wnorm_attribute = 0x0080; + + // This flag determines if document declaration (node_declaration) is added to the DOM tree. This flag is off by default. + const unsigned int parse_declaration = 0x0100; + + // This flag determines if document type declaration (node_doctype) is added to the DOM tree. This flag is off by default. + const unsigned int parse_doctype = 0x0200; + + // This flag determines if plain character data (node_pcdata) that is the only child of the parent node and that consists only + // of whitespace is added to the DOM tree. + // This flag is off by default; turning it on may result in slower parsing and more memory consumption. + const unsigned int parse_ws_pcdata_single = 0x0400; + + // This flag determines if leading and trailing whitespace is to be removed from plain character data. This flag is off by default. + const unsigned int parse_trim_pcdata = 0x0800; + + // This flag determines if plain character data that does not have a parent node is added to the DOM tree, and if an empty document + // is a valid document. This flag is off by default. + const unsigned int parse_fragment = 0x1000; + + // The default parsing mode. + // Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded, + // End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules. + const unsigned int parse_default = parse_cdata | parse_escapes | parse_wconv_attribute | parse_eol; + + // The full parsing mode. + // Nodes of all types are added to the DOM tree, character/reference entities are expanded, + // End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules. + const unsigned int parse_full = parse_default | parse_pi | parse_comments | parse_declaration | parse_doctype; + + // These flags determine the encoding of input data for XML document + enum xml_encoding + { + encoding_auto, // Auto-detect input encoding using BOM or < / class xml_object_range + { + public: + typedef It const_iterator; + typedef It iterator; + + xml_object_range(It b, It e): _begin(b), _end(e) + { + } + + It begin() const { return _begin; } + It end() const { return _end; } + + private: + It _begin, _end; + }; + + // Writer interface for node printing (see xml_node::print) + class PUGIXML_CLASS xml_writer + { + public: + virtual ~xml_writer() {} + + // Write memory chunk into stream/file/whatever + virtual void write(const void* data, size_t size) = 0; + }; + + // xml_writer implementation for FILE* + class PUGIXML_CLASS xml_writer_file: public xml_writer + { + public: + // Construct writer from a FILE* object; void* is used to avoid header dependencies on stdio + xml_writer_file(void* file); + + virtual void write(const void* data, size_t size); + + private: + void* file; + }; + + #ifndef PUGIXML_NO_STL + // xml_writer implementation for streams + class PUGIXML_CLASS xml_writer_stream: public xml_writer + { + public: + // Construct writer from an output stream object + xml_writer_stream(std::basic_ostream >& stream); + xml_writer_stream(std::basic_ostream >& stream); + + virtual void write(const void* data, size_t size); + + private: + std::basic_ostream >* narrow_stream; + std::basic_ostream >* wide_stream; + }; + #endif + + // A light-weight handle for manipulating attributes in DOM tree + class PUGIXML_CLASS xml_attribute + { + friend class xml_attribute_iterator; + friend class xml_node; + + private: + xml_attribute_struct* _attr; + + typedef void (*unspecified_bool_type)(xml_attribute***); + + public: + // Default constructor. Constructs an empty attribute. + xml_attribute(); + + // Constructs attribute from internal pointer + explicit xml_attribute(xml_attribute_struct* attr); + + // Safe bool conversion operator + operator unspecified_bool_type() const; + + // Borland C++ workaround + bool operator!() const; + + // Comparison operators (compares wrapped attribute pointers) + bool operator==(const xml_attribute& r) const; + bool operator!=(const xml_attribute& r) const; + bool operator<(const xml_attribute& r) const; + bool operator>(const xml_attribute& r) const; + bool operator<=(const xml_attribute& r) const; + bool operator>=(const xml_attribute& r) const; + + // Check if attribute is empty + bool empty() const; + + // Get attribute name/value, or "" if attribute is empty + const char_t* name() const; + const char_t* value() const; + + // Get attribute value, or the default value if attribute is empty + const char_t* as_string(const char_t* def = PUGIXML_TEXT("")) const; + + // Get attribute value as a number, or the default value if conversion did not succeed or attribute is empty + int as_int(int def = 0) const; + unsigned int as_uint(unsigned int def = 0) const; + double as_double(double def = 0) const; + float as_float(float def = 0) const; + + #ifdef PUGIXML_HAS_LONG_LONG + long long as_llong(long long def = 0) const; + unsigned long long as_ullong(unsigned long long def = 0) const; + #endif + + // Get attribute value as bool (returns true if first character is in '1tTyY' set), or the default value if attribute is empty + bool as_bool(bool def = false) const; + + // Set attribute name/value (returns false if attribute is empty or there is not enough memory) + bool set_name(const char_t* rhs); + bool set_value(const char_t* rhs); + + // Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false") + bool set_value(int rhs); + bool set_value(unsigned int rhs); + bool set_value(double rhs); + bool set_value(bool rhs); + + #ifdef PUGIXML_HAS_LONG_LONG + bool set_value(long long rhs); + bool set_value(unsigned long long rhs); + #endif + + // Set attribute value (equivalent to set_value without error checking) + xml_attribute& operator=(const char_t* rhs); + xml_attribute& operator=(int rhs); + xml_attribute& operator=(unsigned int rhs); + xml_attribute& operator=(double rhs); + xml_attribute& operator=(bool rhs); + + #ifdef PUGIXML_HAS_LONG_LONG + xml_attribute& operator=(long long rhs); + xml_attribute& operator=(unsigned long long rhs); + #endif + + // Get next/previous attribute in the attribute list of the parent node + xml_attribute next_attribute() const; + xml_attribute previous_attribute() const; + + // Get hash value (unique for handles to the same object) + size_t hash_value() const; + + // Get internal pointer + xml_attribute_struct* internal_object() const; + }; + +#ifdef __BORLANDC__ + // Borland C++ workaround + bool PUGIXML_FUNCTION operator&&(const xml_attribute& lhs, bool rhs); + bool PUGIXML_FUNCTION operator||(const xml_attribute& lhs, bool rhs); +#endif + + // A light-weight handle for manipulating nodes in DOM tree + class PUGIXML_CLASS xml_node + { + friend class xml_attribute_iterator; + friend class xml_node_iterator; + friend class xml_named_node_iterator; + + protected: + xml_node_struct* _root; + + typedef void (*unspecified_bool_type)(xml_node***); + + public: + // Default constructor. Constructs an empty node. + xml_node(); + + // Constructs node from internal pointer + explicit xml_node(xml_node_struct* p); + + // Safe bool conversion operator + operator unspecified_bool_type() const; + + // Borland C++ workaround + bool operator!() const; + + // Comparison operators (compares wrapped node pointers) + bool operator==(const xml_node& r) const; + bool operator!=(const xml_node& r) const; + bool operator<(const xml_node& r) const; + bool operator>(const xml_node& r) const; + bool operator<=(const xml_node& r) const; + bool operator>=(const xml_node& r) const; + + // Check if node is empty. + bool empty() const; + + // Get node type + xml_node_type type() const; + + // Get node name, or "" if node is empty or it has no name + const char_t* name() const; + + // Get node value, or "" if node is empty or it has no value + // Note: For text node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes. + const char_t* value() const; + + // Get attribute list + xml_attribute first_attribute() const; + xml_attribute last_attribute() const; + + // Get children list + xml_node first_child() const; + xml_node last_child() const; + + // Get next/previous sibling in the children list of the parent node + xml_node next_sibling() const; + xml_node previous_sibling() const; + + // Get parent node + xml_node parent() const; + + // Get root of DOM tree this node belongs to + xml_node root() const; + + // Get text object for the current node + xml_text text() const; + + // Get child, attribute or next/previous sibling with the specified name + xml_node child(const char_t* name) const; + xml_attribute attribute(const char_t* name) const; + xml_node next_sibling(const char_t* name) const; + xml_node previous_sibling(const char_t* name) const; + + // Get child value of current node; that is, value of the first child node of type PCDATA/CDATA + const char_t* child_value() const; + + // Get child value of child with specified name. Equivalent to child(name).child_value(). + const char_t* child_value(const char_t* name) const; + + // Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value) + bool set_name(const char_t* rhs); + bool set_value(const char_t* rhs); + + // Add attribute with specified name. Returns added attribute, or empty attribute on errors. + xml_attribute append_attribute(const char_t* name); + xml_attribute prepend_attribute(const char_t* name); + xml_attribute insert_attribute_after(const char_t* name, const xml_attribute& attr); + xml_attribute insert_attribute_before(const char_t* name, const xml_attribute& attr); + + // Add a copy of the specified attribute. Returns added attribute, or empty attribute on errors. + xml_attribute append_copy(const xml_attribute& proto); + xml_attribute prepend_copy(const xml_attribute& proto); + xml_attribute insert_copy_after(const xml_attribute& proto, const xml_attribute& attr); + xml_attribute insert_copy_before(const xml_attribute& proto, const xml_attribute& attr); + + // Add child node with specified type. Returns added node, or empty node on errors. + xml_node append_child(xml_node_type type = node_element); + xml_node prepend_child(xml_node_type type = node_element); + xml_node insert_child_after(xml_node_type type, const xml_node& node); + xml_node insert_child_before(xml_node_type type, const xml_node& node); + + // Add child element with specified name. Returns added node, or empty node on errors. + xml_node append_child(const char_t* name); + xml_node prepend_child(const char_t* name); + xml_node insert_child_after(const char_t* name, const xml_node& node); + xml_node insert_child_before(const char_t* name, const xml_node& node); + + // Add a copy of the specified node as a child. Returns added node, or empty node on errors. + xml_node append_copy(const xml_node& proto); + xml_node prepend_copy(const xml_node& proto); + xml_node insert_copy_after(const xml_node& proto, const xml_node& node); + xml_node insert_copy_before(const xml_node& proto, const xml_node& node); + + // Remove specified attribute + bool remove_attribute(const xml_attribute& a); + bool remove_attribute(const char_t* name); + + // Remove specified child + bool remove_child(const xml_node& n); + bool remove_child(const char_t* name); + + // Parses buffer as an XML document fragment and appends all nodes as children of the current node. + // Copies/converts the buffer, so it may be deleted or changed after the function returns. + // Note: append_buffer allocates memory that has the lifetime of the owning document; removing the appended nodes does not immediately reclaim that memory. + xml_parse_result append_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); + + // Find attribute using predicate. Returns first attribute for which predicate returned true. + template xml_attribute find_attribute(Predicate pred) const + { + if (!_root) return xml_attribute(); + + for (xml_attribute attrib = first_attribute(); attrib; attrib = attrib.next_attribute()) + if (pred(attrib)) + return attrib; + + return xml_attribute(); + } + + // Find child node using predicate. Returns first child for which predicate returned true. + template xml_node find_child(Predicate pred) const + { + if (!_root) return xml_node(); + + for (xml_node node = first_child(); node; node = node.next_sibling()) + if (pred(node)) + return node; + + return xml_node(); + } + + // Find node from subtree using predicate. Returns first node from subtree (depth-first), for which predicate returned true. + template xml_node find_node(Predicate pred) const + { + if (!_root) return xml_node(); + + xml_node cur = first_child(); + + while (cur._root && cur._root != _root) + { + if (pred(cur)) return cur; + + if (cur.first_child()) cur = cur.first_child(); + else if (cur.next_sibling()) cur = cur.next_sibling(); + else + { + while (!cur.next_sibling() && cur._root != _root) cur = cur.parent(); + + if (cur._root != _root) cur = cur.next_sibling(); + } + } + + return xml_node(); + } + + // Find child node by attribute name/value + xml_node find_child_by_attribute(const char_t* name, const char_t* attr_name, const char_t* attr_value) const; + xml_node find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const; + + #ifndef PUGIXML_NO_STL + // Get the absolute node path from root as a text string. + string_t path(char_t delimiter = '/') const; + #endif + + // Search for a node by path consisting of node names and . or .. elements. + xml_node first_element_by_path(const char_t* path, char_t delimiter = '/') const; + + // Recursively traverse subtree with xml_tree_walker + bool traverse(xml_tree_walker& walker); + + #ifndef PUGIXML_NO_XPATH + // Select single node by evaluating XPath query. Returns first node from the resulting node set. + xpath_node select_single_node(const char_t* query, xpath_variable_set* variables = 0) const; + xpath_node select_single_node(const xpath_query& query) const; + + // Select node set by evaluating XPath query + xpath_node_set select_nodes(const char_t* query, xpath_variable_set* variables = 0) const; + xpath_node_set select_nodes(const xpath_query& query) const; + #endif + + // Print subtree using a writer object + void print(xml_writer& writer, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const; + + #ifndef PUGIXML_NO_STL + // Print subtree to stream + void print(std::basic_ostream >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const; + void print(std::basic_ostream >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const; + #endif + + // Child nodes iterators + typedef xml_node_iterator iterator; + + iterator begin() const; + iterator end() const; + + // Attribute iterators + typedef xml_attribute_iterator attribute_iterator; + + attribute_iterator attributes_begin() const; + attribute_iterator attributes_end() const; + + // Range-based for support + xml_object_range children() const; + xml_object_range children(const char_t* name) const; + xml_object_range attributes() const; + + // Get node offset in parsed file/string (in char_t units) for debugging purposes + ptrdiff_t offset_debug() const; + + // Get hash value (unique for handles to the same object) + size_t hash_value() const; + + // Get internal pointer + xml_node_struct* internal_object() const; + }; + +#ifdef __BORLANDC__ + // Borland C++ workaround + bool PUGIXML_FUNCTION operator&&(const xml_node& lhs, bool rhs); + bool PUGIXML_FUNCTION operator||(const xml_node& lhs, bool rhs); +#endif + + // A helper for working with text inside PCDATA nodes + class PUGIXML_CLASS xml_text + { + friend class xml_node; + + xml_node_struct* _root; + + typedef void (*unspecified_bool_type)(xml_text***); + + explicit xml_text(xml_node_struct* root); + + xml_node_struct* _data_new(); + xml_node_struct* _data() const; + + public: + // Default constructor. Constructs an empty object. + xml_text(); + + // Safe bool conversion operator + operator unspecified_bool_type() const; + + // Borland C++ workaround + bool operator!() const; + + // Check if text object is empty + bool empty() const; + + // Get text, or "" if object is empty + const char_t* get() const; + + // Get text, or the default value if object is empty + const char_t* as_string(const char_t* def = PUGIXML_TEXT("")) const; + + // Get text as a number, or the default value if conversion did not succeed or object is empty + int as_int(int def = 0) const; + unsigned int as_uint(unsigned int def = 0) const; + double as_double(double def = 0) const; + float as_float(float def = 0) const; + + #ifdef PUGIXML_HAS_LONG_LONG + long long as_llong(long long def = 0) const; + unsigned long long as_ullong(unsigned long long def = 0) const; + #endif + + // Get text as bool (returns true if first character is in '1tTyY' set), or the default value if object is empty + bool as_bool(bool def = false) const; + + // Set text (returns false if object is empty or there is not enough memory) + bool set(const char_t* rhs); + + // Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false") + bool set(int rhs); + bool set(unsigned int rhs); + bool set(double rhs); + bool set(bool rhs); + + #ifdef PUGIXML_HAS_LONG_LONG + bool set(long long rhs); + bool set(unsigned long long rhs); + #endif + + // Set text (equivalent to set without error checking) + xml_text& operator=(const char_t* rhs); + xml_text& operator=(int rhs); + xml_text& operator=(unsigned int rhs); + xml_text& operator=(double rhs); + xml_text& operator=(bool rhs); + + #ifdef PUGIXML_HAS_LONG_LONG + xml_text& operator=(long long rhs); + xml_text& operator=(unsigned long long rhs); + #endif + + // Get the data node (node_pcdata or node_cdata) for this object + xml_node data() const; + }; + +#ifdef __BORLANDC__ + // Borland C++ workaround + bool PUGIXML_FUNCTION operator&&(const xml_text& lhs, bool rhs); + bool PUGIXML_FUNCTION operator||(const xml_text& lhs, bool rhs); +#endif + + // Child node iterator (a bidirectional iterator over a collection of xml_node) + class PUGIXML_CLASS xml_node_iterator + { + friend class xml_node; + + private: + mutable xml_node _wrap; + xml_node _parent; + + xml_node_iterator(xml_node_struct* ref, xml_node_struct* parent); + + public: + // Iterator traits + typedef ptrdiff_t difference_type; + typedef xml_node value_type; + typedef xml_node* pointer; + typedef xml_node& reference; + + #ifndef PUGIXML_NO_STL + typedef std::bidirectional_iterator_tag iterator_category; + #endif + + // Default constructor + xml_node_iterator(); + + // Construct an iterator which points to the specified node + xml_node_iterator(const xml_node& node); + + // Iterator operators + bool operator==(const xml_node_iterator& rhs) const; + bool operator!=(const xml_node_iterator& rhs) const; + + xml_node& operator*() const; + xml_node* operator->() const; + + const xml_node_iterator& operator++(); + xml_node_iterator operator++(int); + + const xml_node_iterator& operator--(); + xml_node_iterator operator--(int); + }; + + // Attribute iterator (a bidirectional iterator over a collection of xml_attribute) + class PUGIXML_CLASS xml_attribute_iterator + { + friend class xml_node; + + private: + mutable xml_attribute _wrap; + xml_node _parent; + + xml_attribute_iterator(xml_attribute_struct* ref, xml_node_struct* parent); + + public: + // Iterator traits + typedef ptrdiff_t difference_type; + typedef xml_attribute value_type; + typedef xml_attribute* pointer; + typedef xml_attribute& reference; + + #ifndef PUGIXML_NO_STL + typedef std::bidirectional_iterator_tag iterator_category; + #endif + + // Default constructor + xml_attribute_iterator(); + + // Construct an iterator which points to the specified attribute + xml_attribute_iterator(const xml_attribute& attr, const xml_node& parent); + + // Iterator operators + bool operator==(const xml_attribute_iterator& rhs) const; + bool operator!=(const xml_attribute_iterator& rhs) const; + + xml_attribute& operator*() const; + xml_attribute* operator->() const; + + const xml_attribute_iterator& operator++(); + xml_attribute_iterator operator++(int); + + const xml_attribute_iterator& operator--(); + xml_attribute_iterator operator--(int); + }; + + // Named node range helper + class PUGIXML_CLASS xml_named_node_iterator + { + friend class xml_node; + + public: + // Iterator traits + typedef ptrdiff_t difference_type; + typedef xml_node value_type; + typedef xml_node* pointer; + typedef xml_node& reference; + + #ifndef PUGIXML_NO_STL + typedef std::bidirectional_iterator_tag iterator_category; + #endif + + // Default constructor + xml_named_node_iterator(); + + // Construct an iterator which points to the specified node + xml_named_node_iterator(const xml_node& node, const char_t* name); + + // Iterator operators + bool operator==(const xml_named_node_iterator& rhs) const; + bool operator!=(const xml_named_node_iterator& rhs) const; + + xml_node& operator*() const; + xml_node* operator->() const; + + const xml_named_node_iterator& operator++(); + xml_named_node_iterator operator++(int); + + const xml_named_node_iterator& operator--(); + xml_named_node_iterator operator--(int); + + private: + mutable xml_node _wrap; + xml_node _parent; + const char_t* _name; + + xml_named_node_iterator(xml_node_struct* ref, xml_node_struct* parent, const char_t* name); + }; + + // Abstract tree walker class (see xml_node::traverse) + class PUGIXML_CLASS xml_tree_walker + { + friend class xml_node; + + private: + int _depth; + + protected: + // Get current traversal depth + int depth() const; + + public: + xml_tree_walker(); + virtual ~xml_tree_walker(); + + // Callback that is called when traversal begins + virtual bool begin(xml_node& node); + + // Callback that is called for each node traversed + virtual bool for_each(xml_node& node) = 0; + + // Callback that is called when traversal ends + virtual bool end(xml_node& node); + }; + + // Parsing status, returned as part of xml_parse_result object + enum xml_parse_status + { + status_ok = 0, // No error + + status_file_not_found, // File was not found during load_file() + status_io_error, // Error reading from file/stream + status_out_of_memory, // Could not allocate memory + status_internal_error, // Internal error occurred + + status_unrecognized_tag, // Parser could not determine tag type + + status_bad_pi, // Parsing error occurred while parsing document declaration/processing instruction + status_bad_comment, // Parsing error occurred while parsing comment + status_bad_cdata, // Parsing error occurred while parsing CDATA section + status_bad_doctype, // Parsing error occurred while parsing document type declaration + status_bad_pcdata, // Parsing error occurred while parsing PCDATA section + status_bad_start_element, // Parsing error occurred while parsing start element tag + status_bad_attribute, // Parsing error occurred while parsing element attribute + status_bad_end_element, // Parsing error occurred while parsing end element tag + status_end_element_mismatch,// There was a mismatch of start-end tags (closing tag had incorrect name, some tag was not closed or there was an excessive closing tag) + + status_append_invalid_root, // Unable to append nodes since root type is not node_element or node_document (exclusive to xml_node::append_buffer) + + status_no_document_element // Parsing resulted in a document without element nodes + }; + + // Parsing result + struct PUGIXML_CLASS xml_parse_result + { + // Parsing status (see xml_parse_status) + xml_parse_status status; + + // Last parsed offset (in char_t units from start of input data) + ptrdiff_t offset; + + // Source document encoding + xml_encoding encoding; + + // Default constructor, initializes object to failed state + xml_parse_result(); + + // Cast to bool operator + operator bool() const; + + // Get error description + const char* description() const; + }; + + // Document class (DOM tree root) + class PUGIXML_CLASS xml_document: public xml_node + { + private: + char_t* _buffer; + + char _memory[192]; + + // Non-copyable semantics + xml_document(const xml_document&); + const xml_document& operator=(const xml_document&); + + void create(); + void destroy(); + + public: + // Default constructor, makes empty document + xml_document(); + + // Destructor, invalidates all node/attribute handles to this document + ~xml_document(); + + // Removes all nodes, leaving the empty document + void reset(); + + // Removes all nodes, then copies the entire contents of the specified document + void reset(const xml_document& proto); + + #ifndef PUGIXML_NO_STL + // Load document from stream. + xml_parse_result load(std::basic_istream >& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); + xml_parse_result load(std::basic_istream >& stream, unsigned int options = parse_default); + #endif + + // Load document from zero-terminated string. No encoding conversions are applied. + xml_parse_result load(const char_t* contents, unsigned int options = parse_default); + + // Load document from file + xml_parse_result load_file(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); + xml_parse_result load_file(const wchar_t* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); + + // Load document from buffer. Copies/converts the buffer, so it may be deleted or changed after the function returns. + xml_parse_result load_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); + + // Load document from buffer, using the buffer for in-place parsing (the buffer is modified and used for storage of document data). + // You should ensure that buffer data will persist throughout the document's lifetime, and free the buffer memory manually once document is destroyed. + xml_parse_result load_buffer_inplace(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); + + // Load document from buffer, using the buffer for in-place parsing (the buffer is modified and used for storage of document data). + // You should allocate the buffer with pugixml allocation function; document will free the buffer when it is no longer needed (you can't use it anymore). + xml_parse_result load_buffer_inplace_own(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); + + // Save XML document to writer (semantics is slightly different from xml_node::print, see documentation for details). + void save(xml_writer& writer, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const; + + #ifndef PUGIXML_NO_STL + // Save XML document to stream (semantics is slightly different from xml_node::print, see documentation for details). + void save(std::basic_ostream >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const; + void save(std::basic_ostream >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const; + #endif + + // Save XML to file + bool save_file(const char* path, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const; + bool save_file(const wchar_t* path, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const; + + // Get document element + xml_node document_element() const; + }; + +#ifndef PUGIXML_NO_XPATH + // XPath query return type + enum xpath_value_type + { + xpath_type_none, // Unknown type (query failed to compile) + xpath_type_node_set, // Node set (xpath_node_set) + xpath_type_number, // Number + xpath_type_string, // String + xpath_type_boolean // Boolean + }; + + // XPath parsing result + struct PUGIXML_CLASS xpath_parse_result + { + // Error message (0 if no error) + const char* error; + + // Last parsed offset (in char_t units from string start) + ptrdiff_t offset; + + // Default constructor, initializes object to failed state + xpath_parse_result(); + + // Cast to bool operator + operator bool() const; + + // Get error description + const char* description() const; + }; + + // A single XPath variable + class PUGIXML_CLASS xpath_variable + { + friend class xpath_variable_set; + + protected: + xpath_value_type _type; + xpath_variable* _next; + + xpath_variable(); + + // Non-copyable semantics + xpath_variable(const xpath_variable&); + xpath_variable& operator=(const xpath_variable&); + + public: + // Get variable name + const char_t* name() const; + + // Get variable type + xpath_value_type type() const; + + // Get variable value; no type conversion is performed, default value (false, NaN, empty string, empty node set) is returned on type mismatch error + bool get_boolean() const; + double get_number() const; + const char_t* get_string() const; + const xpath_node_set& get_node_set() const; + + // Set variable value; no type conversion is performed, false is returned on type mismatch error + bool set(bool value); + bool set(double value); + bool set(const char_t* value); + bool set(const xpath_node_set& value); + }; + + // A set of XPath variables + class PUGIXML_CLASS xpath_variable_set + { + private: + xpath_variable* _data[64]; + + // Non-copyable semantics + xpath_variable_set(const xpath_variable_set&); + xpath_variable_set& operator=(const xpath_variable_set&); + + xpath_variable* find(const char_t* name) const; + + public: + // Default constructor/destructor + xpath_variable_set(); + ~xpath_variable_set(); + + // Add a new variable or get the existing one, if the types match + xpath_variable* add(const char_t* name, xpath_value_type type); + + // Set value of an existing variable; no type conversion is performed, false is returned if there is no such variable or if types mismatch + bool set(const char_t* name, bool value); + bool set(const char_t* name, double value); + bool set(const char_t* name, const char_t* value); + bool set(const char_t* name, const xpath_node_set& value); + + // Get existing variable by name + xpath_variable* get(const char_t* name); + const xpath_variable* get(const char_t* name) const; + }; + + // A compiled XPath query object + class PUGIXML_CLASS xpath_query + { + private: + void* _impl; + xpath_parse_result _result; + + typedef void (*unspecified_bool_type)(xpath_query***); + + // Non-copyable semantics + xpath_query(const xpath_query&); + xpath_query& operator=(const xpath_query&); + + public: + // Construct a compiled object from XPath expression. + // If PUGIXML_NO_EXCEPTIONS is not defined, throws xpath_exception on compilation errors. + explicit xpath_query(const char_t* query, xpath_variable_set* variables = 0); + + // Destructor + ~xpath_query(); + + // Get query expression return type + xpath_value_type return_type() const; + + // Evaluate expression as boolean value in the specified context; performs type conversion if necessary. + // If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors. + bool evaluate_boolean(const xpath_node& n) const; + + // Evaluate expression as double value in the specified context; performs type conversion if necessary. + // If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors. + double evaluate_number(const xpath_node& n) const; + + #ifndef PUGIXML_NO_STL + // Evaluate expression as string value in the specified context; performs type conversion if necessary. + // If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors. + string_t evaluate_string(const xpath_node& n) const; + #endif + + // Evaluate expression as string value in the specified context; performs type conversion if necessary. + // At most capacity characters are written to the destination buffer, full result size is returned (includes terminating zero). + // If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors. + // If PUGIXML_NO_EXCEPTIONS is defined, returns empty set instead. + size_t evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const; + + // Evaluate expression as node set in the specified context. + // If PUGIXML_NO_EXCEPTIONS is not defined, throws xpath_exception on type mismatch and std::bad_alloc on out of memory errors. + // If PUGIXML_NO_EXCEPTIONS is defined, returns empty node set instead. + xpath_node_set evaluate_node_set(const xpath_node& n) const; + + // Get parsing result (used to get compilation errors in PUGIXML_NO_EXCEPTIONS mode) + const xpath_parse_result& result() const; + + // Safe bool conversion operator + operator unspecified_bool_type() const; + + // Borland C++ workaround + bool operator!() const; + }; + + #ifndef PUGIXML_NO_EXCEPTIONS + // XPath exception class + class PUGIXML_CLASS xpath_exception: public std::exception + { + private: + xpath_parse_result _result; + + public: + // Construct exception from parse result + explicit xpath_exception(const xpath_parse_result& result); + + // Get error message + virtual const char* what() const throw(); + + // Get parse result + const xpath_parse_result& result() const; + }; + #endif + + // XPath node class (either xml_node or xml_attribute) + class PUGIXML_CLASS xpath_node + { + private: + xml_node _node; + xml_attribute _attribute; + + typedef void (*unspecified_bool_type)(xpath_node***); + + public: + // Default constructor; constructs empty XPath node + xpath_node(); + + // Construct XPath node from XML node/attribute + xpath_node(const xml_node& node); + xpath_node(const xml_attribute& attribute, const xml_node& parent); + + // Get node/attribute, if any + xml_node node() const; + xml_attribute attribute() const; + + // Get parent of contained node/attribute + xml_node parent() const; + + // Safe bool conversion operator + operator unspecified_bool_type() const; + + // Borland C++ workaround + bool operator!() const; + + // Comparison operators + bool operator==(const xpath_node& n) const; + bool operator!=(const xpath_node& n) const; + }; + +#ifdef __BORLANDC__ + // Borland C++ workaround + bool PUGIXML_FUNCTION operator&&(const xpath_node& lhs, bool rhs); + bool PUGIXML_FUNCTION operator||(const xpath_node& lhs, bool rhs); +#endif + + // A fixed-size collection of XPath nodes + class PUGIXML_CLASS xpath_node_set + { + public: + // Collection type + enum type_t + { + type_unsorted, // Not ordered + type_sorted, // Sorted by document order (ascending) + type_sorted_reverse // Sorted by document order (descending) + }; + + // Constant iterator type + typedef const xpath_node* const_iterator; + + // Default constructor. Constructs empty set. + xpath_node_set(); + + // Constructs a set from iterator range; data is not checked for duplicates and is not sorted according to provided type, so be careful + xpath_node_set(const_iterator begin, const_iterator end, type_t type = type_unsorted); + + // Destructor + ~xpath_node_set(); + + // Copy constructor/assignment operator + xpath_node_set(const xpath_node_set& ns); + xpath_node_set& operator=(const xpath_node_set& ns); + + // Get collection type + type_t type() const; + + // Get collection size + size_t size() const; + + // Indexing operator + const xpath_node& operator[](size_t index) const; + + // Collection iterators + const_iterator begin() const; + const_iterator end() const; + + // Sort the collection in ascending/descending order by document order + void sort(bool reverse = false); + + // Get first node in the collection by document order + xpath_node first() const; + + // Check if collection is empty + bool empty() const; + + private: + type_t _type; + + xpath_node _storage; + + xpath_node* _begin; + xpath_node* _end; + + void _assign(const_iterator begin, const_iterator end); + }; +#endif + +#ifndef PUGIXML_NO_STL + // Convert wide string to UTF8 + std::basic_string, std::allocator > PUGIXML_FUNCTION as_utf8(const wchar_t* str); + std::basic_string, std::allocator > PUGIXML_FUNCTION as_utf8(const std::basic_string, std::allocator >& str); + + // Convert UTF8 to wide string + std::basic_string, std::allocator > PUGIXML_FUNCTION as_wide(const char* str); + std::basic_string, std::allocator > PUGIXML_FUNCTION as_wide(const std::basic_string, std::allocator >& str); +#endif + + // Memory allocation function interface; returns pointer to allocated memory or NULL on failure + typedef void* (*allocation_function)(size_t size); + + // Memory deallocation function interface + typedef void (*deallocation_function)(void* ptr); + + // Override default memory management functions. All subsequent allocations/deallocations will be performed via supplied functions. + void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate); + + // Get current memory management functions + allocation_function PUGIXML_FUNCTION get_memory_allocation_function(); + deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function(); +} + +#if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC)) +namespace std +{ + // Workarounds for (non-standard) iterator category detection for older versions (MSVC7/IC8 and earlier) + std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(const pugi::xml_node_iterator&); + std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(const pugi::xml_attribute_iterator&); + std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(const pugi::xml_named_node_iterator&); +} +#endif + +#if !defined(PUGIXML_NO_STL) && defined(__SUNPRO_CC) +namespace std +{ + // Workarounds for (non-standard) iterator category detection + std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(const pugi::xml_node_iterator&); + std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(const pugi::xml_attribute_iterator&); + std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(const pugi::xml_named_node_iterator&); +} +#endif + +#endif + +/** + * Copyright (c) 2006-2014 Arseny Kapoulkine + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ diff --git a/Table Generator/Table Generator.cpp b/Table Generator/Table Generator.cpp new file mode 100644 index 0000000..ab9d41c --- /dev/null +++ b/Table Generator/Table Generator.cpp @@ -0,0 +1,8 @@ +#include +#include + +int _tmain(int argc, _TCHAR* argv[]) +{ + // TODO: + return 0; +} diff --git a/Table Generator/Table Generator.vcxproj b/Table Generator/Table Generator.vcxproj new file mode 100644 index 0000000..f81f69d --- /dev/null +++ b/Table Generator/Table Generator.vcxproj @@ -0,0 +1,155 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {BAC14FF0-2567-489A-BC83-840B3603C84A} + Win32Proj + TableGenerator + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + ./PugiXML;$(IncludePath) + + + true + ./PugiXML;$(IncludePath) + + + false + ./PugiXML;$(IncludePath) + + + false + ./PugiXML;$(IncludePath) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Table Generator/Table Generator.vcxproj.filters b/Table Generator/Table Generator.vcxproj.filters new file mode 100644 index 0000000..0bb6dd5 --- /dev/null +++ b/Table Generator/Table Generator.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Verteron Disassembler Engine.sln b/Verteron Disassembler Engine.sln new file mode 100644 index 0000000..074fe26 --- /dev/null +++ b/Verteron Disassembler Engine.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30723.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Verteron Disassembler Engine", "Verteron Disassembler Engine\Verteron Disassembler Engine.vcxproj", "{E9860351-F9EA-4D1B-8AE4-188E3212574A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Disassembler Test", "Disassembler Test\Disassembler Test.vcxproj", "{26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Table Generator", "Table Generator\Table Generator.vcxproj", "{BAC14FF0-2567-489A-BC83-840B3603C84A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E9860351-F9EA-4D1B-8AE4-188E3212574A}.Debug|Win32.ActiveCfg = Debug|Win32 + {E9860351-F9EA-4D1B-8AE4-188E3212574A}.Debug|Win32.Build.0 = Debug|Win32 + {E9860351-F9EA-4D1B-8AE4-188E3212574A}.Debug|x64.ActiveCfg = Debug|x64 + {E9860351-F9EA-4D1B-8AE4-188E3212574A}.Debug|x64.Build.0 = Debug|x64 + {E9860351-F9EA-4D1B-8AE4-188E3212574A}.Release|Win32.ActiveCfg = Release|Win32 + {E9860351-F9EA-4D1B-8AE4-188E3212574A}.Release|Win32.Build.0 = Release|Win32 + {E9860351-F9EA-4D1B-8AE4-188E3212574A}.Release|x64.ActiveCfg = Release|x64 + {E9860351-F9EA-4D1B-8AE4-188E3212574A}.Release|x64.Build.0 = Release|x64 + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}.Debug|Win32.ActiveCfg = Debug|Win32 + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}.Debug|Win32.Build.0 = Debug|Win32 + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}.Debug|x64.ActiveCfg = Debug|x64 + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}.Debug|x64.Build.0 = Debug|x64 + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}.Release|Win32.ActiveCfg = Release|Win32 + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}.Release|Win32.Build.0 = Release|Win32 + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}.Release|x64.ActiveCfg = Release|x64 + {26FB9B13-9A66-44D1-8E78-1E8AA2FCBEF3}.Release|x64.Build.0 = Release|x64 + {BAC14FF0-2567-489A-BC83-840B3603C84A}.Debug|Win32.ActiveCfg = Debug|Win32 + {BAC14FF0-2567-489A-BC83-840B3603C84A}.Debug|Win32.Build.0 = Debug|Win32 + {BAC14FF0-2567-489A-BC83-840B3603C84A}.Debug|x64.ActiveCfg = Debug|x64 + {BAC14FF0-2567-489A-BC83-840B3603C84A}.Debug|x64.Build.0 = Debug|x64 + {BAC14FF0-2567-489A-BC83-840B3603C84A}.Release|Win32.ActiveCfg = Release|Win32 + {BAC14FF0-2567-489A-BC83-840B3603C84A}.Release|Win32.Build.0 = Release|Win32 + {BAC14FF0-2567-489A-BC83-840B3603C84A}.Release|x64.ActiveCfg = Release|x64 + {BAC14FF0-2567-489A-BC83-840B3603C84A}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Verteron Disassembler Engine/VXDisassembler.h b/Verteron Disassembler Engine/VXDisassembler.h new file mode 100644 index 0000000..b63f246 --- /dev/null +++ b/Verteron Disassembler Engine/VXDisassembler.h @@ -0,0 +1,35 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 22. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#pragma once + +#include "VXInstructionDecoder.h" +#include "VXInstructionFormatter.h" diff --git a/Verteron Disassembler Engine/VXDisassemblerTypes.h b/Verteron Disassembler Engine/VXDisassemblerTypes.h new file mode 100644 index 0000000..433568f --- /dev/null +++ b/Verteron Disassembler Engine/VXDisassemblerTypes.h @@ -0,0 +1,450 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 22. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#pragma once + +#include +#include "VXOpcodeTable.h" + +namespace Verteron +{ + +namespace Disassembler +{ + +/** + * @brief Values that represent additional flags of a decoded instruction. + */ +enum InstructionFlags : uint32_t +{ + IF_NONE = 0x00000000, + /** + * @brief The instruction got decoded in 16 bit disassembler mode. + */ + IF_DISASSEMBLER_MODE_16 = 0x00000001, + /** + * @brief The instruction got decoded in 32 bit disassembler mode. + */ + IF_DISASSEMBLER_MODE_32 = 0x00000002, + /** + * @brief The instruction got decoded in 64 bit disassembler mode. + */ + IF_DISASSEMBLER_MODE_64 = 0x00000004, + /** + * @brief The instruction has a segment override prefix (0x26, 0x2E, 0x36, 0x3E, 0x64, 0x65). + */ + IF_PREFIX_SEGMENT = 0x00000008, + /** + * @brief The instruction has a lock prefix (0xF0). + */ + IF_PREFIX_LOCK = 0x00000010, + /** + * @brief The instruction has a repnz prefix (0xF2). + */ + IF_PREFIX_REPNZ = 0x00000020, + /** + * @brief The instruction has a repz prefix (0xF3). + */ + IF_PREFIX_REPZ = 0x00000040, + /** + * @brief The instruction has an operand size override prefix (0x66). + */ + IF_PREFIX_OPERAND_SIZE_OVERRIDE = 0x00000080, + /** + * @brief The instruction has an address size override prefix (0x67). + */ + IF_PREFIX_ADDRESS_SIZE_OVERRIDE = 0x00000100, + /** + * @brief The instruction has a rex prefix (0x40 - 0x4F). + */ + IF_PREFIX_REX = 0x00000200, + /** + * @brief The instruction has a vex prefix (0xC4 or 0xC5). + */ + IF_PREFIX_VEX = 0x00000400, + /** + * @brief The instruction has a modrm byte. + */ + IF_MODRM = 0x00000800, + /** + * @brief The instruction has a sib byte. + */ + IF_SIB = 0x00001000, + /** + * @brief The instruction has an operand with a relative address. + */ + IF_RELATIVE = 0x00002000, + /** + * @brief An error occured while decoding the instruction. + */ + IF_ERROR_MASK = 0xFFF00000, + /** + * @brief End of input reached while decoding the instruction. + */ + IF_ERROR_END_OF_INPUT = 0x00100000, + /** + * @brief The instruction length has exceeded the maximum of 15 bytes. + */ + IF_ERROR_LENGTH = 0x00200000, + /** + * @brief The instruction is invalid. + */ + IF_ERROR_INVALID = 0x00400000, + /** + * @brief The instruction is invalid in 64 bit mode. + */ + IF_ERROR_INVALID_64 = 0x00800000, + /** + * @brief An error occured while decoding the instruction operands. + */ + IF_ERROR_OPERAND = 0x01000000 +}; + +/** + * @brief Values that represent the type of a decoded operand. + */ +enum class VXOperandType +{ + /** + * @brief The operand is not used. + */ + NONE, + /** + * @brief The operand is a register operand. + */ + REGISTER, + /** + * @brief The operand is a memory operand. + */ + MEMORY, + /** + * @brief The operand is a pointer operand. + */ + POINTER, + /** + * @brief The operand is an immediate operand. + */ + IMMEDIATE, + /** + * @brief The operand is a relative immediate operand. + */ + REL_IMMEDIATE, + /** + * @brief The operand is a constant value. + */ + CONSTANT +}; + +/** + * @brief Values that represent a cpu register. + */ +enum class VXRegister : uint16_t +{ + NONE, + /* 8 bit general purpose registers */ + AL, CL, DL, BL, + AH, CH, DH, BH, + SPL, BPL, SIL, DIL, + R8B, R9B, R10B, R11B, + R12B, R13B, R14B, R15B, + /* 16 bit general purpose registers */ + AX, CX, DX, BX, + SP, BP, SI, DI, + R8W, R9W, R10W, R11W, + R12W, R13W, R14W, R15W, + /* 32 bit general purpose registers */ + EAX, ECX, EDX, EBX, + ESP, EBP, ESI, EDI, + R8D, R9D, R10D, R11D, + R12D, R13D, R14D, R15D, + /* 64 bit general purpose registers */ + RAX, RCX, RDX, RBX, + RSP, RBP, RSI, RDI, + R8, R9, R10, R11, + R12, R13, R14, R15, + /* segment registers */ + ES, CS, SS, + DS, FS, GS, + /* control registers */ + CR0, CR1, CR2, CR3, + CR4, CR5, CR6, CR7, + CR8, CR9, CR10, CR11, + CR12, CR13, CR14, CR15, + /* debug registers */ + DR0, DR1, DR2, DR3, + DR4, DR5, DR6, DR7, + DR8, DR9, DR10, DR11, + DR12, DR13, DR14, DR15, + /* mmx registers */ + MM0, MM1, MM2, MM3, + MM4, MM5, MM6, MM7, + /* x87 registers */ + ST0, ST1, ST2, ST3, + ST4, ST5, ST6, ST7, + /* extended multimedia registers */ + XMM0, XMM1, XMM2, XMM3, + XMM4, XMM5, XMM6, XMM7, + XMM8, XMM9, XMM10, XMM11, + XMM12, XMM13, XMM14, XMM15, + /* 256 bit multimedia registers */ + YMM0, YMM1, YMM2, YMM3, + YMM4, YMM5, YMM6, YMM7, + YMM8, YMM9, YMM10, YMM11, + YMM12, YMM13, YMM14, YMM15, + /* instruction pointer register */ + RIP +}; + +/** + * @brief This struct holds information about a decoded operand. + */ +struct VXOperandInfo +{ + /** + * @brief The type of the operand. + */ + VXOperandType type; + /** + * @brief The size of the operand. + */ + uint16_t size; + /** + * @brief The base register. + */ + VXRegister base; + /** + * @brief The index register. + */ + VXRegister index; + /** + * @brief The scale factor. + */ + uint8_t scale; + /** + * @brief The offset. TODO: improve documentation + */ + uint8_t offset; + /** + * @brief The lvalue. TODO: improve documentation + */ + union { + int8_t sbyte; + uint8_t ubyte; + int16_t sword; + uint16_t uword; + int32_t sdword; + uint32_t udword; + int64_t sqword; + uint64_t uqword; + struct { + uint16_t seg; + uint32_t off; + } ptr; + } lval; +}; + +/** + * @brief This struct holds information about a decoded instruction. + */ +struct VXInstructionInfo +{ + /** + * @brief The instruction flags. + */ + uint32_t flags; + /** + * @brief The instruction mnemonic. + */ + VXInstructionMnemonic mnemonic; + /** + * @brief The total length of the instruction. + */ + uint8_t length; + /** + * @brief The instruction bytes. + */ + uint8_t instructionBytes[15]; + /** + * @brief The length of the instruction opcodes. + */ + uint8_t opcodeLength; + /** + * @brief The instruction opcodes. + */ + uint8_t opcode[3]; + /** + * @brief The operand mode. + */ + uint8_t operandMode; + /** + * @brief The address mode. + */ + uint8_t addressMode; + /** + * @brief The decoded operands. + */ + VXOperandInfo operand[4]; + /** + * @brief The segment register. This value will default to @c NONE, if no segment register + * override prefix is present. + */ + VXRegister segmentRegister; + /** + * @brief The rex prefix byte. + */ + uint8_t rex; + /** + * @brief When 1, a 64-bit operand size is used. Otherwise, when 0, the default operand size + * is used. + */ + uint8_t rex_w; + /** + * @brief This 1-bit value is an extension to the MODRM.reg field. + */ + uint8_t rex_r; + /** + * @brief This 1-bit value is an extension to the SIB.index field. + */ + uint8_t rex_x; + /** + * @brief This 1-bit value is an extension to the MODRM.rm field or the SIB.base field. + */ + uint8_t rex_b; + /** + * @brief The modrm byte. + */ + uint8_t modrm; + /** + * @brief The modrm modus bits. When this field is b11, then register-direct addressing mode + * is used; otherwise register-indirect addressing mode is used. + */ + uint8_t modrm_mod; + /** + * @brief The modrm register bits. The REX.R, VEX.~R or XOP.~R field can extend this field + * with 1 most-significant bit to 4 bits total. + */ + uint8_t modrm_reg; + /** + * @brief The modrm register/memory bits. Specifies a direct or indirect register operand, + * optionally with a displacement. The REX.B, VEX.~B or XOP.~B field can extend this + * field with 1 most-significant bit to 4 bits total. + */ + uint8_t modrm_rm; + /** + * @brief The sib byte. + */ + uint8_t sib; + /** + * @brief This field indicates the scaling factor of SIB.index. + */ + uint8_t sib_scale; + /** + * @brief The index register to use. The REX.X, VEX.~X or XOP.~X field can extend this field + * with 1 most-significant bit to 4 bits total. + */ + uint8_t sib_index; + /** + * @brief The base register to use. The REX.B, VEX.~B or XOP.~B field can extend this field + * with 1 most-significant bit to 4 bits total. + */ + uint8_t sib_base; + /** + * @brief The primary vex prefix byte. + */ + uint8_t vex_op; + /** + * @brief The second vex prefix byte. + */ + uint8_t vex_b1; + /** + * @brief The third vex prefix byte. + */ + uint8_t vex_b2; + /** + * @brief This 1-bit value is an 'inverted' extension to the MODRM.reg field. The inverse of + * REX.R. + */ + uint8_t vex_r; + /** + * @brief This 1-bit value is an 'inverted' extension to the SIB.index field. The inverse of + * REX.X. + */ + uint8_t vex_x; + /** + * @brief This 1-bit value is an 'inverted' extension to the MODRM.rm field or the SIB.base + * field. The inverse of REX.B. + */ + uint8_t vex_b; + /** + * @brief Specifies the opcode map to use. + * 00 = 0x0F + * 01 = 0x0F 0x38 + * 02 = 0x0F 0x3A + */ + uint8_t vex_m_mmmm; + /** + * @brief For integer instructions: when 1, a 64-bit operand size is used; otherwise, + * when 0, the default operand size is used (equivalent with REX.W). For non-integer + * instructions, this bit is a general opcode extension bit. + */ + uint8_t vex_w; + /** + * @brief An additional operand for the instruction. The value of the XMM or YMM register + * is 'inverted'. + */ + uint8_t vex_vvvv; + /** + * @brief When 0, a 128-bit vector lengh is used. Otherwise, when 1, a 256-bit vector length + * is used. + */ + uint8_t vex_l; + /** + * @brief Specifies an implied mandatory prefix for the opcode. + * 00 = none + * 01 = 0x66 + * 10 = 0xF3 + * 11 = 0xF2 + */ + uint8_t vex_pp; + /** + * @brief The instruction definition. + */ + const VXInstructionDefinition *instrDefinition; + /** + * @brief The instruction pointer. This field is used to properly format relative + * instructions. + */ + uint64_t instructionPointer; +}; + +} + +} diff --git a/Verteron Disassembler Engine/VXInstructionDecoder.cpp b/Verteron Disassembler Engine/VXInstructionDecoder.cpp new file mode 100644 index 0000000..0385842 --- /dev/null +++ b/Verteron Disassembler Engine/VXInstructionDecoder.cpp @@ -0,0 +1,1234 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 23. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#include "VXInstructionDecoder.h" +#include + +namespace Verteron +{ + +namespace Disassembler +{ + +bool VXInstructionDecoder::decodeRegisterOperand(VXInstructionInfo &info, VXOperandInfo &operand, + RegisterClass registerClass, uint8_t registerId, VXDefinedOperandSize operandSize) const +{ + VXRegister reg = VXRegister::NONE; + uint16_t size = getEffectiveOperandSize(info, operandSize); + switch (registerClass) + { + case RegisterClass::GENERAL_PURPOSE: + switch (size) + { + case 64: + reg = static_cast(static_cast(VXRegister::RAX) + registerId); + break; + case 32: + reg = static_cast(static_cast(VXRegister::EAX) + registerId); + break; + case 16: + reg = static_cast(static_cast(VXRegister::AX) + registerId); + break; + case 8: + // TODO: Only REX? Or VEX too? + if (m_disassemblerMode == VXDisassemblerMode::M64BIT && (info.flags & IF_PREFIX_REX)) + { + if (registerId >= 4) + { + reg = static_cast( + static_cast(VXRegister::SPL) + (registerId - 4)); + } else + { + reg = static_cast( + static_cast(VXRegister::AL) + registerId); + } + } else + { + reg = static_cast(static_cast(VXRegister::AL) + registerId); + } + break; + case 0: + // TODO: Error? + reg = VXRegister::NONE; + break; + default: + assert(0); + } + break; + case RegisterClass::MMX: + reg = + static_cast(static_cast(VXRegister::MM0) + (registerId & 0x07)); + break; + case RegisterClass::CONTROL: + reg = static_cast(static_cast(VXRegister::CR0) + registerId); + break; + case RegisterClass::DEBUG: + reg = static_cast(static_cast(VXRegister::DR0) + registerId); + break; + case RegisterClass::SEGMENT: + if ((registerId & 7) > 5) + { + info.flags |= IF_ERROR_OPERAND; + return false; + } + reg = static_cast(static_cast(VXRegister::ES) + (registerId & 0x07)); + break; + case RegisterClass::XMM: + // TODO: Needs to be tested + reg = static_cast(registerId + static_cast( + ((size == 256) ? VXRegister::YMM0 : VXRegister::XMM0))); + break; + default: + assert(0); + } + operand.type = VXOperandType::REGISTER; + operand.base = static_cast(reg); + operand.size = size; + return true; +} + +bool VXInstructionDecoder::decodeRegisterMemoryOperand(VXInstructionInfo &info, + VXOperandInfo &operand, RegisterClass registerClass, VXDefinedOperandSize operandSize) +{ + assert(info.flags & IF_MODRM); + // Decode register operand + if (info.modrm_mod == 3) + { + return decodeRegisterOperand(info, operand, registerClass, m_effectiveModrmRm, + operandSize); + } + // Decode memory operand + uint8_t offset = 0; + operand.type = VXOperandType::MEMORY; + operand.size = getEffectiveOperandSize(info, operandSize); + switch (info.addressMode) + { + case 16: + { + static const VXRegister bases[] = { + VXRegister::BX, VXRegister::BX, VXRegister::BP, VXRegister::BP, + VXRegister::SI, VXRegister::DI, VXRegister::BP, VXRegister::BX }; + static const VXRegister indices[] = { + VXRegister::SI, VXRegister::DI, VXRegister::SI, VXRegister::DI, + VXRegister::NONE, VXRegister::NONE, VXRegister::NONE, VXRegister::NONE }; + operand.base = static_cast(bases[m_effectiveModrmRm & 0x07]); + operand.index = static_cast(indices[m_effectiveModrmRm & 0x07]); + operand.scale = 0; + if (info.modrm_mod == 0 && m_effectiveModrmRm == 6) { + offset = 16; + operand.base = VXRegister::NONE; + } else if (info.modrm_mod == 1) { + offset = 8; + } else if (info.modrm_mod == 2) { + offset = 16; + } + } + break; + case 32: + operand.base = + static_cast(static_cast(VXRegister::EAX) + m_effectiveModrmRm); + switch (info.modrm_mod) + { + case 0: + if (m_effectiveModrmRm == 5) + { + operand.base = VXRegister::NONE; + offset = 32; + } + break; + case 1: + offset = 8; + break; + case 2: + offset = 32; + break; + default: + assert(0); + } + if ((m_effectiveModrmRm & 0x07) == 4) + { + if (!decodeSIB(info)) + { + return false; + } + operand.base = + static_cast(static_cast(VXRegister::EAX) + + (info.sib_base | (m_effectiveRexB << 3))); + operand.index = + static_cast(static_cast(VXRegister::EAX) + + (info.sib_index | (m_effectiveRexX << 3))); + operand.scale = (1 << info.sib_scale) & ~1; + if (operand.index == VXRegister::ESP) + { + operand.index = VXRegister::NONE; + operand.scale = 0; + } + if (operand.base == VXRegister::EBP) + { + if (info.modrm_mod == 0) + { + operand.base = VXRegister::NONE; + } + if (info.modrm_mod == 1) + { + offset = 8; + } else + { + offset = 32; + } + } + } else + { + operand.index = VXRegister::NONE; + operand.scale = 0; + } + break; + case 64: + operand.base = + static_cast(static_cast(VXRegister::RAX) + m_effectiveModrmRm); + switch (info.modrm_mod) + { + case 0: + if ((m_effectiveModrmRm & 0x07) == 5) + { + info.flags |= IF_RELATIVE; + operand.base = VXRegister::RIP; + offset = 32; + } + break; + case 1: + offset = 8; + break; + case 2: + offset = 32; + break; + default: + assert(0); + } + if ((m_effectiveModrmRm & 0x07) == 4) + { + if (!decodeSIB(info)) + { + return false; + } + operand.base = + static_cast(static_cast(VXRegister::RAX) + + (info.sib_base | (m_effectiveRexB << 3))); + operand.index = + static_cast(static_cast(VXRegister::RAX) + + (info.sib_index | (m_effectiveRexX << 3))); + if (operand.index == VXRegister::RSP) + { + operand.index = VXRegister::NONE; + operand.scale = 0; + } else + { + operand.scale = (1 << info.sib_scale) & ~1; + } + if ((operand.base == VXRegister::RBP) || (operand.base == VXRegister::R13)) + { + if (info.modrm_mod == 0) + { + operand.base = VXRegister::NONE; + } + if (info.modrm_mod == 1) + { + offset = 8; + } else + { + offset = 32; + } + } + } else + { + operand.index = VXRegister::NONE; + operand.scale = 0; + } + break; + } + if (offset) + { + if (!decodeDisplacement(info, operand, offset)) + { + return false; + } + } else + { + operand.offset = 0; + } + return true; +} + +bool VXInstructionDecoder::decodeImmediate(VXInstructionInfo &info, VXOperandInfo &operand, + VXDefinedOperandSize operandSize) +{ + operand.type = VXOperandType::IMMEDIATE; + operand.size = getEffectiveOperandSize(info, operandSize); + switch (operand.size) + { + case 8: + operand.lval.ubyte = inputNext(info); + break; + case 16: + operand.lval.uword = inputNext(info); + break; + case 32: + operand.lval.udword = inputNext(info); + break; + case 64: + operand.lval.uqword = inputNext(info); + break; + default: + // TODO: Maybe return false instead of assert + assert(0); + } + if (!operand.lval.uqword && (info.flags & IF_ERROR_MASK)) + { + return false; + } + return true; +} + +bool VXInstructionDecoder::decodeDisplacement(VXInstructionInfo &info, VXOperandInfo &operand, + uint8_t size) +{ + switch (size) + { + case 8: + operand.offset = 8; + operand.lval.ubyte = inputNext(info); + break; + case 16: + operand.offset = 16; + operand.lval.uword = inputNext(info); + break; + case 32: + operand.offset = 32; + operand.lval.udword = inputNext(info); + break; + case 64: + operand.offset = 64; + operand.lval.uqword = inputNext(info); + break; + default: + // TODO: Maybe return false instead of assert + assert(0); + } + if (!operand.lval.uqword && (info.flags & IF_ERROR_MASK)) + { + return false; + } + return true; +} + +bool VXInstructionDecoder::decodeModrm(VXInstructionInfo &info) +{ + if (!(info.flags & IF_MODRM)) + { + if (!inputNext(info) && (info.flags & IF_ERROR_MASK)) + { + return false; + } + info.flags |= IF_MODRM; + info.modrm = inputCurrent(); + info.modrm_mod = (info.modrm >> 6) & 0x03; + info.modrm_reg = (info.modrm >> 3) & 0x07; + info.modrm_rm = (info.modrm >> 0) & 0x07; + } + return true; +} + +bool VXInstructionDecoder::decodeSIB(VXInstructionInfo &info) +{ + assert(info.flags & IF_MODRM); + assert((info.modrm_rm & 0x7) == 4); + if (!(info.flags & IF_SIB)) + { + if (!inputNext(info) && (info.flags & IF_ERROR_MASK)) + { + return false; + } + info.flags |= IF_SIB; + info.sib = inputCurrent(); + info.sib_scale = (info.sib >> 6) & 0x03; + info.sib_index = (info.sib >> 3) & 0x07; + info.sib_base = (info.sib >> 0) & 0x07; + } + return true; +} + +bool VXInstructionDecoder::decodeVex(VXInstructionInfo &info) +{ + if (!(info.flags & IF_PREFIX_VEX)) + { + info.vex_op = inputCurrent(); + switch (info.vex_op) + { + case 0xC4: + info.vex_b1 = inputNext(info); + if (!info.vex_b1 || (info.flags & IF_ERROR_MASK)) + { + return false; + } + info.vex_b2 = inputNext(info); + if (!info.vex_b2 || (info.flags & IF_ERROR_MASK)) + { + return false; + } + info.vex_r = (info.vex_b1 >> 7) & 0x01; + info.vex_x = (info.vex_b1 >> 6) & 0x01; + info.vex_b = (info.vex_b1 >> 5) & 0x01; + info.vex_m_mmmm = (info.vex_b1 >> 0) & 0x1F; + info.vex_w = (info.vex_b2 >> 7) & 0x01; + info.vex_vvvv = (info.vex_b2 >> 3) & 0x0F; + info.vex_l = (info.vex_b2 >> 2) & 0x01; + info.vex_pp = (info.vex_b2 >> 0) & 0x03; + break; + case 0xC5: + info.vex_b1 = inputNext(info); + if (!info.vex_b1 || (info.flags & IF_ERROR_MASK)) + { + return false; + } + info.vex_r = (info.vex_b1 >> 7) & 0x01; + info.vex_x = 1; + info.vex_b = 1; + info.vex_m_mmmm = 1; + info.vex_w = 0; + info.vex_vvvv = (info.vex_b1 >> 3) & 0x0F; + info.vex_l = (info.vex_b1 >> 2) & 0x01; + info.vex_pp = (info.vex_b1 >> 0) & 0x03; + break; + default: + assert(0); + } + if (info.vex_m_mmmm > 3) + { + // TODO: Add proper error flag + info.flags |= IF_ERROR_MASK; + return false; + } + info.flags |= IF_PREFIX_VEX; + } + return true; +} + +uint16_t VXInstructionDecoder::getEffectiveOperandSize(const VXInstructionInfo &info, + VXDefinedOperandSize operandSize) const +{ + switch (operandSize) + { + case VXDefinedOperandSize::NA: + return 0; + case VXDefinedOperandSize::Z: + return (info.operandMode == 16) ? 16 : 32; + case VXDefinedOperandSize::V: + return info.operandMode; + case VXDefinedOperandSize::Y: + return (info.operandMode == 16) ? 32 : info.operandMode; + case VXDefinedOperandSize::X: + assert(info.vex_op != 0); + return m_effectiveVexL ? + getEffectiveOperandSize(info, VXDefinedOperandSize::QQ) : + getEffectiveOperandSize(info, VXDefinedOperandSize::DQ); + case VXDefinedOperandSize::RDQ: + return (m_disassemblerMode == VXDisassemblerMode::M64BIT) ? 64 : 32; + case VXDefinedOperandSize::B: + return 8; + case VXDefinedOperandSize::W: + return 16; + case VXDefinedOperandSize::D: + return 32; + case VXDefinedOperandSize::Q: + return 64; + case VXDefinedOperandSize::T: + return 80; + case VXDefinedOperandSize::O: + return 12; + case VXDefinedOperandSize::DQ: + return 128; + case VXDefinedOperandSize::QQ: + return 256; + default: + assert(0); + } + return 0; +} + +bool VXInstructionDecoder::decodeOperands(VXInstructionInfo& info) +{ + assert(info.instrDefinition); + // Always try to decode the first operand + if (!decodeOperand(info, info.operand[0], info.instrDefinition->operand[0].type, + info.instrDefinition->operand[0].size)) + { + return false; + } + // Decode other operands on demand + for (unsigned int i = 1; i < 4; ++i) + { + if (info.operand[i - 1].type != VXOperandType::NONE) + { + if (!decodeOperand(info, info.operand[i], info.instrDefinition->operand[i].type, + info.instrDefinition->operand[i].size)) + { + return false; + } + } + } + return true; +} + +bool VXInstructionDecoder::decodeOperand(VXInstructionInfo &info, VXOperandInfo &operand, + VXDefinedOperandType operandType, VXDefinedOperandSize operandSize) +{ + using namespace Internal; + operand.type = VXOperandType::NONE; + switch (operandType) + { + case VXDefinedOperandType::NONE: + break; + case VXDefinedOperandType::A: + operand.type = VXOperandType::POINTER; + if (info.operandMode == 16) + { + operand.size = 32; + operand.lval.ptr.off = inputNext(info); + operand.lval.ptr.seg = inputNext(info); + } else { + operand.size = 48; + operand.lval.ptr.off = inputNext(info); + operand.lval.ptr.seg = inputNext(info); + } + if ((!operand.lval.ptr.off || !operand.lval.ptr.seg) && (info.flags & IF_ERROR_MASK)) + { + return false; + } + break; + case VXDefinedOperandType::C: + return decodeRegisterOperand(info, operand, RegisterClass::CONTROL, m_effectiveModrmReg, + operandSize); + case VXDefinedOperandType::D: + return decodeRegisterOperand(info, operand, RegisterClass::DEBUG, m_effectiveModrmReg, + operandSize); + case VXDefinedOperandType::F: + // TODO: FAR flag + case VXDefinedOperandType::M: + // ModR/M byte may refer only to a register + if (info.modrm_mod == 3) + { + info.flags |= IF_ERROR_OPERAND; + return false; + } + case VXDefinedOperandType::E: + return decodeRegisterMemoryOperand(info, operand, RegisterClass::GENERAL_PURPOSE, + operandSize); + case VXDefinedOperandType::G: + return decodeRegisterOperand(info, operand, RegisterClass::GENERAL_PURPOSE, + m_effectiveModrmReg, operandSize); + case VXDefinedOperandType::H: + assert(info.vex_op != 0); + return decodeRegisterOperand(info, operand, RegisterClass::XMM, (0xF & ~info.vex_vvvv), + operandSize); + case VXDefinedOperandType::I: + return decodeImmediate(info, operand, operandSize); + case VXDefinedOperandType::I1: + operand.type = VXOperandType::CONSTANT; + operand.lval.udword = 1; + break; + case VXDefinedOperandType::J: + if (!decodeImmediate(info, operand, operandSize)) + { + return false; + } + operand.type = VXOperandType::REL_IMMEDIATE; + info.flags |= IF_RELATIVE; + break; + case VXDefinedOperandType::L: + { + assert(info.vex_op != 0); + uint8_t imm = inputNext(info); + if (!imm && (info.flags & IF_ERROR_MASK)) + { + return false; + } + uint8_t mask = (m_disassemblerMode == VXDisassemblerMode::M64BIT) ? 0xF : 0x7; + return decodeRegisterOperand(info, operand, RegisterClass::XMM, mask & (imm >> 4), + operandSize); + } + case VXDefinedOperandType::MR: + return decodeRegisterMemoryOperand(info, operand, RegisterClass::GENERAL_PURPOSE, + info.modrm_mod == 3 ? + GetComplexOperandRegSize(operandSize) : GetComplexOperandMemSize(operandSize)); + case VXDefinedOperandType::MU: + return decodeRegisterMemoryOperand(info, operand, RegisterClass::XMM, + info.modrm_mod == 3 ? + GetComplexOperandRegSize(operandSize) : GetComplexOperandMemSize(operandSize)); + case VXDefinedOperandType::N: + // ModR/M byte may refer only to memory + if (info.modrm_mod != 3) + { + info.flags |= IF_ERROR_OPERAND; + return false; + } + case VXDefinedOperandType::Q: + return decodeRegisterMemoryOperand(info, operand, RegisterClass::MMX, operandSize); + case VXDefinedOperandType::O: + operand.type = VXOperandType::MEMORY; + operand.base = VXRegister::NONE; + operand.index = VXRegister::NONE; + operand.scale = 0; + operand.size = getEffectiveOperandSize(info, operandSize); + return decodeDisplacement(info, operand, info.addressMode); + case VXDefinedOperandType::P: + return decodeRegisterOperand(info, operand, RegisterClass::MMX, m_effectiveModrmReg, + operandSize); + case VXDefinedOperandType::R: + // ModR/M byte may refer only to memory + if (info.modrm_mod != 3) + { + info.flags |= IF_ERROR_OPERAND; + return false; + } + return decodeRegisterMemoryOperand(info, operand, RegisterClass::GENERAL_PURPOSE, + operandSize); + case VXDefinedOperandType::S: + return decodeRegisterOperand(info, operand, RegisterClass::SEGMENT, m_effectiveModrmReg, + operandSize); + case VXDefinedOperandType::U: + // ModR/M byte may refer only to memory + if (info.modrm_mod != 3) + { + info.flags |= IF_ERROR_OPERAND; + return false; + } + case VXDefinedOperandType::W: + return decodeRegisterMemoryOperand(info, operand, RegisterClass::XMM, operandSize); + case VXDefinedOperandType::V: + return decodeRegisterOperand(info, operand, RegisterClass::XMM, m_effectiveModrmReg, + operandSize); + case VXDefinedOperandType::R0: + case VXDefinedOperandType::R1: + case VXDefinedOperandType::R2: + case VXDefinedOperandType::R3: + case VXDefinedOperandType::R4: + case VXDefinedOperandType::R5: + case VXDefinedOperandType::R6: + case VXDefinedOperandType::R7: + return decodeRegisterOperand(info, operand, RegisterClass::GENERAL_PURPOSE, + ((m_effectiveRexB << 3) | (static_cast(operandType) - + static_cast(VXDefinedOperandType::R0))), operandSize); + case VXDefinedOperandType::AL: + case VXDefinedOperandType::AX: + case VXDefinedOperandType::EAX: + case VXDefinedOperandType::RAX: + return decodeRegisterOperand(info, operand, RegisterClass::GENERAL_PURPOSE, 0, + operandSize); + case VXDefinedOperandType::CL: + case VXDefinedOperandType::CX: + case VXDefinedOperandType::ECX: + case VXDefinedOperandType::RCX: + return decodeRegisterOperand(info, operand, RegisterClass::GENERAL_PURPOSE, 1, + operandSize); + case VXDefinedOperandType::DL: + case VXDefinedOperandType::DX: + case VXDefinedOperandType::EDX: + case VXDefinedOperandType::RDX: + return decodeRegisterOperand(info, operand, RegisterClass::GENERAL_PURPOSE, 2, + operandSize); + case VXDefinedOperandType::ES: + case VXDefinedOperandType::CS: + case VXDefinedOperandType::SS: + case VXDefinedOperandType::DS: + case VXDefinedOperandType::FS: + case VXDefinedOperandType::GS: + if (m_disassemblerMode == VXDisassemblerMode::M64BIT) + { + if ((operandType != VXDefinedOperandType::FS) && + (operandType != VXDefinedOperandType::GS)) + { + info.flags |= IF_ERROR_OPERAND; + return false; + } + } + operand.type = VXOperandType::REGISTER; + operand.base = static_cast((static_cast(operandType) - + static_cast(VXDefinedOperandType::ES)) + + static_cast(VXRegister::ES)); + operand.size = 16; + break; + case VXDefinedOperandType::ST0: + case VXDefinedOperandType::ST1: + case VXDefinedOperandType::ST2: + case VXDefinedOperandType::ST3: + case VXDefinedOperandType::ST4: + case VXDefinedOperandType::ST5: + case VXDefinedOperandType::ST6: + case VXDefinedOperandType::ST7: + operand.type = VXOperandType::REGISTER; + operand.base = static_cast((static_cast(operandType) - + static_cast(VXDefinedOperandType::ST0)) + + static_cast(VXRegister::ST0)); + operand.size = 80; + break; + default: + assert(0); + } + return true; +} + +void VXInstructionDecoder::resolveOperandAndAddressMode(VXInstructionInfo &info) const +{ + assert(info.instrDefinition); + switch (m_disassemblerMode) + { + case VXDisassemblerMode::M16BIT: + info.operandMode = (info.flags & IF_PREFIX_OPERAND_SIZE_OVERRIDE) ? 32 : 16; + info.addressMode = (info.flags & IF_PREFIX_ADDRESS_SIZE_OVERRIDE) ? 32 : 16; + break; + case VXDisassemblerMode::M32BIT: + info.operandMode = (info.flags & IF_PREFIX_OPERAND_SIZE_OVERRIDE) ? 16 : 32; + info.addressMode = (info.flags & IF_PREFIX_ADDRESS_SIZE_OVERRIDE) ? 16 : 32; + break; + case VXDisassemblerMode::M64BIT: + if (m_effectiveRexW) + { + info.operandMode = 64; + } else if ((info.flags & IF_PREFIX_OPERAND_SIZE_OVERRIDE)) + { + info.operandMode = 16; + } else + { + info.operandMode = (info.instrDefinition->flags & IDF_DEFAULT_64) ? 64 : 32; + } + info.addressMode = (info.flags & IF_PREFIX_ADDRESS_SIZE_OVERRIDE) ? 32 : 64; + break; + default: + assert(0); + } +} + +bool VXInstructionDecoder::decodePrefixes(VXInstructionInfo &info) +{ + bool done = false; + do + { + if (!inputPeek(info) && (info.flags & IF_ERROR_MASK)) + { + return false; + } + switch (inputCurrent()) + { + case 0xF0: + info.flags |= IF_PREFIX_LOCK; + break; + case 0xF2: + // REPNZ and REPZ are mutally exclusive. The one that comes later has precedence. + info.flags |= IF_PREFIX_REPNZ; + info.flags &= ~IF_PREFIX_REPZ; + break; + case 0xF3: + // REPNZ and REPZ are mutally exclusive. The one that comes later has precedence. + info.flags |= IF_PREFIX_REPZ; + info.flags &= ~IF_PREFIX_REPNZ; + break; + case 0x2E: + info.flags |= IF_PREFIX_SEGMENT; + info.segmentRegister = VXRegister::CS; + break; + case 0x36: + info.flags |= IF_PREFIX_SEGMENT; + info.segmentRegister = VXRegister::SS; + break; + case 0x3E: + info.flags |= IF_PREFIX_SEGMENT; + info.segmentRegister = VXRegister::DS; + break; + case 0x26: + info.flags |= IF_PREFIX_SEGMENT; + info.segmentRegister = VXRegister::ES; + break; + case 0x64: + info.flags |= IF_PREFIX_SEGMENT; + info.segmentRegister = VXRegister::FS; + break; + case 0x65: + info.flags |= IF_PREFIX_SEGMENT; + info.segmentRegister = VXRegister::GS; + break; + case 0x66: + info.flags |= IF_PREFIX_OPERAND_SIZE_OVERRIDE; + break; + case 0x67: + info.flags |= IF_PREFIX_ADDRESS_SIZE_OVERRIDE; + break; + default: + if ((m_disassemblerMode == VXDisassemblerMode::M64BIT) && + (inputCurrent() & 0xF0) == 0x40) + { + info.flags |= IF_PREFIX_REX; + info.rex = inputCurrent(); + } else + { + done = true; + } + break; + } + // Increase the input offset, if a prefix was found + if (!done) + { + if (!inputNext(info) && (info.flags & IF_ERROR_MASK)) + { + return false; + } + } + } while (!done); + // TODO: Add flags for multiple prefixes of the same group + // Parse REX Prefix + if (info.flags & IF_PREFIX_REX) + { + info.rex_w = (info.rex >> 3) & 0x01; + info.rex_r = (info.rex >> 2) & 0x01; + info.rex_x = (info.rex >> 1) & 0x01; + info.rex_b = (info.rex >> 0) & 0x01; + } + return true; +} + +bool VXInstructionDecoder::decodeOpcode(VXInstructionInfo &info) +{ + using namespace Internal; + // Read first opcode byte + if (!inputNext(info) && (info.flags & IF_ERROR_MASK)) + { + return false; + } + // Update instruction info + info.opcode[0] = inputCurrent(); + info.opcodeLength = 1; + // Iterate through opcode tree + VXOpcodeTreeNode node = GetOpcodeTreeChild(GetOpcodeTreeRoot(), inputCurrent()); + VXOpcodeTreeNodeType nodeType; + do + { + uint16_t index = 0; + nodeType = GetOpcodeNodeType(node); + switch (nodeType) + { + case VXOpcodeTreeNodeType::INSTRUCTION_DEFINITION: + { + // Decode opcode + if (!decodeInstructionNode(info, node)) + { + return false; + } + // Decode operands + if (!decodeOperands(info)) + { + return false; + } + } + return true; + case VXOpcodeTreeNodeType::TABLE: + // Read next opcode byte + if (!inputNext(info) && (info.flags & IF_ERROR_MASK)) + { + return false; + } + // Update instruction info + assert((info.opcodeLength > 0) && (info.opcodeLength < 3)); + info.opcode[info.opcodeLength] = inputCurrent(); + info.opcodeLength++; + // Set child node index for next iteration + index = inputCurrent(); + break; + case VXOpcodeTreeNodeType::MODRM_MOD: + // Decode modrm byte + if (!decodeModrm(info)) + { + return false; + } + index = (info.modrm_mod == 0x3) ? 1 : 0; + break; + case VXOpcodeTreeNodeType::MODRM_REG: + // Decode modrm byte + if (!decodeModrm(info)) + { + return false; + } + index = info.modrm_reg; + break; + case VXOpcodeTreeNodeType::MODRM_RM: + // Decode modrm byte + if (!decodeModrm(info)) + { + return false; + } + index = info.modrm_rm; + break; + case VXOpcodeTreeNodeType::MANDATORY: + // Check if there are any prefixes present + if (info.flags & IF_PREFIX_REPNZ) + { + index = 1; // F2 + } else if (info.flags & IF_PREFIX_REPZ) + { + index = 2; // F3 + } else if (info.flags & IF_PREFIX_OPERAND_SIZE_OVERRIDE) + { + index = 3; // 66 + } + if (GetOpcodeTreeChild(node, index) == 0) + { + index = 0; + } + if (index && (GetOpcodeTreeChild(node, index) != 0)) + { + // Remove REPNZ and REPZ prefix + info.flags &= ~IF_PREFIX_REPNZ; + info.flags &= ~IF_PREFIX_REPZ; + // Remove OPERAND_SIZE_OVERRIDE prefix, if it was used as mandatory prefix for + // the instruction + if (index == 3) + { + info.flags &= ~IF_PREFIX_OPERAND_SIZE_OVERRIDE; + } + } + break; + case VXOpcodeTreeNodeType::X87: + // Decode modrm byte + if (!decodeModrm(info)) + { + return false; + } + index = info.modrm - 0xC0; + break; + case VXOpcodeTreeNodeType::ADDRESS_SIZE: + switch (m_disassemblerMode) + { + case VXDisassemblerMode::M16BIT: + index = (info.flags & IF_PREFIX_ADDRESS_SIZE_OVERRIDE) ? 1 : 0; + break; + case VXDisassemblerMode::M32BIT: + index = (info.flags & IF_PREFIX_ADDRESS_SIZE_OVERRIDE) ? 0 : 1; + break; + case VXDisassemblerMode::M64BIT: + index = (info.flags & IF_PREFIX_ADDRESS_SIZE_OVERRIDE) ? 1 : 2; + break; + default: + assert(0); + } + break; + case VXOpcodeTreeNodeType::OPERAND_SIZE: + switch (m_disassemblerMode) + { + case VXDisassemblerMode::M16BIT: + index = (info.flags & IF_PREFIX_OPERAND_SIZE_OVERRIDE) ? 1 : 0; + break; + case VXDisassemblerMode::M32BIT: + index = (info.flags & IF_PREFIX_OPERAND_SIZE_OVERRIDE) ? 0 : 1; + break; + case VXDisassemblerMode::M64BIT: + index = + (info.rex_w) ? 2 : ((info.flags & IF_PREFIX_OPERAND_SIZE_OVERRIDE) ? 0 : 1); + break; + default: + assert(0); + } + break; + case VXOpcodeTreeNodeType::MODE: + index = (m_disassemblerMode != VXDisassemblerMode::M64BIT) ? 0 : 1; + break; + case VXOpcodeTreeNodeType::VENDOR: + switch (m_preferredVendor) + { + case VXInstructionSetVendor::ANY: + index = (GetOpcodeTreeChild(node, 0) != 0) ? 0 : 1; + break; + case VXInstructionSetVendor::INTEL: + index = 1; + break; + case VXInstructionSetVendor::AMD: + index = 0; + break; + default: + assert(0); + } + break; + case VXOpcodeTreeNodeType::AMD3DNOW: + { + // As all 3dnow instructions got the same operands and flag definitions, we just + // decode a random instruction and determine the specific opcode later. + assert(GetOpcodeTreeChild(node, 0x0C) != 0); + if (!decodeInstructionNode(info, GetOpcodeTreeChild(node, 0x0C))) + { + return false; + } + // Decode operands + if (!decodeOperands(info)) + { + return false; + } + // Read the actual 3dnow opcode + info.opcode[2] = inputNext(info); + if (!info.opcode[2] && (info.flags & IF_ERROR_MASK)) + { + return false; + } + // Update instruction mnemonic + const VXInstructionDefinition *instrDefinition = + GetInstructionDefinition(GetOpcodeTreeChild(node, info.opcode[2])); + if (!instrDefinition) + { + info.flags |= IF_ERROR_INVALID; + return false; + } + info.instrDefinition = instrDefinition; + info.mnemonic = instrDefinition->mnemonic; + // Terminate loop + return true; + } + case VXOpcodeTreeNodeType::VEX: + if ((m_disassemblerMode == VXDisassemblerMode::M64BIT) || + (((inputCurrent() >> 6) & 0x03) == 0x03)) + { + // Decode vex prefix + if (!decodeVex(info)) + { + return false; + } + // Update instruction info + switch (info.vex_m_mmmm) + { + case 1: + info.opcodeLength = 1; + info.opcode[0] = 0x0F; + break; + case 2: + info.opcodeLength = 2; + info.opcode[0] = 0x0F; + info.opcode[1] = 0x38; + break; + case 3: + info.opcodeLength = 2; + info.opcode[0] = 0x0F; + info.opcode[1] = 0x3A; + break; + default: + // TODO: ERROR + break; + } + // Set child node index for next iteration + index = info.vex_m_mmmm + (info.vex_pp << 2); + } else + { + index = 0; + } + break; + case VXOpcodeTreeNodeType::VEXW: + assert(info.flags & IF_PREFIX_VEX); + index = info.vex_w; + break; + case VXOpcodeTreeNodeType::VEXL: + assert(info.flags & IF_PREFIX_VEX); + index = info.vex_l; + break; + default: + assert(0); + } + node = GetOpcodeTreeChild(node, index); + } while (nodeType != VXOpcodeTreeNodeType::INSTRUCTION_DEFINITION); + return false; +} + +bool VXInstructionDecoder::decodeInstructionNode(VXInstructionInfo &info, VXOpcodeTreeNode node) +{ + // Check for invalid instruction + if (Internal::GetOpcodeNodeValue(node) == 0) + { + info.flags |= IF_ERROR_INVALID; + return false; + } + // Get instruction definition + bool hasModrm = false; + const VXInstructionDefinition *instrDefinition = + Internal::GetInstructionDefinition(node, hasModrm); + // Check for invalid 64 bit instruction + if ((m_disassemblerMode == VXDisassemblerMode::M64BIT) && + (instrDefinition->flags & IDF_INVALID_64)) + { + info.flags |= IF_ERROR_INVALID_64; + return false; + } + // Update instruction info + info.instrDefinition = instrDefinition; + info.mnemonic = instrDefinition->mnemonic; + // Decode modrm byte + if (hasModrm && !decodeModrm(info)) + { + return false; + } + // Update values required for operand decoding + uint8_t rex = info.rex; + if (info.flags & IF_PREFIX_VEX) + { + switch (info.vex_op) + { + case 0xC4: + rex = ((~(info.vex_b1 >> 5) & 0x07) | ((info.vex_b2 >> 4) & 0x08)); + break; + case 0xC5: + rex = (~(info.vex_b1 >> 5)) & 4; + break; + default: + assert(0); + } + } + // Calculate effective values by adding the corresponding part of the flags bitmask + rex &= (instrDefinition->flags & 0x000F); + // Store effective values in the current disassembler instance + m_effectiveRexW = (rex >> 3) & 0x01; + m_effectiveRexR = (rex >> 2) & 0x01; + m_effectiveRexX = (rex >> 1) & 0x01; + m_effectiveRexB = (rex >> 0) & 0x01; + m_effectiveModrmReg = (m_effectiveRexR << 3) | info.modrm_reg; + m_effectiveModrmRm = (m_effectiveRexB << 3) | info.modrm_rm; + m_effectiveVexL = info.vex_l && (instrDefinition->flags & IDF_ACCEPTS_VEXL); + // Resolve operand and address mode + resolveOperandAndAddressMode(info); + return true; +} + +VXInstructionDecoder::VXInstructionDecoder(void const *buffer, size_t bufferLen, + VXDisassemblerMode disassemblerMode, VXInstructionSetVendor preferredVendor) + : m_inputBuffer(buffer) + , m_inputBufferLen(bufferLen) + , m_inputBufferOffset(0) + , m_disassemblerMode(disassemblerMode) + , m_preferredVendor(preferredVendor) +{ + +} + +bool VXInstructionDecoder::decodeNextInstruction(VXInstructionInfo &info) +{ + // Clear instruction info + memset(&info, 0, sizeof(info)); + // Set disassembler mode flags + switch (m_disassemblerMode) + { + case VXDisassemblerMode::M16BIT: + info.flags |= IF_DISASSEMBLER_MODE_16; + break; + case VXDisassemblerMode::M32BIT: + info.flags |= IF_DISASSEMBLER_MODE_32; + break; + case VXDisassemblerMode::M64BIT: + info.flags |= IF_DISASSEMBLER_MODE_64; + break; + default: + assert(0); + } + // Set instruction pointer + info.instructionPointer = m_instructionPointer; + // Decode + if (!decodePrefixes(info) || !decodeOpcode(info)) + { + goto DecodeError; + } + // SWAPGS is only valid in 64 bit mode + if ((info.mnemonic == VXInstructionMnemonic::SWAPGS) && + (m_disassemblerMode != VXDisassemblerMode::M64BIT)) + { + info.flags &= IF_ERROR_INVALID; + goto DecodeError; + } + // Handle aliases + if (info.mnemonic == VXInstructionMnemonic::XCHG) + { + if ((info.operand[0].type == VXOperandType::REGISTER && + info.operand[0].base == VXRegister::AX && + info.operand[1].type == VXOperandType::REGISTER && + info.operand[1].base == VXRegister::AX) || + (info.operand[0].type == VXOperandType::REGISTER && + info.operand[0].base == VXRegister::EAX && + info.operand[1].type == VXOperandType::REGISTER && + info.operand[1].base == VXRegister::EAX)) + { + info.mnemonic = VXInstructionMnemonic::NOP; + info.operand[0].type = VXOperandType::NONE; + info.operand[1].type = VXOperandType::NONE; + } + } + if ((info.mnemonic == VXInstructionMnemonic::NOP) && (info.flags & IF_PREFIX_REPZ)) + { + info.mnemonic = VXInstructionMnemonic::PAUSE; + info.flags &= ~IF_PREFIX_REPZ; + } + // Increment instruction pointer + m_instructionPointer += info.length; + return true; +DecodeError: + // Increment instruction pointer. + m_instructionPointer += 1; + // Backup all error flags, the instruction length and the instruction pointer + uint32_t flags = info.flags & (IF_ERROR_MASK | 0x00000007); + uint8_t length = info.length; + uint8_t firstByte = info.instructionBytes[0]; + uint64_t instrPointer = info.instructionPointer; + // Clear instruction info + memset(&info, 0, sizeof(info)); + // Restore saved values + info.flags = flags; + info.length = length; + info.instructionBytes[0] = firstByte; + info.instructionPointer = instrPointer; + info.instrDefinition = Internal::GetInstructionDefinition(0); + // Return with error, if the end of the input source was reached while decoding the + // invalid instruction + if (info.flags & IF_ERROR_END_OF_INPUT) + { + info.length = 0; + return false; + } + // Decrement the input position, if more than one byte was read from the input data + // source while decoding the invalid instruction. + if (info.length != 1) + { + m_inputBufferOffset = m_inputBufferOffset - info.length + 1; + info.length = 1; + } + return true; +} + +} + +} diff --git a/Verteron Disassembler Engine/VXInstructionDecoder.h b/Verteron Disassembler Engine/VXInstructionDecoder.h new file mode 100644 index 0000000..cac931e --- /dev/null +++ b/Verteron Disassembler Engine/VXInstructionDecoder.h @@ -0,0 +1,398 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 23. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#pragma once + +#include +#include "VXDisassemblerTypes.h" + +namespace Verteron +{ + +namespace Disassembler +{ + +/** + * @brief Values that represent a disassembler mode. + */ +enum class VXDisassemblerMode +{ + M16BIT = 16, + M32BIT = 32, + M64BIT = 64 +}; + +/** + * @brief Values that represent an instruction vendor. + */ +enum class VXInstructionSetVendor +{ + ANY, + INTEL, + AMD +}; + +/** + * @brief The @c VXInstructionDecoder class decodes x86/x86-64 assembly instructions from a + * given data source. + */ +class VXInstructionDecoder +{ +private: + enum class RegisterClass + { + GENERAL_PURPOSE = 0, + MMX = 1, + CONTROL = 2, + DEBUG = 3, + SEGMENT = 4, + XMM = 5 + }; +private: + VXDisassemblerMode m_disassemblerMode; + VXInstructionSetVendor m_preferredVendor; + uint64_t m_instructionPointer; + const void *m_inputBuffer; + size_t m_inputBufferLen; + size_t m_inputBufferOffset; + uint8_t m_currentInput; +private: + uint8_t m_effectiveRexW; + uint8_t m_effectiveRexR; + uint8_t m_effectiveRexX; + uint8_t m_effectiveRexB; + uint8_t m_effectiveModrmReg; + uint8_t m_effectiveModrmRm; + bool m_effectiveVexL; +private: + /** + * @brief Reads the next byte from the input data source. This method does NOT increase the + * current input offset and the @c length or @c instructionBytes field of the @c info + * parameter. + * @param info The instruction info. + * @return Returns the current input byte. If the result is zero, you should always check + * the @flags field of the @c info parameter for the @c IF_ERROR_MASK. + */ + uint8_t inputPeek(VXInstructionInfo &info); + /** + * @brief Reads the next byte from the input data source. This method increases the current + * input offset and the @c length field of the @info parameter. + * @param info The instruction info. + * @return Returns the current input byte. If the result is zero, you should always check + * the @flags field of the @c info parameter for the @c IF_ERROR_MASK. + */ + uint8_t inputNext(VXInstructionInfo &info); + /** + * @brief Reads the next byte(s) from the data source. This method increases the current + * input offset and the @c length field of the @info parameter. + * @tparam T Generic integral type parameter. + * @param info The instruction info. + * @return Returns the current input byte(s). If the result is zero, you should always check + * the @flags field of the @c info parameter for the @c IF_ERROR_MASK. + */ + template + T inputNext(VXInstructionInfo &info); + /** + * @brief Returns the current input byte. The current input byte is set everytime the + * @c inputPeek or @c inputNext method is called. + * @return The current input byte. + */ + uint8_t inputCurrent() const; +private: + /** + * @brief Decodes a register operand. + * @param info The instruction info. + * @param operand The @c VXOperandInfo struct that receives the decoded data. + * @param registerClass The register class to use. + * @param registerId The register id. + * @param operandSize The defined size of the operand. + * @return True if it succeeds, false if it fails. + */ + bool decodeRegisterOperand(VXInstructionInfo &info, VXOperandInfo &operand, + RegisterClass registerClass, uint8_t registerId, VXDefinedOperandSize operandSize) const; + /** + * @brief Decodes a register/memory operand. + * @param info The instruction info. + * @param operand The @c VXOperandInfo struct that receives the decoded data. + * @param registerClass The register class to use. + * @param operandSize The defined size of the operand. + * @return True if it succeeds, false if it fails. + */ + bool decodeRegisterMemoryOperand(VXInstructionInfo &info, VXOperandInfo &operand, + RegisterClass registerClass, VXDefinedOperandSize operandSize); + /** + * @brief Decodes an immediate operand. + * @param info The instruction info. + * @param operand The @c VXOperandInfo struct that receives the decoded data. + * @param operandSize The defined size of the operand. + * @return True if it succeeds, false if it fails. + */ + bool decodeImmediate(VXInstructionInfo &info, VXOperandInfo &operand, + VXDefinedOperandSize operandSize); + /** + * @brief Decodes a displacement operand. + * @param info The instruction info. + * @param operand The @c VXOperandInfo struct that receives the decoded data. + * @param size The size of the displacement data. + * @return True if it succeeds, false if it fails. + */ + bool decodeDisplacement(VXInstructionInfo &info, VXOperandInfo &operand, uint8_t size); +private: + /** + * @brief Decodes the modrm field of the instruction. This method reads an additional + * input byte. + * @param The @c VXInstructionInfo struct that receives the decoded data. + * @return True if it succeeds, false if it fails. + */ + bool decodeModrm(VXInstructionInfo &info); + /** + * @brief Decodes the sib field of the instruction. This method reads an additional + * input byte. + * @param info The @c VXInstructionInfo struct that receives the decoded data. + * @return True if it succeeds, false if it fails. + */ + bool decodeSIB(VXInstructionInfo &info); + /** + * @brief Decodes vex prefix of the instruction. This method takes the current input byte + * to determine the vex prefix type and reads one or two additional input bytes + * on demand. + * @param info The @c VXInstructionInfo struct that receives the decoded data. + * @return True if it succeeds, false if it fails. + */ + bool decodeVex(VXInstructionInfo &info); +private: + /** + * @brief Resolves the effective operand and address mode of the instruction. + * This method requires a non-null value in the @c instrDefinition field of the + * @c info struct. + * @param info The @c VXInstructionInfo struct that receives the effective operand and + * address mode. + */ + void resolveOperandAndAddressMode(VXInstructionInfo &info) const; +private: + /** + * @brief Returns the effective operand size. + * @param info The instruction info. + * @param operandSize The defined operand size. + * @return The effective operand size. + */ + uint16_t getEffectiveOperandSize(const VXInstructionInfo &info, + VXDefinedOperandSize operandSize) const; + /** + * @brief Decodes all instruction operands. + * @param info The @c VXInstructionInfo struct that receives the decoded data. + * @return True if it succeeds, false if it fails. + */ + bool decodeOperands(VXInstructionInfo &info); + /** + * @brief Decodes the specified instruction operand. + * @param info The instruction info. + * @param operand The @c VXOperandInfo struct that receives the decoded data. + * @param operandType The defined type of the operand. + * @param operandSize The defined size of the operand. + * @return True if it succeeds, false if it fails. + */ + bool decodeOperand(VXInstructionInfo &info, VXOperandInfo &operand, + VXDefinedOperandType operandType, VXDefinedOperandSize operandSize); +private: + /** + * @brief Collects and decodes optional instruction prefixes. + * @param info The @c VXInstructionInfo struct that receives the decoded data. + * @return True if it succeeds, false if it fails. + */ + bool decodePrefixes(VXInstructionInfo &info); + /** + * @brief Collects and decodes the instruction opcodes using the opcode tree. + * @param info The @c VXInstructionInfo struct that receives the decoded data. + * @return True if it succeeds, false if it fails. + */ + bool decodeOpcode(VXInstructionInfo &info); + /** + * @brief Decodes an instruction node. + * @param info The @c VXInstructionInfo struct that receives the decoded data. + * @param node The instruction node. + * @return True if it succeeds, false if it fails. + */ + bool decodeInstructionNode(VXInstructionInfo &info, VXOpcodeTreeNode node); +public: + /** + * @brief Constructor. + * @param buffer The input buffer. + * @param bufferLen The length of the input buffer. + * @param disassemblerMode The disassembler mode. + * @param preferredVendor The preferred instruction-set vendor. + */ + VXInstructionDecoder(const void *buffer, size_t bufferLen, + VXDisassemblerMode disassemblerMode = VXDisassemblerMode::M32BIT, + VXInstructionSetVendor preferredVendor = VXInstructionSetVendor::ANY); +public: + /** + * @brief Decodes the next instruction from the input data source. + * @param info The @c VXInstructionInfo struct that receives the information about the + * decoded instruction. + * @return This method returns false, if the current position has exceeded the maximum input + * length. + * In all other cases (valid and invalid instructions) the return value is true. + */ + bool decodeNextInstruction(VXInstructionInfo &info); + /** + * @brief Decodes a single instruction. + * @param info The @c VXInstructionInfo struct that receives the information + * about the decoded instruction. + * @param buffer The input buffer. + * @param bufferLen The length of the input buffer. + * @param disassemblerMode The disassembler mode. + * @param preferredVendor The preferred instruction-set vendor. + * @return This method returns false, if the current position has exceeded the maximum input + * length. + * In all other cases (valid and invalid instructions) the return value is true. + */ + static bool decodeInstruction(VXInstructionInfo &info, const void *buffer, size_t bufferLen, + VXDisassemblerMode disassemblerMode = VXDisassemblerMode::M32BIT, + VXInstructionSetVendor preferredVendor = VXInstructionSetVendor::ANY); +public: + /** + * @brief Returns the current input position. + * @return The current input position. + */ + uintptr_t getPosition() const; + /** + * @brief Changes the input position. + * @param position The new input position. + * @return True if it succeeds, false if the new position exceeds the maximum input length. + */ + bool setPosition(uintptr_t position); + /** + * @brief Returns the current instruction pointer. The instruction pointer is used to + * properly format relative instructions. + * @return The current instruction pointer. + */ + uint64_t getInstructionPointer() const; + /** + * @brief Sets the current instruction pointer. The instruction pointer is used to + * properly format relative instructions. + * @param instructionPointer The new instruction pointer. + */ + void setInstructionPointer(uint64_t instructionPointer); +}; + +inline uint8_t VXInstructionDecoder::inputPeek(VXInstructionInfo &info) +{ + if (info.length == 15) + { + info.flags |= IF_ERROR_LENGTH; + return 0; + } + if (m_inputBufferOffset == m_inputBufferLen) + { + info.flags |= IF_ERROR_END_OF_INPUT; + return 0; + } + m_currentInput = *(static_cast(m_inputBuffer) + m_inputBufferOffset); + return m_currentInput; +} + +inline uint8_t VXInstructionDecoder::inputNext(VXInstructionInfo &info) +{ + if (info.length == 15) + { + info.flags |= IF_ERROR_LENGTH; + return 0; + } + if (m_inputBufferOffset == m_inputBufferLen) + { + info.flags |= IF_ERROR_END_OF_INPUT; + return 0; + } + m_currentInput = *(static_cast(m_inputBuffer) + m_inputBufferOffset); + m_inputBufferOffset++; + info.instructionBytes[info.length] = m_currentInput; + info.length++; + return m_currentInput; +} + +template +inline T VXInstructionDecoder::inputNext(VXInstructionInfo &info) +{ + static_assert(std::is_integral::value, "integral type required"); + T result = 0; + for (unsigned i = 0; i < (sizeof(T) / sizeof(uint8_t)); i++) + { + T b = inputNext(info); + if (!b && (info.flags & IF_ERROR_MASK)) + { + return 0; + } + result |= (b << (i * 8)); + } + return result; +} + +inline uint8_t VXInstructionDecoder::inputCurrent() const +{ + return m_currentInput; +} + +inline uintptr_t VXInstructionDecoder::getPosition() const +{ + return m_inputBufferOffset; +} + +inline bool VXInstructionDecoder::setPosition(uintptr_t position) +{ + if (position < m_inputBufferLen) + { + m_inputBufferOffset = position; + return true; + } + return false; +} + +inline uint64_t VXInstructionDecoder::getInstructionPointer() const +{ + return m_instructionPointer; +} + +inline void VXInstructionDecoder::setInstructionPointer(uint64_t instructionPointer) +{ + m_instructionPointer = instructionPointer; +} + +inline bool VXInstructionDecoder::decodeInstruction(VXInstructionInfo &info, const void *buffer, + size_t bufferLen, VXDisassemblerMode disassemblerMode, VXInstructionSetVendor preferredVendor) +{ + return VXInstructionDecoder( + buffer, bufferLen, disassemblerMode, preferredVendor).decodeNextInstruction(info); +} + +} + +} diff --git a/Verteron Disassembler Engine/VXInstructionFormatter.cpp b/Verteron Disassembler Engine/VXInstructionFormatter.cpp new file mode 100644 index 0000000..2e4ecf7 --- /dev/null +++ b/Verteron Disassembler Engine/VXInstructionFormatter.cpp @@ -0,0 +1,452 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 22. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#include "VXInstructionFormatter.h" +#include + +namespace Verteron +{ + +namespace Disassembler +{ + +const char* VXBaseInstructionFormatter::m_registerStrings[] = +{ + /* 8 bit general purpose registers */ + "al", "cl", "dl", "bl", + "ah", "ch", "dh", "bh", + "spl", "bpl", "sil", "dil", + "r8b", "r9b", "r10b", "r11b", + "r12b", "r13b", "r14b", "r15b", + /* 16 bit general purpose registers */ + "ax", "cx", "dx", "bx", + "sp", "bp", "si", "di", + "r8w", "r9w", "r10w", "r11w", + "r12w", "r13w", "r14w", "r15w", + /* 32 bit general purpose registers */ + "eax", "ecx", "edx", "ebx", + "esp", "ebp", "esi", "edi", + "r8d", "r9d", "r10d", "r11d", + "r12d", "r13d", "r14d", "r15d", + /* 64 bit general purpose registers */ + "rax", "rcx", "rdx", "rbx", + "rsp", "rbp", "rsi", "rdi", + "r8", "r9", "r10", "r11", + "r12", "r13", "r14", "r15", + /* segment registers */ + "es", "cs", "ss", + "ds", "fs", "gs", + /* control registers */ + "cr0", "cr1", "cr2", "cr3", + "cr4", "cr5", "cr6", "cr7", + "cr8", "cr9", "cr10", "cr11", + "cr12", "cr13", "cr14", "cr15", + /* debug registers */ + "dr0", "dr1", "dr2", "dr3", + "dr4", "dr5", "dr6", "dr7", + "dr8", "dr9", "dr10", "dr11", + "dr12", "dr13", "dr14", "dr15", + /* mmx registers */ + "mm0", "mm1", "mm2", "mm3", + "mm4", "mm5", "mm6", "mm7", + /* x87 registers */ + "st0", "st1", "st2", "st3", + "st4", "st5", "st6", "st7", + /* extended multimedia registers */ + "xmm0", "xmm1", "xmm2", "xmm3", + "xmm4", "xmm5", "xmm6", "xmm7", + "xmm8", "xmm9", "xmm10", "xmm11", + "xmm12", "xmm13", "xmm14", "xmm15", + /* 256 bit multimedia registers */ + "ymm0", "ymm1", "ymm2", "ymm3", + "ymm4", "ymm5", "ymm6", "ymm7", + "ymm8", "ymm9", "ymm10", "ymm11", + "ymm12", "ymm13", "ymm14", "ymm15", + /* instruction pointer register */ + "rip" +}; + +void VXBaseInstructionFormatter::internalFormatInstruction(VXInstructionInfo const& info) +{ + // Nothing to do here +} + +VXBaseInstructionFormatter::VXBaseInstructionFormatter() + : m_symbolResolver(nullptr) +{ + +} + +VXBaseInstructionFormatter::VXBaseInstructionFormatter(VXBaseSymbolResolver *symbolResolver) + : m_symbolResolver(symbolResolver) +{ + +} + +const char* VXBaseInstructionFormatter::formatInstruction(const VXInstructionInfo &info) +{ + // Clears the internal string buffer + outputClear(); + // Calls the virtual format method that actually formats the instruction + internalFormatInstruction(info); + if (m_outputBuffer.size() == 0) + { + // The basic instruction formatter only returns the instruction menmonic. + return Internal::GetInstructionMnemonicString(info.mnemonic); + } + // Return the formatted instruction string + return outputString(); +} + +VXBaseInstructionFormatter::~VXBaseInstructionFormatter() +{ + +} + +void VXBaseInstructionFormatter::outputClear() +{ + m_outputBuffer.clear(); +} + +char const* VXBaseInstructionFormatter::outputString() +{ + return &m_outputBuffer[0]; +} + +void VXBaseInstructionFormatter::outputAppend(char const *text) +{ + // Get the string length including the null-terminator char + size_t strLen = strlen(text) + 1; + // Get the buffer capacity and size + size_t bufCap = m_outputBuffer.capacity(); + size_t bufLen = m_outputBuffer.size(); + // Decrease the offset by one, to exclude already existing null-terminator chars in the + // output buffer + size_t offset = (bufLen) ? bufLen - 1 : 0; + // Resize capacity of the output buffer on demand and add some extra space to improve the + // performance + if (bufCap <= (bufLen + strLen)) + { + m_outputBuffer.reserve(bufCap + strLen + 256); + } + // Append the text + m_outputBuffer.resize(offset + strLen); + memcpy(&m_outputBuffer[offset], text, strLen); +} + +void VXBaseInstructionFormatter::outputAppendFormatted(char const *format, ...) +{ + va_list arguments; + va_start(arguments, format); + // Get the string length including the null-terminator char + size_t strLen = _vscprintf(format, arguments) + 1; + // Get the buffer capacity and size + size_t bufCap = m_outputBuffer.capacity(); + size_t bufLen = m_outputBuffer.size(); + // Decrease the offset by one, to exclude already existing null-terminator chars in the + // output buffer + size_t offset = (bufLen) ? bufLen - 1 : 0; + if (strLen > 1) + { + // Resize capacity of the output buffer on demand and add some extra space to improve the + // performance + if (bufCap < (bufLen + strLen)) + { + m_outputBuffer.reserve(bufCap + strLen + 256); + } + // Append the formatted text + m_outputBuffer.resize(offset + strLen); + vsnprintf_s(&m_outputBuffer[offset], strLen, strLen, format, arguments); + } + va_end(arguments); +} + +uint64_t VXBaseInstructionFormatter::calcAbsoluteTarget(const VXInstructionInfo &info, + const VXOperandInfo &operand) const +{ + switch (operand.size) + { + case 8: + return (info.instructionPointer + info.length + operand.lval.sbyte); + case 16: + return (info.instructionPointer + info.length + operand.lval.sword); + case 32: + case 64: + return (info.instructionPointer + info.length + operand.lval.sdword); + default: + assert(0); + } + return 0; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +void VXIntelInstructionFormatter::outputAppendAddress(const VXInstructionInfo &info, + uint64_t address) +{ + uint64_t offset = 0; + const char* name = resolveSymbol(info, address, offset); + if (name) + { + if (offset) + { + outputAppendFormatted("%s+%.2llX", name, offset); + } else + { + outputAppend(name); + } + } else + { + if (info.flags & IF_DISASSEMBLER_MODE_16) + { + outputAppendFormatted("%.4X", address); + } else if (info.flags & IF_DISASSEMBLER_MODE_32) + { + outputAppendFormatted("%.8lX", address); + } else if (info.flags & IF_DISASSEMBLER_MODE_64) + { + outputAppendFormatted("%.16llX", address); + } else + { + assert(0); + } + } +} + +void VXIntelInstructionFormatter::formatOperand(const VXInstructionInfo &info, + const VXOperandInfo &operand) +{ + switch (operand.type) + { + case VXOperandType::REGISTER: + outputAppend(registerToString(operand.base)); + break; + case VXOperandType::MEMORY: + // TODO: resolve symbols for displacement only and RIP based memory operands + if (info.flags & IF_PREFIX_SEGMENT) + { + outputAppendFormatted("%s:", registerToString(info.segmentRegister)); + } + outputAppend("["); + if (operand.base == VXRegister::RIP) + { + // TODO: Add option + outputAppendAddress(info, calcAbsoluteTarget(info, operand)); + } else + { + if (operand.base != VXRegister::NONE) + { + outputAppend(registerToString(operand.base)); + } + if (operand.index != VXRegister::NONE) + { + outputAppendFormatted("%s%s", operand.base != VXRegister::NONE ? "+" : "", + registerToString(operand.index)); + if (operand.scale) + { + outputAppendFormatted("*%d", operand.scale); + } + } + if (operand.lval.uqword || + (operand.base == VXRegister::NONE && operand.index == VXRegister::NONE)) + { + if (operand.base == VXRegister::NONE && operand.index == VXRegister::NONE) + { + // Assume the displacement value is unsigned + assert(operand.scale == 0); + assert(operand.offset != 8); + uint64_t value = 0; + switch (operand.offset) + { + case 16: + value = operand.lval.uword; + break; + case 32: + value = operand.lval.udword; + break; + case 64: + value = operand.lval.uqword; + break; + default: + assert(0); + } + outputAppendFormatted("%.2llX", value); + } else + { + // The displacement value might be negative + assert(operand.offset != 64); + int64_t value = 0; + switch (operand.offset) + { + case 8: + value = operand.lval.sbyte; + break; + case 16: + value = operand.lval.sword; + break; + case 32: + value = operand.lval.sdword; + break; + default: + assert(0); + } + if (value < 0) + { + outputAppendFormatted("-%.2lX", -value); + } else + { + outputAppendFormatted("%s%.2lX", (operand.base != VXRegister::NONE || + operand.index != VXRegister::NONE) ? "+" : "", value); + } + } + } + } + outputAppend("]"); + break; + case VXOperandType::POINTER: + // TODO: resolve symbols + switch (operand.size) + { + case 32: + outputAppendFormatted("word %.4X:%.4X", operand.lval.ptr.seg, + operand.lval.ptr.off & 0xFFFF); + break; + case 48: + outputAppendFormatted("dword %.4X:%.8lX", operand.lval.ptr.seg, operand.lval.ptr.off); + break; + default: + assert(0); + } + break; + case VXOperandType::IMMEDIATE: + { + // TODO: resolve symbols + uint64_t value = 0; + switch (operand.size) + { + case 8 : + value = operand.lval.ubyte; + break; + case 16: + value = operand.lval.uword; + break; + case 32: + value = operand.lval.udword; + break; + case 64: + value = operand.lval.uqword; + break; + default: + assert(0); + } + outputAppendFormatted("%.2llX", value); + } + break; + case VXOperandType::REL_IMMEDIATE: + { + if (operand.size == 8) + { + outputAppend("short "); + } + outputAppendAddress(info, calcAbsoluteTarget(info, operand)); + } + break; + case VXOperandType::CONSTANT: + outputAppendFormatted("%d", operand.lval.udword); + break; + default: + assert(0); + break; + } +} + +void VXIntelInstructionFormatter::internalFormatInstruction(const VXInstructionInfo &info) +{ + // Append string prefixes + if (info.flags & IF_PREFIX_LOCK) + { + outputAppend("lock "); + } + if (info.flags & IF_PREFIX_REPZ) + { + outputAppend("rep "); + } else if (info.flags & IF_PREFIX_REPNZ) + { + outputAppend("repne "); + } + // Append the instruction mnemonic + outputAppend(Internal::GetInstructionMnemonicString(info.mnemonic)); + // Append the first operand + if (info.operand[0].type != VXOperandType::NONE) + { + outputAppend(" "); + formatOperand(info, info.operand[0]); + } + // Append the second operand + if (info.operand[1].type != VXOperandType::NONE) + { + outputAppend(", "); + formatOperand(info, info.operand[1]); + } + // Append the third operand + if (info.operand[2].type != VXOperandType::NONE) + { + outputAppend(", "); + formatOperand(info, info.operand[2]); + } + // Append the fourth operand + if (info.operand[3].type != VXOperandType::NONE) + { + outputAppend(", "); + formatOperand(info, info.operand[3]); + } +} + +VXIntelInstructionFormatter::VXIntelInstructionFormatter() + : VXBaseInstructionFormatter() +{ + +} + +VXIntelInstructionFormatter::VXIntelInstructionFormatter(VXBaseSymbolResolver* symbolResolver) + : VXBaseInstructionFormatter(symbolResolver) +{ + +} + +VXIntelInstructionFormatter::~VXIntelInstructionFormatter() +{ + +} + +} + +} diff --git a/Verteron Disassembler Engine/VXInstructionFormatter.h b/Verteron Disassembler Engine/VXInstructionFormatter.h new file mode 100644 index 0000000..e3f7f59 --- /dev/null +++ b/Verteron Disassembler Engine/VXInstructionFormatter.h @@ -0,0 +1,212 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 22. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#pragma once + +#include +#include "VXDisassemblerTypes.h" +#include "VXSymbolResolver.h" + +namespace Verteron +{ + +namespace Disassembler +{ + +/** + * @brief Base class for all instruction formatter implementations. + */ +class VXBaseInstructionFormatter +{ +private: + static const char *m_registerStrings[]; + VXBaseSymbolResolver *m_symbolResolver; + std::vector m_outputBuffer; +protected: + /** + * @brief Clears the output string buffer. + */ + void outputClear(); + /** + * @brief Returns the content of the output string buffer. + * @return Pointer to the content of the ouput string buffer. + */ + const char* outputString(); + /** + * @brief Appends text to the ouput string buffer. + * @param text The text. + */ + void outputAppend(const char *text); + /** + * @brief Appends formatted text to the output string buffer. + * @param format The format string. + */ + void outputAppendFormatted(const char *format, ...); +protected: + /** + * @brief Calculates the absolute target address for a relative immediate operand. + * @param info The instruction info. + * @param operand The operand. + * @return The absolute target address. + */ + uint64_t calcAbsoluteTarget(const VXInstructionInfo &info, const VXOperandInfo &operand) const; + /** + * @brief Returns the string representation of a given register. + * @param reg The register. + * @return The string representation of the given register. + */ + const char* registerToString(VXRegister reg) const; + /** + * @brief Resolves a symbol. + * @param info The instruction info. + * @param address The address. + * @param offset Reference to an unsigned 64 bit integer that receives an offset + * relative to the base address of the symbol. + * @return The name of the symbol, if the symbol was found, @c NULL if not. + */ + const char* resolveSymbol(const VXInstructionInfo &info, uint64_t address, + uint64_t &offset) const; +protected: + /** + * @brief Override this method to implement a custom disassembly syntax. Use the + * @c outputAppend and @c outputAppendFormatted methods to fill the internal + * string buffer. + * @param info The instruction info. + */ + virtual void internalFormatInstruction(const VXInstructionInfo &info); +public: + /** + * @brief Default constructor. + */ + VXBaseInstructionFormatter(); + /** + * @brief Constructor. + * @param symbolResolver Pointer to a symbol resolver instance or @c NULL, if no smybol + * resolver should be used. + */ + explicit VXBaseInstructionFormatter(VXBaseSymbolResolver *symbolResolver); + /** + * @brief Destructor. + */ + virtual ~VXBaseInstructionFormatter(); +public: + /** + * @brief Formats a decoded instruction. + * @param info The instruction info. + * @return Pointer to the formatted instruction string. + */ + const char* formatInstruction(const VXInstructionInfo &info); +public: + /** + * @brief Returns a pointer to the current symbol resolver. + * @return Pointer to the current symbol resolver or @c NULL, if no symbol resolver is used. + */ + VXBaseSymbolResolver* getSymbolResolver() const; + /** + * @brief Sets a new symbol resolver. + * @param symbolResolver Pointer to a symbol resolver instance or @c NULL, if no smybol + * resolver should be used. + */ + void setSymbolResolver(VXBaseSymbolResolver *symbolResolver); +}; + +inline char const* VXBaseInstructionFormatter::registerToString(VXRegister reg) const +{ + if (reg == VXRegister::NONE) + { + return "error"; + } + return m_registerStrings[static_cast(reg) - 1]; +} + +inline char const* VXBaseInstructionFormatter::resolveSymbol(const VXInstructionInfo &info, + uint64_t address, uint64_t &offset) const +{ + if (m_symbolResolver) + { + return m_symbolResolver->resolveSymbol(info, address, offset); + } + return nullptr; +} + +inline VXBaseSymbolResolver* VXBaseInstructionFormatter::getSymbolResolver() const +{ + return m_symbolResolver; +} + +inline void VXBaseInstructionFormatter::setSymbolResolver(VXBaseSymbolResolver *symbolResolver) +{ + m_symbolResolver = symbolResolver; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * @brief Intel syntax instruction formatter. + */ +class VXIntelInstructionFormatter : public VXBaseInstructionFormatter +{ +private: + void outputAppendAddress(const VXInstructionInfo &info, uint64_t address); +private: + /** + * @brief Formats the specified operand and appends the resulting string to the output + * buffer. + * @param info The instruction info. + * @param operand The operand. + */ + void formatOperand(const VXInstructionInfo &info, const VXOperandInfo &operand); +protected: + /** + * @brief Fills the internal string buffer with an intel style formatted instruction string. + * @param info The instruction info. + */ + void internalFormatInstruction(const VXInstructionInfo &info) override; +public: + /** + * @brief Default constructor. + */ + VXIntelInstructionFormatter(); + /** + * @brief Constructor. + * @param symbolResolver Pointer to a symbol resolver instance or @c NULL, if no smybol + * resolver should be used. + */ + explicit VXIntelInstructionFormatter(VXBaseSymbolResolver *symbolResolver); + /** + * @brief Destructor. + */ + ~VXIntelInstructionFormatter() override; +}; + +} + +} diff --git a/Verteron Disassembler Engine/VXOpcodeTable.cpp b/Verteron Disassembler Engine/VXOpcodeTable.cpp new file mode 100644 index 0000000..57c200a --- /dev/null +++ b/Verteron Disassembler Engine/VXOpcodeTable.cpp @@ -0,0 +1,10195 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 14. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#include "VXOpcodeTable.h" + +namespace Verteron +{ + +namespace Disassembler +{ + +namespace Internal +{ + +#define INVALID 0 +#define NODE(type, n) (static_cast(type) << 12 | (n)) +#define MODRM(n) ((n) | 0x0800) + +static const VXOpcodeTreeNode optreeTable[][256] = +{ + { + /* 00 */ MODRM(0x0015), + /* 01 */ MODRM(0x0014), + /* 02 */ MODRM(0x0016), + /* 03 */ MODRM(0x0018), + /* 04 */ 0x0017, + /* 05 */ 0x0010, + /* 06 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0000), + /* 07 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0001), + /* 08 */ MODRM(0x039F), + /* 09 */ MODRM(0x039E), + /* 0A */ MODRM(0x03A0), + /* 0B */ MODRM(0x03A2), + /* 0C */ 0x03A1, + /* 0D */ 0x039A, + /* 0E */ NODE(VXOpcodeTreeNodeType::MODE, 0x0002), + /* 0F */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0001), + /* 10 */ MODRM(0x000B), + /* 11 */ MODRM(0x000A), + /* 12 */ MODRM(0x000C), + /* 13 */ MODRM(0x000E), + /* 14 */ 0x000D, + /* 15 */ 0x0006, + /* 16 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0007), + /* 17 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0008), + /* 18 */ MODRM(0x050C), + /* 19 */ MODRM(0x050D), + /* 1A */ MODRM(0x050A), + /* 1B */ MODRM(0x050B), + /* 1C */ 0x0510, + /* 1D */ 0x0511, + /* 1E */ NODE(VXOpcodeTreeNodeType::MODE, 0x0009), + /* 1F */ NODE(VXOpcodeTreeNodeType::MODE, 0x000A), + /* 20 */ MODRM(0x0026), + /* 21 */ MODRM(0x0027), + /* 22 */ MODRM(0x0025), + /* 23 */ MODRM(0x002C), + /* 24 */ 0x002D, + /* 25 */ 0x002E, + /* 26 */ INVALID, + /* 27 */ NODE(VXOpcodeTreeNodeType::MODE, 0x000B), + /* 28 */ MODRM(0x0560), + /* 29 */ MODRM(0x055F), + /* 2A */ MODRM(0x0561), + /* 2B */ MODRM(0x0563), + /* 2C */ 0x0562, + /* 2D */ 0x055B, + /* 2E */ INVALID, + /* 2F */ NODE(VXOpcodeTreeNodeType::MODE, 0x000C), + /* 30 */ MODRM(0x06D2), + /* 31 */ MODRM(0x06D1), + /* 32 */ MODRM(0x06D0), + /* 33 */ MODRM(0x06D3), + /* 34 */ 0x06CC, + /* 35 */ 0x06CB, + /* 36 */ INVALID, + /* 37 */ NODE(VXOpcodeTreeNodeType::MODE, 0x000D), + /* 38 */ MODRM(0x006F), + /* 39 */ MODRM(0x0070), + /* 3A */ MODRM(0x006E), + /* 3B */ MODRM(0x006C), + /* 3C */ 0x006D, + /* 3D */ 0x0073, + /* 3E */ INVALID, + /* 3F */ NODE(VXOpcodeTreeNodeType::MODE, 0x000E), + /* 40 */ 0x02A7, + /* 41 */ 0x02AE, + /* 42 */ 0x02AD, + /* 43 */ 0x02B0, + /* 44 */ 0x02AF, + /* 45 */ 0x02AC, + /* 46 */ 0x02A9, + /* 47 */ 0x02A8, + /* 48 */ 0x00A7, + /* 49 */ 0x00A6, + /* 4A */ 0x00A8, + /* 4B */ 0x00AA, + /* 4C */ 0x00A9, + /* 4D */ 0x00A2, + /* 4E */ 0x00A1, + /* 4F */ 0x00A3, + /* 50 */ 0x04C5, + /* 51 */ 0x04CA, + /* 52 */ 0x04C4, + /* 53 */ 0x04BF, + /* 54 */ 0x04C0, + /* 55 */ 0x04C1, + /* 56 */ 0x04C2, + /* 57 */ 0x04C3, + /* 58 */ 0x0454, + /* 59 */ 0x0451, + /* 5A */ 0x0452, + /* 5B */ 0x044C, + /* 5C */ 0x0448, + /* 5D */ 0x0447, + /* 5E */ 0x0449, + /* 5F */ 0x044B, + /* 60 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0007), + /* 61 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0008), + /* 62 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0013), + /* 63 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0014), + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ 0x04C8, + /* 69 */ MODRM(0x02A1), + /* 6A */ 0x04BC, + /* 6B */ MODRM(0x02A0), + /* 6C */ 0x02B1, + /* 6D */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0009), + /* 6E */ 0x03A9, + /* 6F */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x000A), + /* 70 */ 0x02E2, + /* 71 */ 0x02DB, + /* 72 */ 0x02C8, + /* 73 */ 0x02C6, + /* 74 */ 0x02EA, + /* 75 */ 0x02E1, + /* 76 */ 0x02CA, + /* 77 */ 0x02C4, + /* 78 */ 0x02E8, + /* 79 */ 0x02DF, + /* 7A */ 0x02E5, + /* 7B */ 0x02DC, + /* 7C */ 0x02D1, + /* 7D */ 0x02CF, + /* 7E */ 0x02D4, + /* 7F */ 0x02CE, + /* 80 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x000F), + /* 81 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0010), + /* 82 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0011), + /* 83 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0012), + /* 84 */ MODRM(0x0573), + /* 85 */ MODRM(0x0572), + /* 86 */ MODRM(0x06BB), + /* 87 */ MODRM(0x06BC), + /* 88 */ MODRM(0x0326), + /* 89 */ MODRM(0x0321), + /* 8A */ MODRM(0x0322), + /* 8B */ MODRM(0x0323), + /* 8C */ MODRM(0x032F), + /* 8D */ MODRM(0x02F0), + /* 8E */ MODRM(0x032E), + /* 8F */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0013), + /* 90 */ 0x06BD, + /* 91 */ 0x06B9, + /* 92 */ 0x06BA, + /* 93 */ 0x06C1, + /* 94 */ 0x06C2, + /* 95 */ 0x06BF, + /* 96 */ 0x06C0, + /* 97 */ 0x06BE, + /* 98 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x000B), + /* 99 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x000C), + /* 9A */ NODE(VXOpcodeTreeNodeType::MODE, 0x001D), + /* 9B */ 0x06B4, + /* 9C */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x000D), + /* 9D */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x000E), + /* 9E */ 0x0500, + /* 9F */ 0x02EB, + /* A0 */ 0x032D, + /* A1 */ 0x0332, + /* A2 */ 0x0331, + /* A3 */ 0x0330, + /* A4 */ 0x0371, + /* A5 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x000F), + /* A6 */ 0x0076, + /* A7 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0010), + /* A8 */ 0x0574, + /* A9 */ 0x0576, + /* AA */ 0x0555, + /* AB */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0011), + /* AC */ 0x0303, + /* AD */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0012), + /* AE */ 0x0512, + /* AF */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0013), + /* B0 */ 0x0329, + /* B1 */ 0x0328, + /* B2 */ 0x0327, + /* B3 */ 0x032C, + /* B4 */ 0x032B, + /* B5 */ 0x032A, + /* B6 */ 0x0333, + /* B7 */ 0x033D, + /* B8 */ 0x033C, + /* B9 */ 0x033B, + /* BA */ 0x0338, + /* BB */ 0x0334, + /* BC */ 0x0336, + /* BD */ 0x033E, + /* BE */ 0x0340, + /* BF */ 0x033F, + /* C0 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0014), + /* C1 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0015), + /* C2 */ 0x04EB, + /* C3 */ 0x04EC, + /* C4 */ NODE(VXOpcodeTreeNodeType::VEX, 0x0000), + /* C5 */ NODE(VXOpcodeTreeNodeType::VEX, 0x0001), + /* C6 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x001A), + /* C7 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x001B), + /* C8 */ 0x00B4, + /* C9 */ 0x02F1, + /* CA */ 0x04EA, + /* CB */ 0x04E9, + /* CC */ 0x02B7, + /* CD */ 0x02B5, + /* CE */ NODE(VXOpcodeTreeNodeType::MODE, 0x0027), + /* CF */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0017), + /* D0 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x001C), + /* D1 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x001D), + /* D2 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x001E), + /* D3 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x001F), + /* D4 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0028), + /* D5 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0029), + /* D6 */ NODE(VXOpcodeTreeNodeType::MODE, 0x002A), + /* D7 */ 0x06C9, + /* D8 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0015), + /* D9 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0016), + /* DA */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0017), + /* DB */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0018), + /* DC */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0019), + /* DD */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x001A), + /* DE */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x001B), + /* DF */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x001C), + /* E0 */ 0x0309, + /* E1 */ 0x0308, + /* E2 */ 0x0307, + /* E3 */ NODE(VXOpcodeTreeNodeType::ADDRESS_SIZE, 0x0000), + /* E4 */ 0x02A6, + /* E5 */ 0x02A3, + /* E6 */ 0x03A6, + /* E7 */ 0x03A5, + /* E8 */ 0x004E, + /* E9 */ 0x02D7, + /* EA */ NODE(VXOpcodeTreeNodeType::MODE, 0x002B), + /* EB */ 0x02D8, + /* EC */ 0x02A4, + /* ED */ 0x02A5, + /* EE */ 0x03A7, + /* EF */ 0x03A8, + /* F0 */ 0x0302, + /* F1 */ 0x02B6, + /* F2 */ 0x04E8, + /* F3 */ 0x04E7, + /* F4 */ 0x0299, + /* F5 */ 0x0059, + /* F6 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0028), + /* F7 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0029), + /* F8 */ 0x0053, + /* F9 */ 0x0550, + /* FA */ 0x0057, + /* FB */ 0x0553, + /* FC */ 0x0054, + /* FD */ 0x0551, + /* FE */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x002A), + /* FF */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x002B), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0000), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0000), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0021), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0022), + /* 04 */ INVALID, + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0023), + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0024), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0025), + /* 08 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0026), + /* 09 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0027), + /* 0A */ INVALID, + /* 0B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0028), + /* 0C */ INVALID, + /* 0D */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0003), + /* 0E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0031), + /* 0F */ NODE(VXOpcodeTreeNodeType::AMD3DNOW, 0x0000), + /* 10 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0032), + /* 11 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0033), + /* 12 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0001), + /* 13 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0036), + /* 14 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0037), + /* 15 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0038), + /* 16 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0002), + /* 17 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x003B), + /* 18 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0004), + /* 19 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0040), + /* 1A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0041), + /* 1B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0042), + /* 1C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0043), + /* 1D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0044), + /* 1E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0045), + /* 1F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0046), + /* 20 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0047), + /* 21 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0048), + /* 22 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0049), + /* 23 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x004A), + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x004B), + /* 29 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x004C), + /* 2A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x004D), + /* 2B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x004E), + /* 2C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x004F), + /* 2D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0050), + /* 2E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0051), + /* 2F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0052), + /* 30 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0053), + /* 31 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0054), + /* 32 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0055), + /* 33 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0056), + /* 34 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0057), + /* 35 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0058), + /* 36 */ INVALID, + /* 37 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0059), + /* 38 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0002), + /* 39 */ INVALID, + /* 3A */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0003), + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + /* 40 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A9), + /* 41 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00AA), + /* 42 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00AB), + /* 43 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00AC), + /* 44 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00AD), + /* 45 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00AE), + /* 46 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00AF), + /* 47 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B0), + /* 48 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B1), + /* 49 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B2), + /* 4A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B3), + /* 4B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B4), + /* 4C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B5), + /* 4D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B6), + /* 4E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B7), + /* 4F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B8), + /* 50 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00B9), + /* 51 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00BA), + /* 52 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00BB), + /* 53 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00BC), + /* 54 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00BD), + /* 55 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00BE), + /* 56 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00BF), + /* 57 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C0), + /* 58 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C1), + /* 59 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C2), + /* 5A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C3), + /* 5B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C4), + /* 5C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C5), + /* 5D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C6), + /* 5E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C7), + /* 5F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C8), + /* 60 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00C9), + /* 61 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00CA), + /* 62 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00CB), + /* 63 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00CC), + /* 64 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00CD), + /* 65 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00CE), + /* 66 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00CF), + /* 67 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D0), + /* 68 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D1), + /* 69 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D2), + /* 6A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D3), + /* 6B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D4), + /* 6C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D5), + /* 6D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D6), + /* 6E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D7), + /* 6F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D8), + /* 70 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00D9), + /* 71 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0005), + /* 72 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0006), + /* 73 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0007), + /* 74 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E4), + /* 75 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E5), + /* 76 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E6), + /* 77 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E7), + /* 78 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E8), + /* 79 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E9), + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00EA), + /* 7D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00EB), + /* 7E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00EC), + /* 7F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00ED), + /* 80 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00EE), + /* 81 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00EF), + /* 82 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F0), + /* 83 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F1), + /* 84 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F2), + /* 85 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F3), + /* 86 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F4), + /* 87 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F5), + /* 88 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F6), + /* 89 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F7), + /* 8A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F8), + /* 8B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00F9), + /* 8C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00FA), + /* 8D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00FB), + /* 8E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00FC), + /* 8F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00FD), + /* 90 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00FE), + /* 91 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00FF), + /* 92 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0100), + /* 93 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0101), + /* 94 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0102), + /* 95 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0103), + /* 96 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0104), + /* 97 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0105), + /* 98 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0106), + /* 99 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0107), + /* 9A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0108), + /* 9B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0109), + /* 9C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x010A), + /* 9D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x010B), + /* 9E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x010C), + /* 9F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x010D), + /* A0 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x010E), + /* A1 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x010F), + /* A2 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0110), + /* A3 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0111), + /* A4 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0112), + /* A5 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0113), + /* A6 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0003), + /* A7 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0004), + /* A8 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x011D), + /* A9 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x011E), + /* AA */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x011F), + /* AB */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0120), + /* AC */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0121), + /* AD */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0122), + /* AE */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0005), + /* AF */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0142), + /* B0 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0143), + /* B1 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0144), + /* B2 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0145), + /* B3 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0146), + /* B4 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0147), + /* B5 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0148), + /* B6 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0149), + /* B7 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x014A), + /* B8 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x014B), + /* B9 */ INVALID, + /* BA */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x000C), + /* BB */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0150), + /* BC */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0151), + /* BD */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0152), + /* BE */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0153), + /* BF */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0154), + /* C0 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0155), + /* C1 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0156), + /* C2 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0157), + /* C3 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0158), + /* C4 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0159), + /* C5 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x015A), + /* C6 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x015B), + /* C7 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0006), + /* C8 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0160), + /* C9 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0161), + /* CA */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0162), + /* CB */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0163), + /* CC */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0164), + /* CD */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0165), + /* CE */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0166), + /* CF */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0167), + /* D0 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0168), + /* D1 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0169), + /* D2 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x016A), + /* D3 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x016B), + /* D4 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x016C), + /* D5 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x016D), + /* D6 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x016E), + /* D7 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x016F), + /* D8 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0170), + /* D9 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0171), + /* DA */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0172), + /* DB */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0173), + /* DC */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0174), + /* DD */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0175), + /* DE */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0176), + /* DF */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0177), + /* E0 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0178), + /* E1 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0179), + /* E2 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x017A), + /* E3 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x017B), + /* E4 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x017C), + /* E5 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x017D), + /* E6 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x017E), + /* E7 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x017F), + /* E8 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0180), + /* E9 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0181), + /* EA */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0182), + /* EB */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0183), + /* EC */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0184), + /* ED */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0185), + /* EE */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0186), + /* EF */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0187), + /* F0 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0188), + /* F1 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0189), + /* F2 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x018A), + /* F3 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x018B), + /* F4 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x018C), + /* F5 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x018D), + /* F6 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x018E), + /* F7 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0007), + /* F8 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0190), + /* F9 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0191), + /* FA */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0192), + /* FB */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0193), + /* FC */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0194), + /* FD */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0195), + /* FE */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0196), + /* FF */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x005A), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x005B), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x005C), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x005D), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x005E), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x005F), + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0060), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0061), + /* 08 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0062), + /* 09 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0063), + /* 0A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0064), + /* 0B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0065), + /* 0C */ INVALID, + /* 0D */ INVALID, + /* 0E */ INVALID, + /* 0F */ INVALID, + /* 10 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0066), + /* 11 */ INVALID, + /* 12 */ INVALID, + /* 13 */ INVALID, + /* 14 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0067), + /* 15 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0068), + /* 16 */ INVALID, + /* 17 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0069), + /* 18 */ INVALID, + /* 19 */ INVALID, + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x006A), + /* 1D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x006B), + /* 1E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x006C), + /* 1F */ INVALID, + /* 20 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x006D), + /* 21 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x006E), + /* 22 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x006F), + /* 23 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0070), + /* 24 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0071), + /* 25 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0072), + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0073), + /* 29 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0074), + /* 2A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0075), + /* 2B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0076), + /* 2C */ INVALID, + /* 2D */ INVALID, + /* 2E */ INVALID, + /* 2F */ INVALID, + /* 30 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0077), + /* 31 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0078), + /* 32 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0079), + /* 33 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x007A), + /* 34 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x007B), + /* 35 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x007C), + /* 36 */ INVALID, + /* 37 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x007D), + /* 38 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x007E), + /* 39 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x007F), + /* 3A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0080), + /* 3B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0081), + /* 3C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0082), + /* 3D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0083), + /* 3E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0084), + /* 3F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0085), + /* 40 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0086), + /* 41 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0087), + /* 42 */ INVALID, + /* 43 */ INVALID, + /* 44 */ INVALID, + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ INVALID, + /* 4B */ INVALID, + /* 4C */ INVALID, + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ INVALID, + /* 51 */ INVALID, + /* 52 */ INVALID, + /* 53 */ INVALID, + /* 54 */ INVALID, + /* 55 */ INVALID, + /* 56 */ INVALID, + /* 57 */ INVALID, + /* 58 */ INVALID, + /* 59 */ INVALID, + /* 5A */ INVALID, + /* 5B */ INVALID, + /* 5C */ INVALID, + /* 5D */ INVALID, + /* 5E */ INVALID, + /* 5F */ INVALID, + /* 60 */ INVALID, + /* 61 */ INVALID, + /* 62 */ INVALID, + /* 63 */ INVALID, + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ INVALID, + /* 69 */ INVALID, + /* 6A */ INVALID, + /* 6B */ INVALID, + /* 6C */ INVALID, + /* 6D */ INVALID, + /* 6E */ INVALID, + /* 6F */ INVALID, + /* 70 */ INVALID, + /* 71 */ INVALID, + /* 72 */ INVALID, + /* 73 */ INVALID, + /* 74 */ INVALID, + /* 75 */ INVALID, + /* 76 */ INVALID, + /* 77 */ INVALID, + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ INVALID, + /* 7D */ INVALID, + /* 7E */ INVALID, + /* 7F */ INVALID, + /* 80 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0088), + /* 81 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0089), + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ INVALID, + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ INVALID, + /* 8F */ INVALID, + /* 90 */ INVALID, + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ INVALID, + /* 95 */ INVALID, + /* 96 */ INVALID, + /* 97 */ INVALID, + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ INVALID, + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ INVALID, + /* 9F */ INVALID, + /* A0 */ INVALID, + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ INVALID, + /* A5 */ INVALID, + /* A6 */ INVALID, + /* A7 */ INVALID, + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ INVALID, + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ INVALID, + /* AF */ INVALID, + /* B0 */ INVALID, + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ INVALID, + /* B5 */ INVALID, + /* B6 */ INVALID, + /* B7 */ INVALID, + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ INVALID, + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ INVALID, + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ INVALID, + /* C3 */ INVALID, + /* C4 */ INVALID, + /* C5 */ INVALID, + /* C6 */ INVALID, + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ INVALID, + /* D1 */ INVALID, + /* D2 */ INVALID, + /* D3 */ INVALID, + /* D4 */ INVALID, + /* D5 */ INVALID, + /* D6 */ INVALID, + /* D7 */ INVALID, + /* D8 */ INVALID, + /* D9 */ INVALID, + /* DA */ INVALID, + /* DB */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x008A), + /* DC */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x008B), + /* DD */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x008C), + /* DE */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x008D), + /* DF */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x008E), + /* E0 */ INVALID, + /* E1 */ INVALID, + /* E2 */ INVALID, + /* E3 */ INVALID, + /* E4 */ INVALID, + /* E5 */ INVALID, + /* E6 */ INVALID, + /* E7 */ INVALID, + /* E8 */ INVALID, + /* E9 */ INVALID, + /* EA */ INVALID, + /* EB */ INVALID, + /* EC */ INVALID, + /* ED */ INVALID, + /* EE */ INVALID, + /* EF */ INVALID, + /* F0 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x008F), + /* F1 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0090), + /* F2 */ INVALID, + /* F3 */ INVALID, + /* F4 */ INVALID, + /* F5 */ INVALID, + /* F6 */ INVALID, + /* F7 */ INVALID, + /* F8 */ INVALID, + /* F9 */ INVALID, + /* FA */ INVALID, + /* FB */ INVALID, + /* FC */ INVALID, + /* FD */ INVALID, + /* FE */ INVALID, + /* FF */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + /* 08 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0091), + /* 09 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0092), + /* 0A */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0093), + /* 0B */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0094), + /* 0C */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0095), + /* 0D */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0096), + /* 0E */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0097), + /* 0F */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0098), + /* 10 */ INVALID, + /* 11 */ INVALID, + /* 12 */ INVALID, + /* 13 */ INVALID, + /* 14 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0099), + /* 15 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x009A), + /* 16 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x009B), + /* 17 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x009C), + /* 18 */ INVALID, + /* 19 */ INVALID, + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ INVALID, + /* 1D */ INVALID, + /* 1E */ INVALID, + /* 1F */ INVALID, + /* 20 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x009D), + /* 21 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x009E), + /* 22 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x009F), + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ INVALID, + /* 29 */ INVALID, + /* 2A */ INVALID, + /* 2B */ INVALID, + /* 2C */ INVALID, + /* 2D */ INVALID, + /* 2E */ INVALID, + /* 2F */ INVALID, + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + /* 40 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A0), + /* 41 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A1), + /* 42 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A2), + /* 43 */ INVALID, + /* 44 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A3), + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ INVALID, + /* 4B */ INVALID, + /* 4C */ INVALID, + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ INVALID, + /* 51 */ INVALID, + /* 52 */ INVALID, + /* 53 */ INVALID, + /* 54 */ INVALID, + /* 55 */ INVALID, + /* 56 */ INVALID, + /* 57 */ INVALID, + /* 58 */ INVALID, + /* 59 */ INVALID, + /* 5A */ INVALID, + /* 5B */ INVALID, + /* 5C */ INVALID, + /* 5D */ INVALID, + /* 5E */ INVALID, + /* 5F */ INVALID, + /* 60 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A4), + /* 61 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A5), + /* 62 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A6), + /* 63 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A7), + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ INVALID, + /* 69 */ INVALID, + /* 6A */ INVALID, + /* 6B */ INVALID, + /* 6C */ INVALID, + /* 6D */ INVALID, + /* 6E */ INVALID, + /* 6F */ INVALID, + /* 70 */ INVALID, + /* 71 */ INVALID, + /* 72 */ INVALID, + /* 73 */ INVALID, + /* 74 */ INVALID, + /* 75 */ INVALID, + /* 76 */ INVALID, + /* 77 */ INVALID, + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ INVALID, + /* 7D */ INVALID, + /* 7E */ INVALID, + /* 7F */ INVALID, + /* 80 */ INVALID, + /* 81 */ INVALID, + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ INVALID, + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ INVALID, + /* 8F */ INVALID, + /* 90 */ INVALID, + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ INVALID, + /* 95 */ INVALID, + /* 96 */ INVALID, + /* 97 */ INVALID, + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ INVALID, + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ INVALID, + /* 9F */ INVALID, + /* A0 */ INVALID, + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ INVALID, + /* A5 */ INVALID, + /* A6 */ INVALID, + /* A7 */ INVALID, + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ INVALID, + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ INVALID, + /* AF */ INVALID, + /* B0 */ INVALID, + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ INVALID, + /* B5 */ INVALID, + /* B6 */ INVALID, + /* B7 */ INVALID, + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ INVALID, + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ INVALID, + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ INVALID, + /* C3 */ INVALID, + /* C4 */ INVALID, + /* C5 */ INVALID, + /* C6 */ INVALID, + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ INVALID, + /* D1 */ INVALID, + /* D2 */ INVALID, + /* D3 */ INVALID, + /* D4 */ INVALID, + /* D5 */ INVALID, + /* D6 */ INVALID, + /* D7 */ INVALID, + /* D8 */ INVALID, + /* D9 */ INVALID, + /* DA */ INVALID, + /* DB */ INVALID, + /* DC */ INVALID, + /* DD */ INVALID, + /* DE */ INVALID, + /* DF */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00A8), + /* E0 */ INVALID, + /* E1 */ INVALID, + /* E2 */ INVALID, + /* E3 */ INVALID, + /* E4 */ INVALID, + /* E5 */ INVALID, + /* E6 */ INVALID, + /* E7 */ INVALID, + /* E8 */ INVALID, + /* E9 */ INVALID, + /* EA */ INVALID, + /* EB */ INVALID, + /* EC */ INVALID, + /* ED */ INVALID, + /* EE */ INVALID, + /* EF */ INVALID, + /* F0 */ INVALID, + /* F1 */ INVALID, + /* F2 */ INVALID, + /* F3 */ INVALID, + /* F4 */ INVALID, + /* F5 */ INVALID, + /* F6 */ INVALID, + /* F7 */ INVALID, + /* F8 */ INVALID, + /* F9 */ INVALID, + /* FA */ INVALID, + /* FB */ INVALID, + /* FC */ INVALID, + /* FD */ INVALID, + /* FE */ INVALID, + /* FF */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + /* 08 */ INVALID, + /* 09 */ INVALID, + /* 0A */ INVALID, + /* 0B */ INVALID, + /* 0C */ INVALID, + /* 0D */ INVALID, + /* 0E */ INVALID, + /* 0F */ INVALID, + /* 10 */ MODRM(0x05FC), + /* 11 */ MODRM(0x05FD), + /* 12 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0008), + /* 13 */ MODRM(0x05E2), + /* 14 */ MODRM(0x06AF), + /* 15 */ MODRM(0x06AD), + /* 16 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0009), + /* 17 */ MODRM(0x05DD), + /* 18 */ INVALID, + /* 19 */ INVALID, + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ INVALID, + /* 1D */ INVALID, + /* 1E */ INVALID, + /* 1F */ INVALID, + /* 20 */ INVALID, + /* 21 */ INVALID, + /* 22 */ INVALID, + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ MODRM(0x05CF), + /* 29 */ MODRM(0x05D0), + /* 2A */ INVALID, + /* 2B */ MODRM(0x05E9), + /* 2C */ INVALID, + /* 2D */ INVALID, + /* 2E */ MODRM(0x06AB), + /* 2F */ MODRM(0x0599), + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + /* 40 */ INVALID, + /* 41 */ INVALID, + /* 42 */ INVALID, + /* 43 */ INVALID, + /* 44 */ INVALID, + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ INVALID, + /* 4B */ INVALID, + /* 4C */ INVALID, + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ MODRM(0x05E5), + /* 51 */ MODRM(0x06A0), + /* 52 */ MODRM(0x069B), + /* 53 */ MODRM(0x0695), + /* 54 */ MODRM(0x058D), + /* 55 */ MODRM(0x058B), + /* 56 */ MODRM(0x060D), + /* 57 */ MODRM(0x06B1), + /* 58 */ MODRM(0x057F), + /* 59 */ MODRM(0x0606), + /* 5A */ MODRM(0x059F), + /* 5B */ MODRM(0x059B), + /* 5C */ MODRM(0x06A5), + /* 5D */ MODRM(0x05C7), + /* 5E */ MODRM(0x05AB), + /* 5F */ MODRM(0x05C1), + /* 60 */ INVALID, + /* 61 */ INVALID, + /* 62 */ INVALID, + /* 63 */ INVALID, + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ INVALID, + /* 69 */ INVALID, + /* 6A */ INVALID, + /* 6B */ INVALID, + /* 6C */ INVALID, + /* 6D */ INVALID, + /* 6E */ INVALID, + /* 6F */ INVALID, + /* 70 */ INVALID, + /* 71 */ INVALID, + /* 72 */ INVALID, + /* 73 */ INVALID, + /* 74 */ INVALID, + /* 75 */ INVALID, + /* 76 */ INVALID, + /* 77 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0000), + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ INVALID, + /* 7D */ INVALID, + /* 7E */ INVALID, + /* 7F */ INVALID, + /* 80 */ INVALID, + /* 81 */ INVALID, + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ INVALID, + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ INVALID, + /* 8F */ INVALID, + /* 90 */ INVALID, + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ INVALID, + /* 95 */ INVALID, + /* 96 */ INVALID, + /* 97 */ INVALID, + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ INVALID, + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ INVALID, + /* 9F */ INVALID, + /* A0 */ INVALID, + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ INVALID, + /* A5 */ INVALID, + /* A6 */ INVALID, + /* A7 */ INVALID, + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ INVALID, + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x000A), + /* AF */ INVALID, + /* B0 */ INVALID, + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ INVALID, + /* B5 */ INVALID, + /* B6 */ INVALID, + /* B7 */ INVALID, + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ INVALID, + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ INVALID, + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ MODRM(0x0595), + /* C3 */ INVALID, + /* C4 */ INVALID, + /* C5 */ INVALID, + /* C6 */ MODRM(0x069E), + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ INVALID, + /* D1 */ INVALID, + /* D2 */ INVALID, + /* D3 */ INVALID, + /* D4 */ INVALID, + /* D5 */ INVALID, + /* D6 */ INVALID, + /* D7 */ INVALID, + /* D8 */ INVALID, + /* D9 */ INVALID, + /* DA */ INVALID, + /* DB */ INVALID, + /* DC */ INVALID, + /* DD */ INVALID, + /* DE */ INVALID, + /* DF */ INVALID, + /* E0 */ INVALID, + /* E1 */ INVALID, + /* E2 */ INVALID, + /* E3 */ INVALID, + /* E4 */ INVALID, + /* E5 */ INVALID, + /* E6 */ INVALID, + /* E7 */ INVALID, + /* E8 */ INVALID, + /* E9 */ INVALID, + /* EA */ INVALID, + /* EB */ INVALID, + /* EC */ INVALID, + /* ED */ INVALID, + /* EE */ INVALID, + /* EF */ INVALID, + /* F0 */ INVALID, + /* F1 */ INVALID, + /* F2 */ INVALID, + /* F3 */ INVALID, + /* F4 */ INVALID, + /* F5 */ INVALID, + /* F6 */ INVALID, + /* F7 */ INVALID, + /* F8 */ INVALID, + /* F9 */ INVALID, + /* FA */ INVALID, + /* FB */ INVALID, + /* FC */ INVALID, + /* FD */ INVALID, + /* FE */ INVALID, + /* FF */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + /* 08 */ INVALID, + /* 09 */ INVALID, + /* 0A */ INVALID, + /* 0B */ INVALID, + /* 0C */ INVALID, + /* 0D */ INVALID, + /* 0E */ INVALID, + /* 0F */ INVALID, + /* 10 */ MODRM(0x05FA), + /* 11 */ MODRM(0x05FB), + /* 12 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x000B), + /* 13 */ MODRM(0x05E0), + /* 14 */ MODRM(0x06AE), + /* 15 */ MODRM(0x06AC), + /* 16 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x000C), + /* 17 */ MODRM(0x05DC), + /* 18 */ INVALID, + /* 19 */ INVALID, + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ INVALID, + /* 1D */ INVALID, + /* 1E */ INVALID, + /* 1F */ INVALID, + /* 20 */ INVALID, + /* 21 */ INVALID, + /* 22 */ INVALID, + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ MODRM(0x05CD), + /* 29 */ MODRM(0x05CE), + /* 2A */ INVALID, + /* 2B */ MODRM(0x05E8), + /* 2C */ INVALID, + /* 2D */ INVALID, + /* 2E */ MODRM(0x06AA), + /* 2F */ MODRM(0x0598), + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + /* 40 */ INVALID, + /* 41 */ INVALID, + /* 42 */ INVALID, + /* 43 */ INVALID, + /* 44 */ INVALID, + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ INVALID, + /* 4B */ INVALID, + /* 4C */ INVALID, + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ MODRM(0x05E4), + /* 51 */ MODRM(0x069F), + /* 52 */ INVALID, + /* 53 */ INVALID, + /* 54 */ MODRM(0x058C), + /* 55 */ MODRM(0x058A), + /* 56 */ MODRM(0x060C), + /* 57 */ MODRM(0x06B0), + /* 58 */ MODRM(0x057E), + /* 59 */ MODRM(0x0605), + /* 5A */ MODRM(0x059D), + /* 5B */ MODRM(0x059E), + /* 5C */ MODRM(0x06A4), + /* 5D */ MODRM(0x05C6), + /* 5E */ MODRM(0x05AA), + /* 5F */ MODRM(0x05C0), + /* 60 */ MODRM(0x0690), + /* 61 */ MODRM(0x0693), + /* 62 */ MODRM(0x0691), + /* 63 */ MODRM(0x0612), + /* 64 */ MODRM(0x062B), + /* 65 */ MODRM(0x062E), + /* 66 */ MODRM(0x062C), + /* 67 */ MODRM(0x0614), + /* 68 */ MODRM(0x068C), + /* 69 */ MODRM(0x068F), + /* 6A */ MODRM(0x068D), + /* 6B */ MODRM(0x0611), + /* 6C */ MODRM(0x0692), + /* 6D */ MODRM(0x068E), + /* 6E */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0014), + /* 6F */ MODRM(0x05D7), + /* 70 */ MODRM(0x066B), + /* 71 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0017), + /* 72 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0018), + /* 73 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0019), + /* 74 */ MODRM(0x0625), + /* 75 */ MODRM(0x0628), + /* 76 */ MODRM(0x0626), + /* 77 */ INVALID, + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ MODRM(0x05B4), + /* 7D */ MODRM(0x05B6), + /* 7E */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0015), + /* 7F */ MODRM(0x05D8), + /* 80 */ INVALID, + /* 81 */ INVALID, + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ INVALID, + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ INVALID, + /* 8F */ INVALID, + /* 90 */ INVALID, + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ INVALID, + /* 95 */ INVALID, + /* 96 */ INVALID, + /* 97 */ INVALID, + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ INVALID, + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ INVALID, + /* 9F */ INVALID, + /* A0 */ INVALID, + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ INVALID, + /* A5 */ INVALID, + /* A6 */ INVALID, + /* A7 */ INVALID, + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ INVALID, + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ INVALID, + /* AF */ INVALID, + /* B0 */ INVALID, + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ INVALID, + /* B5 */ INVALID, + /* B6 */ INVALID, + /* B7 */ INVALID, + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ INVALID, + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ INVALID, + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ MODRM(0x0594), + /* C3 */ INVALID, + /* C4 */ MODRM(0x0647), + /* C5 */ MODRM(0x063B), + /* C6 */ MODRM(0x069D), + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ MODRM(0x0582), + /* D1 */ MODRM(0x0681), + /* D2 */ MODRM(0x067D), + /* D3 */ MODRM(0x067F), + /* D4 */ MODRM(0x0617), + /* D5 */ MODRM(0x0667), + /* D6 */ MODRM(0x05EB), + /* D7 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0004), + /* D8 */ MODRM(0x0688), + /* D9 */ MODRM(0x0689), + /* DA */ MODRM(0x0653), + /* DB */ MODRM(0x061E), + /* DC */ MODRM(0x061A), + /* DD */ MODRM(0x061B), + /* DE */ MODRM(0x064D), + /* DF */ MODRM(0x061F), + /* E0 */ MODRM(0x0620), + /* E1 */ MODRM(0x067B), + /* E2 */ MODRM(0x0678), + /* E3 */ MODRM(0x0621), + /* E4 */ MODRM(0x0664), + /* E5 */ MODRM(0x0665), + /* E6 */ MODRM(0x05A6), + /* E7 */ MODRM(0x05E6), + /* E8 */ MODRM(0x0686), + /* E9 */ MODRM(0x0687), + /* EA */ MODRM(0x0652), + /* EB */ MODRM(0x0668), + /* EC */ MODRM(0x0618), + /* ED */ MODRM(0x0619), + /* EE */ MODRM(0x064C), + /* EF */ MODRM(0x0694), + /* F0 */ INVALID, + /* F1 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0005), + /* F2 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0006), + /* F3 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0007), + /* F4 */ INVALID, + /* F5 */ MODRM(0x0649), + /* F6 */ MODRM(0x0669), + /* F7 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x000D), + /* F8 */ MODRM(0x0683), + /* F9 */ MODRM(0x068A), + /* FA */ MODRM(0x0684), + /* FB */ MODRM(0x0685), + /* FC */ MODRM(0x0615), + /* FD */ MODRM(0x061C), + /* FE */ MODRM(0x0616), + /* FF */ INVALID, + }, + { + /* 00 */ MODRM(0x066A), + /* 01 */ MODRM(0x063E), + /* 02 */ MODRM(0x063C), + /* 03 */ MODRM(0x063D), + /* 04 */ MODRM(0x0648), + /* 05 */ MODRM(0x0642), + /* 06 */ MODRM(0x0640), + /* 07 */ MODRM(0x0641), + /* 08 */ MODRM(0x066E), + /* 09 */ MODRM(0x0670), + /* 0A */ MODRM(0x066F), + /* 0B */ MODRM(0x0663), + /* 0C */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0000), + /* 0D */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0001), + /* 0E */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0002), + /* 0F */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0003), + /* 10 */ INVALID, + /* 11 */ INVALID, + /* 12 */ INVALID, + /* 13 */ INVALID, + /* 14 */ INVALID, + /* 15 */ INVALID, + /* 16 */ INVALID, + /* 17 */ MODRM(0x068B), + /* 18 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0004), + /* 19 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0005), + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ MODRM(0x060E), + /* 1D */ MODRM(0x0610), + /* 1E */ MODRM(0x060F), + /* 1F */ INVALID, + /* 20 */ MODRM(0x0659), + /* 21 */ MODRM(0x0657), + /* 22 */ MODRM(0x0658), + /* 23 */ MODRM(0x065A), + /* 24 */ MODRM(0x065B), + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ MODRM(0x0662), + /* 29 */ MODRM(0x0627), + /* 2A */ MODRM(0x05E7), + /* 2B */ MODRM(0x0613), + /* 2C */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0006), + /* 2D */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0007), + /* 2E */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0008), + /* 2F */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0009), + /* 30 */ MODRM(0x065E), + /* 31 */ MODRM(0x065C), + /* 32 */ MODRM(0x065D), + /* 33 */ MODRM(0x0660), + /* 34 */ MODRM(0x0661), + /* 35 */ MODRM(0x065F), + /* 36 */ INVALID, + /* 37 */ MODRM(0x062D), + /* 38 */ MODRM(0x0650), + /* 39 */ MODRM(0x0651), + /* 3A */ MODRM(0x0655), + /* 3B */ MODRM(0x0654), + /* 3C */ MODRM(0x064A), + /* 3D */ MODRM(0x064B), + /* 3E */ MODRM(0x064F), + /* 3F */ MODRM(0x064E), + /* 40 */ MODRM(0x0666), + /* 41 */ MODRM(0x063F), + /* 42 */ INVALID, + /* 43 */ INVALID, + /* 44 */ INVALID, + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ INVALID, + /* 4B */ INVALID, + /* 4C */ INVALID, + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ INVALID, + /* 51 */ INVALID, + /* 52 */ INVALID, + /* 53 */ INVALID, + /* 54 */ INVALID, + /* 55 */ INVALID, + /* 56 */ INVALID, + /* 57 */ INVALID, + /* 58 */ INVALID, + /* 59 */ INVALID, + /* 5A */ INVALID, + /* 5B */ INVALID, + /* 5C */ INVALID, + /* 5D */ INVALID, + /* 5E */ INVALID, + /* 5F */ INVALID, + /* 60 */ INVALID, + /* 61 */ INVALID, + /* 62 */ INVALID, + /* 63 */ INVALID, + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ INVALID, + /* 69 */ INVALID, + /* 6A */ INVALID, + /* 6B */ INVALID, + /* 6C */ INVALID, + /* 6D */ INVALID, + /* 6E */ INVALID, + /* 6F */ INVALID, + /* 70 */ INVALID, + /* 71 */ INVALID, + /* 72 */ INVALID, + /* 73 */ INVALID, + /* 74 */ INVALID, + /* 75 */ INVALID, + /* 76 */ INVALID, + /* 77 */ INVALID, + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ INVALID, + /* 7D */ INVALID, + /* 7E */ INVALID, + /* 7F */ INVALID, + /* 80 */ INVALID, + /* 81 */ INVALID, + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ INVALID, + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ INVALID, + /* 8F */ INVALID, + /* 90 */ INVALID, + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ INVALID, + /* 95 */ INVALID, + /* 96 */ INVALID, + /* 97 */ INVALID, + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ INVALID, + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ INVALID, + /* 9F */ INVALID, + /* A0 */ INVALID, + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ INVALID, + /* A5 */ INVALID, + /* A6 */ INVALID, + /* A7 */ INVALID, + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ INVALID, + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ INVALID, + /* AF */ INVALID, + /* B0 */ INVALID, + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ INVALID, + /* B5 */ INVALID, + /* B6 */ INVALID, + /* B7 */ INVALID, + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ INVALID, + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ INVALID, + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ INVALID, + /* C3 */ INVALID, + /* C4 */ INVALID, + /* C5 */ INVALID, + /* C6 */ INVALID, + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ INVALID, + /* D1 */ INVALID, + /* D2 */ INVALID, + /* D3 */ INVALID, + /* D4 */ INVALID, + /* D5 */ INVALID, + /* D6 */ INVALID, + /* D7 */ INVALID, + /* D8 */ INVALID, + /* D9 */ INVALID, + /* DA */ INVALID, + /* DB */ MODRM(0x0588), + /* DC */ MODRM(0x0586), + /* DD */ MODRM(0x0587), + /* DE */ MODRM(0x0584), + /* DF */ MODRM(0x0585), + /* E0 */ INVALID, + /* E1 */ INVALID, + /* E2 */ INVALID, + /* E3 */ INVALID, + /* E4 */ INVALID, + /* E5 */ INVALID, + /* E6 */ INVALID, + /* E7 */ INVALID, + /* E8 */ INVALID, + /* E9 */ INVALID, + /* EA */ INVALID, + /* EB */ INVALID, + /* EC */ INVALID, + /* ED */ INVALID, + /* EE */ INVALID, + /* EF */ INVALID, + /* F0 */ INVALID, + /* F1 */ INVALID, + /* F2 */ INVALID, + /* F3 */ INVALID, + /* F4 */ INVALID, + /* F5 */ INVALID, + /* F6 */ INVALID, + /* F7 */ INVALID, + /* F8 */ INVALID, + /* F9 */ INVALID, + /* FA */ INVALID, + /* FB */ INVALID, + /* FC */ INVALID, + /* FD */ INVALID, + /* FE */ INVALID, + /* FF */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x000A), + /* 05 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x000B), + /* 06 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x000C), + /* 07 */ INVALID, + /* 08 */ MODRM(0x0698), + /* 09 */ MODRM(0x0697), + /* 0A */ MODRM(0x069A), + /* 0B */ MODRM(0x0699), + /* 0C */ MODRM(0x058F), + /* 0D */ MODRM(0x058E), + /* 0E */ MODRM(0x0623), + /* 0F */ MODRM(0x061D), + /* 10 */ INVALID, + /* 11 */ INVALID, + /* 12 */ INVALID, + /* 13 */ INVALID, + /* 14 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x000D), + /* 15 */ MODRM(0x063A), + /* 16 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0016), + /* 17 */ MODRM(0x05B3), + /* 18 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0011), + /* 19 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0012), + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ INVALID, + /* 1D */ INVALID, + /* 1E */ INVALID, + /* 1F */ INVALID, + /* 20 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0013), + /* 21 */ MODRM(0x05B9), + /* 22 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0025), + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ INVALID, + /* 29 */ INVALID, + /* 2A */ INVALID, + /* 2B */ INVALID, + /* 2C */ INVALID, + /* 2D */ INVALID, + /* 2E */ INVALID, + /* 2F */ INVALID, + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + /* 40 */ MODRM(0x05AF), + /* 41 */ MODRM(0x05AE), + /* 42 */ MODRM(0x05FE), + /* 43 */ INVALID, + /* 44 */ MODRM(0x0624), + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0016), + /* 4B */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0017), + /* 4C */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0018), + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ INVALID, + /* 51 */ INVALID, + /* 52 */ INVALID, + /* 53 */ INVALID, + /* 54 */ INVALID, + /* 55 */ INVALID, + /* 56 */ INVALID, + /* 57 */ INVALID, + /* 58 */ INVALID, + /* 59 */ INVALID, + /* 5A */ INVALID, + /* 5B */ INVALID, + /* 5C */ INVALID, + /* 5D */ INVALID, + /* 5E */ INVALID, + /* 5F */ INVALID, + /* 60 */ MODRM(0x062A), + /* 61 */ MODRM(0x0629), + /* 62 */ MODRM(0x0630), + /* 63 */ MODRM(0x062F), + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ INVALID, + /* 69 */ INVALID, + /* 6A */ INVALID, + /* 6B */ INVALID, + /* 6C */ INVALID, + /* 6D */ INVALID, + /* 6E */ INVALID, + /* 6F */ INVALID, + /* 70 */ INVALID, + /* 71 */ INVALID, + /* 72 */ INVALID, + /* 73 */ INVALID, + /* 74 */ INVALID, + /* 75 */ INVALID, + /* 76 */ INVALID, + /* 77 */ INVALID, + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ INVALID, + /* 7D */ INVALID, + /* 7E */ INVALID, + /* 7F */ INVALID, + /* 80 */ INVALID, + /* 81 */ INVALID, + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ INVALID, + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ INVALID, + /* 8F */ INVALID, + /* 90 */ INVALID, + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ INVALID, + /* 95 */ INVALID, + /* 96 */ INVALID, + /* 97 */ INVALID, + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ INVALID, + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ INVALID, + /* 9F */ INVALID, + /* A0 */ INVALID, + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ INVALID, + /* A5 */ INVALID, + /* A6 */ INVALID, + /* A7 */ INVALID, + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ INVALID, + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ INVALID, + /* AF */ INVALID, + /* B0 */ INVALID, + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ INVALID, + /* B5 */ INVALID, + /* B6 */ INVALID, + /* B7 */ INVALID, + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ INVALID, + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ INVALID, + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ INVALID, + /* C3 */ INVALID, + /* C4 */ INVALID, + /* C5 */ INVALID, + /* C6 */ INVALID, + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ INVALID, + /* D1 */ INVALID, + /* D2 */ INVALID, + /* D3 */ INVALID, + /* D4 */ INVALID, + /* D5 */ INVALID, + /* D6 */ INVALID, + /* D7 */ INVALID, + /* D8 */ INVALID, + /* D9 */ INVALID, + /* DA */ INVALID, + /* DB */ INVALID, + /* DC */ INVALID, + /* DD */ INVALID, + /* DE */ INVALID, + /* DF */ MODRM(0x0589), + /* E0 */ INVALID, + /* E1 */ INVALID, + /* E2 */ INVALID, + /* E3 */ INVALID, + /* E4 */ INVALID, + /* E5 */ INVALID, + /* E6 */ INVALID, + /* E7 */ INVALID, + /* E8 */ INVALID, + /* E9 */ INVALID, + /* EA */ INVALID, + /* EB */ INVALID, + /* EC */ INVALID, + /* ED */ INVALID, + /* EE */ INVALID, + /* EF */ INVALID, + /* F0 */ INVALID, + /* F1 */ INVALID, + /* F2 */ INVALID, + /* F3 */ INVALID, + /* F4 */ INVALID, + /* F5 */ INVALID, + /* F6 */ INVALID, + /* F7 */ INVALID, + /* F8 */ INVALID, + /* F9 */ INVALID, + /* FA */ INVALID, + /* FB */ INVALID, + /* FC */ INVALID, + /* FD */ INVALID, + /* FE */ INVALID, + /* FF */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + /* 08 */ INVALID, + /* 09 */ INVALID, + /* 0A */ INVALID, + /* 0B */ INVALID, + /* 0C */ INVALID, + /* 0D */ INVALID, + /* 0E */ INVALID, + /* 0F */ INVALID, + /* 10 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x000E), + /* 11 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x000F), + /* 12 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0010), + /* 13 */ INVALID, + /* 14 */ INVALID, + /* 15 */ INVALID, + /* 16 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0011), + /* 17 */ INVALID, + /* 18 */ INVALID, + /* 19 */ INVALID, + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ INVALID, + /* 1D */ INVALID, + /* 1E */ INVALID, + /* 1F */ INVALID, + /* 20 */ INVALID, + /* 21 */ INVALID, + /* 22 */ INVALID, + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ INVALID, + /* 29 */ INVALID, + /* 2A */ MODRM(0x05A3), + /* 2B */ INVALID, + /* 2C */ MODRM(0x05A9), + /* 2D */ MODRM(0x05A5), + /* 2E */ INVALID, + /* 2F */ INVALID, + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + /* 40 */ INVALID, + /* 41 */ INVALID, + /* 42 */ INVALID, + /* 43 */ INVALID, + /* 44 */ INVALID, + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ INVALID, + /* 4B */ INVALID, + /* 4C */ INVALID, + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ INVALID, + /* 51 */ MODRM(0x06A2), + /* 52 */ MODRM(0x069C), + /* 53 */ MODRM(0x0696), + /* 54 */ INVALID, + /* 55 */ INVALID, + /* 56 */ INVALID, + /* 57 */ INVALID, + /* 58 */ MODRM(0x0581), + /* 59 */ MODRM(0x0608), + /* 5A */ MODRM(0x05A4), + /* 5B */ MODRM(0x05A7), + /* 5C */ MODRM(0x06A7), + /* 5D */ MODRM(0x05C9), + /* 5E */ MODRM(0x05AD), + /* 5F */ MODRM(0x05C3), + /* 60 */ INVALID, + /* 61 */ INVALID, + /* 62 */ INVALID, + /* 63 */ INVALID, + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ INVALID, + /* 69 */ INVALID, + /* 6A */ INVALID, + /* 6B */ INVALID, + /* 6C */ INVALID, + /* 6D */ INVALID, + /* 6E */ INVALID, + /* 6F */ MODRM(0x05D9), + /* 70 */ MODRM(0x066C), + /* 71 */ INVALID, + /* 72 */ INVALID, + /* 73 */ INVALID, + /* 74 */ INVALID, + /* 75 */ INVALID, + /* 76 */ INVALID, + /* 77 */ INVALID, + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ INVALID, + /* 7D */ INVALID, + /* 7E */ MODRM(0x05ED), + /* 7F */ INVALID, + /* 80 */ INVALID, + /* 81 */ INVALID, + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ INVALID, + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ INVALID, + /* 8F */ INVALID, + /* 90 */ INVALID, + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ INVALID, + /* 95 */ INVALID, + /* 96 */ INVALID, + /* 97 */ INVALID, + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ INVALID, + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ INVALID, + /* 9F */ INVALID, + /* A0 */ INVALID, + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ INVALID, + /* A5 */ INVALID, + /* A6 */ INVALID, + /* A7 */ INVALID, + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ INVALID, + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ INVALID, + /* AF */ INVALID, + /* B0 */ INVALID, + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ INVALID, + /* B5 */ INVALID, + /* B6 */ INVALID, + /* B7 */ INVALID, + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ INVALID, + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ INVALID, + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ MODRM(0x0597), + /* C3 */ INVALID, + /* C4 */ INVALID, + /* C5 */ INVALID, + /* C6 */ INVALID, + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ INVALID, + /* D1 */ INVALID, + /* D2 */ INVALID, + /* D3 */ INVALID, + /* D4 */ INVALID, + /* D5 */ INVALID, + /* D6 */ INVALID, + /* D7 */ INVALID, + /* D8 */ INVALID, + /* D9 */ INVALID, + /* DA */ INVALID, + /* DB */ INVALID, + /* DC */ INVALID, + /* DD */ INVALID, + /* DE */ INVALID, + /* DF */ INVALID, + /* E0 */ INVALID, + /* E1 */ INVALID, + /* E2 */ INVALID, + /* E3 */ INVALID, + /* E4 */ INVALID, + /* E5 */ INVALID, + /* E6 */ MODRM(0x059A), + /* E7 */ INVALID, + /* E8 */ INVALID, + /* E9 */ INVALID, + /* EA */ INVALID, + /* EB */ INVALID, + /* EC */ INVALID, + /* ED */ INVALID, + /* EE */ INVALID, + /* EF */ INVALID, + /* F0 */ INVALID, + /* F1 */ INVALID, + /* F2 */ INVALID, + /* F3 */ INVALID, + /* F4 */ INVALID, + /* F5 */ INVALID, + /* F6 */ INVALID, + /* F7 */ INVALID, + /* F8 */ INVALID, + /* F9 */ INVALID, + /* FA */ INVALID, + /* FB */ INVALID, + /* FC */ INVALID, + /* FD */ INVALID, + /* FE */ INVALID, + /* FF */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + /* 08 */ INVALID, + /* 09 */ INVALID, + /* 0A */ INVALID, + /* 0B */ INVALID, + /* 0C */ INVALID, + /* 0D */ INVALID, + /* 0E */ INVALID, + /* 0F */ INVALID, + /* 10 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0012), + /* 11 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0013), + /* 12 */ NODE(VXOpcodeTreeNodeType::MODRM_MOD, 0x0014), + /* 13 */ INVALID, + /* 14 */ INVALID, + /* 15 */ INVALID, + /* 16 */ INVALID, + /* 17 */ INVALID, + /* 18 */ INVALID, + /* 19 */ INVALID, + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ INVALID, + /* 1D */ INVALID, + /* 1E */ INVALID, + /* 1F */ INVALID, + /* 20 */ INVALID, + /* 21 */ INVALID, + /* 22 */ INVALID, + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ INVALID, + /* 29 */ INVALID, + /* 2A */ MODRM(0x05A2), + /* 2B */ INVALID, + /* 2C */ MODRM(0x05A8), + /* 2D */ MODRM(0x05A0), + /* 2E */ INVALID, + /* 2F */ INVALID, + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + /* 40 */ INVALID, + /* 41 */ INVALID, + /* 42 */ INVALID, + /* 43 */ INVALID, + /* 44 */ INVALID, + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ INVALID, + /* 4B */ INVALID, + /* 4C */ INVALID, + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ INVALID, + /* 51 */ MODRM(0x06A1), + /* 52 */ INVALID, + /* 53 */ INVALID, + /* 54 */ INVALID, + /* 55 */ INVALID, + /* 56 */ INVALID, + /* 57 */ INVALID, + /* 58 */ MODRM(0x0580), + /* 59 */ MODRM(0x0607), + /* 5A */ MODRM(0x05A1), + /* 5B */ INVALID, + /* 5C */ MODRM(0x06A6), + /* 5D */ MODRM(0x05C8), + /* 5E */ MODRM(0x05AC), + /* 5F */ MODRM(0x05C2), + /* 60 */ INVALID, + /* 61 */ INVALID, + /* 62 */ INVALID, + /* 63 */ INVALID, + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ INVALID, + /* 69 */ INVALID, + /* 6A */ INVALID, + /* 6B */ INVALID, + /* 6C */ INVALID, + /* 6D */ INVALID, + /* 6E */ INVALID, + /* 6F */ INVALID, + /* 70 */ MODRM(0x066D), + /* 71 */ INVALID, + /* 72 */ INVALID, + /* 73 */ INVALID, + /* 74 */ INVALID, + /* 75 */ INVALID, + /* 76 */ INVALID, + /* 77 */ INVALID, + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ MODRM(0x05B5), + /* 7D */ MODRM(0x05B7), + /* 7E */ INVALID, + /* 7F */ INVALID, + /* 80 */ INVALID, + /* 81 */ INVALID, + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ INVALID, + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ INVALID, + /* 8F */ INVALID, + /* 90 */ INVALID, + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ INVALID, + /* 95 */ INVALID, + /* 96 */ INVALID, + /* 97 */ INVALID, + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ INVALID, + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ INVALID, + /* 9F */ INVALID, + /* A0 */ INVALID, + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ INVALID, + /* A5 */ INVALID, + /* A6 */ INVALID, + /* A7 */ INVALID, + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ INVALID, + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ INVALID, + /* AF */ INVALID, + /* B0 */ INVALID, + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ INVALID, + /* B5 */ INVALID, + /* B6 */ INVALID, + /* B7 */ INVALID, + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ INVALID, + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ INVALID, + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ MODRM(0x0596), + /* C3 */ INVALID, + /* C4 */ INVALID, + /* C5 */ INVALID, + /* C6 */ INVALID, + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ MODRM(0x0583), + /* D1 */ INVALID, + /* D2 */ INVALID, + /* D3 */ INVALID, + /* D4 */ INVALID, + /* D5 */ INVALID, + /* D6 */ INVALID, + /* D7 */ INVALID, + /* D8 */ INVALID, + /* D9 */ INVALID, + /* DA */ INVALID, + /* DB */ INVALID, + /* DC */ INVALID, + /* DD */ INVALID, + /* DE */ INVALID, + /* DF */ INVALID, + /* E0 */ INVALID, + /* E1 */ INVALID, + /* E2 */ INVALID, + /* E3 */ INVALID, + /* E4 */ INVALID, + /* E5 */ INVALID, + /* E6 */ MODRM(0x059C), + /* E7 */ INVALID, + /* E8 */ INVALID, + /* E9 */ INVALID, + /* EA */ INVALID, + /* EB */ INVALID, + /* EC */ INVALID, + /* ED */ INVALID, + /* EE */ INVALID, + /* EF */ INVALID, + /* F0 */ MODRM(0x05BA), + /* F1 */ INVALID, + /* F2 */ INVALID, + /* F3 */ INVALID, + /* F4 */ INVALID, + /* F5 */ INVALID, + /* F6 */ INVALID, + /* F7 */ INVALID, + /* F8 */ INVALID, + /* F9 */ INVALID, + /* FA */ INVALID, + /* FB */ INVALID, + /* FC */ INVALID, + /* FD */ INVALID, + /* FE */ INVALID, + /* FF */ INVALID, + }, +}; + +static const VXOpcodeTreeNode optreeModrmMod[][2] = +{ + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0001), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0002), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0034), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0035), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0039), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x003A), + }, + { + /* 00 */ INVALID, + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0008), + }, + { + /* 00 */ INVALID, + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0009), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x000A), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x000B), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x000D), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x000E), + }, + { + /* 00 */ INVALID, + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x018F), + }, + { + /* 00 */ MODRM(0x05E3), + /* 01 */ MODRM(0x05DA), + }, + { + /* 00 */ MODRM(0x05DE), + /* 01 */ MODRM(0x05DF), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0016), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x05E1), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x05DB), + /* 01 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x05BB), + }, + { + /* 00 */ MODRM(0x05F8), + /* 01 */ MODRM(0x05F6), + }, + { + /* 00 */ MODRM(0x05F9), + /* 01 */ MODRM(0x05F7), + }, + { + /* 00 */ MODRM(0x05F5), + /* 01 */ MODRM(0x05F4), + }, + { + /* 00 */ MODRM(0x05F2), + /* 01 */ MODRM(0x05F3), + }, + { + /* 00 */ MODRM(0x05EE), + /* 01 */ MODRM(0x05EF), + }, + { + /* 00 */ MODRM(0x05F1), + /* 01 */ MODRM(0x05F0), + }, + { + /* 00 */ MODRM(0x05D6), + /* 01 */ MODRM(0x05D5), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0020), + /* 01 */ NODE(VXOpcodeTreeNodeType::X87, 0x0000), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0021), + /* 01 */ NODE(VXOpcodeTreeNodeType::X87, 0x0001), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0022), + /* 01 */ NODE(VXOpcodeTreeNodeType::X87, 0x0002), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0023), + /* 01 */ NODE(VXOpcodeTreeNodeType::X87, 0x0003), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0024), + /* 01 */ NODE(VXOpcodeTreeNodeType::X87, 0x0004), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0025), + /* 01 */ NODE(VXOpcodeTreeNodeType::X87, 0x0005), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0026), + /* 01 */ NODE(VXOpcodeTreeNodeType::X87, 0x0006), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_REG, 0x0027), + /* 01 */ NODE(VXOpcodeTreeNodeType::X87, 0x0007), + }, +}; + +static const VXOpcodeTreeNode optreeModrmReg[][8] = +{ + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0000), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0001), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0002), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0003), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0004), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0005), + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0006), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0007), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0008), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0009), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x000A), + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x000B), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x000C), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0000), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0001), + /* 02 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0002), + /* 03 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0003), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x001D), + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x001E), + /* 07 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0004), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0029), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x002A), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x002B), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x002C), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x002D), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x002E), + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x002F), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0030), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x003C), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x003D), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x003E), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x003F), + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00DA), + /* 03 */ INVALID, + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00DB), + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00DC), + /* 07 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00DD), + /* 03 */ INVALID, + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00DE), + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00DF), + /* 07 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E0), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E1), + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E2), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x00E3), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0005), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0006), + /* 02 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0007), + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0008), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0009), + /* 02 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x000A), + /* 03 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x000B), + /* 04 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x000C), + /* 05 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x000D), + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0123), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0124), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0125), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0126), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0127), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0128), + /* 06 */ INVALID, + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0129), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x000E), + /* 06 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x000F), + /* 07 */ NODE(VXOpcodeTreeNodeType::MODRM_RM, 0x0010), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x014C), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x014D), + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x014E), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x014F), + }, + { + /* 00 */ INVALID, + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x015C), + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x015D), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x015E), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x015F), + /* 07 */ INVALID, + }, + { + /* 00 */ MODRM(0x000F), + /* 01 */ MODRM(0x0399), + /* 02 */ MODRM(0x0005), + /* 03 */ MODRM(0x050E), + /* 04 */ MODRM(0x0028), + /* 05 */ MODRM(0x055A), + /* 06 */ MODRM(0x06CA), + /* 07 */ MODRM(0x0071), + }, + { + /* 00 */ MODRM(0x0013), + /* 01 */ MODRM(0x039B), + /* 02 */ MODRM(0x0009), + /* 03 */ MODRM(0x050F), + /* 04 */ MODRM(0x0029), + /* 05 */ MODRM(0x055C), + /* 06 */ MODRM(0x06CF), + /* 07 */ MODRM(0x006A), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0015), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0016), + /* 02 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0017), + /* 03 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0018), + /* 04 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0019), + /* 05 */ NODE(VXOpcodeTreeNodeType::MODE, 0x001A), + /* 06 */ NODE(VXOpcodeTreeNodeType::MODE, 0x001B), + /* 07 */ NODE(VXOpcodeTreeNodeType::MODE, 0x001C), + }, + { + /* 00 */ MODRM(0x0012), + /* 01 */ MODRM(0x039C), + /* 02 */ MODRM(0x0008), + /* 03 */ MODRM(0x0509), + /* 04 */ MODRM(0x002B), + /* 05 */ MODRM(0x055D), + /* 06 */ MODRM(0x06CD), + /* 07 */ MODRM(0x006B), + }, + { + /* 00 */ MODRM(0x044A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ MODRM(0x04EE), + /* 01 */ MODRM(0x04F6), + /* 02 */ MODRM(0x04D7), + /* 03 */ MODRM(0x04E1), + /* 04 */ MODRM(0x053A), + /* 05 */ MODRM(0x053F), + /* 06 */ MODRM(0x0534), + /* 07 */ MODRM(0x0503), + }, + { + /* 00 */ MODRM(0x04F0), + /* 01 */ MODRM(0x04F7), + /* 02 */ MODRM(0x04D8), + /* 03 */ MODRM(0x04DF), + /* 04 */ MODRM(0x052F), + /* 05 */ MODRM(0x053E), + /* 06 */ MODRM(0x0533), + /* 07 */ MODRM(0x0506), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x06A3), + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ 0x0682, + /* 03 */ INVALID, + /* 04 */ 0x067A, + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0001), + /* 07 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ 0x067C, + /* 03 */ INVALID, + /* 04 */ 0x0679, + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0002), + /* 07 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ 0x0680, + /* 03 */ 0x067E, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0003), + /* 07 */ 0x0673, + }, + { + /* 00 */ MODRM(0x0324), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ MODRM(0x0325), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ MODRM(0x04ED), + /* 01 */ MODRM(0x04F5), + /* 02 */ MODRM(0x04D9), + /* 03 */ MODRM(0x04E0), + /* 04 */ MODRM(0x0537), + /* 05 */ MODRM(0x0542), + /* 06 */ MODRM(0x0536), + /* 07 */ MODRM(0x0505), + }, + { + /* 00 */ MODRM(0x04EF), + /* 01 */ MODRM(0x04F8), + /* 02 */ MODRM(0x04D6), + /* 03 */ MODRM(0x04DC), + /* 04 */ MODRM(0x0531), + /* 05 */ MODRM(0x0541), + /* 06 */ MODRM(0x0538), + /* 07 */ MODRM(0x0504), + }, + { + /* 00 */ MODRM(0x04F2), + /* 01 */ MODRM(0x04F3), + /* 02 */ MODRM(0x04D4), + /* 03 */ MODRM(0x04DE), + /* 04 */ MODRM(0x0532), + /* 05 */ MODRM(0x053D), + /* 06 */ MODRM(0x0535), + /* 07 */ MODRM(0x0507), + }, + { + /* 00 */ MODRM(0x04F1), + /* 01 */ MODRM(0x04F4), + /* 02 */ MODRM(0x04D5), + /* 03 */ MODRM(0x04DD), + /* 04 */ MODRM(0x0539), + /* 05 */ MODRM(0x0540), + /* 06 */ MODRM(0x0530), + /* 07 */ MODRM(0x0502), + }, + { + /* 00 */ MODRM(0x00BB), + /* 01 */ MODRM(0x01CC), + /* 02 */ MODRM(0x0119), + /* 03 */ MODRM(0x013D), + /* 04 */ MODRM(0x022C), + /* 05 */ MODRM(0x0245), + /* 06 */ MODRM(0x0166), + /* 07 */ MODRM(0x0171), + }, + { + /* 00 */ MODRM(0x01BE), + /* 01 */ INVALID, + /* 02 */ MODRM(0x01F5), + /* 03 */ MODRM(0x0205), + /* 04 */ MODRM(0x01C3), + /* 05 */ MODRM(0x01C2), + /* 06 */ MODRM(0x01E8), + /* 07 */ MODRM(0x01E7), + }, + { + /* 00 */ MODRM(0x019B), + /* 01 */ MODRM(0x01A8), + /* 02 */ MODRM(0x019C), + /* 03 */ MODRM(0x019F), + /* 04 */ MODRM(0x01B3), + /* 05 */ MODRM(0x01B5), + /* 06 */ MODRM(0x01A0), + /* 07 */ MODRM(0x01A2), + }, + { + /* 00 */ MODRM(0x01A5), + /* 01 */ MODRM(0x01B1), + /* 02 */ MODRM(0x01AB), + /* 03 */ MODRM(0x01AC), + /* 04 */ INVALID, + /* 05 */ MODRM(0x01BD), + /* 06 */ INVALID, + /* 07 */ MODRM(0x01FF), + }, + { + /* 00 */ MODRM(0x00BA), + /* 01 */ MODRM(0x01D5), + /* 02 */ MODRM(0x0118), + /* 03 */ MODRM(0x013E), + /* 04 */ MODRM(0x022B), + /* 05 */ MODRM(0x024B), + /* 06 */ MODRM(0x0158), + /* 07 */ MODRM(0x017A), + }, + { + /* 00 */ MODRM(0x01BC), + /* 01 */ MODRM(0x01B0), + /* 02 */ MODRM(0x01FC), + /* 03 */ MODRM(0x0206), + /* 04 */ MODRM(0x01F0), + /* 05 */ INVALID, + /* 06 */ MODRM(0x01E6), + /* 07 */ MODRM(0x01EA), + }, + { + /* 00 */ MODRM(0x019A), + /* 01 */ MODRM(0x01A7), + /* 02 */ MODRM(0x019D), + /* 03 */ MODRM(0x019E), + /* 04 */ MODRM(0x01B2), + /* 05 */ MODRM(0x01B4), + /* 06 */ MODRM(0x01A1), + /* 07 */ MODRM(0x01A3), + }, + { + /* 00 */ MODRM(0x01A6), + /* 01 */ MODRM(0x01AF), + /* 02 */ MODRM(0x01AA), + /* 03 */ MODRM(0x01AE), + /* 04 */ MODRM(0x00D2), + /* 05 */ MODRM(0x01A4), + /* 06 */ MODRM(0x00D3), + /* 07 */ MODRM(0x01AD), + }, + { + /* 00 */ MODRM(0x0570), + /* 01 */ MODRM(0x0575), + /* 02 */ MODRM(0x0398), + /* 03 */ MODRM(0x038F), + /* 04 */ MODRM(0x0387), + /* 05 */ MODRM(0x029F), + /* 06 */ MODRM(0x00AC), + /* 07 */ MODRM(0x029C), + }, + { + /* 00 */ MODRM(0x0571), + /* 01 */ MODRM(0x056F), + /* 02 */ MODRM(0x0397), + /* 03 */ MODRM(0x038E), + /* 04 */ MODRM(0x0388), + /* 05 */ MODRM(0x029E), + /* 06 */ MODRM(0x00AB), + /* 07 */ MODRM(0x029D), + }, + { + /* 00 */ MODRM(0x02AA), + /* 01 */ MODRM(0x00A5), + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ MODRM(0x02AB), + /* 01 */ MODRM(0x00A4), + /* 02 */ NODE(VXOpcodeTreeNodeType::MODE, 0x002C), + /* 03 */ MODRM(0x004D), + /* 04 */ MODRM(0x02D6), + /* 05 */ MODRM(0x02D5), + /* 06 */ MODRM(0x04C9), + /* 07 */ INVALID, + }, +}; + +static const VXOpcodeTreeNode optreeModrmRm[][8] = +{ + { + /* 00 */ INVALID, + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x000D), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x000E), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x000F), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0010), + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0011), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0012), + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0013), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0014), + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0015), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0016), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0017), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0018), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0019), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x001A), + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x001B), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x001C), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x001F), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0020), + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0114), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0115), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0116), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0117), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0118), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0119), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x011A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x011B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x011C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x012A), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x012B), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x012C), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x012D), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x012E), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x012F), + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0130), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0131), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0132), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0133), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0134), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0135), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0136), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0137), + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0138), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0139), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x013A), + /* 01 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x013B), + /* 02 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x013C), + /* 03 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x013D), + /* 04 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x013E), + /* 05 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x013F), + /* 06 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0140), + /* 07 */ NODE(VXOpcodeTreeNodeType::MANDATORY, 0x0141), + }, +}; + +static const VXOpcodeTreeNode optreeMandatory[][4] = +{ + { + /* 00 */ MODRM(0x0549), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0559), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02FF), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x030C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x05B0), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x05B1), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x052E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0547), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02FC), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02FE), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x054B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0300), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02BC), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0000), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0001), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0002), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0003), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x031F, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x038D, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06C8, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06D8, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0004), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0005), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0006), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0007), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0008), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0009), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x000A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x000B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x054A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0301), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0568, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x000C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02EC), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x030A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0569, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0058, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x056E, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02B9, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06B5, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0579, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0463), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0462), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0461), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0464), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0465), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0460), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x045E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x045F), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0189, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0383), + /* 01 */ MODRM(0x0372), + /* 02 */ MODRM(0x037B), + /* 03 */ MODRM(0x0381), + }, + { + /* 00 */ MODRM(0x0382), + /* 01 */ MODRM(0x0374), + /* 02 */ MODRM(0x037A), + /* 03 */ MODRM(0x0380), + }, + { + /* 00 */ MODRM(0x035F), + /* 01 */ MODRM(0x034F), + /* 02 */ MODRM(0x0377), + /* 03 */ MODRM(0x035C), + }, + { + /* 00 */ MODRM(0x0356), + /* 01 */ MODRM(0x0350), + /* 02 */ MODRM(0x0378), + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x035E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x035D), + }, + { + /* 00 */ MODRM(0x057D), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x057C), + }, + { + /* 00 */ MODRM(0x057B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x057A), + }, + { + /* 00 */ MODRM(0x0359), + /* 01 */ INVALID, + /* 02 */ MODRM(0x0375), + /* 03 */ MODRM(0x0357), + }, + { + /* 00 */ MODRM(0x035B), + /* 01 */ INVALID, + /* 02 */ MODRM(0x0376), + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x035A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0358), + }, + { + /* 00 */ MODRM(0x0466), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0467), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0468), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0469), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0395), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0396), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0393), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0390), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0391), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0392), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0394), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x033A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0335), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0337), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0339), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0343), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0342), + }, + { + /* 00 */ MODRM(0x0344), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0341), + }, + { + /* 00 */ MODRM(0x008D), + /* 01 */ MODRM(0x0093), + /* 02 */ MODRM(0x0094), + /* 03 */ MODRM(0x008C), + }, + { + /* 00 */ MODRM(0x0366), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0365), + }, + { + /* 00 */ MODRM(0x009A), + /* 01 */ MODRM(0x009B), + /* 02 */ MODRM(0x009C), + /* 03 */ MODRM(0x0098), + }, + { + /* 00 */ MODRM(0x0090), + /* 01 */ MODRM(0x0091), + /* 02 */ MODRM(0x0096), + /* 03 */ MODRM(0x008A), + }, + { + /* 00 */ MODRM(0x0578), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0577), + }, + { + /* 00 */ MODRM(0x0082), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0081), + }, + { + /* 00 */ 0x06B6, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x04E5, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x04E2, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x04E3, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0003), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0004), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0296, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x046C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x046D), + }, + { + /* 00 */ MODRM(0x0408), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0407), + }, + { + /* 00 */ MODRM(0x0404), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0403), + }, + { + /* 00 */ MODRM(0x0405), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0406), + }, + { + /* 00 */ MODRM(0x0418), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0419), + }, + { + /* 00 */ MODRM(0x040E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x040F), + }, + { + /* 00 */ MODRM(0x040B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x040A), + }, + { + /* 00 */ MODRM(0x040D), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x040C), + }, + { + /* 00 */ MODRM(0x0473), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0472), + }, + { + /* 00 */ MODRM(0x0476), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0477), + }, + { + /* 00 */ MODRM(0x0475), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0474), + }, + { + /* 00 */ MODRM(0x043C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x043B), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03D4), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0037), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0036), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04AB), + }, + { + /* 00 */ MODRM(0x03AD), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03AC), + }, + { + /* 00 */ MODRM(0x03B0), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03B1), + }, + { + /* 00 */ MODRM(0x03AE), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03AF), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0430), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x042E), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x042F), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0432), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0433), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0431), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x043A), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03DB), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0363), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03B6), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0436), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0434), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0435), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0438), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0439), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0437), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03E4), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0424), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0425), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x042B), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x042A), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x041C), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x041D), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0423), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0422), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0442), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0409), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0005), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0006), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0023), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0021), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0022), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x001F), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0020), + }, + { + /* 00 */ MODRM(0x0346), + /* 01 */ MODRM(0x0086), + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0345), + /* 01 */ MODRM(0x0085), + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04FA), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04F9), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04FC), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04FB), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0035), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0034), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03D5), + }, + { + /* 00 */ MODRM(0x03CA), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03C9), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03E9), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03EF), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0000), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x00B5), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0412), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x02B3), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0001), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x00B2), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x00B1), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0386), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03D6), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03DF), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03DE), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03E8), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03E7), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0024), + }, + { + /* 00 */ MODRM(0x0066), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0062), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x005C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x005B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0069), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0065), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x005D), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x005A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0068), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0064), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0067), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0063), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0060), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x005F), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0061), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x005E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0361), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0360), + }, + { + /* 00 */ MODRM(0x054D), + /* 01 */ MODRM(0x054E), + /* 02 */ MODRM(0x054F), + /* 03 */ MODRM(0x054C), + }, + { + /* 00 */ MODRM(0x04FE), + /* 01 */ INVALID, + /* 02 */ MODRM(0x04FF), + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x04DA), + /* 01 */ INVALID, + /* 02 */ MODRM(0x04DB), + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0032), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0031), + }, + { + /* 00 */ MODRM(0x0030), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x002F), + }, + { + /* 00 */ MODRM(0x03A4), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03A3), + }, + { + /* 00 */ MODRM(0x06D5), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x06D4), + }, + { + /* 00 */ MODRM(0x001A), + /* 01 */ MODRM(0x001B), + /* 02 */ MODRM(0x001C), + /* 03 */ MODRM(0x0019), + }, + { + /* 00 */ MODRM(0x038A), + /* 01 */ MODRM(0x038B), + /* 02 */ MODRM(0x038C), + /* 03 */ MODRM(0x0389), + }, + { + /* 00 */ MODRM(0x008F), + /* 01 */ MODRM(0x0092), + /* 02 */ MODRM(0x0095), + /* 03 */ MODRM(0x008B), + }, + { + /* 00 */ MODRM(0x0088), + /* 01 */ INVALID, + /* 02 */ MODRM(0x0099), + /* 03 */ MODRM(0x008E), + }, + { + /* 00 */ MODRM(0x0565), + /* 01 */ MODRM(0x0566), + /* 02 */ MODRM(0x0567), + /* 03 */ MODRM(0x0564), + }, + { + /* 00 */ MODRM(0x031C), + /* 01 */ MODRM(0x031D), + /* 02 */ MODRM(0x031E), + /* 03 */ MODRM(0x031B), + }, + { + /* 00 */ MODRM(0x00AE), + /* 01 */ MODRM(0x00AF), + /* 02 */ MODRM(0x00B0), + /* 03 */ MODRM(0x00AD), + }, + { + /* 00 */ MODRM(0x0310), + /* 01 */ MODRM(0x0311), + /* 02 */ MODRM(0x0312), + /* 03 */ MODRM(0x030F), + }, + { + /* 00 */ MODRM(0x04B3), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04B4), + }, + { + /* 00 */ MODRM(0x04B8), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04B9), + }, + { + /* 00 */ MODRM(0x04B6), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04B5), + }, + { + /* 00 */ MODRM(0x03B4), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03B5), + }, + { + /* 00 */ MODRM(0x03E1), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03E0), + }, + { + /* 00 */ MODRM(0x03E6), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03E5), + }, + { + /* 00 */ MODRM(0x03E3), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03E2), + }, + { + /* 00 */ MODRM(0x03B8), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03B7), + }, + { + /* 00 */ MODRM(0x04AC), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04AD), + }, + { + /* 00 */ MODRM(0x04B2), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04B1), + }, + { + /* 00 */ MODRM(0x04AF), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04AE), + }, + { + /* 00 */ MODRM(0x03B2), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03B3), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04B7), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04B0), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0002), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0003), + }, + { + /* 00 */ MODRM(0x036A), + /* 01 */ INVALID, + /* 02 */ MODRM(0x0355), + /* 03 */ MODRM(0x0353), + }, + { + /* 00 */ MODRM(0x0471), + /* 01 */ MODRM(0x0470), + /* 02 */ MODRM(0x046F), + /* 03 */ MODRM(0x046E), + }, + { + /* 00 */ MODRM(0x0497), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0496), + }, + { + /* 00 */ MODRM(0x048A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0489), + }, + { + /* 00 */ MODRM(0x0481), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0482), + }, + { + /* 00 */ MODRM(0x048F), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x048D), + }, + { + /* 00 */ MODRM(0x0486), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0487), + }, + { + /* 00 */ MODRM(0x047B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0478), + }, + { + /* 00 */ MODRM(0x0493), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0492), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0491), + }, + { + /* 00 */ MODRM(0x0480), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x047E), + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x047C), + }, + { + /* 00 */ MODRM(0x03D8), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03D7), + }, + { + /* 00 */ MODRM(0x03DD), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03DC), + }, + { + /* 00 */ MODRM(0x03DA), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03D9), + }, + { + /* 00 */ 0x00B3, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0013), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0014), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0298), + /* 02 */ INVALID, + /* 03 */ MODRM(0x0297), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x029B), + /* 02 */ INVALID, + /* 03 */ MODRM(0x029A), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0004), + /* 01 */ INVALID, + /* 02 */ MODRM(0x0368), + /* 03 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0005), + }, + { + /* 00 */ MODRM(0x036B), + /* 01 */ INVALID, + /* 02 */ MODRM(0x0354), + /* 03 */ MODRM(0x0352), + }, + { + /* 00 */ 0x02E3, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02DA, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02C7, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02C5, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02E9, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02E0, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02C9, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02C3, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02E7, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02DE, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02E4, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02DD, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02D2, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02D0, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02D3, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02CD, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0522), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x051E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0518), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0517), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0525), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0521), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0519), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0516), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0524), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0520), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0523), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x051F), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x051C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x051B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x051D), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x051A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x04C6, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0453, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0083, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0044), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x053B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x053C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0320, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06D9, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06DA, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06DB, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06C6, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06C3, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06C5, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06C4, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x06C7, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x04C7, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x044E, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x04FD, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x004A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0544), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0543), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0292), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0291), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02EE), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0554), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x06D7), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x06D6), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0055), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02FA, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02F9, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02F5, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02F4, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02F3, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02F8, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02F7, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x02F6, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0313, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0318, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0319, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x031A, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0317, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0314, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0315, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0316, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x052B, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x052A, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x052D, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x052C, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0527, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0526, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0529, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0528, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02A2), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x007D), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x007C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x030B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0048), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02FB), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x02FD), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0385), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0384), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ MODRM(0x0457), + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0043), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0049), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0047), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0045), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0046), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0039), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x003A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x037D), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x037E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x06B8), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x06B7), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0075), + /* 01 */ MODRM(0x0077), + /* 02 */ MODRM(0x007A), + /* 03 */ MODRM(0x0074), + }, + { + /* 00 */ MODRM(0x0364), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0417), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0416), + }, + { + /* 00 */ MODRM(0x03EE), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03ED), + }, + { + /* 00 */ MODRM(0x0546), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0545), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::OPERAND_SIZE, 0x0006), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0015), + /* 01 */ INVALID, + /* 02 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0016), + /* 03 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0017), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0018), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x04E4), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x003F, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x003D, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0040, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x003C, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x003E, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x003B, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0042, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ 0x0041, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x001E), + /* 02 */ INVALID, + /* 03 */ MODRM(0x001D), + }, + { + /* 00 */ MODRM(0x0498), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0499), + }, + { + /* 00 */ MODRM(0x048E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0490), + }, + { + /* 00 */ MODRM(0x0494), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0495), + }, + { + /* 00 */ MODRM(0x03BE), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03BD), + }, + { + /* 00 */ MODRM(0x0443), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0444), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0351), + /* 02 */ MODRM(0x0370), + /* 03 */ MODRM(0x0369), + }, + { + /* 00 */ MODRM(0x042D), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x042C), + }, + { + /* 00 */ MODRM(0x04A5), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04A4), + }, + { + /* 00 */ MODRM(0x04A7), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04A6), + }, + { + /* 00 */ MODRM(0x0428), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0429), + }, + { + /* 00 */ MODRM(0x03CB), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03CC), + }, + { + /* 00 */ MODRM(0x03C3), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03C4), + }, + { + /* 00 */ MODRM(0x03C6), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03C5), + }, + { + /* 00 */ MODRM(0x0420), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0421), + }, + { + /* 00 */ MODRM(0x03CE), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03CD), + }, + { + /* 00 */ MODRM(0x03CF), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03D0), + }, + { + /* 00 */ MODRM(0x048B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x048C), + }, + { + /* 00 */ MODRM(0x0488), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0485), + }, + { + /* 00 */ MODRM(0x03D2), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03D3), + }, + { + /* 00 */ MODRM(0x043F), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x043E), + }, + { + /* 00 */ MODRM(0x0440), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0441), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0089), + /* 02 */ MODRM(0x0087), + /* 03 */ MODRM(0x0097), + }, + { + /* 00 */ MODRM(0x0367), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0362), + }, + { + /* 00 */ MODRM(0x04A0), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04A1), + }, + { + /* 00 */ MODRM(0x04A3), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04A2), + }, + { + /* 00 */ MODRM(0x0426), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0427), + }, + { + /* 00 */ MODRM(0x045C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x045D), + }, + { + /* 00 */ MODRM(0x03BF), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03C0), + }, + { + /* 00 */ MODRM(0x03C2), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03C1), + }, + { + /* 00 */ MODRM(0x041E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x041F), + }, + { + /* 00 */ MODRM(0x04D2), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04D3), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x02ED), + /* 02 */ INVALID, + /* 03 */ INVALID, + }, + { + /* 00 */ MODRM(0x0484), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0483), + }, + { + /* 00 */ MODRM(0x047A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0479), + }, + { + /* 00 */ MODRM(0x047D), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x047F), + }, + { + /* 00 */ MODRM(0x0445), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x0446), + }, + { + /* 00 */ MODRM(0x041B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x041A), + }, + { + /* 00 */ MODRM(0x046B), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x046A), + }, + { + /* 00 */ MODRM(0x030E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x030D), + }, + { + /* 00 */ MODRM(0x049A), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x049B), + }, + { + /* 00 */ MODRM(0x04A9), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x04A8), + }, + { + /* 00 */ MODRM(0x049C), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x049D), + }, + { + /* 00 */ MODRM(0x049E), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x049F), + }, + { + /* 00 */ MODRM(0x03BA), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03B9), + }, + { + /* 00 */ MODRM(0x03C8), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03C7), + }, + { + /* 00 */ MODRM(0x03BB), + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ MODRM(0x03BC), + }, +}; + +static const VXOpcodeTreeNode optreeX87[][64] = +{ + { + /* 00 */ 0x00BC, + /* 01 */ 0x00BF, + /* 02 */ 0x00C2, + /* 03 */ 0x00C1, + /* 04 */ 0x00C0, + /* 05 */ 0x00C5, + /* 06 */ 0x00C3, + /* 07 */ 0x00C4, + /* 08 */ 0x01CD, + /* 09 */ 0x01CA, + /* 0A */ 0x01CB, + /* 0B */ 0x01D0, + /* 0C */ 0x01D1, + /* 0D */ 0x01CE, + /* 0E */ 0x01CF, + /* 0F */ 0x01DB, + /* 10 */ 0x011A, + /* 11 */ 0x011C, + /* 12 */ 0x011B, + /* 13 */ 0x0117, + /* 14 */ 0x0116, + /* 15 */ 0x011D, + /* 16 */ 0x011F, + /* 17 */ 0x011E, + /* 18 */ 0x013A, + /* 19 */ 0x0141, + /* 1A */ 0x013C, + /* 1B */ 0x0138, + /* 1C */ 0x013B, + /* 1D */ 0x0140, + /* 1E */ 0x013F, + /* 1F */ 0x0139, + /* 20 */ 0x0224, + /* 21 */ 0x0223, + /* 22 */ 0x0222, + /* 23 */ 0x0225, + /* 24 */ 0x0232, + /* 25 */ 0x022D, + /* 26 */ 0x0228, + /* 27 */ 0x0229, + /* 28 */ 0x0242, + /* 29 */ 0x0241, + /* 2A */ 0x0240, + /* 2B */ 0x0243, + /* 2C */ 0x0246, + /* 2D */ 0x024C, + /* 2E */ 0x024D, + /* 2F */ 0x024A, + /* 30 */ 0x0161, + /* 31 */ 0x0162, + /* 32 */ 0x0155, + /* 33 */ 0x015A, + /* 34 */ 0x0159, + /* 35 */ 0x0156, + /* 36 */ 0x0157, + /* 37 */ 0x0163, + /* 38 */ 0x0172, + /* 39 */ 0x016F, + /* 3A */ 0x0170, + /* 3B */ 0x0173, + /* 3C */ 0x0176, + /* 3D */ 0x0177, + /* 3E */ 0x0174, + /* 3F */ 0x0175, + }, + { + /* 00 */ 0x01C0, + /* 01 */ 0x01BF, + /* 02 */ 0x01BB, + /* 03 */ 0x01B7, + /* 04 */ 0x01B6, + /* 05 */ 0x01B8, + /* 06 */ 0x01BA, + /* 07 */ 0x01B9, + /* 08 */ 0x027E, + /* 09 */ 0x027D, + /* 0A */ 0x0280, + /* 0B */ 0x027F, + /* 0C */ 0x027A, + /* 0D */ 0x0279, + /* 0E */ 0x027C, + /* 0F */ 0x027B, + /* 10 */ 0x01E5, + /* 11 */ INVALID, + /* 12 */ INVALID, + /* 13 */ INVALID, + /* 14 */ INVALID, + /* 15 */ INVALID, + /* 16 */ INVALID, + /* 17 */ INVALID, + /* 18 */ 0x020F, + /* 19 */ 0x020E, + /* 1A */ 0x0211, + /* 1B */ 0x0210, + /* 1C */ 0x020B, + /* 1D */ 0x020A, + /* 1E */ 0x020D, + /* 1F */ 0x020C, + /* 20 */ 0x00D4, + /* 21 */ 0x00B7, + /* 22 */ INVALID, + /* 23 */ INVALID, + /* 24 */ 0x0256, + /* 25 */ 0x0278, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ 0x01C1, + /* 29 */ 0x01C5, + /* 2A */ 0x01C4, + /* 2B */ 0x01C8, + /* 2C */ 0x01C6, + /* 2D */ 0x01C7, + /* 2E */ 0x01C9, + /* 2F */ INVALID, + /* 30 */ 0x00B6, + /* 31 */ 0x0294, + /* 32 */ 0x01EE, + /* 33 */ 0x01EB, + /* 34 */ 0x0293, + /* 35 */ 0x01ED, + /* 36 */ 0x0154, + /* 37 */ 0x01A9, + /* 38 */ 0x01EC, + /* 39 */ 0x0295, + /* 3A */ 0x01F4, + /* 3B */ 0x01F3, + /* 3C */ 0x01EF, + /* 3D */ 0x01F1, + /* 3E */ 0x01F2, + /* 3F */ 0x0153, + }, + { + /* 00 */ 0x00D9, + /* 01 */ 0x00DA, + /* 02 */ 0x00DB, + /* 03 */ 0x00D6, + /* 04 */ 0x00D7, + /* 05 */ 0x00D8, + /* 06 */ 0x00DD, + /* 07 */ 0x00DC, + /* 08 */ 0x00E6, + /* 09 */ 0x00E7, + /* 0A */ 0x00E8, + /* 0B */ 0x00EC, + /* 0C */ 0x00ED, + /* 0D */ 0x00EB, + /* 0E */ 0x00E9, + /* 0F */ 0x00EA, + /* 10 */ 0x00E4, + /* 11 */ 0x00E5, + /* 12 */ 0x00E2, + /* 13 */ 0x00E3, + /* 14 */ 0x00DF, + /* 15 */ 0x00DE, + /* 16 */ 0x00E0, + /* 17 */ 0x00E1, + /* 18 */ 0x0113, + /* 19 */ 0x0114, + /* 1A */ 0x0115, + /* 1B */ 0x010F, + /* 1C */ 0x010E, + /* 1D */ 0x0110, + /* 1E */ 0x0111, + /* 1F */ 0x0112, + /* 20 */ INVALID, + /* 21 */ INVALID, + /* 22 */ INVALID, + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ INVALID, + /* 29 */ 0x0277, + /* 2A */ INVALID, + /* 2B */ INVALID, + /* 2C */ INVALID, + /* 2D */ INVALID, + /* 2E */ INVALID, + /* 2F */ INVALID, + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + }, + { + /* 00 */ 0x00F0, + /* 01 */ 0x00F1, + /* 02 */ 0x00EE, + /* 03 */ 0x00EF, + /* 04 */ 0x00F4, + /* 05 */ 0x00F5, + /* 06 */ 0x00F2, + /* 07 */ 0x00F3, + /* 08 */ 0x0103, + /* 09 */ 0x0102, + /* 0A */ 0x0105, + /* 0B */ 0x0104, + /* 0C */ 0x00FF, + /* 0D */ 0x00FE, + /* 0E */ 0x0101, + /* 0F */ 0x0100, + /* 10 */ 0x00F8, + /* 11 */ 0x00F9, + /* 12 */ 0x00F6, + /* 13 */ 0x00F7, + /* 14 */ 0x00FC, + /* 15 */ 0x00FD, + /* 16 */ 0x00FA, + /* 17 */ 0x00FB, + /* 18 */ 0x010B, + /* 19 */ 0x010A, + /* 1A */ 0x010D, + /* 1B */ 0x010C, + /* 1C */ 0x0107, + /* 1D */ 0x0106, + /* 1E */ 0x0109, + /* 1F */ 0x0108, + /* 20 */ INVALID, + /* 21 */ INVALID, + /* 22 */ 0x00D5, + /* 23 */ 0x01E4, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ 0x0265, + /* 29 */ 0x0266, + /* 2A */ 0x025F, + /* 2B */ 0x0260, + /* 2C */ 0x0263, + /* 2D */ 0x0264, + /* 2E */ 0x0261, + /* 2F */ 0x0262, + /* 30 */ 0x0129, + /* 31 */ 0x0128, + /* 32 */ 0x012B, + /* 33 */ 0x012A, + /* 34 */ 0x012F, + /* 35 */ 0x012E, + /* 36 */ 0x012D, + /* 37 */ 0x012C, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + }, + { + /* 00 */ 0x00B9, + /* 01 */ 0x00B8, + /* 02 */ 0x00C6, + /* 03 */ 0x00C9, + /* 04 */ 0x00C8, + /* 05 */ 0x00C7, + /* 06 */ 0x00BE, + /* 07 */ 0x00BD, + /* 08 */ 0x01D6, + /* 09 */ 0x01D3, + /* 0A */ 0x01D4, + /* 0B */ 0x01D9, + /* 0C */ 0x01DA, + /* 0D */ 0x01D7, + /* 0E */ 0x01D8, + /* 0F */ 0x01D2, + /* 10 */ 0x0125, + /* 11 */ 0x0124, + /* 12 */ 0x0127, + /* 13 */ 0x0126, + /* 14 */ 0x0121, + /* 15 */ 0x0120, + /* 16 */ 0x0123, + /* 17 */ 0x0122, + /* 18 */ 0x0148, + /* 19 */ 0x0142, + /* 1A */ 0x0145, + /* 1B */ 0x0144, + /* 1C */ 0x0143, + /* 1D */ 0x0147, + /* 1E */ 0x0146, + /* 1F */ 0x0149, + /* 20 */ 0x0247, + /* 21 */ 0x0248, + /* 22 */ 0x0249, + /* 23 */ 0x023F, + /* 24 */ 0x023C, + /* 25 */ 0x023E, + /* 26 */ 0x023D, + /* 27 */ 0x0244, + /* 28 */ 0x022A, + /* 29 */ 0x022F, + /* 2A */ 0x0226, + /* 2B */ 0x0227, + /* 2C */ 0x0231, + /* 2D */ 0x0233, + /* 2E */ 0x022E, + /* 2F */ 0x0230, + /* 30 */ 0x017B, + /* 31 */ 0x0178, + /* 32 */ 0x0179, + /* 33 */ 0x017C, + /* 34 */ 0x017F, + /* 35 */ 0x0180, + /* 36 */ 0x017D, + /* 37 */ 0x017E, + /* 38 */ 0x015E, + /* 39 */ 0x015F, + /* 3A */ 0x0160, + /* 3B */ 0x015B, + /* 3C */ 0x015C, + /* 3D */ 0x015D, + /* 3E */ 0x0164, + /* 3F */ 0x0165, + }, + { + /* 00 */ 0x0191, + /* 01 */ 0x018E, + /* 02 */ 0x018F, + /* 03 */ 0x0190, + /* 04 */ 0x018A, + /* 05 */ 0x018B, + /* 06 */ 0x018D, + /* 07 */ 0x018C, + /* 08 */ 0x0287, + /* 09 */ 0x0284, + /* 0A */ 0x0282, + /* 0B */ 0x0281, + /* 0C */ 0x0288, + /* 0D */ 0x0283, + /* 0E */ 0x0285, + /* 0F */ 0x0286, + /* 10 */ 0x01FB, + /* 11 */ 0x01FE, + /* 12 */ 0x01FD, + /* 13 */ 0x01FA, + /* 14 */ 0x01F7, + /* 15 */ 0x01F6, + /* 16 */ 0x01F9, + /* 17 */ 0x01F8, + /* 18 */ 0x0207, + /* 19 */ 0x0209, + /* 1A */ 0x0208, + /* 1B */ 0x0201, + /* 1C */ 0x0200, + /* 1D */ 0x0202, + /* 1E */ 0x0204, + /* 1F */ 0x0203, + /* 20 */ 0x025E, + /* 21 */ 0x025B, + /* 22 */ 0x025C, + /* 23 */ 0x025D, + /* 24 */ 0x0258, + /* 25 */ 0x0257, + /* 26 */ 0x025A, + /* 27 */ 0x0259, + /* 28 */ 0x0275, + /* 29 */ 0x0276, + /* 2A */ 0x0273, + /* 2B */ 0x0274, + /* 2C */ 0x0270, + /* 2D */ 0x026F, + /* 2E */ 0x0272, + /* 2F */ 0x0271, + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + }, + { + /* 00 */ 0x00CC, + /* 01 */ 0x00CD, + /* 02 */ 0x00CA, + /* 03 */ 0x00CB, + /* 04 */ 0x00D0, + /* 05 */ 0x00D1, + /* 06 */ 0x00CE, + /* 07 */ 0x00CF, + /* 08 */ 0x01E1, + /* 09 */ 0x01E0, + /* 0A */ 0x01E3, + /* 0B */ 0x01E2, + /* 0C */ 0x01DD, + /* 0D */ 0x01DC, + /* 0E */ 0x01DF, + /* 0F */ 0x01DE, + /* 10 */ 0x014F, + /* 11 */ 0x014E, + /* 12 */ 0x0151, + /* 13 */ 0x0150, + /* 14 */ 0x014B, + /* 15 */ 0x014A, + /* 16 */ 0x014D, + /* 17 */ 0x014C, + /* 18 */ INVALID, + /* 19 */ 0x0152, + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ INVALID, + /* 1D */ INVALID, + /* 1E */ INVALID, + /* 1F */ INVALID, + /* 20 */ 0x0252, + /* 21 */ 0x0253, + /* 22 */ 0x0254, + /* 23 */ 0x0251, + /* 24 */ 0x024E, + /* 25 */ 0x024F, + /* 26 */ 0x0250, + /* 27 */ 0x0255, + /* 28 */ 0x0238, + /* 29 */ 0x023B, + /* 2A */ 0x023A, + /* 2B */ 0x0234, + /* 2C */ 0x0237, + /* 2D */ 0x0236, + /* 2E */ 0x0239, + /* 2F */ 0x0235, + /* 30 */ 0x0186, + /* 31 */ 0x0185, + /* 32 */ 0x0188, + /* 33 */ 0x0187, + /* 34 */ 0x0182, + /* 35 */ 0x0181, + /* 36 */ 0x0184, + /* 37 */ 0x0183, + /* 38 */ 0x016C, + /* 39 */ 0x016B, + /* 3A */ 0x016E, + /* 3B */ 0x016D, + /* 3C */ 0x0168, + /* 3D */ 0x0167, + /* 3E */ 0x016A, + /* 3F */ 0x0169, + }, + { + /* 00 */ 0x0195, + /* 01 */ 0x0196, + /* 02 */ 0x0197, + /* 03 */ 0x0192, + /* 04 */ 0x0193, + /* 05 */ 0x0194, + /* 06 */ 0x0199, + /* 07 */ 0x0198, + /* 08 */ 0x028B, + /* 09 */ 0x028A, + /* 0A */ 0x028C, + /* 0B */ 0x028E, + /* 0C */ 0x028D, + /* 0D */ 0x0289, + /* 0E */ 0x0290, + /* 0F */ 0x028F, + /* 10 */ 0x0217, + /* 11 */ 0x0216, + /* 12 */ 0x0219, + /* 13 */ 0x0218, + /* 14 */ 0x0213, + /* 15 */ 0x0212, + /* 16 */ 0x0215, + /* 17 */ 0x0214, + /* 18 */ 0x021C, + /* 19 */ 0x021D, + /* 1A */ 0x021A, + /* 1B */ 0x021B, + /* 1C */ 0x0220, + /* 1D */ 0x0221, + /* 1E */ 0x021E, + /* 1F */ 0x021F, + /* 20 */ 0x01E9, + /* 21 */ INVALID, + /* 22 */ INVALID, + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ 0x026D, + /* 29 */ 0x026E, + /* 2A */ 0x0269, + /* 2B */ 0x0268, + /* 2C */ 0x0267, + /* 2D */ 0x026C, + /* 2E */ 0x026B, + /* 2F */ 0x026A, + /* 30 */ 0x0136, + /* 31 */ 0x0137, + /* 32 */ 0x0133, + /* 33 */ 0x0134, + /* 34 */ 0x0135, + /* 35 */ 0x0130, + /* 36 */ 0x0131, + /* 37 */ 0x0132, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + }, +}; + +static const VXOpcodeTreeNode optreeAddressSize[][3] = +{ + { + /* 00 */ 0x02CB, + /* 01 */ 0x02CC, + /* 02 */ 0x02E6, + }, +}; + +static const VXOpcodeTreeNode optreeOperandSize[][3] = +{ + { + /* 00 */ MODRM(0x03EB), + /* 01 */ MODRM(0x03EA), + /* 02 */ MODRM(0x03EC), + }, + { + /* 00 */ MODRM(0x0414), + /* 01 */ MODRM(0x0413), + /* 02 */ MODRM(0x0415), + }, + { + /* 00 */ MODRM(0x0347), + /* 01 */ MODRM(0x034C), + /* 02 */ MODRM(0x036C), + }, + { + /* 00 */ MODRM(0x034D), + /* 01 */ MODRM(0x034E), + /* 02 */ MODRM(0x036F), + }, + { + /* 00 */ MODRM(0x034B), + /* 01 */ MODRM(0x0348), + /* 02 */ MODRM(0x036D), + }, + { + /* 00 */ MODRM(0x0349), + /* 01 */ MODRM(0x034A), + /* 02 */ MODRM(0x036E), + }, + { + /* 00 */ MODRM(0x007F), + /* 01 */ MODRM(0x0080), + /* 02 */ MODRM(0x007E), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x000F), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0010), + /* 02 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0011), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0012), + /* 02 */ INVALID, + }, + { + /* 00 */ 0x02B4, + /* 01 */ 0x02B2, + /* 02 */ INVALID, + }, + { + /* 00 */ 0x03AB, + /* 01 */ 0x03AA, + /* 02 */ INVALID, + }, + { + /* 00 */ 0x0050, + /* 01 */ 0x009E, + /* 02 */ 0x0052, + }, + { + /* 00 */ 0x009D, + /* 01 */ 0x0051, + /* 02 */ 0x0084, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x001E), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODE, 0x001F), + /* 02 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0020), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0021), + /* 01 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0022), + /* 02 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0023), + }, + { + /* 00 */ 0x037C, + /* 01 */ 0x0373, + /* 02 */ 0x0379, + }, + { + /* 00 */ 0x007B, + /* 01 */ 0x0078, + /* 02 */ 0x0079, + }, + { + /* 00 */ 0x0558, + /* 01 */ 0x0556, + /* 02 */ 0x0557, + }, + { + /* 00 */ 0x0306, + /* 01 */ 0x0304, + /* 02 */ 0x0305, + }, + { + /* 00 */ 0x0515, + /* 01 */ 0x0513, + /* 02 */ 0x0514, + }, + { + /* 00 */ MODRM(0x05D1), + /* 01 */ MODRM(0x05D3), + /* 02 */ MODRM(0x05EC), + }, + { + /* 00 */ MODRM(0x05D4), + /* 01 */ MODRM(0x05D2), + /* 02 */ MODRM(0x05EA), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x000E), + /* 01 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x000F), + /* 02 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0010), + }, + { + /* 00 */ 0x02C2, + /* 01 */ 0x02C0, + /* 02 */ 0x02C1, + }, +}; + +static const VXOpcodeTreeNode optreeMode[][2] = +{ + { + /* 00 */ 0x04BB, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x044F, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x04BE, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x056A, + /* 01 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x000D), + }, + { + /* 00 */ 0x056C, + /* 01 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x000E), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x000F), + /* 01 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0010), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0011), + /* 01 */ NODE(VXOpcodeTreeNodeType::VENDOR, 0x0012), + }, + { + /* 00 */ 0x04BD, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0450, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x04BA, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x044D, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x009F, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x00A0, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0001, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0004, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x04CB, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x04CC, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0455, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0456, + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0038), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0033), + /* 01 */ MODRM(0x037F), + }, + { + /* 00 */ MODRM(0x0011), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x039D), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0007), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0508), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x002A), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x055E), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x06CE), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0072), + /* 01 */ INVALID, + }, + { + /* 00 */ 0x004F, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x04D1, + /* 01 */ 0x04D0, + }, + { + /* 00 */ 0x04CD, + /* 01 */ 0x04CF, + }, + { + /* 00 */ INVALID, + /* 01 */ 0x04CE, + }, + { + /* 00 */ 0x045B, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0458, + /* 01 */ 0x045A, + }, + { + /* 00 */ INVALID, + /* 01 */ 0x0459, + }, + { + /* 00 */ MODRM(0x02F2), + /* 01 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0014), + /* 01 */ NODE(VXOpcodeTreeNodeType::VEXW, 0x0015), + }, + { + /* 00 */ MODRM(0x02EF), + /* 01 */ INVALID, + }, + { + /* 00 */ 0x02B8, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0003, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0002, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0501, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x02D9, + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x004B), + /* 01 */ MODRM(0x004C), + }, +}; + +static const VXOpcodeTreeNode optreeVendor[][2] = +{ + { + /* 00 */ INVALID, + /* 01 */ 0x05C4, + }, + { + /* 00 */ INVALID, + /* 01 */ 0x05CA, + }, + { + /* 00 */ INVALID, + /* 01 */ 0x0602, + }, + { + /* 00 */ INVALID, + /* 01 */ 0x060A, + }, + { + /* 00 */ 0x0603, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x05CC, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x05CB, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0604, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0552, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0056, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0548, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x02BD, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x04E6, + /* 01 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ 0x056B, + }, + { + /* 00 */ INVALID, + /* 01 */ 0x056D, + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x02BA), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x02BB), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x02BF), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x02BE), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0601), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0609), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x05FF), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x060B), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x05C5), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0600), + }, +}; + +static const VXOpcodeTreeNode optree3dnow[][256] = +{ + { + /* 00 */ INVALID, + /* 01 */ INVALID, + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ INVALID, + /* 06 */ INVALID, + /* 07 */ INVALID, + /* 08 */ INVALID, + /* 09 */ INVALID, + /* 0A */ INVALID, + /* 0B */ INVALID, + /* 0C */ MODRM(0x0411), + /* 0D */ MODRM(0x0410), + /* 0E */ INVALID, + /* 0F */ INVALID, + /* 10 */ INVALID, + /* 11 */ INVALID, + /* 12 */ INVALID, + /* 13 */ INVALID, + /* 14 */ INVALID, + /* 15 */ INVALID, + /* 16 */ INVALID, + /* 17 */ INVALID, + /* 18 */ INVALID, + /* 19 */ INVALID, + /* 1A */ INVALID, + /* 1B */ INVALID, + /* 1C */ MODRM(0x03F1), + /* 1D */ MODRM(0x03F0), + /* 1E */ INVALID, + /* 1F */ INVALID, + /* 20 */ INVALID, + /* 21 */ INVALID, + /* 22 */ INVALID, + /* 23 */ INVALID, + /* 24 */ INVALID, + /* 25 */ INVALID, + /* 26 */ INVALID, + /* 27 */ INVALID, + /* 28 */ INVALID, + /* 29 */ INVALID, + /* 2A */ INVALID, + /* 2B */ INVALID, + /* 2C */ INVALID, + /* 2D */ INVALID, + /* 2E */ INVALID, + /* 2F */ INVALID, + /* 30 */ INVALID, + /* 31 */ INVALID, + /* 32 */ INVALID, + /* 33 */ INVALID, + /* 34 */ INVALID, + /* 35 */ INVALID, + /* 36 */ INVALID, + /* 37 */ INVALID, + /* 38 */ INVALID, + /* 39 */ INVALID, + /* 3A */ INVALID, + /* 3B */ INVALID, + /* 3C */ INVALID, + /* 3D */ INVALID, + /* 3E */ INVALID, + /* 3F */ INVALID, + /* 40 */ INVALID, + /* 41 */ INVALID, + /* 42 */ INVALID, + /* 43 */ INVALID, + /* 44 */ INVALID, + /* 45 */ INVALID, + /* 46 */ INVALID, + /* 47 */ INVALID, + /* 48 */ INVALID, + /* 49 */ INVALID, + /* 4A */ INVALID, + /* 4B */ INVALID, + /* 4C */ INVALID, + /* 4D */ INVALID, + /* 4E */ INVALID, + /* 4F */ INVALID, + /* 50 */ INVALID, + /* 51 */ INVALID, + /* 52 */ INVALID, + /* 53 */ INVALID, + /* 54 */ INVALID, + /* 55 */ INVALID, + /* 56 */ INVALID, + /* 57 */ INVALID, + /* 58 */ INVALID, + /* 59 */ INVALID, + /* 5A */ INVALID, + /* 5B */ INVALID, + /* 5C */ INVALID, + /* 5D */ INVALID, + /* 5E */ INVALID, + /* 5F */ INVALID, + /* 60 */ INVALID, + /* 61 */ INVALID, + /* 62 */ INVALID, + /* 63 */ INVALID, + /* 64 */ INVALID, + /* 65 */ INVALID, + /* 66 */ INVALID, + /* 67 */ INVALID, + /* 68 */ INVALID, + /* 69 */ INVALID, + /* 6A */ INVALID, + /* 6B */ INVALID, + /* 6C */ INVALID, + /* 6D */ INVALID, + /* 6E */ INVALID, + /* 6F */ INVALID, + /* 70 */ INVALID, + /* 71 */ INVALID, + /* 72 */ INVALID, + /* 73 */ INVALID, + /* 74 */ INVALID, + /* 75 */ INVALID, + /* 76 */ INVALID, + /* 77 */ INVALID, + /* 78 */ INVALID, + /* 79 */ INVALID, + /* 7A */ INVALID, + /* 7B */ INVALID, + /* 7C */ INVALID, + /* 7D */ INVALID, + /* 7E */ INVALID, + /* 7F */ INVALID, + /* 80 */ INVALID, + /* 81 */ INVALID, + /* 82 */ INVALID, + /* 83 */ INVALID, + /* 84 */ INVALID, + /* 85 */ INVALID, + /* 86 */ INVALID, + /* 87 */ INVALID, + /* 88 */ INVALID, + /* 89 */ INVALID, + /* 8A */ MODRM(0x03FA), + /* 8B */ INVALID, + /* 8C */ INVALID, + /* 8D */ INVALID, + /* 8E */ MODRM(0x03FB), + /* 8F */ INVALID, + /* 90 */ MODRM(0x03F5), + /* 91 */ INVALID, + /* 92 */ INVALID, + /* 93 */ INVALID, + /* 94 */ MODRM(0x03F8), + /* 95 */ INVALID, + /* 96 */ MODRM(0x03FC), + /* 97 */ MODRM(0x0400), + /* 98 */ INVALID, + /* 99 */ INVALID, + /* 9A */ MODRM(0x0401), + /* 9B */ INVALID, + /* 9C */ INVALID, + /* 9D */ INVALID, + /* 9E */ MODRM(0x03F3), + /* 9F */ INVALID, + /* A0 */ MODRM(0x03F6), + /* A1 */ INVALID, + /* A2 */ INVALID, + /* A3 */ INVALID, + /* A4 */ MODRM(0x03F7), + /* A5 */ INVALID, + /* A6 */ MODRM(0x03FD), + /* A7 */ MODRM(0x03FF), + /* A8 */ INVALID, + /* A9 */ INVALID, + /* AA */ MODRM(0x0402), + /* AB */ INVALID, + /* AC */ INVALID, + /* AD */ INVALID, + /* AE */ MODRM(0x03F2), + /* AF */ INVALID, + /* B0 */ MODRM(0x03F4), + /* B1 */ INVALID, + /* B2 */ INVALID, + /* B3 */ INVALID, + /* B4 */ MODRM(0x03F9), + /* B5 */ INVALID, + /* B6 */ MODRM(0x03FE), + /* B7 */ MODRM(0x043D), + /* B8 */ INVALID, + /* B9 */ INVALID, + /* BA */ INVALID, + /* BB */ MODRM(0x04AA), + /* BC */ INVALID, + /* BD */ INVALID, + /* BE */ INVALID, + /* BF */ MODRM(0x03D1), + /* C0 */ INVALID, + /* C1 */ INVALID, + /* C2 */ INVALID, + /* C3 */ INVALID, + /* C4 */ INVALID, + /* C5 */ INVALID, + /* C6 */ INVALID, + /* C7 */ INVALID, + /* C8 */ INVALID, + /* C9 */ INVALID, + /* CA */ INVALID, + /* CB */ INVALID, + /* CC */ INVALID, + /* CD */ INVALID, + /* CE */ INVALID, + /* CF */ INVALID, + /* D0 */ INVALID, + /* D1 */ INVALID, + /* D2 */ INVALID, + /* D3 */ INVALID, + /* D4 */ INVALID, + /* D5 */ INVALID, + /* D6 */ INVALID, + /* D7 */ INVALID, + /* D8 */ INVALID, + /* D9 */ INVALID, + /* DA */ INVALID, + /* DB */ INVALID, + /* DC */ INVALID, + /* DD */ INVALID, + /* DE */ INVALID, + /* DF */ INVALID, + /* E0 */ INVALID, + /* E1 */ INVALID, + /* E2 */ INVALID, + /* E3 */ INVALID, + /* E4 */ INVALID, + /* E5 */ INVALID, + /* E6 */ INVALID, + /* E7 */ INVALID, + /* E8 */ INVALID, + /* E9 */ INVALID, + /* EA */ INVALID, + /* EB */ INVALID, + /* EC */ INVALID, + /* ED */ INVALID, + /* EE */ INVALID, + /* EF */ INVALID, + /* F0 */ INVALID, + /* F1 */ INVALID, + /* F2 */ INVALID, + /* F3 */ INVALID, + /* F4 */ INVALID, + /* F5 */ INVALID, + /* F6 */ INVALID, + /* F7 */ INVALID, + /* F8 */ INVALID, + /* F9 */ INVALID, + /* FA */ INVALID, + /* FB */ INVALID, + /* FC */ INVALID, + /* FD */ INVALID, + /* FE */ INVALID, + /* FF */ INVALID, + }, +}; + +static const VXOpcodeTreeNode optreeVex[][16] = +{ + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0024), + /* 01 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0004), + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0005), + /* 06 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0006), + /* 07 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0007), + /* 08 */ INVALID, + /* 09 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0008), + /* 0A */ INVALID, + /* 0B */ INVALID, + /* 0C */ INVALID, + /* 0D */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0009), + /* 0E */ INVALID, + /* 0F */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::MODE, 0x0026), + /* 01 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0004), + /* 02 */ INVALID, + /* 03 */ INVALID, + /* 04 */ INVALID, + /* 05 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0005), + /* 06 */ INVALID, + /* 07 */ INVALID, + /* 08 */ INVALID, + /* 09 */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0008), + /* 0A */ INVALID, + /* 0B */ INVALID, + /* 0C */ INVALID, + /* 0D */ NODE(VXOpcodeTreeNodeType::TABLE, 0x0009), + /* 0E */ INVALID, + /* 0F */ INVALID, + }, +}; + +static const VXOpcodeTreeNode optreeVexW[][2] = +{ + { + /* 00 */ MODRM(0x0635), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0633), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x06A9), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x06A8), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0593), + /* 01 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0008), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x05BF), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x05BC), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x05BE), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x05BD), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0634), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0632), + /* 01 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x0009), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0636), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0637), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0638), + /* 01 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0639), + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x000A), + /* 01 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x000B), + /* 01 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x000C), + /* 01 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x000D), + /* 01 */ INVALID, + }, + { + /* 00 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x000E), + /* 01 */ NODE(VXOpcodeTreeNodeType::VEXL, 0x000F), + }, + { + /* 00 */ MODRM(0x0591), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0590), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0622), + /* 01 */ INVALID, + }, +}; + +static const VXOpcodeTreeNode optreeVexL[][2] = +{ + { + /* 00 */ 0x06B3, + /* 01 */ 0x06B2, + }, + { + /* 00 */ 0x0677, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0672, + /* 01 */ INVALID, + }, + { + /* 00 */ 0x0675, + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0656), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0676), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0671), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0674), + /* 01 */ INVALID, + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0592), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x0631), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x05B8), + }, + { + /* 00 */ INVALID, + /* 01 */ MODRM(0x05B2), + }, + { + /* 00 */ MODRM(0x0643), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0645), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0644), + /* 01 */ INVALID, + }, + { + /* 00 */ MODRM(0x0646), + /* 01 */ INVALID, + }, +}; + +#undef INVALID +#undef NODE +#undef MODRM + +#define OPI_NONE { VXDefinedOperandType::NONE, VXDefinedOperandSize::NA } +#define OPI_AL { VXDefinedOperandType::AL, VXDefinedOperandSize::B } +#define OPI_AX { VXDefinedOperandType::AX, VXDefinedOperandSize::W } +#define OPI_Av { VXDefinedOperandType::A, VXDefinedOperandSize::V } +#define OPI_C { VXDefinedOperandType::C, VXDefinedOperandSize::NA } +#define OPI_CL { VXDefinedOperandType::CL, VXDefinedOperandSize::B } +#define OPI_CS { VXDefinedOperandType::CS, VXDefinedOperandSize::NA } +#define OPI_CX { VXDefinedOperandType::CX, VXDefinedOperandSize::W } +#define OPI_D { VXDefinedOperandType::D, VXDefinedOperandSize::NA } +#define OPI_DL { VXDefinedOperandType::DL, VXDefinedOperandSize::B } +#define OPI_DS { VXDefinedOperandType::DS, VXDefinedOperandSize::NA } +#define OPI_DX { VXDefinedOperandType::DX, VXDefinedOperandSize::W } +#define OPI_E { VXDefinedOperandType::E, VXDefinedOperandSize::NA } +#define OPI_ES { VXDefinedOperandType::ES, VXDefinedOperandSize::NA } +#define OPI_Eb { VXDefinedOperandType::E, VXDefinedOperandSize::B } +#define OPI_Ed { VXDefinedOperandType::E, VXDefinedOperandSize::D } +#define OPI_Eq { VXDefinedOperandType::E, VXDefinedOperandSize::Q } +#define OPI_Ev { VXDefinedOperandType::E, VXDefinedOperandSize::V } +#define OPI_Ew { VXDefinedOperandType::E, VXDefinedOperandSize::W } +#define OPI_Ey { VXDefinedOperandType::E, VXDefinedOperandSize::Y } +#define OPI_Ez { VXDefinedOperandType::E, VXDefinedOperandSize::Z } +#define OPI_FS { VXDefinedOperandType::FS, VXDefinedOperandSize::NA } +#define OPI_Fv { VXDefinedOperandType::F, VXDefinedOperandSize::V } +#define OPI_G { VXDefinedOperandType::G, VXDefinedOperandSize::NA } +#define OPI_GS { VXDefinedOperandType::GS, VXDefinedOperandSize::NA } +#define OPI_Gb { VXDefinedOperandType::G, VXDefinedOperandSize::B } +#define OPI_Gd { VXDefinedOperandType::G, VXDefinedOperandSize::D } +#define OPI_Gq { VXDefinedOperandType::G, VXDefinedOperandSize::Q } +#define OPI_Gv { VXDefinedOperandType::G, VXDefinedOperandSize::V } +#define OPI_Gw { VXDefinedOperandType::G, VXDefinedOperandSize::W } +#define OPI_Gy { VXDefinedOperandType::G, VXDefinedOperandSize::Y } +#define OPI_Gz { VXDefinedOperandType::G, VXDefinedOperandSize::Z } +#define OPI_H { VXDefinedOperandType::H, VXDefinedOperandSize::X } +#define OPI_Hqq { VXDefinedOperandType::H, VXDefinedOperandSize::QQ } +#define OPI_Hx { VXDefinedOperandType::H, VXDefinedOperandSize::X } +#define OPI_I1 { VXDefinedOperandType::I1, VXDefinedOperandSize::NA } +#define OPI_Ib { VXDefinedOperandType::I, VXDefinedOperandSize::B } +#define OPI_Iv { VXDefinedOperandType::I, VXDefinedOperandSize::V } +#define OPI_Iw { VXDefinedOperandType::I, VXDefinedOperandSize::W } +#define OPI_Iz { VXDefinedOperandType::I, VXDefinedOperandSize::Z } +#define OPI_Jb { VXDefinedOperandType::J, VXDefinedOperandSize::B } +#define OPI_Jv { VXDefinedOperandType::J, VXDefinedOperandSize::V } +#define OPI_Jz { VXDefinedOperandType::J, VXDefinedOperandSize::Z } +#define OPI_L { VXDefinedOperandType::L, VXDefinedOperandSize::O } +#define OPI_Lx { VXDefinedOperandType::L, VXDefinedOperandSize::X } +#define OPI_M { VXDefinedOperandType::M, VXDefinedOperandSize::NA } +#define OPI_Mb { VXDefinedOperandType::M, VXDefinedOperandSize::B } +#define OPI_MbRd { VXDefinedOperandType::MR, VXDefinedOperandSize::BD } +#define OPI_MbRv { VXDefinedOperandType::MR, VXDefinedOperandSize::BV } +#define OPI_Md { VXDefinedOperandType::M, VXDefinedOperandSize::D } +#define OPI_MdRy { VXDefinedOperandType::MR, VXDefinedOperandSize::DY } +#define OPI_MdU { VXDefinedOperandType::MU, VXDefinedOperandSize::DO } +#define OPI_Mdq { VXDefinedOperandType::M, VXDefinedOperandSize::DQ } +#define OPI_Mo { VXDefinedOperandType::M, VXDefinedOperandSize::O } +#define OPI_Mq { VXDefinedOperandType::M, VXDefinedOperandSize::Q } +#define OPI_MqU { VXDefinedOperandType::MU, VXDefinedOperandSize::QO } +#define OPI_Ms { VXDefinedOperandType::M, VXDefinedOperandSize::W } +#define OPI_Mt { VXDefinedOperandType::M, VXDefinedOperandSize::T } +#define OPI_Mv { VXDefinedOperandType::M, VXDefinedOperandSize::V } +#define OPI_Mw { VXDefinedOperandType::M, VXDefinedOperandSize::W } +#define OPI_MwRd { VXDefinedOperandType::MR, VXDefinedOperandSize::WD } +#define OPI_MwRv { VXDefinedOperandType::MR, VXDefinedOperandSize::WV } +#define OPI_MwRy { VXDefinedOperandType::MR, VXDefinedOperandSize::WY } +#define OPI_MwU { VXDefinedOperandType::MU, VXDefinedOperandSize::WO } +#define OPI_N { VXDefinedOperandType::N, VXDefinedOperandSize::Q } +#define OPI_Ob { VXDefinedOperandType::O, VXDefinedOperandSize::B } +#define OPI_Ov { VXDefinedOperandType::O, VXDefinedOperandSize::V } +#define OPI_Ow { VXDefinedOperandType::O, VXDefinedOperandSize::W } +#define OPI_P { VXDefinedOperandType::P, VXDefinedOperandSize::Q } +#define OPI_Q { VXDefinedOperandType::Q, VXDefinedOperandSize::Q } +#define OPI_R { VXDefinedOperandType::R, VXDefinedOperandSize::RDQ } +#define OPI_R0b { VXDefinedOperandType::R0, VXDefinedOperandSize::B } +#define OPI_R0v { VXDefinedOperandType::R0, VXDefinedOperandSize::V } +#define OPI_R0w { VXDefinedOperandType::R0, VXDefinedOperandSize::W } +#define OPI_R0y { VXDefinedOperandType::R0, VXDefinedOperandSize::Y } +#define OPI_R0z { VXDefinedOperandType::R0, VXDefinedOperandSize::Z } +#define OPI_R1b { VXDefinedOperandType::R1, VXDefinedOperandSize::B } +#define OPI_R1v { VXDefinedOperandType::R1, VXDefinedOperandSize::V } +#define OPI_R1w { VXDefinedOperandType::R1, VXDefinedOperandSize::W } +#define OPI_R1y { VXDefinedOperandType::R1, VXDefinedOperandSize::Y } +#define OPI_R1z { VXDefinedOperandType::R1, VXDefinedOperandSize::Z } +#define OPI_R2b { VXDefinedOperandType::R2, VXDefinedOperandSize::B } +#define OPI_R2v { VXDefinedOperandType::R2, VXDefinedOperandSize::V } +#define OPI_R2w { VXDefinedOperandType::R2, VXDefinedOperandSize::W } +#define OPI_R2y { VXDefinedOperandType::R2, VXDefinedOperandSize::Y } +#define OPI_R2z { VXDefinedOperandType::R2, VXDefinedOperandSize::Z } +#define OPI_R3b { VXDefinedOperandType::R3, VXDefinedOperandSize::B } +#define OPI_R3v { VXDefinedOperandType::R3, VXDefinedOperandSize::V } +#define OPI_R3w { VXDefinedOperandType::R3, VXDefinedOperandSize::W } +#define OPI_R3y { VXDefinedOperandType::R3, VXDefinedOperandSize::Y } +#define OPI_R3z { VXDefinedOperandType::R3, VXDefinedOperandSize::Z } +#define OPI_R4b { VXDefinedOperandType::R4, VXDefinedOperandSize::B } +#define OPI_R4v { VXDefinedOperandType::R4, VXDefinedOperandSize::V } +#define OPI_R4w { VXDefinedOperandType::R4, VXDefinedOperandSize::W } +#define OPI_R4y { VXDefinedOperandType::R4, VXDefinedOperandSize::Y } +#define OPI_R4z { VXDefinedOperandType::R4, VXDefinedOperandSize::Z } +#define OPI_R5b { VXDefinedOperandType::R5, VXDefinedOperandSize::B } +#define OPI_R5v { VXDefinedOperandType::R5, VXDefinedOperandSize::V } +#define OPI_R5w { VXDefinedOperandType::R5, VXDefinedOperandSize::W } +#define OPI_R5y { VXDefinedOperandType::R5, VXDefinedOperandSize::Y } +#define OPI_R5z { VXDefinedOperandType::R5, VXDefinedOperandSize::Z } +#define OPI_R6b { VXDefinedOperandType::R6, VXDefinedOperandSize::B } +#define OPI_R6v { VXDefinedOperandType::R6, VXDefinedOperandSize::V } +#define OPI_R6w { VXDefinedOperandType::R6, VXDefinedOperandSize::W } +#define OPI_R6y { VXDefinedOperandType::R6, VXDefinedOperandSize::Y } +#define OPI_R6z { VXDefinedOperandType::R6, VXDefinedOperandSize::Z } +#define OPI_R7b { VXDefinedOperandType::R7, VXDefinedOperandSize::B } +#define OPI_R7v { VXDefinedOperandType::R7, VXDefinedOperandSize::V } +#define OPI_R7w { VXDefinedOperandType::R7, VXDefinedOperandSize::W } +#define OPI_R7y { VXDefinedOperandType::R7, VXDefinedOperandSize::Y } +#define OPI_R7z { VXDefinedOperandType::R7, VXDefinedOperandSize::Z } +#define OPI_S { VXDefinedOperandType::S, VXDefinedOperandSize::W } +#define OPI_SS { VXDefinedOperandType::SS, VXDefinedOperandSize::NA } +#define OPI_ST0 { VXDefinedOperandType::ST0, VXDefinedOperandSize::NA } +#define OPI_ST1 { VXDefinedOperandType::ST1, VXDefinedOperandSize::NA } +#define OPI_ST2 { VXDefinedOperandType::ST2, VXDefinedOperandSize::NA } +#define OPI_ST3 { VXDefinedOperandType::ST3, VXDefinedOperandSize::NA } +#define OPI_ST4 { VXDefinedOperandType::ST4, VXDefinedOperandSize::NA } +#define OPI_ST5 { VXDefinedOperandType::ST5, VXDefinedOperandSize::NA } +#define OPI_ST6 { VXDefinedOperandType::ST6, VXDefinedOperandSize::NA } +#define OPI_ST7 { VXDefinedOperandType::ST7, VXDefinedOperandSize::NA } +#define OPI_U { VXDefinedOperandType::U, VXDefinedOperandSize::O } +#define OPI_Ux { VXDefinedOperandType::U, VXDefinedOperandSize::X } +#define OPI_V { VXDefinedOperandType::V, VXDefinedOperandSize::DQ } +#define OPI_Vdq { VXDefinedOperandType::V, VXDefinedOperandSize::DQ } +#define OPI_Vqq { VXDefinedOperandType::V, VXDefinedOperandSize::QQ } +#define OPI_Vsd { VXDefinedOperandType::V, VXDefinedOperandSize::Q } +#define OPI_Vx { VXDefinedOperandType::V, VXDefinedOperandSize::X } +#define OPI_W { VXDefinedOperandType::W, VXDefinedOperandSize::DQ } +#define OPI_Wdq { VXDefinedOperandType::W, VXDefinedOperandSize::DQ } +#define OPI_Wqq { VXDefinedOperandType::W, VXDefinedOperandSize::QQ } +#define OPI_Wsd { VXDefinedOperandType::W, VXDefinedOperandSize::Q } +#define OPI_Wx { VXDefinedOperandType::W, VXDefinedOperandSize::X } +#define OPI_eAX { VXDefinedOperandType::EAX, VXDefinedOperandSize::Z } +#define OPI_eCX { VXDefinedOperandType::ECX, VXDefinedOperandSize::Z } +#define OPI_eDX { VXDefinedOperandType::EDX, VXDefinedOperandSize::Z } +#define OPI_rAX { VXDefinedOperandType::RAX, VXDefinedOperandSize::V } +#define OPI_rCX { VXDefinedOperandType::RCX, VXDefinedOperandSize::V } +#define OPI_rDX { VXDefinedOperandType::RDX, VXDefinedOperandSize::V } + +static const VXInstructionDefinition instrDefinitions[] = +{ + /* 000 */ { VXInstructionMnemonic::INVALID, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 001 */ { VXInstructionMnemonic::AAA, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 002 */ { VXInstructionMnemonic::AAD, { OPI_Ib, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 003 */ { VXInstructionMnemonic::AAM, { OPI_Ib, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 004 */ { VXInstructionMnemonic::AAS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 005 */ { VXInstructionMnemonic::ADC, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 006 */ { VXInstructionMnemonic::ADC, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 007 */ { VXInstructionMnemonic::ADC, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_INVALID_64 }, + /* 008 */ { VXInstructionMnemonic::ADC, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 009 */ { VXInstructionMnemonic::ADC, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 00A */ { VXInstructionMnemonic::ADC, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 00B */ { VXInstructionMnemonic::ADC, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 00C */ { VXInstructionMnemonic::ADC, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 00D */ { VXInstructionMnemonic::ADC, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 00E */ { VXInstructionMnemonic::ADC, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 00F */ { VXInstructionMnemonic::ADD, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 010 */ { VXInstructionMnemonic::ADD, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 011 */ { VXInstructionMnemonic::ADD, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_INVALID_64 }, + /* 012 */ { VXInstructionMnemonic::ADD, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 013 */ { VXInstructionMnemonic::ADD, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 014 */ { VXInstructionMnemonic::ADD, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 015 */ { VXInstructionMnemonic::ADD, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 016 */ { VXInstructionMnemonic::ADD, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 017 */ { VXInstructionMnemonic::ADD, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 018 */ { VXInstructionMnemonic::ADD, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 019 */ { VXInstructionMnemonic::ADDPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 01A */ { VXInstructionMnemonic::ADDPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 01B */ { VXInstructionMnemonic::ADDSD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 01C */ { VXInstructionMnemonic::ADDSS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 01D */ { VXInstructionMnemonic::ADDSUBPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 01E */ { VXInstructionMnemonic::ADDSUBPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 01F */ { VXInstructionMnemonic::AESDEC, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 020 */ { VXInstructionMnemonic::AESDECLAST, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 021 */ { VXInstructionMnemonic::AESENC, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 022 */ { VXInstructionMnemonic::AESENCLAST, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 023 */ { VXInstructionMnemonic::AESIMC, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 024 */ { VXInstructionMnemonic::AESKEYGENASSIST, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 025 */ { VXInstructionMnemonic::AND, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 026 */ { VXInstructionMnemonic::AND, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 027 */ { VXInstructionMnemonic::AND, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 028 */ { VXInstructionMnemonic::AND, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 029 */ { VXInstructionMnemonic::AND, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 02A */ { VXInstructionMnemonic::AND, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_INVALID_64 }, + /* 02B */ { VXInstructionMnemonic::AND, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 02C */ { VXInstructionMnemonic::AND, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 02D */ { VXInstructionMnemonic::AND, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 02E */ { VXInstructionMnemonic::AND, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 02F */ { VXInstructionMnemonic::ANDNPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 030 */ { VXInstructionMnemonic::ANDNPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 031 */ { VXInstructionMnemonic::ANDPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 032 */ { VXInstructionMnemonic::ANDPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 033 */ { VXInstructionMnemonic::ARPL, { OPI_Ew, OPI_Gw, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE }, + /* 034 */ { VXInstructionMnemonic::BLENDPD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 035 */ { VXInstructionMnemonic::BLENDPS, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 036 */ { VXInstructionMnemonic::BLENDVPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 037 */ { VXInstructionMnemonic::BLENDVPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 038 */ { VXInstructionMnemonic::BOUND, { OPI_Gv, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 039 */ { VXInstructionMnemonic::BSF, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 03A */ { VXInstructionMnemonic::BSR, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 03B */ { VXInstructionMnemonic::BSWAP, { OPI_R5y, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 03C */ { VXInstructionMnemonic::BSWAP, { OPI_R3y, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 03D */ { VXInstructionMnemonic::BSWAP, { OPI_R1y, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 03E */ { VXInstructionMnemonic::BSWAP, { OPI_R4y, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 03F */ { VXInstructionMnemonic::BSWAP, { OPI_R0y, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 040 */ { VXInstructionMnemonic::BSWAP, { OPI_R2y, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 041 */ { VXInstructionMnemonic::BSWAP, { OPI_R7y, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 042 */ { VXInstructionMnemonic::BSWAP, { OPI_R6y, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 043 */ { VXInstructionMnemonic::BT, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 044 */ { VXInstructionMnemonic::BT, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 045 */ { VXInstructionMnemonic::BTC, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 046 */ { VXInstructionMnemonic::BTC, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 047 */ { VXInstructionMnemonic::BTR, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 048 */ { VXInstructionMnemonic::BTR, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 049 */ { VXInstructionMnemonic::BTS, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 04A */ { VXInstructionMnemonic::BTS, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 04B */ { VXInstructionMnemonic::CALL, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 04C */ { VXInstructionMnemonic::CALL, { OPI_Eq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 04D */ { VXInstructionMnemonic::CALL, { OPI_Fv, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 04E */ { VXInstructionMnemonic::CALL, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 04F */ { VXInstructionMnemonic::CALL, { OPI_Av, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 050 */ { VXInstructionMnemonic::CBW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 051 */ { VXInstructionMnemonic::CDQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 052 */ { VXInstructionMnemonic::CDQE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 053 */ { VXInstructionMnemonic::CLC, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 054 */ { VXInstructionMnemonic::CLD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 055 */ { VXInstructionMnemonic::CLFLUSH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 056 */ { VXInstructionMnemonic::CLGI, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 057 */ { VXInstructionMnemonic::CLI, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 058 */ { VXInstructionMnemonic::CLTS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 059 */ { VXInstructionMnemonic::CMC, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 05A */ { VXInstructionMnemonic::CMOVA, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 05B */ { VXInstructionMnemonic::CMOVAE, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 05C */ { VXInstructionMnemonic::CMOVB, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 05D */ { VXInstructionMnemonic::CMOVBE, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 05E */ { VXInstructionMnemonic::CMOVG, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 05F */ { VXInstructionMnemonic::CMOVGE, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 060 */ { VXInstructionMnemonic::CMOVL, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 061 */ { VXInstructionMnemonic::CMOVLE, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 062 */ { VXInstructionMnemonic::CMOVNO, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 063 */ { VXInstructionMnemonic::CMOVNP, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 064 */ { VXInstructionMnemonic::CMOVNS, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 065 */ { VXInstructionMnemonic::CMOVNZ, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 066 */ { VXInstructionMnemonic::CMOVO, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 067 */ { VXInstructionMnemonic::CMOVP, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 068 */ { VXInstructionMnemonic::CMOVS, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 069 */ { VXInstructionMnemonic::CMOVZ, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 06A */ { VXInstructionMnemonic::CMP, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 06B */ { VXInstructionMnemonic::CMP, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 06C */ { VXInstructionMnemonic::CMP, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 06D */ { VXInstructionMnemonic::CMP, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 06E */ { VXInstructionMnemonic::CMP, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 06F */ { VXInstructionMnemonic::CMP, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 070 */ { VXInstructionMnemonic::CMP, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 071 */ { VXInstructionMnemonic::CMP, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 072 */ { VXInstructionMnemonic::CMP, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_INVALID_64 }, + /* 073 */ { VXInstructionMnemonic::CMP, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 074 */ { VXInstructionMnemonic::CMPPD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 075 */ { VXInstructionMnemonic::CMPPS, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 076 */ { VXInstructionMnemonic::CMPSB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 077 */ { VXInstructionMnemonic::CMPSD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 078 */ { VXInstructionMnemonic::CMPSD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 079 */ { VXInstructionMnemonic::CMPSQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 07A */ { VXInstructionMnemonic::CMPSS, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 07B */ { VXInstructionMnemonic::CMPSW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 07C */ { VXInstructionMnemonic::CMPXCHG, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 07D */ { VXInstructionMnemonic::CMPXCHG, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 07E */ { VXInstructionMnemonic::CMPXCHG16B, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 07F */ { VXInstructionMnemonic::CMPXCHG8B, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 080 */ { VXInstructionMnemonic::CMPXCHG8B, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 081 */ { VXInstructionMnemonic::COMISD, { OPI_Vsd, OPI_Wsd, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 082 */ { VXInstructionMnemonic::COMISS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 083 */ { VXInstructionMnemonic::CPUID, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 084 */ { VXInstructionMnemonic::CQO, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 085 */ { VXInstructionMnemonic::CRC32, { OPI_Gy, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 086 */ { VXInstructionMnemonic::CRC32, { OPI_Gy, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 087 */ { VXInstructionMnemonic::CVTDQ2PD, { OPI_V, OPI_Wdq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 088 */ { VXInstructionMnemonic::CVTDQ2PS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 089 */ { VXInstructionMnemonic::CVTPD2DQ, { OPI_Vdq, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 08A */ { VXInstructionMnemonic::CVTPD2PI, { OPI_P, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 08B */ { VXInstructionMnemonic::CVTPD2PS, { OPI_Vdq, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 08C */ { VXInstructionMnemonic::CVTPI2PD, { OPI_V, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 08D */ { VXInstructionMnemonic::CVTPI2PS, { OPI_V, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 08E */ { VXInstructionMnemonic::CVTPS2DQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 08F */ { VXInstructionMnemonic::CVTPS2PD, { OPI_V, OPI_Wdq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 090 */ { VXInstructionMnemonic::CVTPS2PI, { OPI_P, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 091 */ { VXInstructionMnemonic::CVTSD2SI, { OPI_Gy, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 092 */ { VXInstructionMnemonic::CVTSD2SS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 093 */ { VXInstructionMnemonic::CVTSI2SD, { OPI_V, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 094 */ { VXInstructionMnemonic::CVTSI2SS, { OPI_V, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 095 */ { VXInstructionMnemonic::CVTSS2SD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 096 */ { VXInstructionMnemonic::CVTSS2SI, { OPI_Gy, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 097 */ { VXInstructionMnemonic::CVTTPD2DQ, { OPI_Vdq, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 098 */ { VXInstructionMnemonic::CVTTPD2PI, { OPI_P, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 099 */ { VXInstructionMnemonic::CVTTPS2DQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 09A */ { VXInstructionMnemonic::CVTTPS2PI, { OPI_P, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 09B */ { VXInstructionMnemonic::CVTTSD2SI, { OPI_Gy, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 09C */ { VXInstructionMnemonic::CVTTSS2SI, { OPI_Gy, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 09D */ { VXInstructionMnemonic::CWD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 09E */ { VXInstructionMnemonic::CWDE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 09F */ { VXInstructionMnemonic::DAA, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 0A0 */ { VXInstructionMnemonic::DAS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 0A1 */ { VXInstructionMnemonic::DEC, { OPI_R6z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 0A2 */ { VXInstructionMnemonic::DEC, { OPI_R5z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 0A3 */ { VXInstructionMnemonic::DEC, { OPI_R7z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 0A4 */ { VXInstructionMnemonic::DEC, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0A5 */ { VXInstructionMnemonic::DEC, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0A6 */ { VXInstructionMnemonic::DEC, { OPI_R1z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 0A7 */ { VXInstructionMnemonic::DEC, { OPI_R0z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 0A8 */ { VXInstructionMnemonic::DEC, { OPI_R2z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 0A9 */ { VXInstructionMnemonic::DEC, { OPI_R4z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 0AA */ { VXInstructionMnemonic::DEC, { OPI_R3z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 0AB */ { VXInstructionMnemonic::DIV, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0AC */ { VXInstructionMnemonic::DIV, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0AD */ { VXInstructionMnemonic::DIVPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0AE */ { VXInstructionMnemonic::DIVPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0AF */ { VXInstructionMnemonic::DIVSD, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0B0 */ { VXInstructionMnemonic::DIVSS, { OPI_V, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0B1 */ { VXInstructionMnemonic::DPPD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0B2 */ { VXInstructionMnemonic::DPPS, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0B3 */ { VXInstructionMnemonic::EMMS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 0B4 */ { VXInstructionMnemonic::ENTER, { OPI_Iw, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_DEFAULT_64 }, + /* 0B5 */ { VXInstructionMnemonic::EXTRACTPS, { OPI_MdRy, OPI_V, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0B6 */ { VXInstructionMnemonic::F2XM1, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 0B7 */ { VXInstructionMnemonic::FABS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 0B8 */ { VXInstructionMnemonic::FADD, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0B9 */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0BA */ { VXInstructionMnemonic::FADD, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0BB */ { VXInstructionMnemonic::FADD, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0BC */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0BD */ { VXInstructionMnemonic::FADD, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0BE */ { VXInstructionMnemonic::FADD, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0BF */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 0C0 */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 0C1 */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 0C2 */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 0C3 */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 0C4 */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 0C5 */ { VXInstructionMnemonic::FADD, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 0C6 */ { VXInstructionMnemonic::FADD, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0C7 */ { VXInstructionMnemonic::FADD, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0C8 */ { VXInstructionMnemonic::FADD, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0C9 */ { VXInstructionMnemonic::FADD, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0CA */ { VXInstructionMnemonic::FADDP, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0CB */ { VXInstructionMnemonic::FADDP, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0CC */ { VXInstructionMnemonic::FADDP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0CD */ { VXInstructionMnemonic::FADDP, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0CE */ { VXInstructionMnemonic::FADDP, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0CF */ { VXInstructionMnemonic::FADDP, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0D0 */ { VXInstructionMnemonic::FADDP, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0D1 */ { VXInstructionMnemonic::FADDP, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0D2 */ { VXInstructionMnemonic::FBLD, { OPI_Mt, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0D3 */ { VXInstructionMnemonic::FBSTP, { OPI_Mt, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 0D4 */ { VXInstructionMnemonic::FCHS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 0D5 */ { VXInstructionMnemonic::FCLEX, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 0D6 */ { VXInstructionMnemonic::FCMOVB, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 0D7 */ { VXInstructionMnemonic::FCMOVB, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 0D8 */ { VXInstructionMnemonic::FCMOVB, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 0D9 */ { VXInstructionMnemonic::FCMOVB, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0DA */ { VXInstructionMnemonic::FCMOVB, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 0DB */ { VXInstructionMnemonic::FCMOVB, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 0DC */ { VXInstructionMnemonic::FCMOVB, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 0DD */ { VXInstructionMnemonic::FCMOVB, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 0DE */ { VXInstructionMnemonic::FCMOVBE, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 0DF */ { VXInstructionMnemonic::FCMOVBE, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 0E0 */ { VXInstructionMnemonic::FCMOVBE, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 0E1 */ { VXInstructionMnemonic::FCMOVBE, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 0E2 */ { VXInstructionMnemonic::FCMOVBE, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 0E3 */ { VXInstructionMnemonic::FCMOVBE, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 0E4 */ { VXInstructionMnemonic::FCMOVBE, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0E5 */ { VXInstructionMnemonic::FCMOVBE, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 0E6 */ { VXInstructionMnemonic::FCMOVE, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0E7 */ { VXInstructionMnemonic::FCMOVE, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 0E8 */ { VXInstructionMnemonic::FCMOVE, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 0E9 */ { VXInstructionMnemonic::FCMOVE, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 0EA */ { VXInstructionMnemonic::FCMOVE, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 0EB */ { VXInstructionMnemonic::FCMOVE, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 0EC */ { VXInstructionMnemonic::FCMOVE, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 0ED */ { VXInstructionMnemonic::FCMOVE, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 0EE */ { VXInstructionMnemonic::FCMOVNB, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 0EF */ { VXInstructionMnemonic::FCMOVNB, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 0F0 */ { VXInstructionMnemonic::FCMOVNB, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0F1 */ { VXInstructionMnemonic::FCMOVNB, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 0F2 */ { VXInstructionMnemonic::FCMOVNB, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 0F3 */ { VXInstructionMnemonic::FCMOVNB, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 0F4 */ { VXInstructionMnemonic::FCMOVNB, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 0F5 */ { VXInstructionMnemonic::FCMOVNB, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 0F6 */ { VXInstructionMnemonic::FCMOVNBE, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 0F7 */ { VXInstructionMnemonic::FCMOVNBE, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 0F8 */ { VXInstructionMnemonic::FCMOVNBE, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 0F9 */ { VXInstructionMnemonic::FCMOVNBE, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 0FA */ { VXInstructionMnemonic::FCMOVNBE, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 0FB */ { VXInstructionMnemonic::FCMOVNBE, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 0FC */ { VXInstructionMnemonic::FCMOVNBE, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 0FD */ { VXInstructionMnemonic::FCMOVNBE, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 0FE */ { VXInstructionMnemonic::FCMOVNE, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 0FF */ { VXInstructionMnemonic::FCMOVNE, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 100 */ { VXInstructionMnemonic::FCMOVNE, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 101 */ { VXInstructionMnemonic::FCMOVNE, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 102 */ { VXInstructionMnemonic::FCMOVNE, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 103 */ { VXInstructionMnemonic::FCMOVNE, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 104 */ { VXInstructionMnemonic::FCMOVNE, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 105 */ { VXInstructionMnemonic::FCMOVNE, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 106 */ { VXInstructionMnemonic::FCMOVNU, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 107 */ { VXInstructionMnemonic::FCMOVNU, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 108 */ { VXInstructionMnemonic::FCMOVNU, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 109 */ { VXInstructionMnemonic::FCMOVNU, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 10A */ { VXInstructionMnemonic::FCMOVNU, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 10B */ { VXInstructionMnemonic::FCMOVNU, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 10C */ { VXInstructionMnemonic::FCMOVNU, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 10D */ { VXInstructionMnemonic::FCMOVNU, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 10E */ { VXInstructionMnemonic::FCMOVU, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 10F */ { VXInstructionMnemonic::FCMOVU, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 110 */ { VXInstructionMnemonic::FCMOVU, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 111 */ { VXInstructionMnemonic::FCMOVU, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 112 */ { VXInstructionMnemonic::FCMOVU, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 113 */ { VXInstructionMnemonic::FCMOVU, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 114 */ { VXInstructionMnemonic::FCMOVU, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 115 */ { VXInstructionMnemonic::FCMOVU, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 116 */ { VXInstructionMnemonic::FCOM, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 117 */ { VXInstructionMnemonic::FCOM, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 118 */ { VXInstructionMnemonic::FCOM, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 119 */ { VXInstructionMnemonic::FCOM, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 11A */ { VXInstructionMnemonic::FCOM, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 11B */ { VXInstructionMnemonic::FCOM, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 11C */ { VXInstructionMnemonic::FCOM, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 11D */ { VXInstructionMnemonic::FCOM, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 11E */ { VXInstructionMnemonic::FCOM, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 11F */ { VXInstructionMnemonic::FCOM, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 120 */ { VXInstructionMnemonic::FCOM2, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 121 */ { VXInstructionMnemonic::FCOM2, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 122 */ { VXInstructionMnemonic::FCOM2, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 123 */ { VXInstructionMnemonic::FCOM2, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 124 */ { VXInstructionMnemonic::FCOM2, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 125 */ { VXInstructionMnemonic::FCOM2, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 126 */ { VXInstructionMnemonic::FCOM2, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 127 */ { VXInstructionMnemonic::FCOM2, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 128 */ { VXInstructionMnemonic::FCOMI, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 129 */ { VXInstructionMnemonic::FCOMI, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 12A */ { VXInstructionMnemonic::FCOMI, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 12B */ { VXInstructionMnemonic::FCOMI, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 12C */ { VXInstructionMnemonic::FCOMI, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 12D */ { VXInstructionMnemonic::FCOMI, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 12E */ { VXInstructionMnemonic::FCOMI, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 12F */ { VXInstructionMnemonic::FCOMI, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 130 */ { VXInstructionMnemonic::FCOMIP, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 131 */ { VXInstructionMnemonic::FCOMIP, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 132 */ { VXInstructionMnemonic::FCOMIP, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 133 */ { VXInstructionMnemonic::FCOMIP, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 134 */ { VXInstructionMnemonic::FCOMIP, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 135 */ { VXInstructionMnemonic::FCOMIP, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 136 */ { VXInstructionMnemonic::FCOMIP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 137 */ { VXInstructionMnemonic::FCOMIP, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 138 */ { VXInstructionMnemonic::FCOMP, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 139 */ { VXInstructionMnemonic::FCOMP, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 13A */ { VXInstructionMnemonic::FCOMP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 13B */ { VXInstructionMnemonic::FCOMP, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 13C */ { VXInstructionMnemonic::FCOMP, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 13D */ { VXInstructionMnemonic::FCOMP, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 13E */ { VXInstructionMnemonic::FCOMP, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 13F */ { VXInstructionMnemonic::FCOMP, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 140 */ { VXInstructionMnemonic::FCOMP, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 141 */ { VXInstructionMnemonic::FCOMP, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 142 */ { VXInstructionMnemonic::FCOMP3, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 143 */ { VXInstructionMnemonic::FCOMP3, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 144 */ { VXInstructionMnemonic::FCOMP3, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 145 */ { VXInstructionMnemonic::FCOMP3, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 146 */ { VXInstructionMnemonic::FCOMP3, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 147 */ { VXInstructionMnemonic::FCOMP3, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 148 */ { VXInstructionMnemonic::FCOMP3, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 149 */ { VXInstructionMnemonic::FCOMP3, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 14A */ { VXInstructionMnemonic::FCOMP5, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 14B */ { VXInstructionMnemonic::FCOMP5, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 14C */ { VXInstructionMnemonic::FCOMP5, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 14D */ { VXInstructionMnemonic::FCOMP5, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 14E */ { VXInstructionMnemonic::FCOMP5, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 14F */ { VXInstructionMnemonic::FCOMP5, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 150 */ { VXInstructionMnemonic::FCOMP5, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 151 */ { VXInstructionMnemonic::FCOMP5, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 152 */ { VXInstructionMnemonic::FCOMPP, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 153 */ { VXInstructionMnemonic::FCOS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 154 */ { VXInstructionMnemonic::FDECSTP, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 155 */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 156 */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 157 */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 158 */ { VXInstructionMnemonic::FDIV, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 159 */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 15A */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 15B */ { VXInstructionMnemonic::FDIV, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 15C */ { VXInstructionMnemonic::FDIV, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 15D */ { VXInstructionMnemonic::FDIV, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 15E */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 15F */ { VXInstructionMnemonic::FDIV, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 160 */ { VXInstructionMnemonic::FDIV, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 161 */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 162 */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 163 */ { VXInstructionMnemonic::FDIV, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 164 */ { VXInstructionMnemonic::FDIV, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 165 */ { VXInstructionMnemonic::FDIV, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 166 */ { VXInstructionMnemonic::FDIV, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 167 */ { VXInstructionMnemonic::FDIVP, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 168 */ { VXInstructionMnemonic::FDIVP, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 169 */ { VXInstructionMnemonic::FDIVP, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 16A */ { VXInstructionMnemonic::FDIVP, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 16B */ { VXInstructionMnemonic::FDIVP, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 16C */ { VXInstructionMnemonic::FDIVP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 16D */ { VXInstructionMnemonic::FDIVP, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 16E */ { VXInstructionMnemonic::FDIVP, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 16F */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 170 */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 171 */ { VXInstructionMnemonic::FDIVR, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 172 */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 173 */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 174 */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 175 */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 176 */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 177 */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 178 */ { VXInstructionMnemonic::FDIVR, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 179 */ { VXInstructionMnemonic::FDIVR, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 17A */ { VXInstructionMnemonic::FDIVR, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 17B */ { VXInstructionMnemonic::FDIVR, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 17C */ { VXInstructionMnemonic::FDIVR, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 17D */ { VXInstructionMnemonic::FDIVR, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 17E */ { VXInstructionMnemonic::FDIVR, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 17F */ { VXInstructionMnemonic::FDIVR, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 180 */ { VXInstructionMnemonic::FDIVR, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 181 */ { VXInstructionMnemonic::FDIVRP, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 182 */ { VXInstructionMnemonic::FDIVRP, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 183 */ { VXInstructionMnemonic::FDIVRP, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 184 */ { VXInstructionMnemonic::FDIVRP, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 185 */ { VXInstructionMnemonic::FDIVRP, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 186 */ { VXInstructionMnemonic::FDIVRP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 187 */ { VXInstructionMnemonic::FDIVRP, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 188 */ { VXInstructionMnemonic::FDIVRP, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 189 */ { VXInstructionMnemonic::FEMMS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 18A */ { VXInstructionMnemonic::FFREE, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 18B */ { VXInstructionMnemonic::FFREE, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 18C */ { VXInstructionMnemonic::FFREE, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 18D */ { VXInstructionMnemonic::FFREE, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 18E */ { VXInstructionMnemonic::FFREE, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 18F */ { VXInstructionMnemonic::FFREE, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 190 */ { VXInstructionMnemonic::FFREE, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 191 */ { VXInstructionMnemonic::FFREE, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 192 */ { VXInstructionMnemonic::FFREEP, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 193 */ { VXInstructionMnemonic::FFREEP, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 194 */ { VXInstructionMnemonic::FFREEP, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 195 */ { VXInstructionMnemonic::FFREEP, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 196 */ { VXInstructionMnemonic::FFREEP, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 197 */ { VXInstructionMnemonic::FFREEP, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 198 */ { VXInstructionMnemonic::FFREEP, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 199 */ { VXInstructionMnemonic::FFREEP, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 19A */ { VXInstructionMnemonic::FIADD, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 19B */ { VXInstructionMnemonic::FIADD, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 19C */ { VXInstructionMnemonic::FICOM, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 19D */ { VXInstructionMnemonic::FICOM, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 19E */ { VXInstructionMnemonic::FICOMP, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 19F */ { VXInstructionMnemonic::FICOMP, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A0 */ { VXInstructionMnemonic::FIDIV, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A1 */ { VXInstructionMnemonic::FIDIV, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A2 */ { VXInstructionMnemonic::FIDIVR, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A3 */ { VXInstructionMnemonic::FIDIVR, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A4 */ { VXInstructionMnemonic::FILD, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A5 */ { VXInstructionMnemonic::FILD, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A6 */ { VXInstructionMnemonic::FILD, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A7 */ { VXInstructionMnemonic::FIMUL, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A8 */ { VXInstructionMnemonic::FIMUL, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1A9 */ { VXInstructionMnemonic::FINCSTP, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1AA */ { VXInstructionMnemonic::FIST, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1AB */ { VXInstructionMnemonic::FIST, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1AC */ { VXInstructionMnemonic::FISTP, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1AD */ { VXInstructionMnemonic::FISTP, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1AE */ { VXInstructionMnemonic::FISTP, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1AF */ { VXInstructionMnemonic::FISTTP, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1B0 */ { VXInstructionMnemonic::FISTTP, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1B1 */ { VXInstructionMnemonic::FISTTP, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1B2 */ { VXInstructionMnemonic::FISUB, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1B3 */ { VXInstructionMnemonic::FISUB, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1B4 */ { VXInstructionMnemonic::FISUBR, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1B5 */ { VXInstructionMnemonic::FISUBR, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1B6 */ { VXInstructionMnemonic::FLD, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1B7 */ { VXInstructionMnemonic::FLD, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1B8 */ { VXInstructionMnemonic::FLD, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1B9 */ { VXInstructionMnemonic::FLD, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1BA */ { VXInstructionMnemonic::FLD, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1BB */ { VXInstructionMnemonic::FLD, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1BC */ { VXInstructionMnemonic::FLD, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1BD */ { VXInstructionMnemonic::FLD, { OPI_Mt, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1BE */ { VXInstructionMnemonic::FLD, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1BF */ { VXInstructionMnemonic::FLD, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1C0 */ { VXInstructionMnemonic::FLD, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1C1 */ { VXInstructionMnemonic::FLD1, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1C2 */ { VXInstructionMnemonic::FLDCW, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1C3 */ { VXInstructionMnemonic::FLDENV, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1C4 */ { VXInstructionMnemonic::FLDL2E, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1C5 */ { VXInstructionMnemonic::FLDL2T, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1C6 */ { VXInstructionMnemonic::FLDLG2, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1C7 */ { VXInstructionMnemonic::FLDLN2, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1C8 */ { VXInstructionMnemonic::FLDPI, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1C9 */ { VXInstructionMnemonic::FLDZ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1CA */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 1CB */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 1CC */ { VXInstructionMnemonic::FMUL, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1CD */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1CE */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 1CF */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 1D0 */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 1D1 */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 1D2 */ { VXInstructionMnemonic::FMUL, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1D3 */ { VXInstructionMnemonic::FMUL, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1D4 */ { VXInstructionMnemonic::FMUL, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1D5 */ { VXInstructionMnemonic::FMUL, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1D6 */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1D7 */ { VXInstructionMnemonic::FMUL, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1D8 */ { VXInstructionMnemonic::FMUL, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1D9 */ { VXInstructionMnemonic::FMUL, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1DA */ { VXInstructionMnemonic::FMUL, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1DB */ { VXInstructionMnemonic::FMUL, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 1DC */ { VXInstructionMnemonic::FMULP, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1DD */ { VXInstructionMnemonic::FMULP, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1DE */ { VXInstructionMnemonic::FMULP, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1DF */ { VXInstructionMnemonic::FMULP, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1E0 */ { VXInstructionMnemonic::FMULP, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1E1 */ { VXInstructionMnemonic::FMULP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1E2 */ { VXInstructionMnemonic::FMULP, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1E3 */ { VXInstructionMnemonic::FMULP, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 1E4 */ { VXInstructionMnemonic::FNINIT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1E5 */ { VXInstructionMnemonic::FNOP, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1E6 */ { VXInstructionMnemonic::FNSAVE, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1E7 */ { VXInstructionMnemonic::FNSTCW, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1E8 */ { VXInstructionMnemonic::FNSTENV, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1E9 */ { VXInstructionMnemonic::FNSTSW, { OPI_AX, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1EA */ { VXInstructionMnemonic::FNSTSW, { OPI_Mw, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1EB */ { VXInstructionMnemonic::FPATAN, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1EC */ { VXInstructionMnemonic::FPREM, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1ED */ { VXInstructionMnemonic::FPREM1, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1EE */ { VXInstructionMnemonic::FPTAN, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1EF */ { VXInstructionMnemonic::FRNDINT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1F0 */ { VXInstructionMnemonic::FRSTOR, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1F1 */ { VXInstructionMnemonic::FSCALE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1F2 */ { VXInstructionMnemonic::FSIN, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1F3 */ { VXInstructionMnemonic::FSINCOS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1F4 */ { VXInstructionMnemonic::FSQRT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1F5 */ { VXInstructionMnemonic::FST, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1F6 */ { VXInstructionMnemonic::FST, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1F7 */ { VXInstructionMnemonic::FST, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1F8 */ { VXInstructionMnemonic::FST, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1F9 */ { VXInstructionMnemonic::FST, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1FA */ { VXInstructionMnemonic::FST, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1FB */ { VXInstructionMnemonic::FST, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1FC */ { VXInstructionMnemonic::FST, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 1FD */ { VXInstructionMnemonic::FST, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1FE */ { VXInstructionMnemonic::FST, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 1FF */ { VXInstructionMnemonic::FSTP, { OPI_Mt, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 200 */ { VXInstructionMnemonic::FSTP, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 201 */ { VXInstructionMnemonic::FSTP, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 202 */ { VXInstructionMnemonic::FSTP, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 203 */ { VXInstructionMnemonic::FSTP, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 204 */ { VXInstructionMnemonic::FSTP, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 205 */ { VXInstructionMnemonic::FSTP, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 206 */ { VXInstructionMnemonic::FSTP, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 207 */ { VXInstructionMnemonic::FSTP, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 208 */ { VXInstructionMnemonic::FSTP, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 209 */ { VXInstructionMnemonic::FSTP, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 20A */ { VXInstructionMnemonic::FSTP1, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 20B */ { VXInstructionMnemonic::FSTP1, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 20C */ { VXInstructionMnemonic::FSTP1, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 20D */ { VXInstructionMnemonic::FSTP1, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 20E */ { VXInstructionMnemonic::FSTP1, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 20F */ { VXInstructionMnemonic::FSTP1, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 210 */ { VXInstructionMnemonic::FSTP1, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 211 */ { VXInstructionMnemonic::FSTP1, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 212 */ { VXInstructionMnemonic::FSTP8, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 213 */ { VXInstructionMnemonic::FSTP8, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 214 */ { VXInstructionMnemonic::FSTP8, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 215 */ { VXInstructionMnemonic::FSTP8, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 216 */ { VXInstructionMnemonic::FSTP8, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 217 */ { VXInstructionMnemonic::FSTP8, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 218 */ { VXInstructionMnemonic::FSTP8, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 219 */ { VXInstructionMnemonic::FSTP8, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 21A */ { VXInstructionMnemonic::FSTP9, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 21B */ { VXInstructionMnemonic::FSTP9, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 21C */ { VXInstructionMnemonic::FSTP9, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 21D */ { VXInstructionMnemonic::FSTP9, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 21E */ { VXInstructionMnemonic::FSTP9, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 21F */ { VXInstructionMnemonic::FSTP9, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 220 */ { VXInstructionMnemonic::FSTP9, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 221 */ { VXInstructionMnemonic::FSTP9, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 222 */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 223 */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 224 */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 225 */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 226 */ { VXInstructionMnemonic::FSUB, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 227 */ { VXInstructionMnemonic::FSUB, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 228 */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 229 */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 22A */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 22B */ { VXInstructionMnemonic::FSUB, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 22C */ { VXInstructionMnemonic::FSUB, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 22D */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 22E */ { VXInstructionMnemonic::FSUB, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 22F */ { VXInstructionMnemonic::FSUB, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 230 */ { VXInstructionMnemonic::FSUB, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 231 */ { VXInstructionMnemonic::FSUB, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 232 */ { VXInstructionMnemonic::FSUB, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 233 */ { VXInstructionMnemonic::FSUB, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 234 */ { VXInstructionMnemonic::FSUBP, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 235 */ { VXInstructionMnemonic::FSUBP, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 236 */ { VXInstructionMnemonic::FSUBP, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 237 */ { VXInstructionMnemonic::FSUBP, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 238 */ { VXInstructionMnemonic::FSUBP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 239 */ { VXInstructionMnemonic::FSUBP, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 23A */ { VXInstructionMnemonic::FSUBP, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 23B */ { VXInstructionMnemonic::FSUBP, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 23C */ { VXInstructionMnemonic::FSUBR, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 23D */ { VXInstructionMnemonic::FSUBR, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 23E */ { VXInstructionMnemonic::FSUBR, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 23F */ { VXInstructionMnemonic::FSUBR, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 240 */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 241 */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 242 */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 243 */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 244 */ { VXInstructionMnemonic::FSUBR, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 245 */ { VXInstructionMnemonic::FSUBR, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 246 */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 247 */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 248 */ { VXInstructionMnemonic::FSUBR, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 249 */ { VXInstructionMnemonic::FSUBR, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 24A */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 24B */ { VXInstructionMnemonic::FSUBR, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 24C */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 24D */ { VXInstructionMnemonic::FSUBR, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 24E */ { VXInstructionMnemonic::FSUBRP, { OPI_ST4, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 24F */ { VXInstructionMnemonic::FSUBRP, { OPI_ST5, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 250 */ { VXInstructionMnemonic::FSUBRP, { OPI_ST6, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 251 */ { VXInstructionMnemonic::FSUBRP, { OPI_ST3, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 252 */ { VXInstructionMnemonic::FSUBRP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 253 */ { VXInstructionMnemonic::FSUBRP, { OPI_ST1, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 254 */ { VXInstructionMnemonic::FSUBRP, { OPI_ST2, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 255 */ { VXInstructionMnemonic::FSUBRP, { OPI_ST7, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 256 */ { VXInstructionMnemonic::FTST, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 257 */ { VXInstructionMnemonic::FUCOM, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 258 */ { VXInstructionMnemonic::FUCOM, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 259 */ { VXInstructionMnemonic::FUCOM, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 25A */ { VXInstructionMnemonic::FUCOM, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 25B */ { VXInstructionMnemonic::FUCOM, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 25C */ { VXInstructionMnemonic::FUCOM, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 25D */ { VXInstructionMnemonic::FUCOM, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 25E */ { VXInstructionMnemonic::FUCOM, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 25F */ { VXInstructionMnemonic::FUCOMI, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 260 */ { VXInstructionMnemonic::FUCOMI, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 261 */ { VXInstructionMnemonic::FUCOMI, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 262 */ { VXInstructionMnemonic::FUCOMI, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 263 */ { VXInstructionMnemonic::FUCOMI, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 264 */ { VXInstructionMnemonic::FUCOMI, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 265 */ { VXInstructionMnemonic::FUCOMI, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 266 */ { VXInstructionMnemonic::FUCOMI, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 267 */ { VXInstructionMnemonic::FUCOMIP, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 268 */ { VXInstructionMnemonic::FUCOMIP, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 269 */ { VXInstructionMnemonic::FUCOMIP, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 26A */ { VXInstructionMnemonic::FUCOMIP, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 26B */ { VXInstructionMnemonic::FUCOMIP, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 26C */ { VXInstructionMnemonic::FUCOMIP, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 26D */ { VXInstructionMnemonic::FUCOMIP, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 26E */ { VXInstructionMnemonic::FUCOMIP, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 26F */ { VXInstructionMnemonic::FUCOMP, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 270 */ { VXInstructionMnemonic::FUCOMP, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 271 */ { VXInstructionMnemonic::FUCOMP, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 272 */ { VXInstructionMnemonic::FUCOMP, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 273 */ { VXInstructionMnemonic::FUCOMP, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 274 */ { VXInstructionMnemonic::FUCOMP, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 275 */ { VXInstructionMnemonic::FUCOMP, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 276 */ { VXInstructionMnemonic::FUCOMP, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 277 */ { VXInstructionMnemonic::FUCOMPP, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 278 */ { VXInstructionMnemonic::FXAM, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 279 */ { VXInstructionMnemonic::FXCH, { OPI_ST0, OPI_ST5, OPI_NONE, OPI_NONE }, 0 }, + /* 27A */ { VXInstructionMnemonic::FXCH, { OPI_ST0, OPI_ST4, OPI_NONE, OPI_NONE }, 0 }, + /* 27B */ { VXInstructionMnemonic::FXCH, { OPI_ST0, OPI_ST7, OPI_NONE, OPI_NONE }, 0 }, + /* 27C */ { VXInstructionMnemonic::FXCH, { OPI_ST0, OPI_ST6, OPI_NONE, OPI_NONE }, 0 }, + /* 27D */ { VXInstructionMnemonic::FXCH, { OPI_ST0, OPI_ST1, OPI_NONE, OPI_NONE }, 0 }, + /* 27E */ { VXInstructionMnemonic::FXCH, { OPI_ST0, OPI_ST0, OPI_NONE, OPI_NONE }, 0 }, + /* 27F */ { VXInstructionMnemonic::FXCH, { OPI_ST0, OPI_ST3, OPI_NONE, OPI_NONE }, 0 }, + /* 280 */ { VXInstructionMnemonic::FXCH, { OPI_ST0, OPI_ST2, OPI_NONE, OPI_NONE }, 0 }, + /* 281 */ { VXInstructionMnemonic::FXCH4, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 282 */ { VXInstructionMnemonic::FXCH4, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 283 */ { VXInstructionMnemonic::FXCH4, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 284 */ { VXInstructionMnemonic::FXCH4, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 285 */ { VXInstructionMnemonic::FXCH4, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 286 */ { VXInstructionMnemonic::FXCH4, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 287 */ { VXInstructionMnemonic::FXCH4, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 288 */ { VXInstructionMnemonic::FXCH4, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 289 */ { VXInstructionMnemonic::FXCH7, { OPI_ST5, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 28A */ { VXInstructionMnemonic::FXCH7, { OPI_ST1, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 28B */ { VXInstructionMnemonic::FXCH7, { OPI_ST0, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 28C */ { VXInstructionMnemonic::FXCH7, { OPI_ST2, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 28D */ { VXInstructionMnemonic::FXCH7, { OPI_ST4, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 28E */ { VXInstructionMnemonic::FXCH7, { OPI_ST3, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 28F */ { VXInstructionMnemonic::FXCH7, { OPI_ST7, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 290 */ { VXInstructionMnemonic::FXCH7, { OPI_ST6, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 291 */ { VXInstructionMnemonic::FXRSTOR, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 292 */ { VXInstructionMnemonic::FXSAVE, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 293 */ { VXInstructionMnemonic::FXTRACT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 294 */ { VXInstructionMnemonic::FYL2X, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 295 */ { VXInstructionMnemonic::FYL2XP1, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 296 */ { VXInstructionMnemonic::GETSEC, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 297 */ { VXInstructionMnemonic::HADDPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 298 */ { VXInstructionMnemonic::HADDPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 299 */ { VXInstructionMnemonic::HLT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 29A */ { VXInstructionMnemonic::HSUBPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 29B */ { VXInstructionMnemonic::HSUBPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 29C */ { VXInstructionMnemonic::IDIV, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 29D */ { VXInstructionMnemonic::IDIV, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 29E */ { VXInstructionMnemonic::IMUL, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 29F */ { VXInstructionMnemonic::IMUL, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2A0 */ { VXInstructionMnemonic::IMUL, { OPI_Gv, OPI_Ev, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2A1 */ { VXInstructionMnemonic::IMUL, { OPI_Gv, OPI_Ev, OPI_Iz, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2A2 */ { VXInstructionMnemonic::IMUL, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2A3 */ { VXInstructionMnemonic::IN, { OPI_eAX, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2A4 */ { VXInstructionMnemonic::IN, { OPI_AL, OPI_DX, OPI_NONE, OPI_NONE }, 0 }, + /* 2A5 */ { VXInstructionMnemonic::IN, { OPI_eAX, OPI_DX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2A6 */ { VXInstructionMnemonic::IN, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 2A7 */ { VXInstructionMnemonic::INC, { OPI_R0z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2A8 */ { VXInstructionMnemonic::INC, { OPI_R7z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2A9 */ { VXInstructionMnemonic::INC, { OPI_R6z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2AA */ { VXInstructionMnemonic::INC, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2AB */ { VXInstructionMnemonic::INC, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2AC */ { VXInstructionMnemonic::INC, { OPI_R5z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2AD */ { VXInstructionMnemonic::INC, { OPI_R2z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2AE */ { VXInstructionMnemonic::INC, { OPI_R1z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2AF */ { VXInstructionMnemonic::INC, { OPI_R4z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2B0 */ { VXInstructionMnemonic::INC, { OPI_R3z, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2B1 */ { VXInstructionMnemonic::INSB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 2B2 */ { VXInstructionMnemonic::INSD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 2B3 */ { VXInstructionMnemonic::INSERTPS, { OPI_V, OPI_Md, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2B4 */ { VXInstructionMnemonic::INSW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 2B5 */ { VXInstructionMnemonic::INT, { OPI_Ib, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2B6 */ { VXInstructionMnemonic::INT1, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2B7 */ { VXInstructionMnemonic::INT3, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2B8 */ { VXInstructionMnemonic::INTO, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 2B9 */ { VXInstructionMnemonic::INVD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2BA */ { VXInstructionMnemonic::INVEPT, { OPI_Gd, OPI_Mo, OPI_NONE, OPI_NONE }, 0 }, + /* 2BB */ { VXInstructionMnemonic::INVEPT, { OPI_Gq, OPI_Mo, OPI_NONE, OPI_NONE }, 0 }, + /* 2BC */ { VXInstructionMnemonic::INVLPG, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2BD */ { VXInstructionMnemonic::INVLPGA, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2BE */ { VXInstructionMnemonic::INVVPID, { OPI_Gq, OPI_Mo, OPI_NONE, OPI_NONE }, 0 }, + /* 2BF */ { VXInstructionMnemonic::INVVPID, { OPI_Gd, OPI_Mo, OPI_NONE, OPI_NONE }, 0 }, + /* 2C0 */ { VXInstructionMnemonic::IRETD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 2C1 */ { VXInstructionMnemonic::IRETQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 2C2 */ { VXInstructionMnemonic::IRETW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 2C3 */ { VXInstructionMnemonic::JA, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2C4 */ { VXInstructionMnemonic::JA, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2C5 */ { VXInstructionMnemonic::JAE, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2C6 */ { VXInstructionMnemonic::JAE, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2C7 */ { VXInstructionMnemonic::JB, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2C8 */ { VXInstructionMnemonic::JB, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2C9 */ { VXInstructionMnemonic::JBE, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2CA */ { VXInstructionMnemonic::JBE, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2CB */ { VXInstructionMnemonic::JCXZ, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE }, + /* 2CC */ { VXInstructionMnemonic::JECXZ, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE }, + /* 2CD */ { VXInstructionMnemonic::JG, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2CE */ { VXInstructionMnemonic::JG, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2CF */ { VXInstructionMnemonic::JGE, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2D0 */ { VXInstructionMnemonic::JGE, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2D1 */ { VXInstructionMnemonic::JL, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2D2 */ { VXInstructionMnemonic::JL, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2D3 */ { VXInstructionMnemonic::JLE, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2D4 */ { VXInstructionMnemonic::JLE, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2D5 */ { VXInstructionMnemonic::JMP, { OPI_Fv, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2D6 */ { VXInstructionMnemonic::JMP, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 2D7 */ { VXInstructionMnemonic::JMP, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2D8 */ { VXInstructionMnemonic::JMP, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_DEFAULT_64 }, + /* 2D9 */ { VXInstructionMnemonic::JMP, { OPI_Av, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2DA */ { VXInstructionMnemonic::JNO, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2DB */ { VXInstructionMnemonic::JNO, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2DC */ { VXInstructionMnemonic::JNP, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2DD */ { VXInstructionMnemonic::JNP, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2DE */ { VXInstructionMnemonic::JNS, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2DF */ { VXInstructionMnemonic::JNS, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2E0 */ { VXInstructionMnemonic::JNZ, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2E1 */ { VXInstructionMnemonic::JNZ, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2E2 */ { VXInstructionMnemonic::JO, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2E3 */ { VXInstructionMnemonic::JO, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2E4 */ { VXInstructionMnemonic::JP, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2E5 */ { VXInstructionMnemonic::JP, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2E6 */ { VXInstructionMnemonic::JRCXZ, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE }, + /* 2E7 */ { VXInstructionMnemonic::JS, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2E8 */ { VXInstructionMnemonic::JS, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2E9 */ { VXInstructionMnemonic::JZ, { OPI_Jz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 2EA */ { VXInstructionMnemonic::JZ, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2EB */ { VXInstructionMnemonic::LAHF, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2EC */ { VXInstructionMnemonic::LAR, { OPI_Gv, OPI_Ew, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2ED */ { VXInstructionMnemonic::LDDQU, { OPI_V, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2EE */ { VXInstructionMnemonic::LDMXCSR, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2EF */ { VXInstructionMnemonic::LDS, { OPI_Gv, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2F0 */ { VXInstructionMnemonic::LEA, { OPI_Gv, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2F1 */ { VXInstructionMnemonic::LEAVE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2F2 */ { VXInstructionMnemonic::LES, { OPI_Gv, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 2F3 */ { VXInstructionMnemonic::LFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2F4 */ { VXInstructionMnemonic::LFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2F5 */ { VXInstructionMnemonic::LFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2F6 */ { VXInstructionMnemonic::LFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2F7 */ { VXInstructionMnemonic::LFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2F8 */ { VXInstructionMnemonic::LFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2F9 */ { VXInstructionMnemonic::LFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2FA */ { VXInstructionMnemonic::LFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 2FB */ { VXInstructionMnemonic::LFS, { OPI_Gz, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2FC */ { VXInstructionMnemonic::LGDT, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2FD */ { VXInstructionMnemonic::LGS, { OPI_Gz, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2FE */ { VXInstructionMnemonic::LIDT, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 2FF */ { VXInstructionMnemonic::LLDT, { OPI_Ew, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 300 */ { VXInstructionMnemonic::LMSW, { OPI_Ew, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 301 */ { VXInstructionMnemonic::LMSW, { OPI_Ew, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 302 */ { VXInstructionMnemonic::LOCK, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 303 */ { VXInstructionMnemonic::LODSB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 304 */ { VXInstructionMnemonic::LODSD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 305 */ { VXInstructionMnemonic::LODSQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 306 */ { VXInstructionMnemonic::LODSW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 307 */ { VXInstructionMnemonic::LOOP, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 308 */ { VXInstructionMnemonic::LOOPE, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 309 */ { VXInstructionMnemonic::LOOPNE, { OPI_Jb, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 30A */ { VXInstructionMnemonic::LSL, { OPI_Gv, OPI_Ew, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 30B */ { VXInstructionMnemonic::LSS, { OPI_Gv, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 30C */ { VXInstructionMnemonic::LTR, { OPI_Ew, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 30D */ { VXInstructionMnemonic::MASKMOVDQU, { OPI_V, OPI_U, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 30E */ { VXInstructionMnemonic::MASKMOVQ, { OPI_P, OPI_N, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 30F */ { VXInstructionMnemonic::MAXPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 310 */ { VXInstructionMnemonic::MAXPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 311 */ { VXInstructionMnemonic::MAXSD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 312 */ { VXInstructionMnemonic::MAXSS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 313 */ { VXInstructionMnemonic::MFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 314 */ { VXInstructionMnemonic::MFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 315 */ { VXInstructionMnemonic::MFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 316 */ { VXInstructionMnemonic::MFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 317 */ { VXInstructionMnemonic::MFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 318 */ { VXInstructionMnemonic::MFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 319 */ { VXInstructionMnemonic::MFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 31A */ { VXInstructionMnemonic::MFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 31B */ { VXInstructionMnemonic::MINPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 31C */ { VXInstructionMnemonic::MINPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 31D */ { VXInstructionMnemonic::MINSD, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 31E */ { VXInstructionMnemonic::MINSS, { OPI_V, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 31F */ { VXInstructionMnemonic::MONITOR, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 320 */ { VXInstructionMnemonic::MONTMUL, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 321 */ { VXInstructionMnemonic::MOV, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 322 */ { VXInstructionMnemonic::MOV, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 323 */ { VXInstructionMnemonic::MOV, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 324 */ { VXInstructionMnemonic::MOV, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 325 */ { VXInstructionMnemonic::MOV, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 326 */ { VXInstructionMnemonic::MOV, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 327 */ { VXInstructionMnemonic::MOV, { OPI_R2b, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 328 */ { VXInstructionMnemonic::MOV, { OPI_R1b, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 329 */ { VXInstructionMnemonic::MOV, { OPI_R0b, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 32A */ { VXInstructionMnemonic::MOV, { OPI_R5b, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 32B */ { VXInstructionMnemonic::MOV, { OPI_R4b, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 32C */ { VXInstructionMnemonic::MOV, { OPI_R3b, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 32D */ { VXInstructionMnemonic::MOV, { OPI_AL, OPI_Ob, OPI_NONE, OPI_NONE }, 0 }, + /* 32E */ { VXInstructionMnemonic::MOV, { OPI_S, OPI_MwRv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 32F */ { VXInstructionMnemonic::MOV, { OPI_MwRv, OPI_S, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 330 */ { VXInstructionMnemonic::MOV, { OPI_Ov, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 331 */ { VXInstructionMnemonic::MOV, { OPI_Ob, OPI_AL, OPI_NONE, OPI_NONE }, 0 }, + /* 332 */ { VXInstructionMnemonic::MOV, { OPI_rAX, OPI_Ov, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 333 */ { VXInstructionMnemonic::MOV, { OPI_R6b, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 334 */ { VXInstructionMnemonic::MOV, { OPI_R3v, OPI_Iv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 335 */ { VXInstructionMnemonic::MOV, { OPI_R, OPI_D, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 336 */ { VXInstructionMnemonic::MOV, { OPI_R4v, OPI_Iv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 337 */ { VXInstructionMnemonic::MOV, { OPI_C, OPI_R, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 338 */ { VXInstructionMnemonic::MOV, { OPI_R2v, OPI_Iv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 339 */ { VXInstructionMnemonic::MOV, { OPI_D, OPI_R, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 33A */ { VXInstructionMnemonic::MOV, { OPI_R, OPI_C, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 33B */ { VXInstructionMnemonic::MOV, { OPI_R1v, OPI_Iv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 33C */ { VXInstructionMnemonic::MOV, { OPI_R0v, OPI_Iv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 33D */ { VXInstructionMnemonic::MOV, { OPI_R7b, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 33E */ { VXInstructionMnemonic::MOV, { OPI_R5v, OPI_Iv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 33F */ { VXInstructionMnemonic::MOV, { OPI_R7v, OPI_Iv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 340 */ { VXInstructionMnemonic::MOV, { OPI_R6v, OPI_Iv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 341 */ { VXInstructionMnemonic::MOVAPD, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 342 */ { VXInstructionMnemonic::MOVAPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 343 */ { VXInstructionMnemonic::MOVAPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 344 */ { VXInstructionMnemonic::MOVAPS, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 345 */ { VXInstructionMnemonic::MOVBE, { OPI_Mv, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 346 */ { VXInstructionMnemonic::MOVBE, { OPI_Gv, OPI_Mv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 347 */ { VXInstructionMnemonic::MOVD, { OPI_P, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 348 */ { VXInstructionMnemonic::MOVD, { OPI_Ey, OPI_P, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 349 */ { VXInstructionMnemonic::MOVD, { OPI_Ey, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 34A */ { VXInstructionMnemonic::MOVD, { OPI_Ey, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 34B */ { VXInstructionMnemonic::MOVD, { OPI_Ey, OPI_P, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 34C */ { VXInstructionMnemonic::MOVD, { OPI_P, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 34D */ { VXInstructionMnemonic::MOVD, { OPI_V, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 34E */ { VXInstructionMnemonic::MOVD, { OPI_V, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 34F */ { VXInstructionMnemonic::MOVDDUP, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 350 */ { VXInstructionMnemonic::MOVDDUP, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 351 */ { VXInstructionMnemonic::MOVDQ2Q, { OPI_P, OPI_U, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXB }, + /* 352 */ { VXInstructionMnemonic::MOVDQA, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 353 */ { VXInstructionMnemonic::MOVDQA, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 354 */ { VXInstructionMnemonic::MOVDQU, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 355 */ { VXInstructionMnemonic::MOVDQU, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 356 */ { VXInstructionMnemonic::MOVHLPS, { OPI_V, OPI_U, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 357 */ { VXInstructionMnemonic::MOVHPD, { OPI_V, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 358 */ { VXInstructionMnemonic::MOVHPD, { OPI_M, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 359 */ { VXInstructionMnemonic::MOVHPS, { OPI_V, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 35A */ { VXInstructionMnemonic::MOVHPS, { OPI_M, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 35B */ { VXInstructionMnemonic::MOVLHPS, { OPI_V, OPI_U, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 35C */ { VXInstructionMnemonic::MOVLPD, { OPI_V, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 35D */ { VXInstructionMnemonic::MOVLPD, { OPI_M, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 35E */ { VXInstructionMnemonic::MOVLPS, { OPI_M, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 35F */ { VXInstructionMnemonic::MOVLPS, { OPI_V, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 360 */ { VXInstructionMnemonic::MOVMSKPD, { OPI_Gd, OPI_U, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB }, + /* 361 */ { VXInstructionMnemonic::MOVMSKPS, { OPI_Gd, OPI_U, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB }, + /* 362 */ { VXInstructionMnemonic::MOVNTDQ, { OPI_M, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 363 */ { VXInstructionMnemonic::MOVNTDQA, { OPI_V, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 364 */ { VXInstructionMnemonic::MOVNTI, { OPI_M, OPI_Gy, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 365 */ { VXInstructionMnemonic::MOVNTPD, { OPI_M, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 366 */ { VXInstructionMnemonic::MOVNTPS, { OPI_M, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 367 */ { VXInstructionMnemonic::MOVNTQ, { OPI_M, OPI_P, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 368 */ { VXInstructionMnemonic::MOVQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 369 */ { VXInstructionMnemonic::MOVQ, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 36A */ { VXInstructionMnemonic::MOVQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 36B */ { VXInstructionMnemonic::MOVQ, { OPI_Q, OPI_P, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 36C */ { VXInstructionMnemonic::MOVQ, { OPI_P, OPI_Eq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 36D */ { VXInstructionMnemonic::MOVQ, { OPI_Eq, OPI_P, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 36E */ { VXInstructionMnemonic::MOVQ, { OPI_Eq, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 36F */ { VXInstructionMnemonic::MOVQ, { OPI_V, OPI_Eq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 370 */ { VXInstructionMnemonic::MOVQ2DQ, { OPI_V, OPI_N, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR }, + /* 371 */ { VXInstructionMnemonic::MOVSB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 372 */ { VXInstructionMnemonic::MOVSD, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 373 */ { VXInstructionMnemonic::MOVSD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 374 */ { VXInstructionMnemonic::MOVSD, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 375 */ { VXInstructionMnemonic::MOVSHDUP, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 376 */ { VXInstructionMnemonic::MOVSHDUP, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 377 */ { VXInstructionMnemonic::MOVSLDUP, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 378 */ { VXInstructionMnemonic::MOVSLDUP, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 379 */ { VXInstructionMnemonic::MOVSQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 37A */ { VXInstructionMnemonic::MOVSS, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 37B */ { VXInstructionMnemonic::MOVSS, { OPI_V, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 37C */ { VXInstructionMnemonic::MOVSW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 37D */ { VXInstructionMnemonic::MOVSX, { OPI_Gv, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 37E */ { VXInstructionMnemonic::MOVSX, { OPI_Gy, OPI_Ew, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 37F */ { VXInstructionMnemonic::MOVSXD, { OPI_Gq, OPI_Ed, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB }, + /* 380 */ { VXInstructionMnemonic::MOVUPD, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 381 */ { VXInstructionMnemonic::MOVUPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 382 */ { VXInstructionMnemonic::MOVUPS, { OPI_W, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 383 */ { VXInstructionMnemonic::MOVUPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 384 */ { VXInstructionMnemonic::MOVZX, { OPI_Gy, OPI_Ew, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 385 */ { VXInstructionMnemonic::MOVZX, { OPI_Gv, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 386 */ { VXInstructionMnemonic::MPSADBW, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 387 */ { VXInstructionMnemonic::MUL, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 388 */ { VXInstructionMnemonic::MUL, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 389 */ { VXInstructionMnemonic::MULPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 38A */ { VXInstructionMnemonic::MULPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 38B */ { VXInstructionMnemonic::MULSD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 38C */ { VXInstructionMnemonic::MULSS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 38D */ { VXInstructionMnemonic::MWAIT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 38E */ { VXInstructionMnemonic::NEG, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 38F */ { VXInstructionMnemonic::NEG, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 390 */ { VXInstructionMnemonic::NOP, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 391 */ { VXInstructionMnemonic::NOP, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 392 */ { VXInstructionMnemonic::NOP, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 393 */ { VXInstructionMnemonic::NOP, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 394 */ { VXInstructionMnemonic::NOP, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 395 */ { VXInstructionMnemonic::NOP, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 396 */ { VXInstructionMnemonic::NOP, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 397 */ { VXInstructionMnemonic::NOT, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 398 */ { VXInstructionMnemonic::NOT, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 399 */ { VXInstructionMnemonic::OR, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 39A */ { VXInstructionMnemonic::OR, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 39B */ { VXInstructionMnemonic::OR, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 39C */ { VXInstructionMnemonic::OR, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 39D */ { VXInstructionMnemonic::OR, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 39E */ { VXInstructionMnemonic::OR, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 39F */ { VXInstructionMnemonic::OR, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3A0 */ { VXInstructionMnemonic::OR, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3A1 */ { VXInstructionMnemonic::OR, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 3A2 */ { VXInstructionMnemonic::OR, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3A3 */ { VXInstructionMnemonic::ORPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3A4 */ { VXInstructionMnemonic::ORPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3A5 */ { VXInstructionMnemonic::OUT, { OPI_Ib, OPI_eAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 3A6 */ { VXInstructionMnemonic::OUT, { OPI_Ib, OPI_AL, OPI_NONE, OPI_NONE }, 0 }, + /* 3A7 */ { VXInstructionMnemonic::OUT, { OPI_DX, OPI_AL, OPI_NONE, OPI_NONE }, 0 }, + /* 3A8 */ { VXInstructionMnemonic::OUT, { OPI_DX, OPI_eAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 3A9 */ { VXInstructionMnemonic::OUTSB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 3AA */ { VXInstructionMnemonic::OUTSD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 3AB */ { VXInstructionMnemonic::OUTSW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 3AC */ { VXInstructionMnemonic::PABSB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3AD */ { VXInstructionMnemonic::PABSB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3AE */ { VXInstructionMnemonic::PABSD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3AF */ { VXInstructionMnemonic::PABSD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B0 */ { VXInstructionMnemonic::PABSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B1 */ { VXInstructionMnemonic::PABSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B2 */ { VXInstructionMnemonic::PACKSSDW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B3 */ { VXInstructionMnemonic::PACKSSDW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B4 */ { VXInstructionMnemonic::PACKSSWB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B5 */ { VXInstructionMnemonic::PACKSSWB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B6 */ { VXInstructionMnemonic::PACKUSDW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B7 */ { VXInstructionMnemonic::PACKUSWB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B8 */ { VXInstructionMnemonic::PACKUSWB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3B9 */ { VXInstructionMnemonic::PADDB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3BA */ { VXInstructionMnemonic::PADDB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3BB */ { VXInstructionMnemonic::PADDD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3BC */ { VXInstructionMnemonic::PADDD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3BD */ { VXInstructionMnemonic::PADDQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3BE */ { VXInstructionMnemonic::PADDQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3BF */ { VXInstructionMnemonic::PADDSB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C0 */ { VXInstructionMnemonic::PADDSB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C1 */ { VXInstructionMnemonic::PADDSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C2 */ { VXInstructionMnemonic::PADDSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C3 */ { VXInstructionMnemonic::PADDUSB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C4 */ { VXInstructionMnemonic::PADDUSB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C5 */ { VXInstructionMnemonic::PADDUSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C6 */ { VXInstructionMnemonic::PADDUSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C7 */ { VXInstructionMnemonic::PADDW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C8 */ { VXInstructionMnemonic::PADDW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3C9 */ { VXInstructionMnemonic::PALIGNR, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3CA */ { VXInstructionMnemonic::PALIGNR, { OPI_P, OPI_Q, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3CB */ { VXInstructionMnemonic::PAND, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3CC */ { VXInstructionMnemonic::PAND, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3CD */ { VXInstructionMnemonic::PANDN, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3CE */ { VXInstructionMnemonic::PANDN, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3CF */ { VXInstructionMnemonic::PAVGB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D0 */ { VXInstructionMnemonic::PAVGB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D1 */ { VXInstructionMnemonic::PAVGUSB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D2 */ { VXInstructionMnemonic::PAVGW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D3 */ { VXInstructionMnemonic::PAVGW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D4 */ { VXInstructionMnemonic::PBLENDVB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D5 */ { VXInstructionMnemonic::PBLENDW, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D6 */ { VXInstructionMnemonic::PCLMULQDQ, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D7 */ { VXInstructionMnemonic::PCMPEQB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D8 */ { VXInstructionMnemonic::PCMPEQB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3D9 */ { VXInstructionMnemonic::PCMPEQD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3DA */ { VXInstructionMnemonic::PCMPEQD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3DB */ { VXInstructionMnemonic::PCMPEQQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3DC */ { VXInstructionMnemonic::PCMPEQW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3DD */ { VXInstructionMnemonic::PCMPEQW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3DE */ { VXInstructionMnemonic::PCMPESTRI, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3DF */ { VXInstructionMnemonic::PCMPESTRM, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E0 */ { VXInstructionMnemonic::PCMPGTB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E1 */ { VXInstructionMnemonic::PCMPGTB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E2 */ { VXInstructionMnemonic::PCMPGTD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E3 */ { VXInstructionMnemonic::PCMPGTD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E4 */ { VXInstructionMnemonic::PCMPGTQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E5 */ { VXInstructionMnemonic::PCMPGTW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E6 */ { VXInstructionMnemonic::PCMPGTW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E7 */ { VXInstructionMnemonic::PCMPISTRI, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E8 */ { VXInstructionMnemonic::PCMPISTRM, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3E9 */ { VXInstructionMnemonic::PEXTRB, { OPI_MbRv, OPI_V, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 3EA */ { VXInstructionMnemonic::PEXTRD, { OPI_Ed, OPI_V, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 3EB */ { VXInstructionMnemonic::PEXTRD, { OPI_Ed, OPI_V, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 3EC */ { VXInstructionMnemonic::PEXTRQ, { OPI_Eq, OPI_V, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 3ED */ { VXInstructionMnemonic::PEXTRW, { OPI_Gd, OPI_U, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB }, + /* 3EE */ { VXInstructionMnemonic::PEXTRW, { OPI_Gd, OPI_N, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3EF */ { VXInstructionMnemonic::PEXTRW, { OPI_MwRd, OPI_V, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB }, + /* 3F0 */ { VXInstructionMnemonic::PF2ID, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F1 */ { VXInstructionMnemonic::PF2IW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F2 */ { VXInstructionMnemonic::PFACC, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F3 */ { VXInstructionMnemonic::PFADD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F4 */ { VXInstructionMnemonic::PFCMPEQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F5 */ { VXInstructionMnemonic::PFCMPGE, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F6 */ { VXInstructionMnemonic::PFCMPGT, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F7 */ { VXInstructionMnemonic::PFMAX, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F8 */ { VXInstructionMnemonic::PFMIN, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3F9 */ { VXInstructionMnemonic::PFMUL, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3FA */ { VXInstructionMnemonic::PFNACC, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3FB */ { VXInstructionMnemonic::PFPNACC, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3FC */ { VXInstructionMnemonic::PFRCP, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3FD */ { VXInstructionMnemonic::PFRCPIT1, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3FE */ { VXInstructionMnemonic::PFRCPIT2, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 3FF */ { VXInstructionMnemonic::PFRSQIT1, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 400 */ { VXInstructionMnemonic::PFRSQRT, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 401 */ { VXInstructionMnemonic::PFSUB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 402 */ { VXInstructionMnemonic::PFSUBR, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 403 */ { VXInstructionMnemonic::PHADDD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 404 */ { VXInstructionMnemonic::PHADDD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 405 */ { VXInstructionMnemonic::PHADDSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 406 */ { VXInstructionMnemonic::PHADDSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 407 */ { VXInstructionMnemonic::PHADDW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 408 */ { VXInstructionMnemonic::PHADDW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 409 */ { VXInstructionMnemonic::PHMINPOSUW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 40A */ { VXInstructionMnemonic::PHSUBD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 40B */ { VXInstructionMnemonic::PHSUBD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 40C */ { VXInstructionMnemonic::PHSUBSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 40D */ { VXInstructionMnemonic::PHSUBSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 40E */ { VXInstructionMnemonic::PHSUBW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 40F */ { VXInstructionMnemonic::PHSUBW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 410 */ { VXInstructionMnemonic::PI2FD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 411 */ { VXInstructionMnemonic::PI2FW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 412 */ { VXInstructionMnemonic::PINSRB, { OPI_V, OPI_MbRd, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 413 */ { VXInstructionMnemonic::PINSRD, { OPI_V, OPI_Ed, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 414 */ { VXInstructionMnemonic::PINSRD, { OPI_V, OPI_Ed, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 415 */ { VXInstructionMnemonic::PINSRQ, { OPI_V, OPI_Eq, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 416 */ { VXInstructionMnemonic::PINSRW, { OPI_V, OPI_MwRy, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 417 */ { VXInstructionMnemonic::PINSRW, { OPI_P, OPI_MwRy, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 418 */ { VXInstructionMnemonic::PMADDUBSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 419 */ { VXInstructionMnemonic::PMADDUBSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 41A */ { VXInstructionMnemonic::PMADDWD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 41B */ { VXInstructionMnemonic::PMADDWD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 41C */ { VXInstructionMnemonic::PMAXSB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 41D */ { VXInstructionMnemonic::PMAXSD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 41E */ { VXInstructionMnemonic::PMAXSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 41F */ { VXInstructionMnemonic::PMAXSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 420 */ { VXInstructionMnemonic::PMAXUB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 421 */ { VXInstructionMnemonic::PMAXUB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 422 */ { VXInstructionMnemonic::PMAXUD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 423 */ { VXInstructionMnemonic::PMAXUW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 424 */ { VXInstructionMnemonic::PMINSB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 425 */ { VXInstructionMnemonic::PMINSD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 426 */ { VXInstructionMnemonic::PMINSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 427 */ { VXInstructionMnemonic::PMINSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 428 */ { VXInstructionMnemonic::PMINUB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 429 */ { VXInstructionMnemonic::PMINUB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 42A */ { VXInstructionMnemonic::PMINUD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 42B */ { VXInstructionMnemonic::PMINUW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 42C */ { VXInstructionMnemonic::PMOVMSKB, { OPI_Gd, OPI_U, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 42D */ { VXInstructionMnemonic::PMOVMSKB, { OPI_Gd, OPI_N, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 42E */ { VXInstructionMnemonic::PMOVSXBD, { OPI_V, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 42F */ { VXInstructionMnemonic::PMOVSXBQ, { OPI_V, OPI_MwU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 430 */ { VXInstructionMnemonic::PMOVSXBW, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 431 */ { VXInstructionMnemonic::PMOVSXDQ, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 432 */ { VXInstructionMnemonic::PMOVSXWD, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 433 */ { VXInstructionMnemonic::PMOVSXWQ, { OPI_V, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 434 */ { VXInstructionMnemonic::PMOVZXBD, { OPI_V, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 435 */ { VXInstructionMnemonic::PMOVZXBQ, { OPI_V, OPI_MwU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 436 */ { VXInstructionMnemonic::PMOVZXBW, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 437 */ { VXInstructionMnemonic::PMOVZXDQ, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 438 */ { VXInstructionMnemonic::PMOVZXWD, { OPI_V, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 439 */ { VXInstructionMnemonic::PMOVZXWQ, { OPI_V, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 43A */ { VXInstructionMnemonic::PMULDQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 43B */ { VXInstructionMnemonic::PMULHRSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 43C */ { VXInstructionMnemonic::PMULHRSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 43D */ { VXInstructionMnemonic::PMULHRW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 43E */ { VXInstructionMnemonic::PMULHUW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 43F */ { VXInstructionMnemonic::PMULHUW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 440 */ { VXInstructionMnemonic::PMULHW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 441 */ { VXInstructionMnemonic::PMULHW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 442 */ { VXInstructionMnemonic::PMULLD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 443 */ { VXInstructionMnemonic::PMULLW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 444 */ { VXInstructionMnemonic::PMULLW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 445 */ { VXInstructionMnemonic::PMULUDQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 446 */ { VXInstructionMnemonic::PMULUDQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 447 */ { VXInstructionMnemonic::POP, { OPI_R5v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 448 */ { VXInstructionMnemonic::POP, { OPI_R4v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 449 */ { VXInstructionMnemonic::POP, { OPI_R6v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 44A */ { VXInstructionMnemonic::POP, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 44B */ { VXInstructionMnemonic::POP, { OPI_R7v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 44C */ { VXInstructionMnemonic::POP, { OPI_R3v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 44D */ { VXInstructionMnemonic::POP, { OPI_DS, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 44E */ { VXInstructionMnemonic::POP, { OPI_GS, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 44F */ { VXInstructionMnemonic::POP, { OPI_ES, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 450 */ { VXInstructionMnemonic::POP, { OPI_SS, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 451 */ { VXInstructionMnemonic::POP, { OPI_R1v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 452 */ { VXInstructionMnemonic::POP, { OPI_R2v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 453 */ { VXInstructionMnemonic::POP, { OPI_FS, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 454 */ { VXInstructionMnemonic::POP, { OPI_R0v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 455 */ { VXInstructionMnemonic::POPA, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_INVALID_64 }, + /* 456 */ { VXInstructionMnemonic::POPAD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_INVALID_64 }, + /* 457 */ { VXInstructionMnemonic::POPCNT, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 458 */ { VXInstructionMnemonic::POPFD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 459 */ { VXInstructionMnemonic::POPFQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 45A */ { VXInstructionMnemonic::POPFQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 45B */ { VXInstructionMnemonic::POPFW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 45C */ { VXInstructionMnemonic::POR, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 45D */ { VXInstructionMnemonic::POR, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 45E */ { VXInstructionMnemonic::PREFETCH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 45F */ { VXInstructionMnemonic::PREFETCH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 460 */ { VXInstructionMnemonic::PREFETCH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 461 */ { VXInstructionMnemonic::PREFETCH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 462 */ { VXInstructionMnemonic::PREFETCH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 463 */ { VXInstructionMnemonic::PREFETCH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 464 */ { VXInstructionMnemonic::PREFETCH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 465 */ { VXInstructionMnemonic::PREFETCH, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 466 */ { VXInstructionMnemonic::PREFETCHNTA, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 467 */ { VXInstructionMnemonic::PREFETCHT0, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 468 */ { VXInstructionMnemonic::PREFETCHT1, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 469 */ { VXInstructionMnemonic::PREFETCHT2, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 46A */ { VXInstructionMnemonic::PSADBW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 46B */ { VXInstructionMnemonic::PSADBW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 46C */ { VXInstructionMnemonic::PSHUFB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 46D */ { VXInstructionMnemonic::PSHUFB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 46E */ { VXInstructionMnemonic::PSHUFD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 46F */ { VXInstructionMnemonic::PSHUFHW, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 470 */ { VXInstructionMnemonic::PSHUFLW, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 471 */ { VXInstructionMnemonic::PSHUFW, { OPI_P, OPI_Q, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 472 */ { VXInstructionMnemonic::PSIGNB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 473 */ { VXInstructionMnemonic::PSIGNB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 474 */ { VXInstructionMnemonic::PSIGND, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 475 */ { VXInstructionMnemonic::PSIGND, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 476 */ { VXInstructionMnemonic::PSIGNW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 477 */ { VXInstructionMnemonic::PSIGNW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 478 */ { VXInstructionMnemonic::PSLLD, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 479 */ { VXInstructionMnemonic::PSLLD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 47A */ { VXInstructionMnemonic::PSLLD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 47B */ { VXInstructionMnemonic::PSLLD, { OPI_N, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 47C */ { VXInstructionMnemonic::PSLLDQ, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 47D */ { VXInstructionMnemonic::PSLLQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 47E */ { VXInstructionMnemonic::PSLLQ, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 47F */ { VXInstructionMnemonic::PSLLQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 480 */ { VXInstructionMnemonic::PSLLQ, { OPI_N, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 481 */ { VXInstructionMnemonic::PSLLW, { OPI_N, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 482 */ { VXInstructionMnemonic::PSLLW, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 483 */ { VXInstructionMnemonic::PSLLW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 484 */ { VXInstructionMnemonic::PSLLW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 485 */ { VXInstructionMnemonic::PSRAD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 486 */ { VXInstructionMnemonic::PSRAD, { OPI_N, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 487 */ { VXInstructionMnemonic::PSRAD, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 488 */ { VXInstructionMnemonic::PSRAD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 489 */ { VXInstructionMnemonic::PSRAW, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 48A */ { VXInstructionMnemonic::PSRAW, { OPI_N, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 48B */ { VXInstructionMnemonic::PSRAW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 48C */ { VXInstructionMnemonic::PSRAW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 48D */ { VXInstructionMnemonic::PSRLD, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 48E */ { VXInstructionMnemonic::PSRLD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 48F */ { VXInstructionMnemonic::PSRLD, { OPI_N, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 490 */ { VXInstructionMnemonic::PSRLD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 491 */ { VXInstructionMnemonic::PSRLDQ, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 492 */ { VXInstructionMnemonic::PSRLQ, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 493 */ { VXInstructionMnemonic::PSRLQ, { OPI_N, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 494 */ { VXInstructionMnemonic::PSRLQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 495 */ { VXInstructionMnemonic::PSRLQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 496 */ { VXInstructionMnemonic::PSRLW, { OPI_U, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 497 */ { VXInstructionMnemonic::PSRLW, { OPI_N, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 498 */ { VXInstructionMnemonic::PSRLW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 499 */ { VXInstructionMnemonic::PSRLW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 49A */ { VXInstructionMnemonic::PSUBB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 49B */ { VXInstructionMnemonic::PSUBB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 49C */ { VXInstructionMnemonic::PSUBD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 49D */ { VXInstructionMnemonic::PSUBD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 49E */ { VXInstructionMnemonic::PSUBQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 49F */ { VXInstructionMnemonic::PSUBQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A0 */ { VXInstructionMnemonic::PSUBSB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A1 */ { VXInstructionMnemonic::PSUBSB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A2 */ { VXInstructionMnemonic::PSUBSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A3 */ { VXInstructionMnemonic::PSUBSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A4 */ { VXInstructionMnemonic::PSUBUSB, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A5 */ { VXInstructionMnemonic::PSUBUSB, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A6 */ { VXInstructionMnemonic::PSUBUSW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A7 */ { VXInstructionMnemonic::PSUBUSW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A8 */ { VXInstructionMnemonic::PSUBW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4A9 */ { VXInstructionMnemonic::PSUBW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4AA */ { VXInstructionMnemonic::PSWAPD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4AB */ { VXInstructionMnemonic::PTEST, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4AC */ { VXInstructionMnemonic::PUNPCKHBW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4AD */ { VXInstructionMnemonic::PUNPCKHBW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4AE */ { VXInstructionMnemonic::PUNPCKHDQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4AF */ { VXInstructionMnemonic::PUNPCKHDQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B0 */ { VXInstructionMnemonic::PUNPCKHQDQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B1 */ { VXInstructionMnemonic::PUNPCKHWD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B2 */ { VXInstructionMnemonic::PUNPCKHWD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B3 */ { VXInstructionMnemonic::PUNPCKLBW, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B4 */ { VXInstructionMnemonic::PUNPCKLBW, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B5 */ { VXInstructionMnemonic::PUNPCKLDQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B6 */ { VXInstructionMnemonic::PUNPCKLDQ, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B7 */ { VXInstructionMnemonic::PUNPCKLQDQ, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B8 */ { VXInstructionMnemonic::PUNPCKLWD, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4B9 */ { VXInstructionMnemonic::PUNPCKLWD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4BA */ { VXInstructionMnemonic::PUSH, { OPI_DS, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 4BB */ { VXInstructionMnemonic::PUSH, { OPI_ES, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 4BC */ { VXInstructionMnemonic::PUSH, { OPI_Ib, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 4BD */ { VXInstructionMnemonic::PUSH, { OPI_SS, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 4BE */ { VXInstructionMnemonic::PUSH, { OPI_CS, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 4BF */ { VXInstructionMnemonic::PUSH, { OPI_R3v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4C0 */ { VXInstructionMnemonic::PUSH, { OPI_R4v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4C1 */ { VXInstructionMnemonic::PUSH, { OPI_R5v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4C2 */ { VXInstructionMnemonic::PUSH, { OPI_R6v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4C3 */ { VXInstructionMnemonic::PUSH, { OPI_R7v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4C4 */ { VXInstructionMnemonic::PUSH, { OPI_R2v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4C5 */ { VXInstructionMnemonic::PUSH, { OPI_R0v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4C6 */ { VXInstructionMnemonic::PUSH, { OPI_FS, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4C7 */ { VXInstructionMnemonic::PUSH, { OPI_GS, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4C8 */ { VXInstructionMnemonic::PUSH, { OPI_Iz, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_DEFAULT_64 }, + /* 4C9 */ { VXInstructionMnemonic::PUSH, { OPI_Ev, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4CA */ { VXInstructionMnemonic::PUSH, { OPI_R1v, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 4CB */ { VXInstructionMnemonic::PUSHA, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_INVALID_64 }, + /* 4CC */ { VXInstructionMnemonic::PUSHAD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_INVALID_64 }, + /* 4CD */ { VXInstructionMnemonic::PUSHFD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 4CE */ { VXInstructionMnemonic::PUSHFQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_DEFAULT_64 }, + /* 4CF */ { VXInstructionMnemonic::PUSHFQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_DEFAULT_64 }, + /* 4D0 */ { VXInstructionMnemonic::PUSHFW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_DEFAULT_64 }, + /* 4D1 */ { VXInstructionMnemonic::PUSHFW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE }, + /* 4D2 */ { VXInstructionMnemonic::PXOR, { OPI_P, OPI_Q, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4D3 */ { VXInstructionMnemonic::PXOR, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4D4 */ { VXInstructionMnemonic::RCL, { OPI_Eb, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4D5 */ { VXInstructionMnemonic::RCL, { OPI_Ev, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4D6 */ { VXInstructionMnemonic::RCL, { OPI_Ev, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4D7 */ { VXInstructionMnemonic::RCL, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4D8 */ { VXInstructionMnemonic::RCL, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4D9 */ { VXInstructionMnemonic::RCL, { OPI_Eb, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4DA */ { VXInstructionMnemonic::RCPPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4DB */ { VXInstructionMnemonic::RCPSS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4DC */ { VXInstructionMnemonic::RCR, { OPI_Ev, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4DD */ { VXInstructionMnemonic::RCR, { OPI_Ev, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4DE */ { VXInstructionMnemonic::RCR, { OPI_Eb, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4DF */ { VXInstructionMnemonic::RCR, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4E0 */ { VXInstructionMnemonic::RCR, { OPI_Eb, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4E1 */ { VXInstructionMnemonic::RCR, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4E2 */ { VXInstructionMnemonic::RDMSR, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4E3 */ { VXInstructionMnemonic::RDPMC, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4E4 */ { VXInstructionMnemonic::RDRAND, { OPI_R, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4E5 */ { VXInstructionMnemonic::RDTSC, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4E6 */ { VXInstructionMnemonic::RDTSCP, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4E7 */ { VXInstructionMnemonic::REP, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4E8 */ { VXInstructionMnemonic::REPNE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4E9 */ { VXInstructionMnemonic::RETF, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4EA */ { VXInstructionMnemonic::RETF, { OPI_Iw, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4EB */ { VXInstructionMnemonic::RETN, { OPI_Iw, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4EC */ { VXInstructionMnemonic::RETN, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4ED */ { VXInstructionMnemonic::ROL, { OPI_Eb, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4EE */ { VXInstructionMnemonic::ROL, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4EF */ { VXInstructionMnemonic::ROL, { OPI_Ev, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F0 */ { VXInstructionMnemonic::ROL, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F1 */ { VXInstructionMnemonic::ROL, { OPI_Ev, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F2 */ { VXInstructionMnemonic::ROL, { OPI_Eb, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F3 */ { VXInstructionMnemonic::ROR, { OPI_Eb, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F4 */ { VXInstructionMnemonic::ROR, { OPI_Ev, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F5 */ { VXInstructionMnemonic::ROR, { OPI_Eb, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F6 */ { VXInstructionMnemonic::ROR, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F7 */ { VXInstructionMnemonic::ROR, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F8 */ { VXInstructionMnemonic::ROR, { OPI_Ev, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4F9 */ { VXInstructionMnemonic::ROUNDPD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4FA */ { VXInstructionMnemonic::ROUNDPS, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4FB */ { VXInstructionMnemonic::ROUNDSD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4FC */ { VXInstructionMnemonic::ROUNDSS, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4FD */ { VXInstructionMnemonic::RSM, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 4FE */ { VXInstructionMnemonic::RSQRTPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 4FF */ { VXInstructionMnemonic::RSQRTSS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 500 */ { VXInstructionMnemonic::SAHF, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 501 */ { VXInstructionMnemonic::SALC, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_INVALID_64 }, + /* 502 */ { VXInstructionMnemonic::SAR, { OPI_Ev, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 503 */ { VXInstructionMnemonic::SAR, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 504 */ { VXInstructionMnemonic::SAR, { OPI_Ev, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 505 */ { VXInstructionMnemonic::SAR, { OPI_Eb, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 506 */ { VXInstructionMnemonic::SAR, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 507 */ { VXInstructionMnemonic::SAR, { OPI_Eb, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 508 */ { VXInstructionMnemonic::SBB, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_INVALID_64 }, + /* 509 */ { VXInstructionMnemonic::SBB, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 50A */ { VXInstructionMnemonic::SBB, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 50B */ { VXInstructionMnemonic::SBB, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 50C */ { VXInstructionMnemonic::SBB, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 50D */ { VXInstructionMnemonic::SBB, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 50E */ { VXInstructionMnemonic::SBB, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 50F */ { VXInstructionMnemonic::SBB, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 510 */ { VXInstructionMnemonic::SBB, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 511 */ { VXInstructionMnemonic::SBB, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 512 */ { VXInstructionMnemonic::SCASB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 513 */ { VXInstructionMnemonic::SCASD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 514 */ { VXInstructionMnemonic::SCASQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 515 */ { VXInstructionMnemonic::SCASW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 516 */ { VXInstructionMnemonic::SETA, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 517 */ { VXInstructionMnemonic::SETAE, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 518 */ { VXInstructionMnemonic::SETB, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 519 */ { VXInstructionMnemonic::SETBE, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 51A */ { VXInstructionMnemonic::SETG, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 51B */ { VXInstructionMnemonic::SETGE, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 51C */ { VXInstructionMnemonic::SETL, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 51D */ { VXInstructionMnemonic::SETLE, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 51E */ { VXInstructionMnemonic::SETNO, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 51F */ { VXInstructionMnemonic::SETNP, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 520 */ { VXInstructionMnemonic::SETNS, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 521 */ { VXInstructionMnemonic::SETNZ, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 522 */ { VXInstructionMnemonic::SETO, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 523 */ { VXInstructionMnemonic::SETP, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 524 */ { VXInstructionMnemonic::SETS, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 525 */ { VXInstructionMnemonic::SETZ, { OPI_Eb, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 526 */ { VXInstructionMnemonic::SFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 527 */ { VXInstructionMnemonic::SFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 528 */ { VXInstructionMnemonic::SFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 529 */ { VXInstructionMnemonic::SFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 52A */ { VXInstructionMnemonic::SFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 52B */ { VXInstructionMnemonic::SFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 52C */ { VXInstructionMnemonic::SFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 52D */ { VXInstructionMnemonic::SFENCE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 52E */ { VXInstructionMnemonic::SGDT, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 52F */ { VXInstructionMnemonic::SHL, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 530 */ { VXInstructionMnemonic::SHL, { OPI_Ev, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 531 */ { VXInstructionMnemonic::SHL, { OPI_Ev, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 532 */ { VXInstructionMnemonic::SHL, { OPI_Eb, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 533 */ { VXInstructionMnemonic::SHL, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 534 */ { VXInstructionMnemonic::SHL, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 535 */ { VXInstructionMnemonic::SHL, { OPI_Eb, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 536 */ { VXInstructionMnemonic::SHL, { OPI_Eb, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 537 */ { VXInstructionMnemonic::SHL, { OPI_Eb, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 538 */ { VXInstructionMnemonic::SHL, { OPI_Ev, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 539 */ { VXInstructionMnemonic::SHL, { OPI_Ev, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 53A */ { VXInstructionMnemonic::SHL, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 53B */ { VXInstructionMnemonic::SHLD, { OPI_Ev, OPI_Gv, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 53C */ { VXInstructionMnemonic::SHLD, { OPI_Ev, OPI_Gv, OPI_CL, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 53D */ { VXInstructionMnemonic::SHR, { OPI_Eb, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 53E */ { VXInstructionMnemonic::SHR, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 53F */ { VXInstructionMnemonic::SHR, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 540 */ { VXInstructionMnemonic::SHR, { OPI_Ev, OPI_CL, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 541 */ { VXInstructionMnemonic::SHR, { OPI_Ev, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 542 */ { VXInstructionMnemonic::SHR, { OPI_Eb, OPI_I1, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 543 */ { VXInstructionMnemonic::SHRD, { OPI_Ev, OPI_Gv, OPI_CL, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 544 */ { VXInstructionMnemonic::SHRD, { OPI_Ev, OPI_Gv, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 545 */ { VXInstructionMnemonic::SHUFPD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 546 */ { VXInstructionMnemonic::SHUFPS, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 547 */ { VXInstructionMnemonic::SIDT, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 548 */ { VXInstructionMnemonic::SKINIT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 549 */ { VXInstructionMnemonic::SLDT, { OPI_MwRv, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 54A */ { VXInstructionMnemonic::SMSW, { OPI_MwRv, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 54B */ { VXInstructionMnemonic::SMSW, { OPI_MwRv, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 54C */ { VXInstructionMnemonic::SQRTPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 54D */ { VXInstructionMnemonic::SQRTPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 54E */ { VXInstructionMnemonic::SQRTSD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 54F */ { VXInstructionMnemonic::SQRTSS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 550 */ { VXInstructionMnemonic::STC, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 551 */ { VXInstructionMnemonic::STD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 552 */ { VXInstructionMnemonic::STGI, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 553 */ { VXInstructionMnemonic::STI, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 554 */ { VXInstructionMnemonic::STMXCSR, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 555 */ { VXInstructionMnemonic::STOSB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 556 */ { VXInstructionMnemonic::STOSD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 557 */ { VXInstructionMnemonic::STOSQ, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 558 */ { VXInstructionMnemonic::STOSW, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REP_PREFIX |IDF_ACCEPTS_SEGMENT_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 559 */ { VXInstructionMnemonic::STR, { OPI_MwRv, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 55A */ { VXInstructionMnemonic::SUB, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 55B */ { VXInstructionMnemonic::SUB, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 55C */ { VXInstructionMnemonic::SUB, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 55D */ { VXInstructionMnemonic::SUB, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 55E */ { VXInstructionMnemonic::SUB, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_INVALID_64 }, + /* 55F */ { VXInstructionMnemonic::SUB, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 560 */ { VXInstructionMnemonic::SUB, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 561 */ { VXInstructionMnemonic::SUB, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 562 */ { VXInstructionMnemonic::SUB, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 563 */ { VXInstructionMnemonic::SUB, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 564 */ { VXInstructionMnemonic::SUBPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 565 */ { VXInstructionMnemonic::SUBPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 566 */ { VXInstructionMnemonic::SUBSD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 567 */ { VXInstructionMnemonic::SUBSS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 568 */ { VXInstructionMnemonic::SWAPGS, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 569 */ { VXInstructionMnemonic::SYSCALL, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 56A */ { VXInstructionMnemonic::SYSENTER, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 56B */ { VXInstructionMnemonic::SYSENTER, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 56C */ { VXInstructionMnemonic::SYSEXIT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 56D */ { VXInstructionMnemonic::SYSEXIT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 56E */ { VXInstructionMnemonic::SYSRET, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 56F */ { VXInstructionMnemonic::TEST, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 570 */ { VXInstructionMnemonic::TEST, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 571 */ { VXInstructionMnemonic::TEST, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 572 */ { VXInstructionMnemonic::TEST, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 573 */ { VXInstructionMnemonic::TEST, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 574 */ { VXInstructionMnemonic::TEST, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 575 */ { VXInstructionMnemonic::TEST, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 576 */ { VXInstructionMnemonic::TEST, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 577 */ { VXInstructionMnemonic::UCOMISD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 578 */ { VXInstructionMnemonic::UCOMISS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 579 */ { VXInstructionMnemonic::UD2, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 57A */ { VXInstructionMnemonic::UNPCKHPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 57B */ { VXInstructionMnemonic::UNPCKHPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 57C */ { VXInstructionMnemonic::UNPCKLPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 57D */ { VXInstructionMnemonic::UNPCKLPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 57E */ { VXInstructionMnemonic::VADDPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 57F */ { VXInstructionMnemonic::VADDPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 580 */ { VXInstructionMnemonic::VADDSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 581 */ { VXInstructionMnemonic::VADDSS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 582 */ { VXInstructionMnemonic::VADDSUBPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 583 */ { VXInstructionMnemonic::VADDSUBPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 584 */ { VXInstructionMnemonic::VAESDEC, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 585 */ { VXInstructionMnemonic::VAESDECLAST, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 586 */ { VXInstructionMnemonic::VAESENC, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 587 */ { VXInstructionMnemonic::VAESENCLAST, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 588 */ { VXInstructionMnemonic::VAESIMC, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 589 */ { VXInstructionMnemonic::VAESKEYGENASSIST, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 58A */ { VXInstructionMnemonic::VANDNPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 58B */ { VXInstructionMnemonic::VANDNPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 58C */ { VXInstructionMnemonic::VANDPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 58D */ { VXInstructionMnemonic::VANDPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 58E */ { VXInstructionMnemonic::VBLENDPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 58F */ { VXInstructionMnemonic::VBLENDPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 590 */ { VXInstructionMnemonic::VBLENDVPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Lx }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 591 */ { VXInstructionMnemonic::VBLENDVPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Lx }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 592 */ { VXInstructionMnemonic::VBROADCASTSD, { OPI_Vqq, OPI_Mq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 593 */ { VXInstructionMnemonic::VBROADCASTSS, { OPI_V, OPI_Md, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 594 */ { VXInstructionMnemonic::VCMPPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 595 */ { VXInstructionMnemonic::VCMPPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 596 */ { VXInstructionMnemonic::VCMPSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 597 */ { VXInstructionMnemonic::VCMPSS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 598 */ { VXInstructionMnemonic::VCOMISD, { OPI_Vsd, OPI_Wsd, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 599 */ { VXInstructionMnemonic::VCOMISS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 59A */ { VXInstructionMnemonic::VCVTDQ2PD, { OPI_Vx, OPI_Wdq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 59B */ { VXInstructionMnemonic::VCVTDQ2PS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 59C */ { VXInstructionMnemonic::VCVTPD2DQ, { OPI_Vdq, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 59D */ { VXInstructionMnemonic::VCVTPD2PS, { OPI_Vdq, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 59E */ { VXInstructionMnemonic::VCVTPS2DQ, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 59F */ { VXInstructionMnemonic::VCVTPS2PD, { OPI_Vx, OPI_Wdq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5A0 */ { VXInstructionMnemonic::VCVTSD2SI, { OPI_Gy, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5A1 */ { VXInstructionMnemonic::VCVTSD2SS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5A2 */ { VXInstructionMnemonic::VCVTSI2SD, { OPI_Vx, OPI_Hx, OPI_Ey, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5A3 */ { VXInstructionMnemonic::VCVTSI2SS, { OPI_Vx, OPI_Hx, OPI_Ey, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5A4 */ { VXInstructionMnemonic::VCVTSS2SD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5A5 */ { VXInstructionMnemonic::VCVTSS2SI, { OPI_Gy, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5A6 */ { VXInstructionMnemonic::VCVTTPD2DQ, { OPI_Vdq, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5A7 */ { VXInstructionMnemonic::VCVTTPS2DQ, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5A8 */ { VXInstructionMnemonic::VCVTTSD2SI, { OPI_Gy, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5A9 */ { VXInstructionMnemonic::VCVTTSS2SI, { OPI_Gy, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5AA */ { VXInstructionMnemonic::VDIVPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5AB */ { VXInstructionMnemonic::VDIVPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5AC */ { VXInstructionMnemonic::VDIVSD, { OPI_Vx, OPI_Hx, OPI_MqU, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5AD */ { VXInstructionMnemonic::VDIVSS, { OPI_Vx, OPI_Hx, OPI_MdU, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5AE */ { VXInstructionMnemonic::VDPPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5AF */ { VXInstructionMnemonic::VDPPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5B0 */ { VXInstructionMnemonic::VERR, { OPI_Ew, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5B1 */ { VXInstructionMnemonic::VERW, { OPI_Ew, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5B2 */ { VXInstructionMnemonic::VEXTRACTF128, { OPI_Wdq, OPI_Vqq, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5B3 */ { VXInstructionMnemonic::VEXTRACTPS, { OPI_MdRy, OPI_Vx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5B4 */ { VXInstructionMnemonic::VHADDPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5B5 */ { VXInstructionMnemonic::VHADDPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5B6 */ { VXInstructionMnemonic::VHSUBPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5B7 */ { VXInstructionMnemonic::VHSUBPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5B8 */ { VXInstructionMnemonic::VINSERTF128, { OPI_Vqq, OPI_Hqq, OPI_Wdq, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5B9 */ { VXInstructionMnemonic::VINSERTPS, { OPI_Vx, OPI_Hx, OPI_Md, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5BA */ { VXInstructionMnemonic::VLDDQU, { OPI_Vx, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5BB */ { VXInstructionMnemonic::VMASKMOVDQU, { OPI_Vx, OPI_Ux, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5BC */ { VXInstructionMnemonic::VMASKMOVPD, { OPI_V, OPI_H, OPI_M, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5BD */ { VXInstructionMnemonic::VMASKMOVPD, { OPI_M, OPI_H, OPI_V, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5BE */ { VXInstructionMnemonic::VMASKMOVPS, { OPI_M, OPI_H, OPI_V, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5BF */ { VXInstructionMnemonic::VMASKMOVPS, { OPI_V, OPI_H, OPI_M, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5C0 */ { VXInstructionMnemonic::VMAXPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5C1 */ { VXInstructionMnemonic::VMAXPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5C2 */ { VXInstructionMnemonic::VMAXSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5C3 */ { VXInstructionMnemonic::VMAXSS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5C4 */ { VXInstructionMnemonic::VMCALL, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 5C5 */ { VXInstructionMnemonic::VMCLEAR, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5C6 */ { VXInstructionMnemonic::VMINPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5C7 */ { VXInstructionMnemonic::VMINPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5C8 */ { VXInstructionMnemonic::VMINSD, { OPI_Vx, OPI_Hx, OPI_MqU, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5C9 */ { VXInstructionMnemonic::VMINSS, { OPI_Vx, OPI_Hx, OPI_MdU, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5CA */ { VXInstructionMnemonic::VMLAUNCH, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 5CB */ { VXInstructionMnemonic::VMLOAD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 5CC */ { VXInstructionMnemonic::VMMCALL, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 5CD */ { VXInstructionMnemonic::VMOVAPD, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5CE */ { VXInstructionMnemonic::VMOVAPD, { OPI_Wx, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5CF */ { VXInstructionMnemonic::VMOVAPS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5D0 */ { VXInstructionMnemonic::VMOVAPS, { OPI_Wx, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5D1 */ { VXInstructionMnemonic::VMOVD, { OPI_Vx, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5D2 */ { VXInstructionMnemonic::VMOVD, { OPI_Ey, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5D3 */ { VXInstructionMnemonic::VMOVD, { OPI_Vx, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5D4 */ { VXInstructionMnemonic::VMOVD, { OPI_Ey, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5D5 */ { VXInstructionMnemonic::VMOVDDUP, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5D6 */ { VXInstructionMnemonic::VMOVDDUP, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5D7 */ { VXInstructionMnemonic::VMOVDQA, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5D8 */ { VXInstructionMnemonic::VMOVDQA, { OPI_Wx, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5D9 */ { VXInstructionMnemonic::VMOVDQU, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5DA */ { VXInstructionMnemonic::VMOVHLPS, { OPI_Vx, OPI_Ux, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5DB */ { VXInstructionMnemonic::VMOVHPD, { OPI_Vx, OPI_Hx, OPI_M, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5DC */ { VXInstructionMnemonic::VMOVHPD, { OPI_M, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5DD */ { VXInstructionMnemonic::VMOVHPS, { OPI_M, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5DE */ { VXInstructionMnemonic::VMOVHPS, { OPI_Vx, OPI_Hx, OPI_M, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5DF */ { VXInstructionMnemonic::VMOVLHPS, { OPI_Vx, OPI_Hx, OPI_Ux, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5E0 */ { VXInstructionMnemonic::VMOVLPD, { OPI_M, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5E1 */ { VXInstructionMnemonic::VMOVLPD, { OPI_Vx, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5E2 */ { VXInstructionMnemonic::VMOVLPS, { OPI_M, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5E3 */ { VXInstructionMnemonic::VMOVLPS, { OPI_Vx, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5E4 */ { VXInstructionMnemonic::VMOVMSKPD, { OPI_Gd, OPI_Ux, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5E5 */ { VXInstructionMnemonic::VMOVMSKPS, { OPI_Gd, OPI_Ux, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB }, + /* 5E6 */ { VXInstructionMnemonic::VMOVNTDQ, { OPI_M, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5E7 */ { VXInstructionMnemonic::VMOVNTDQA, { OPI_Vx, OPI_M, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5E8 */ { VXInstructionMnemonic::VMOVNTPD, { OPI_M, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5E9 */ { VXInstructionMnemonic::VMOVNTPS, { OPI_M, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5EA */ { VXInstructionMnemonic::VMOVQ, { OPI_Eq, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5EB */ { VXInstructionMnemonic::VMOVQ, { OPI_Wx, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5EC */ { VXInstructionMnemonic::VMOVQ, { OPI_Vx, OPI_Eq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5ED */ { VXInstructionMnemonic::VMOVQ, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5EE */ { VXInstructionMnemonic::VMOVSD, { OPI_V, OPI_Mq, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5EF */ { VXInstructionMnemonic::VMOVSD, { OPI_V, OPI_H, OPI_U, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5F0 */ { VXInstructionMnemonic::VMOVSD, { OPI_U, OPI_H, OPI_V, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5F1 */ { VXInstructionMnemonic::VMOVSD, { OPI_Mq, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5F2 */ { VXInstructionMnemonic::VMOVSHDUP, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5F3 */ { VXInstructionMnemonic::VMOVSHDUP, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5F4 */ { VXInstructionMnemonic::VMOVSLDUP, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5F5 */ { VXInstructionMnemonic::VMOVSLDUP, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5F6 */ { VXInstructionMnemonic::VMOVSS, { OPI_V, OPI_H, OPI_U, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5F7 */ { VXInstructionMnemonic::VMOVSS, { OPI_U, OPI_H, OPI_V, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5F8 */ { VXInstructionMnemonic::VMOVSS, { OPI_V, OPI_Md, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5F9 */ { VXInstructionMnemonic::VMOVSS, { OPI_Md, OPI_V, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 5FA */ { VXInstructionMnemonic::VMOVUPD, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5FB */ { VXInstructionMnemonic::VMOVUPD, { OPI_Wx, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5FC */ { VXInstructionMnemonic::VMOVUPS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5FD */ { VXInstructionMnemonic::VMOVUPS, { OPI_Wx, OPI_Vx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5FE */ { VXInstructionMnemonic::VMPSADBW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 5FF */ { VXInstructionMnemonic::VMPTRLD, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 600 */ { VXInstructionMnemonic::VMPTRST, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 601 */ { VXInstructionMnemonic::VMREAD, { OPI_Ey, OPI_Gy, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 602 */ { VXInstructionMnemonic::VMRESUME, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 603 */ { VXInstructionMnemonic::VMRUN, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 604 */ { VXInstructionMnemonic::VMSAVE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 605 */ { VXInstructionMnemonic::VMULPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 606 */ { VXInstructionMnemonic::VMULPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 607 */ { VXInstructionMnemonic::VMULSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 608 */ { VXInstructionMnemonic::VMULSS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 609 */ { VXInstructionMnemonic::VMWRITE, { OPI_Gy, OPI_Ey, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 60A */ { VXInstructionMnemonic::VMXOFF, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 60B */ { VXInstructionMnemonic::VMXON, { OPI_Mq, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 60C */ { VXInstructionMnemonic::VORPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 60D */ { VXInstructionMnemonic::VORPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 60E */ { VXInstructionMnemonic::VPABSB, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 60F */ { VXInstructionMnemonic::VPABSD, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 610 */ { VXInstructionMnemonic::VPABSW, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 611 */ { VXInstructionMnemonic::VPACKSSDW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 612 */ { VXInstructionMnemonic::VPACKSSWB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 613 */ { VXInstructionMnemonic::VPACKUSDW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 614 */ { VXInstructionMnemonic::VPACKUSWB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 615 */ { VXInstructionMnemonic::VPADDB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 616 */ { VXInstructionMnemonic::VPADDD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 617 */ { VXInstructionMnemonic::VPADDQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 618 */ { VXInstructionMnemonic::VPADDSB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 619 */ { VXInstructionMnemonic::VPADDSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 61A */ { VXInstructionMnemonic::VPADDUSB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 61B */ { VXInstructionMnemonic::VPADDUSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 61C */ { VXInstructionMnemonic::VPADDW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 61D */ { VXInstructionMnemonic::VPALIGNR, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 61E */ { VXInstructionMnemonic::VPAND, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 61F */ { VXInstructionMnemonic::VPANDN, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 620 */ { VXInstructionMnemonic::VPAVGB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 621 */ { VXInstructionMnemonic::VPAVGW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 622 */ { VXInstructionMnemonic::VPBLENDVB, { OPI_V, OPI_H, OPI_W, OPI_L }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 623 */ { VXInstructionMnemonic::VPBLENDW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 624 */ { VXInstructionMnemonic::VPCLMULQDQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 625 */ { VXInstructionMnemonic::VPCMPEQB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 626 */ { VXInstructionMnemonic::VPCMPEQD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 627 */ { VXInstructionMnemonic::VPCMPEQQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 628 */ { VXInstructionMnemonic::VPCMPEQW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 629 */ { VXInstructionMnemonic::VPCMPESTRI, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 62A */ { VXInstructionMnemonic::VPCMPESTRM, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 62B */ { VXInstructionMnemonic::VPCMPGTB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 62C */ { VXInstructionMnemonic::VPCMPGTD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 62D */ { VXInstructionMnemonic::VPCMPGTQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 62E */ { VXInstructionMnemonic::VPCMPGTW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 62F */ { VXInstructionMnemonic::VPCMPISTRI, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 630 */ { VXInstructionMnemonic::VPCMPISTRM, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 631 */ { VXInstructionMnemonic::VPERM2F128, { OPI_Vqq, OPI_Hqq, OPI_Wqq, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 632 */ { VXInstructionMnemonic::VPERMILPD, { OPI_V, OPI_W, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 633 */ { VXInstructionMnemonic::VPERMILPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 634 */ { VXInstructionMnemonic::VPERMILPS, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 635 */ { VXInstructionMnemonic::VPERMILPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 636 */ { VXInstructionMnemonic::VPEXTRB, { OPI_MbRv, OPI_Vx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 637 */ { VXInstructionMnemonic::VPEXTRD, { OPI_Ed, OPI_Vx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 638 */ { VXInstructionMnemonic::VPEXTRD, { OPI_Ed, OPI_Vx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 639 */ { VXInstructionMnemonic::VPEXTRQ, { OPI_Eq, OPI_Vx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 63A */ { VXInstructionMnemonic::VPEXTRW, { OPI_MwRd, OPI_Vx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB }, + /* 63B */ { VXInstructionMnemonic::VPEXTRW, { OPI_Gd, OPI_Ux, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXB }, + /* 63C */ { VXInstructionMnemonic::VPHADDD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 63D */ { VXInstructionMnemonic::VPHADDSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 63E */ { VXInstructionMnemonic::VPHADDW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 63F */ { VXInstructionMnemonic::VPHMINPOSUW, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 640 */ { VXInstructionMnemonic::VPHSUBD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 641 */ { VXInstructionMnemonic::VPHSUBSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 642 */ { VXInstructionMnemonic::VPHSUBW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 643 */ { VXInstructionMnemonic::VPINSRB, { OPI_V, OPI_H, OPI_MbRd, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 644 */ { VXInstructionMnemonic::VPINSRD, { OPI_V, OPI_H, OPI_Ed, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 645 */ { VXInstructionMnemonic::VPINSRD, { OPI_V, OPI_H, OPI_Ed, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 646 */ { VXInstructionMnemonic::VPINSRQ, { OPI_V, OPI_H, OPI_Eq, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 647 */ { VXInstructionMnemonic::VPINSRW, { OPI_Vx, OPI_MwRy, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_DEFAULT_64 }, + /* 648 */ { VXInstructionMnemonic::VPMADDUBSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 649 */ { VXInstructionMnemonic::VPMADDWD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 64A */ { VXInstructionMnemonic::VPMAXSB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 64B */ { VXInstructionMnemonic::VPMAXSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 64C */ { VXInstructionMnemonic::VPMAXSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 64D */ { VXInstructionMnemonic::VPMAXUB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 64E */ { VXInstructionMnemonic::VPMAXUD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 64F */ { VXInstructionMnemonic::VPMAXUW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 650 */ { VXInstructionMnemonic::VPMINSB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 651 */ { VXInstructionMnemonic::VPMINSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 652 */ { VXInstructionMnemonic::VPMINSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 653 */ { VXInstructionMnemonic::VPMINUB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 654 */ { VXInstructionMnemonic::VPMINUD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 655 */ { VXInstructionMnemonic::VPMINUW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 656 */ { VXInstructionMnemonic::VPMOVMSKB, { OPI_Gd, OPI_Ux, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 657 */ { VXInstructionMnemonic::VPMOVSXBD, { OPI_Vx, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 658 */ { VXInstructionMnemonic::VPMOVSXBQ, { OPI_Vx, OPI_MwU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 659 */ { VXInstructionMnemonic::VPMOVSXBW, { OPI_Vx, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 65A */ { VXInstructionMnemonic::VPMOVSXWD, { OPI_Vx, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 65B */ { VXInstructionMnemonic::VPMOVSXWQ, { OPI_Vx, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 65C */ { VXInstructionMnemonic::VPMOVZXBD, { OPI_Vx, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 65D */ { VXInstructionMnemonic::VPMOVZXBQ, { OPI_Vx, OPI_MwU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 65E */ { VXInstructionMnemonic::VPMOVZXBW, { OPI_Vx, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 65F */ { VXInstructionMnemonic::VPMOVZXDQ, { OPI_Vx, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 660 */ { VXInstructionMnemonic::VPMOVZXWD, { OPI_Vx, OPI_MqU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 661 */ { VXInstructionMnemonic::VPMOVZXWQ, { OPI_Vx, OPI_MdU, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 662 */ { VXInstructionMnemonic::VPMULDQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 663 */ { VXInstructionMnemonic::VPMULHRSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 664 */ { VXInstructionMnemonic::VPMULHUW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 665 */ { VXInstructionMnemonic::VPMULHW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 666 */ { VXInstructionMnemonic::VPMULLD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 667 */ { VXInstructionMnemonic::VPMULLW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 668 */ { VXInstructionMnemonic::VPOR, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 669 */ { VXInstructionMnemonic::VPSADBW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 66A */ { VXInstructionMnemonic::VPSHUFB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 66B */ { VXInstructionMnemonic::VPSHUFD, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 66C */ { VXInstructionMnemonic::VPSHUFHW, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 66D */ { VXInstructionMnemonic::VPSHUFLW, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 66E */ { VXInstructionMnemonic::VPSIGNB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 66F */ { VXInstructionMnemonic::VPSIGND, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 670 */ { VXInstructionMnemonic::VPSIGNW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 671 */ { VXInstructionMnemonic::VPSLLD, { OPI_V, OPI_H, OPI_W, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 672 */ { VXInstructionMnemonic::VPSLLD, { OPI_H, OPI_V, OPI_W, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 673 */ { VXInstructionMnemonic::VPSLLDQ, { OPI_Hx, OPI_Ux, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 674 */ { VXInstructionMnemonic::VPSLLQ, { OPI_V, OPI_H, OPI_W, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 675 */ { VXInstructionMnemonic::VPSLLQ, { OPI_H, OPI_V, OPI_W, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 676 */ { VXInstructionMnemonic::VPSLLW, { OPI_V, OPI_H, OPI_W, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 677 */ { VXInstructionMnemonic::VPSLLW, { OPI_H, OPI_V, OPI_W, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 678 */ { VXInstructionMnemonic::VPSRAD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 679 */ { VXInstructionMnemonic::VPSRAD, { OPI_Hx, OPI_Ux, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 67A */ { VXInstructionMnemonic::VPSRAW, { OPI_Hx, OPI_Ux, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 67B */ { VXInstructionMnemonic::VPSRAW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 67C */ { VXInstructionMnemonic::VPSRLD, { OPI_Hx, OPI_Ux, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 67D */ { VXInstructionMnemonic::VPSRLD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 67E */ { VXInstructionMnemonic::VPSRLDQ, { OPI_Hx, OPI_Ux, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 67F */ { VXInstructionMnemonic::VPSRLQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 680 */ { VXInstructionMnemonic::VPSRLQ, { OPI_Hx, OPI_Ux, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 681 */ { VXInstructionMnemonic::VPSRLW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 682 */ { VXInstructionMnemonic::VPSRLW, { OPI_Hx, OPI_Ux, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_REXB }, + /* 683 */ { VXInstructionMnemonic::VPSUBB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 684 */ { VXInstructionMnemonic::VPSUBD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 685 */ { VXInstructionMnemonic::VPSUBQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 686 */ { VXInstructionMnemonic::VPSUBSB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 687 */ { VXInstructionMnemonic::VPSUBSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 688 */ { VXInstructionMnemonic::VPSUBUSB, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 689 */ { VXInstructionMnemonic::VPSUBUSW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 68A */ { VXInstructionMnemonic::VPSUBW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 68B */ { VXInstructionMnemonic::VPTEST, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 68C */ { VXInstructionMnemonic::VPUNPCKHBW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 68D */ { VXInstructionMnemonic::VPUNPCKHDQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 68E */ { VXInstructionMnemonic::VPUNPCKHQDQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 68F */ { VXInstructionMnemonic::VPUNPCKHWD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 690 */ { VXInstructionMnemonic::VPUNPCKLBW, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 691 */ { VXInstructionMnemonic::VPUNPCKLDQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 692 */ { VXInstructionMnemonic::VPUNPCKLQDQ, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 693 */ { VXInstructionMnemonic::VPUNPCKLWD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 694 */ { VXInstructionMnemonic::VPXOR, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 695 */ { VXInstructionMnemonic::VRCPPS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 696 */ { VXInstructionMnemonic::VRCPSS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 697 */ { VXInstructionMnemonic::VROUNDPD, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 698 */ { VXInstructionMnemonic::VROUNDPS, { OPI_Vx, OPI_Wx, OPI_Ib, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 699 */ { VXInstructionMnemonic::VROUNDSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 69A */ { VXInstructionMnemonic::VROUNDSS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 69B */ { VXInstructionMnemonic::VRSQRTPS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 69C */ { VXInstructionMnemonic::VRSQRTSS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 69D */ { VXInstructionMnemonic::VSHUFPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 69E */ { VXInstructionMnemonic::VSHUFPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_Ib }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 69F */ { VXInstructionMnemonic::VSQRTPD, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6A0 */ { VXInstructionMnemonic::VSQRTPS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 6A1 */ { VXInstructionMnemonic::VSQRTSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6A2 */ { VXInstructionMnemonic::VSQRTSS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6A3 */ { VXInstructionMnemonic::VSTMXCSR, { OPI_Md, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6A4 */ { VXInstructionMnemonic::VSUBPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 6A5 */ { VXInstructionMnemonic::VSUBPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 6A6 */ { VXInstructionMnemonic::VSUBSD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6A7 */ { VXInstructionMnemonic::VSUBSS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6A8 */ { VXInstructionMnemonic::VTESTPD, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 6A9 */ { VXInstructionMnemonic::VTESTPS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 6AA */ { VXInstructionMnemonic::VUCOMISD, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6AB */ { VXInstructionMnemonic::VUCOMISS, { OPI_Vx, OPI_Wx, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6AC */ { VXInstructionMnemonic::VUNPCKHPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 6AD */ { VXInstructionMnemonic::VUNPCKHPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6AE */ { VXInstructionMnemonic::VUNPCKLPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 6AF */ { VXInstructionMnemonic::VUNPCKLPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6B0 */ { VXInstructionMnemonic::VXORPD, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_ACCEPTS_VEXL }, + /* 6B1 */ { VXInstructionMnemonic::VXORPS, { OPI_Vx, OPI_Hx, OPI_Wx, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6B2 */ { VXInstructionMnemonic::VZEROALL, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6B3 */ { VXInstructionMnemonic::VZEROUPPER, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6B4 */ { VXInstructionMnemonic::WAIT, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6B5 */ { VXInstructionMnemonic::WBINVD, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6B6 */ { VXInstructionMnemonic::WRMSR, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6B7 */ { VXInstructionMnemonic::XADD, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6B8 */ { VXInstructionMnemonic::XADD, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6B9 */ { VXInstructionMnemonic::XCHG, { OPI_R1v, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 6BA */ { VXInstructionMnemonic::XCHG, { OPI_R2v, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 6BB */ { VXInstructionMnemonic::XCHG, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6BC */ { VXInstructionMnemonic::XCHG, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6BD */ { VXInstructionMnemonic::XCHG, { OPI_R0v, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 6BE */ { VXInstructionMnemonic::XCHG, { OPI_R7v, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 6BF */ { VXInstructionMnemonic::XCHG, { OPI_R5v, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 6C0 */ { VXInstructionMnemonic::XCHG, { OPI_R6v, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 6C1 */ { VXInstructionMnemonic::XCHG, { OPI_R3v, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 6C2 */ { VXInstructionMnemonic::XCHG, { OPI_R4v, OPI_rAX, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXB }, + /* 6C3 */ { VXInstructionMnemonic::XCRYPTCBC, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6C4 */ { VXInstructionMnemonic::XCRYPTCFB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6C5 */ { VXInstructionMnemonic::XCRYPTCTR, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6C6 */ { VXInstructionMnemonic::XCRYPTECB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6C7 */ { VXInstructionMnemonic::XCRYPTOFB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6C8 */ { VXInstructionMnemonic::XGETBV, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6C9 */ { VXInstructionMnemonic::XLATB, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_REXW | IDF_ACCEPTS_SEGMENT_OVERRIDE }, + /* 6CA */ { VXInstructionMnemonic::XOR, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6CB */ { VXInstructionMnemonic::XOR, { OPI_rAX, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW }, + /* 6CC */ { VXInstructionMnemonic::XOR, { OPI_AL, OPI_Ib, OPI_NONE, OPI_NONE }, 0 }, + /* 6CD */ { VXInstructionMnemonic::XOR, { OPI_Ev, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6CE */ { VXInstructionMnemonic::XOR, { OPI_Eb, OPI_Ib, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB | IDF_INVALID_64 }, + /* 6CF */ { VXInstructionMnemonic::XOR, { OPI_Ev, OPI_Iz, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D0 */ { VXInstructionMnemonic::XOR, { OPI_Gb, OPI_Eb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D1 */ { VXInstructionMnemonic::XOR, { OPI_Ev, OPI_Gv, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D2 */ { VXInstructionMnemonic::XOR, { OPI_Eb, OPI_Gb, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D3 */ { VXInstructionMnemonic::XOR, { OPI_Gv, OPI_Ev, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D4 */ { VXInstructionMnemonic::XORPD, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D5 */ { VXInstructionMnemonic::XORPS, { OPI_V, OPI_W, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D6 */ { VXInstructionMnemonic::XRSTOR, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D7 */ { VXInstructionMnemonic::XSAVE, { OPI_M, OPI_NONE, OPI_NONE, OPI_NONE }, IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE | IDF_ACCEPTS_REXW | IDF_ACCEPTS_REXR | IDF_ACCEPTS_REXX | IDF_ACCEPTS_REXB }, + /* 6D8 */ { VXInstructionMnemonic::XSETBV, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6D9 */ { VXInstructionMnemonic::XSHA1, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6DA */ { VXInstructionMnemonic::XSHA256, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, + /* 6DB */ { VXInstructionMnemonic::XSTORE, { OPI_NONE, OPI_NONE, OPI_NONE, OPI_NONE }, 0 }, +}; + +#undef OPI_NONE +#undef OPI_AL +#undef OPI_AX +#undef OPI_Av +#undef OPI_C +#undef OPI_CL +#undef OPI_CS +#undef OPI_CX +#undef OPI_D +#undef OPI_DL +#undef OPI_DS +#undef OPI_DX +#undef OPI_E +#undef OPI_ES +#undef OPI_Eb +#undef OPI_Ed +#undef OPI_Eq +#undef OPI_Ev +#undef OPI_Ew +#undef OPI_Ey +#undef OPI_Ez +#undef OPI_FS +#undef OPI_Fv +#undef OPI_G +#undef OPI_GS +#undef OPI_Gb +#undef OPI_Gd +#undef OPI_Gq +#undef OPI_Gv +#undef OPI_Gw +#undef OPI_Gy +#undef OPI_Gz +#undef OPI_H +#undef OPI_Hqq +#undef OPI_Hx +#undef OPI_I1 +#undef OPI_Ib +#undef OPI_Iv +#undef OPI_Iw +#undef OPI_Iz +#undef OPI_Jb +#undef OPI_Jv +#undef OPI_Jz +#undef OPI_L +#undef OPI_Lx +#undef OPI_M +#undef OPI_Mb +#undef OPI_MbRd +#undef OPI_MbRv +#undef OPI_Md +#undef OPI_MdRy +#undef OPI_MdU +#undef OPI_Mdq +#undef OPI_Mo +#undef OPI_Mq +#undef OPI_MqU +#undef OPI_Ms +#undef OPI_Mt +#undef OPI_Mv +#undef OPI_Mw +#undef OPI_MwRd +#undef OPI_MwRv +#undef OPI_MwRy +#undef OPI_MwU +#undef OPI_N +#undef OPI_Ob +#undef OPI_Ov +#undef OPI_Ow +#undef OPI_P +#undef OPI_Q +#undef OPI_R +#undef OPI_R0b +#undef OPI_R0v +#undef OPI_R0w +#undef OPI_R0y +#undef OPI_R0z +#undef OPI_R1b +#undef OPI_R1v +#undef OPI_R1w +#undef OPI_R1y +#undef OPI_R1z +#undef OPI_R2b +#undef OPI_R2v +#undef OPI_R2w +#undef OPI_R2y +#undef OPI_R2z +#undef OPI_R3b +#undef OPI_R3v +#undef OPI_R3w +#undef OPI_R3y +#undef OPI_R3z +#undef OPI_R4b +#undef OPI_R4v +#undef OPI_R4w +#undef OPI_R4y +#undef OPI_R4z +#undef OPI_R5b +#undef OPI_R5v +#undef OPI_R5w +#undef OPI_R5y +#undef OPI_R5z +#undef OPI_R6b +#undef OPI_R6v +#undef OPI_R6w +#undef OPI_R6y +#undef OPI_R6z +#undef OPI_R7b +#undef OPI_R7v +#undef OPI_R7w +#undef OPI_R7y +#undef OPI_R7z +#undef OPI_S +#undef OPI_SS +#undef OPI_ST0 +#undef OPI_ST1 +#undef OPI_ST2 +#undef OPI_ST3 +#undef OPI_ST4 +#undef OPI_ST5 +#undef OPI_ST6 +#undef OPI_ST7 +#undef OPI_U +#undef OPI_Ux +#undef OPI_V +#undef OPI_Vdq +#undef OPI_Vqq +#undef OPI_Vsd +#undef OPI_Vx +#undef OPI_W +#undef OPI_Wdq +#undef OPI_Wqq +#undef OPI_Wsd +#undef OPI_Wx +#undef OPI_eAX +#undef OPI_eCX +#undef OPI_eDX +#undef OPI_rAX +#undef OPI_rCX +#undef OPI_rDX + +const char* instrMnemonicStrings[] = +{ + /* 000 */ "invalid", + /* 001 */ "aaa", + /* 002 */ "aad", + /* 003 */ "aam", + /* 004 */ "aas", + /* 005 */ "adc", + /* 006 */ "add", + /* 007 */ "addpd", + /* 008 */ "addps", + /* 009 */ "addsd", + /* 00A */ "addss", + /* 00B */ "addsubpd", + /* 00C */ "addsubps", + /* 00D */ "aesdec", + /* 00E */ "aesdeclast", + /* 00F */ "aesenc", + /* 010 */ "aesenclast", + /* 011 */ "aesimc", + /* 012 */ "aeskeygenassist", + /* 013 */ "and", + /* 014 */ "andnpd", + /* 015 */ "andnps", + /* 016 */ "andpd", + /* 017 */ "andps", + /* 018 */ "arpl", + /* 019 */ "blendpd", + /* 01A */ "blendps", + /* 01B */ "blendvpd", + /* 01C */ "blendvps", + /* 01D */ "bound", + /* 01E */ "bsf", + /* 01F */ "bsr", + /* 020 */ "bswap", + /* 021 */ "bt", + /* 022 */ "btc", + /* 023 */ "btr", + /* 024 */ "bts", + /* 025 */ "call", + /* 026 */ "cbw", + /* 027 */ "cdq", + /* 028 */ "cdqe", + /* 029 */ "clc", + /* 02A */ "cld", + /* 02B */ "clflush", + /* 02C */ "clgi", + /* 02D */ "cli", + /* 02E */ "clts", + /* 02F */ "cmc", + /* 030 */ "cmova", + /* 031 */ "cmovae", + /* 032 */ "cmovb", + /* 033 */ "cmovbe", + /* 034 */ "cmovg", + /* 035 */ "cmovge", + /* 036 */ "cmovl", + /* 037 */ "cmovle", + /* 038 */ "cmovno", + /* 039 */ "cmovnp", + /* 03A */ "cmovns", + /* 03B */ "cmovnz", + /* 03C */ "cmovo", + /* 03D */ "cmovp", + /* 03E */ "cmovs", + /* 03F */ "cmovz", + /* 040 */ "cmp", + /* 041 */ "cmppd", + /* 042 */ "cmpps", + /* 043 */ "cmpsb", + /* 044 */ "cmpsd", + /* 045 */ "cmpsq", + /* 046 */ "cmpss", + /* 047 */ "cmpsw", + /* 048 */ "cmpxchg", + /* 049 */ "cmpxchg16b", + /* 04A */ "cmpxchg8b", + /* 04B */ "comisd", + /* 04C */ "comiss", + /* 04D */ "cpuid", + /* 04E */ "cqo", + /* 04F */ "crc32", + /* 050 */ "cvtdq2pd", + /* 051 */ "cvtdq2ps", + /* 052 */ "cvtpd2dq", + /* 053 */ "cvtpd2pi", + /* 054 */ "cvtpd2ps", + /* 055 */ "cvtpi2pd", + /* 056 */ "cvtpi2ps", + /* 057 */ "cvtps2dq", + /* 058 */ "cvtps2pd", + /* 059 */ "cvtps2pi", + /* 05A */ "cvtsd2si", + /* 05B */ "cvtsd2ss", + /* 05C */ "cvtsi2sd", + /* 05D */ "cvtsi2ss", + /* 05E */ "cvtss2sd", + /* 05F */ "cvtss2si", + /* 060 */ "cvttpd2dq", + /* 061 */ "cvttpd2pi", + /* 062 */ "cvttps2dq", + /* 063 */ "cvttps2pi", + /* 064 */ "cvttsd2si", + /* 065 */ "cvttss2si", + /* 066 */ "cwd", + /* 067 */ "cwde", + /* 068 */ "daa", + /* 069 */ "das", + /* 06A */ "dec", + /* 06B */ "div", + /* 06C */ "divpd", + /* 06D */ "divps", + /* 06E */ "divsd", + /* 06F */ "divss", + /* 070 */ "dppd", + /* 071 */ "dpps", + /* 072 */ "emms", + /* 073 */ "enter", + /* 074 */ "extractps", + /* 075 */ "f2xm1", + /* 076 */ "fabs", + /* 077 */ "fadd", + /* 078 */ "faddp", + /* 079 */ "fbld", + /* 07A */ "fbstp", + /* 07B */ "fchs", + /* 07C */ "fclex", + /* 07D */ "fcmovb", + /* 07E */ "fcmovbe", + /* 07F */ "fcmove", + /* 080 */ "fcmovnb", + /* 081 */ "fcmovnbe", + /* 082 */ "fcmovne", + /* 083 */ "fcmovnu", + /* 084 */ "fcmovu", + /* 085 */ "fcom", + /* 086 */ "fcom2", + /* 087 */ "fcomi", + /* 088 */ "fcomip", + /* 089 */ "fcomp", + /* 08A */ "fcomp3", + /* 08B */ "fcomp5", + /* 08C */ "fcompp", + /* 08D */ "fcos", + /* 08E */ "fdecstp", + /* 08F */ "fdiv", + /* 090 */ "fdivp", + /* 091 */ "fdivr", + /* 092 */ "fdivrp", + /* 093 */ "femms", + /* 094 */ "ffree", + /* 095 */ "ffreep", + /* 096 */ "fiadd", + /* 097 */ "ficom", + /* 098 */ "ficomp", + /* 099 */ "fidiv", + /* 09A */ "fidivr", + /* 09B */ "fild", + /* 09C */ "fimul", + /* 09D */ "fincstp", + /* 09E */ "fist", + /* 09F */ "fistp", + /* 0A0 */ "fisttp", + /* 0A1 */ "fisub", + /* 0A2 */ "fisubr", + /* 0A3 */ "fld", + /* 0A4 */ "fld1", + /* 0A5 */ "fldcw", + /* 0A6 */ "fldenv", + /* 0A7 */ "fldl2e", + /* 0A8 */ "fldl2t", + /* 0A9 */ "fldlg2", + /* 0AA */ "fldln2", + /* 0AB */ "fldpi", + /* 0AC */ "fldz", + /* 0AD */ "fmul", + /* 0AE */ "fmulp", + /* 0AF */ "fninit", + /* 0B0 */ "fnop", + /* 0B1 */ "fnsave", + /* 0B2 */ "fnstcw", + /* 0B3 */ "fnstenv", + /* 0B4 */ "fnstsw", + /* 0B5 */ "fpatan", + /* 0B6 */ "fprem", + /* 0B7 */ "fprem1", + /* 0B8 */ "fptan", + /* 0B9 */ "frndint", + /* 0BA */ "frstor", + /* 0BB */ "fscale", + /* 0BC */ "fsin", + /* 0BD */ "fsincos", + /* 0BE */ "fsqrt", + /* 0BF */ "fst", + /* 0C0 */ "fstp", + /* 0C1 */ "fstp1", + /* 0C2 */ "fstp8", + /* 0C3 */ "fstp9", + /* 0C4 */ "fsub", + /* 0C5 */ "fsubp", + /* 0C6 */ "fsubr", + /* 0C7 */ "fsubrp", + /* 0C8 */ "ftst", + /* 0C9 */ "fucom", + /* 0CA */ "fucomi", + /* 0CB */ "fucomip", + /* 0CC */ "fucomp", + /* 0CD */ "fucompp", + /* 0CE */ "fxam", + /* 0CF */ "fxch", + /* 0D0 */ "fxch4", + /* 0D1 */ "fxch7", + /* 0D2 */ "fxrstor", + /* 0D3 */ "fxsave", + /* 0D4 */ "fxtract", + /* 0D5 */ "fyl2x", + /* 0D6 */ "fyl2xp1", + /* 0D7 */ "getsec", + /* 0D8 */ "haddpd", + /* 0D9 */ "haddps", + /* 0DA */ "hlt", + /* 0DB */ "hsubpd", + /* 0DC */ "hsubps", + /* 0DD */ "idiv", + /* 0DE */ "imul", + /* 0DF */ "in", + /* 0E0 */ "inc", + /* 0E1 */ "insb", + /* 0E2 */ "insd", + /* 0E3 */ "insertps", + /* 0E4 */ "insw", + /* 0E5 */ "int", + /* 0E6 */ "int1", + /* 0E7 */ "int3", + /* 0E8 */ "into", + /* 0E9 */ "invd", + /* 0EA */ "invept", + /* 0EB */ "invlpg", + /* 0EC */ "invlpga", + /* 0ED */ "invvpid", + /* 0EE */ "iretd", + /* 0EF */ "iretq", + /* 0F0 */ "iretw", + /* 0F1 */ "ja", + /* 0F2 */ "jae", + /* 0F3 */ "jb", + /* 0F4 */ "jbe", + /* 0F5 */ "jcxz", + /* 0F6 */ "jecxz", + /* 0F7 */ "jg", + /* 0F8 */ "jge", + /* 0F9 */ "jl", + /* 0FA */ "jle", + /* 0FB */ "jmp", + /* 0FC */ "jno", + /* 0FD */ "jnp", + /* 0FE */ "jns", + /* 0FF */ "jnz", + /* 100 */ "jo", + /* 101 */ "jp", + /* 102 */ "jrcxz", + /* 103 */ "js", + /* 104 */ "jz", + /* 105 */ "lahf", + /* 106 */ "lar", + /* 107 */ "lddqu", + /* 108 */ "ldmxcsr", + /* 109 */ "lds", + /* 10A */ "lea", + /* 10B */ "leave", + /* 10C */ "les", + /* 10D */ "lfence", + /* 10E */ "lfs", + /* 10F */ "lgdt", + /* 110 */ "lgs", + /* 111 */ "lidt", + /* 112 */ "lldt", + /* 113 */ "lmsw", + /* 114 */ "lock", + /* 115 */ "lodsb", + /* 116 */ "lodsd", + /* 117 */ "lodsq", + /* 118 */ "lodsw", + /* 119 */ "loop", + /* 11A */ "loope", + /* 11B */ "loopne", + /* 11C */ "lsl", + /* 11D */ "lss", + /* 11E */ "ltr", + /* 11F */ "maskmovdqu", + /* 120 */ "maskmovq", + /* 121 */ "maxpd", + /* 122 */ "maxps", + /* 123 */ "maxsd", + /* 124 */ "maxss", + /* 125 */ "mfence", + /* 126 */ "minpd", + /* 127 */ "minps", + /* 128 */ "minsd", + /* 129 */ "minss", + /* 12A */ "monitor", + /* 12B */ "montmul", + /* 12C */ "mov", + /* 12D */ "movapd", + /* 12E */ "movaps", + /* 12F */ "movbe", + /* 130 */ "movd", + /* 131 */ "movddup", + /* 132 */ "movdq2q", + /* 133 */ "movdqa", + /* 134 */ "movdqu", + /* 135 */ "movhlps", + /* 136 */ "movhpd", + /* 137 */ "movhps", + /* 138 */ "movlhps", + /* 139 */ "movlpd", + /* 13A */ "movlps", + /* 13B */ "movmskpd", + /* 13C */ "movmskps", + /* 13D */ "movntdq", + /* 13E */ "movntdqa", + /* 13F */ "movnti", + /* 140 */ "movntpd", + /* 141 */ "movntps", + /* 142 */ "movntq", + /* 143 */ "movq", + /* 144 */ "movq2dq", + /* 145 */ "movsb", + /* 146 */ "movsd", + /* 147 */ "movshdup", + /* 148 */ "movsldup", + /* 149 */ "movsq", + /* 14A */ "movss", + /* 14B */ "movsw", + /* 14C */ "movsx", + /* 14D */ "movsxd", + /* 14E */ "movupd", + /* 14F */ "movups", + /* 150 */ "movzx", + /* 151 */ "mpsadbw", + /* 152 */ "mul", + /* 153 */ "mulpd", + /* 154 */ "mulps", + /* 155 */ "mulsd", + /* 156 */ "mulss", + /* 157 */ "mwait", + /* 158 */ "neg", + /* 159 */ "nop", + /* 15A */ "not", + /* 15B */ "or", + /* 15C */ "orpd", + /* 15D */ "orps", + /* 15E */ "out", + /* 15F */ "outsb", + /* 160 */ "outsd", + /* 161 */ "outsw", + /* 162 */ "pabsb", + /* 163 */ "pabsd", + /* 164 */ "pabsw", + /* 165 */ "packssdw", + /* 166 */ "packsswb", + /* 167 */ "packusdw", + /* 168 */ "packuswb", + /* 169 */ "paddb", + /* 16A */ "paddd", + /* 16B */ "paddq", + /* 16C */ "paddsb", + /* 16D */ "paddsw", + /* 16E */ "paddusb", + /* 16F */ "paddusw", + /* 170 */ "paddw", + /* 171 */ "palignr", + /* 172 */ "pand", + /* 173 */ "pandn", + /* 174 */ "pause", + /* 175 */ "pavgb", + /* 176 */ "pavgusb", + /* 177 */ "pavgw", + /* 178 */ "pblendvb", + /* 179 */ "pblendw", + /* 17A */ "pclmulqdq", + /* 17B */ "pcmpeqb", + /* 17C */ "pcmpeqd", + /* 17D */ "pcmpeqq", + /* 17E */ "pcmpeqw", + /* 17F */ "pcmpestri", + /* 180 */ "pcmpestrm", + /* 181 */ "pcmpgtb", + /* 182 */ "pcmpgtd", + /* 183 */ "pcmpgtq", + /* 184 */ "pcmpgtw", + /* 185 */ "pcmpistri", + /* 186 */ "pcmpistrm", + /* 187 */ "pextrb", + /* 188 */ "pextrd", + /* 189 */ "pextrq", + /* 18A */ "pextrw", + /* 18B */ "pf2id", + /* 18C */ "pf2iw", + /* 18D */ "pfacc", + /* 18E */ "pfadd", + /* 18F */ "pfcmpeq", + /* 190 */ "pfcmpge", + /* 191 */ "pfcmpgt", + /* 192 */ "pfmax", + /* 193 */ "pfmin", + /* 194 */ "pfmul", + /* 195 */ "pfnacc", + /* 196 */ "pfpnacc", + /* 197 */ "pfrcp", + /* 198 */ "pfrcpit1", + /* 199 */ "pfrcpit2", + /* 19A */ "pfrsqit1", + /* 19B */ "pfrsqrt", + /* 19C */ "pfsub", + /* 19D */ "pfsubr", + /* 19E */ "phaddd", + /* 19F */ "phaddsw", + /* 1A0 */ "phaddw", + /* 1A1 */ "phminposuw", + /* 1A2 */ "phsubd", + /* 1A3 */ "phsubsw", + /* 1A4 */ "phsubw", + /* 1A5 */ "pi2fd", + /* 1A6 */ "pi2fw", + /* 1A7 */ "pinsrb", + /* 1A8 */ "pinsrd", + /* 1A9 */ "pinsrq", + /* 1AA */ "pinsrw", + /* 1AB */ "pmaddubsw", + /* 1AC */ "pmaddwd", + /* 1AD */ "pmaxsb", + /* 1AE */ "pmaxsd", + /* 1AF */ "pmaxsw", + /* 1B0 */ "pmaxub", + /* 1B1 */ "pmaxud", + /* 1B2 */ "pmaxuw", + /* 1B3 */ "pminsb", + /* 1B4 */ "pminsd", + /* 1B5 */ "pminsw", + /* 1B6 */ "pminub", + /* 1B7 */ "pminud", + /* 1B8 */ "pminuw", + /* 1B9 */ "pmovmskb", + /* 1BA */ "pmovsxbd", + /* 1BB */ "pmovsxbq", + /* 1BC */ "pmovsxbw", + /* 1BD */ "pmovsxdq", + /* 1BE */ "pmovsxwd", + /* 1BF */ "pmovsxwq", + /* 1C0 */ "pmovzxbd", + /* 1C1 */ "pmovzxbq", + /* 1C2 */ "pmovzxbw", + /* 1C3 */ "pmovzxdq", + /* 1C4 */ "pmovzxwd", + /* 1C5 */ "pmovzxwq", + /* 1C6 */ "pmuldq", + /* 1C7 */ "pmulhrsw", + /* 1C8 */ "pmulhrw", + /* 1C9 */ "pmulhuw", + /* 1CA */ "pmulhw", + /* 1CB */ "pmulld", + /* 1CC */ "pmullw", + /* 1CD */ "pmuludq", + /* 1CE */ "pop", + /* 1CF */ "popa", + /* 1D0 */ "popad", + /* 1D1 */ "popcnt", + /* 1D2 */ "popfd", + /* 1D3 */ "popfq", + /* 1D4 */ "popfw", + /* 1D5 */ "por", + /* 1D6 */ "prefetch", + /* 1D7 */ "prefetchnta", + /* 1D8 */ "prefetcht0", + /* 1D9 */ "prefetcht1", + /* 1DA */ "prefetcht2", + /* 1DB */ "psadbw", + /* 1DC */ "pshufb", + /* 1DD */ "pshufd", + /* 1DE */ "pshufhw", + /* 1DF */ "pshuflw", + /* 1E0 */ "pshufw", + /* 1E1 */ "psignb", + /* 1E2 */ "psignd", + /* 1E3 */ "psignw", + /* 1E4 */ "pslld", + /* 1E5 */ "pslldq", + /* 1E6 */ "psllq", + /* 1E7 */ "psllw", + /* 1E8 */ "psrad", + /* 1E9 */ "psraw", + /* 1EA */ "psrld", + /* 1EB */ "psrldq", + /* 1EC */ "psrlq", + /* 1ED */ "psrlw", + /* 1EE */ "psubb", + /* 1EF */ "psubd", + /* 1F0 */ "psubq", + /* 1F1 */ "psubsb", + /* 1F2 */ "psubsw", + /* 1F3 */ "psubusb", + /* 1F4 */ "psubusw", + /* 1F5 */ "psubw", + /* 1F6 */ "pswapd", + /* 1F7 */ "ptest", + /* 1F8 */ "punpckhbw", + /* 1F9 */ "punpckhdq", + /* 1FA */ "punpckhqdq", + /* 1FB */ "punpckhwd", + /* 1FC */ "punpcklbw", + /* 1FD */ "punpckldq", + /* 1FE */ "punpcklqdq", + /* 1FF */ "punpcklwd", + /* 200 */ "push", + /* 201 */ "pusha", + /* 202 */ "pushad", + /* 203 */ "pushfd", + /* 204 */ "pushfq", + /* 205 */ "pushfw", + /* 206 */ "pxor", + /* 207 */ "rcl", + /* 208 */ "rcpps", + /* 209 */ "rcpss", + /* 20A */ "rcr", + /* 20B */ "rdmsr", + /* 20C */ "rdpmc", + /* 20D */ "rdrand", + /* 20E */ "rdtsc", + /* 20F */ "rdtscp", + /* 210 */ "rep", + /* 211 */ "repne", + /* 212 */ "retf", + /* 213 */ "retn", + /* 214 */ "rol", + /* 215 */ "ror", + /* 216 */ "roundpd", + /* 217 */ "roundps", + /* 218 */ "roundsd", + /* 219 */ "roundss", + /* 21A */ "rsm", + /* 21B */ "rsqrtps", + /* 21C */ "rsqrtss", + /* 21D */ "sahf", + /* 21E */ "salc", + /* 21F */ "sar", + /* 220 */ "sbb", + /* 221 */ "scasb", + /* 222 */ "scasd", + /* 223 */ "scasq", + /* 224 */ "scasw", + /* 225 */ "seta", + /* 226 */ "setae", + /* 227 */ "setb", + /* 228 */ "setbe", + /* 229 */ "setg", + /* 22A */ "setge", + /* 22B */ "setl", + /* 22C */ "setle", + /* 22D */ "setno", + /* 22E */ "setnp", + /* 22F */ "setns", + /* 230 */ "setnz", + /* 231 */ "seto", + /* 232 */ "setp", + /* 233 */ "sets", + /* 234 */ "setz", + /* 235 */ "sfence", + /* 236 */ "sgdt", + /* 237 */ "shl", + /* 238 */ "shld", + /* 239 */ "shr", + /* 23A */ "shrd", + /* 23B */ "shufpd", + /* 23C */ "shufps", + /* 23D */ "sidt", + /* 23E */ "skinit", + /* 23F */ "sldt", + /* 240 */ "smsw", + /* 241 */ "sqrtpd", + /* 242 */ "sqrtps", + /* 243 */ "sqrtsd", + /* 244 */ "sqrtss", + /* 245 */ "stc", + /* 246 */ "std", + /* 247 */ "stgi", + /* 248 */ "sti", + /* 249 */ "stmxcsr", + /* 24A */ "stosb", + /* 24B */ "stosd", + /* 24C */ "stosq", + /* 24D */ "stosw", + /* 24E */ "str", + /* 24F */ "sub", + /* 250 */ "subpd", + /* 251 */ "subps", + /* 252 */ "subsd", + /* 253 */ "subss", + /* 254 */ "swapgs", + /* 255 */ "syscall", + /* 256 */ "sysenter", + /* 257 */ "sysexit", + /* 258 */ "sysret", + /* 259 */ "test", + /* 25A */ "ucomisd", + /* 25B */ "ucomiss", + /* 25C */ "ud2", + /* 25D */ "unpckhpd", + /* 25E */ "unpckhps", + /* 25F */ "unpcklpd", + /* 260 */ "unpcklps", + /* 261 */ "vaddpd", + /* 262 */ "vaddps", + /* 263 */ "vaddsd", + /* 264 */ "vaddss", + /* 265 */ "vaddsubpd", + /* 266 */ "vaddsubps", + /* 267 */ "vaesdec", + /* 268 */ "vaesdeclast", + /* 269 */ "vaesenc", + /* 26A */ "vaesenclast", + /* 26B */ "vaesimc", + /* 26C */ "vaeskeygenassist", + /* 26D */ "vandnpd", + /* 26E */ "vandnps", + /* 26F */ "vandpd", + /* 270 */ "vandps", + /* 271 */ "vblendpd", + /* 272 */ "vblendps", + /* 273 */ "vblendvpd", + /* 274 */ "vblendvps", + /* 275 */ "vbroadcastsd", + /* 276 */ "vbroadcastss", + /* 277 */ "vcmppd", + /* 278 */ "vcmpps", + /* 279 */ "vcmpsd", + /* 27A */ "vcmpss", + /* 27B */ "vcomisd", + /* 27C */ "vcomiss", + /* 27D */ "vcvtdq2pd", + /* 27E */ "vcvtdq2ps", + /* 27F */ "vcvtpd2dq", + /* 280 */ "vcvtpd2ps", + /* 281 */ "vcvtps2dq", + /* 282 */ "vcvtps2pd", + /* 283 */ "vcvtsd2si", + /* 284 */ "vcvtsd2ss", + /* 285 */ "vcvtsi2sd", + /* 286 */ "vcvtsi2ss", + /* 287 */ "vcvtss2sd", + /* 288 */ "vcvtss2si", + /* 289 */ "vcvttpd2dq", + /* 28A */ "vcvttps2dq", + /* 28B */ "vcvttsd2si", + /* 28C */ "vcvttss2si", + /* 28D */ "vdivpd", + /* 28E */ "vdivps", + /* 28F */ "vdivsd", + /* 290 */ "vdivss", + /* 291 */ "vdppd", + /* 292 */ "vdpps", + /* 293 */ "verr", + /* 294 */ "verw", + /* 295 */ "vextractf128", + /* 296 */ "vextractps", + /* 297 */ "vhaddpd", + /* 298 */ "vhaddps", + /* 299 */ "vhsubpd", + /* 29A */ "vhsubps", + /* 29B */ "vinsertf128", + /* 29C */ "vinsertps", + /* 29D */ "vlddqu", + /* 29E */ "vmaskmovdqu", + /* 29F */ "vmaskmovpd", + /* 2A0 */ "vmaskmovps", + /* 2A1 */ "vmaxpd", + /* 2A2 */ "vmaxps", + /* 2A3 */ "vmaxsd", + /* 2A4 */ "vmaxss", + /* 2A5 */ "vmcall", + /* 2A6 */ "vmclear", + /* 2A7 */ "vminpd", + /* 2A8 */ "vminps", + /* 2A9 */ "vminsd", + /* 2AA */ "vminss", + /* 2AB */ "vmlaunch", + /* 2AC */ "vmload", + /* 2AD */ "vmmcall", + /* 2AE */ "vmovapd", + /* 2AF */ "vmovaps", + /* 2B0 */ "vmovd", + /* 2B1 */ "vmovddup", + /* 2B2 */ "vmovdqa", + /* 2B3 */ "vmovdqu", + /* 2B4 */ "vmovhlps", + /* 2B5 */ "vmovhpd", + /* 2B6 */ "vmovhps", + /* 2B7 */ "vmovlhps", + /* 2B8 */ "vmovlpd", + /* 2B9 */ "vmovlps", + /* 2BA */ "vmovmskpd", + /* 2BB */ "vmovmskps", + /* 2BC */ "vmovntdq", + /* 2BD */ "vmovntdqa", + /* 2BE */ "vmovntpd", + /* 2BF */ "vmovntps", + /* 2C0 */ "vmovq", + /* 2C1 */ "vmovsd", + /* 2C2 */ "vmovshdup", + /* 2C3 */ "vmovsldup", + /* 2C4 */ "vmovss", + /* 2C5 */ "vmovupd", + /* 2C6 */ "vmovups", + /* 2C7 */ "vmpsadbw", + /* 2C8 */ "vmptrld", + /* 2C9 */ "vmptrst", + /* 2CA */ "vmread", + /* 2CB */ "vmresume", + /* 2CC */ "vmrun", + /* 2CD */ "vmsave", + /* 2CE */ "vmulpd", + /* 2CF */ "vmulps", + /* 2D0 */ "vmulsd", + /* 2D1 */ "vmulss", + /* 2D2 */ "vmwrite", + /* 2D3 */ "vmxoff", + /* 2D4 */ "vmxon", + /* 2D5 */ "vorpd", + /* 2D6 */ "vorps", + /* 2D7 */ "vpabsb", + /* 2D8 */ "vpabsd", + /* 2D9 */ "vpabsw", + /* 2DA */ "vpackssdw", + /* 2DB */ "vpacksswb", + /* 2DC */ "vpackusdw", + /* 2DD */ "vpackuswb", + /* 2DE */ "vpaddb", + /* 2DF */ "vpaddd", + /* 2E0 */ "vpaddq", + /* 2E1 */ "vpaddsb", + /* 2E2 */ "vpaddsw", + /* 2E3 */ "vpaddusb", + /* 2E4 */ "vpaddusw", + /* 2E5 */ "vpaddw", + /* 2E6 */ "vpalignr", + /* 2E7 */ "vpand", + /* 2E8 */ "vpandn", + /* 2E9 */ "vpavgb", + /* 2EA */ "vpavgw", + /* 2EB */ "vpblendvb", + /* 2EC */ "vpblendw", + /* 2ED */ "vpclmulqdq", + /* 2EE */ "vpcmpeqb", + /* 2EF */ "vpcmpeqd", + /* 2F0 */ "vpcmpeqq", + /* 2F1 */ "vpcmpeqw", + /* 2F2 */ "vpcmpestri", + /* 2F3 */ "vpcmpestrm", + /* 2F4 */ "vpcmpgtb", + /* 2F5 */ "vpcmpgtd", + /* 2F6 */ "vpcmpgtq", + /* 2F7 */ "vpcmpgtw", + /* 2F8 */ "vpcmpistri", + /* 2F9 */ "vpcmpistrm", + /* 2FA */ "vperm2f128", + /* 2FB */ "vpermilpd", + /* 2FC */ "vpermilps", + /* 2FD */ "vpextrb", + /* 2FE */ "vpextrd", + /* 2FF */ "vpextrq", + /* 300 */ "vpextrw", + /* 301 */ "vphaddd", + /* 302 */ "vphaddsw", + /* 303 */ "vphaddw", + /* 304 */ "vphminposuw", + /* 305 */ "vphsubd", + /* 306 */ "vphsubsw", + /* 307 */ "vphsubw", + /* 308 */ "vpinsrb", + /* 309 */ "vpinsrd", + /* 30A */ "vpinsrq", + /* 30B */ "vpinsrw", + /* 30C */ "vpmaddubsw", + /* 30D */ "vpmaddwd", + /* 30E */ "vpmaxsb", + /* 30F */ "vpmaxsd", + /* 310 */ "vpmaxsw", + /* 311 */ "vpmaxub", + /* 312 */ "vpmaxud", + /* 313 */ "vpmaxuw", + /* 314 */ "vpminsb", + /* 315 */ "vpminsd", + /* 316 */ "vpminsw", + /* 317 */ "vpminub", + /* 318 */ "vpminud", + /* 319 */ "vpminuw", + /* 31A */ "vpmovmskb", + /* 31B */ "vpmovsxbd", + /* 31C */ "vpmovsxbq", + /* 31D */ "vpmovsxbw", + /* 31E */ "vpmovsxwd", + /* 31F */ "vpmovsxwq", + /* 320 */ "vpmovzxbd", + /* 321 */ "vpmovzxbq", + /* 322 */ "vpmovzxbw", + /* 323 */ "vpmovzxdq", + /* 324 */ "vpmovzxwd", + /* 325 */ "vpmovzxwq", + /* 326 */ "vpmuldq", + /* 327 */ "vpmulhrsw", + /* 328 */ "vpmulhuw", + /* 329 */ "vpmulhw", + /* 32A */ "vpmulld", + /* 32B */ "vpmullw", + /* 32C */ "vpor", + /* 32D */ "vpsadbw", + /* 32E */ "vpshufb", + /* 32F */ "vpshufd", + /* 330 */ "vpshufhw", + /* 331 */ "vpshuflw", + /* 332 */ "vpsignb", + /* 333 */ "vpsignd", + /* 334 */ "vpsignw", + /* 335 */ "vpslld", + /* 336 */ "vpslldq", + /* 337 */ "vpsllq", + /* 338 */ "vpsllw", + /* 339 */ "vpsrad", + /* 33A */ "vpsraw", + /* 33B */ "vpsrld", + /* 33C */ "vpsrldq", + /* 33D */ "vpsrlq", + /* 33E */ "vpsrlw", + /* 33F */ "vpsubb", + /* 340 */ "vpsubd", + /* 341 */ "vpsubq", + /* 342 */ "vpsubsb", + /* 343 */ "vpsubsw", + /* 344 */ "vpsubusb", + /* 345 */ "vpsubusw", + /* 346 */ "vpsubw", + /* 347 */ "vptest", + /* 348 */ "vpunpckhbw", + /* 349 */ "vpunpckhdq", + /* 34A */ "vpunpckhqdq", + /* 34B */ "vpunpckhwd", + /* 34C */ "vpunpcklbw", + /* 34D */ "vpunpckldq", + /* 34E */ "vpunpcklqdq", + /* 34F */ "vpunpcklwd", + /* 350 */ "vpxor", + /* 351 */ "vrcpps", + /* 352 */ "vrcpss", + /* 353 */ "vroundpd", + /* 354 */ "vroundps", + /* 355 */ "vroundsd", + /* 356 */ "vroundss", + /* 357 */ "vrsqrtps", + /* 358 */ "vrsqrtss", + /* 359 */ "vshufpd", + /* 35A */ "vshufps", + /* 35B */ "vsqrtpd", + /* 35C */ "vsqrtps", + /* 35D */ "vsqrtsd", + /* 35E */ "vsqrtss", + /* 35F */ "vstmxcsr", + /* 360 */ "vsubpd", + /* 361 */ "vsubps", + /* 362 */ "vsubsd", + /* 363 */ "vsubss", + /* 364 */ "vtestpd", + /* 365 */ "vtestps", + /* 366 */ "vucomisd", + /* 367 */ "vucomiss", + /* 368 */ "vunpckhpd", + /* 369 */ "vunpckhps", + /* 36A */ "vunpcklpd", + /* 36B */ "vunpcklps", + /* 36C */ "vxorpd", + /* 36D */ "vxorps", + /* 36E */ "vzeroall", + /* 36F */ "vzeroupper", + /* 370 */ "wait", + /* 371 */ "wbinvd", + /* 372 */ "wrmsr", + /* 373 */ "xadd", + /* 374 */ "xchg", + /* 375 */ "xcryptcbc", + /* 376 */ "xcryptcfb", + /* 377 */ "xcryptctr", + /* 378 */ "xcryptecb", + /* 379 */ "xcryptofb", + /* 37A */ "xgetbv", + /* 37B */ "xlatb", + /* 37C */ "xor", + /* 37D */ "xorpd", + /* 37E */ "xorps", + /* 37F */ "xrstor", + /* 380 */ "xsave", + /* 381 */ "xsetbv", + /* 382 */ "xsha1", + /* 383 */ "xsha256", + /* 384 */ "xstore", +}; + +} + +} + +} diff --git a/Verteron Disassembler Engine/VXOpcodeTable.h b/Verteron Disassembler Engine/VXOpcodeTable.h new file mode 100644 index 0000000..584fba4 --- /dev/null +++ b/Verteron Disassembler Engine/VXOpcodeTable.h @@ -0,0 +1,1686 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 14. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#pragma once + +#include "stdint.h" +#include "assert.h" + +namespace Verteron +{ + +namespace Disassembler +{ + +/** + * @brief Values that represent an instruction mnemonic. + */ +enum class VXInstructionMnemonic : uint16_t +{ + /* 000 */ INVALID, + /* 001 */ AAA, + /* 002 */ AAD, + /* 003 */ AAM, + /* 004 */ AAS, + /* 005 */ ADC, + /* 006 */ ADD, + /* 007 */ ADDPD, + /* 008 */ ADDPS, + /* 009 */ ADDSD, + /* 00A */ ADDSS, + /* 00B */ ADDSUBPD, + /* 00C */ ADDSUBPS, + /* 00D */ AESDEC, + /* 00E */ AESDECLAST, + /* 00F */ AESENC, + /* 010 */ AESENCLAST, + /* 011 */ AESIMC, + /* 012 */ AESKEYGENASSIST, + /* 013 */ AND, + /* 014 */ ANDNPD, + /* 015 */ ANDNPS, + /* 016 */ ANDPD, + /* 017 */ ANDPS, + /* 018 */ ARPL, + /* 019 */ BLENDPD, + /* 01A */ BLENDPS, + /* 01B */ BLENDVPD, + /* 01C */ BLENDVPS, + /* 01D */ BOUND, + /* 01E */ BSF, + /* 01F */ BSR, + /* 020 */ BSWAP, + /* 021 */ BT, + /* 022 */ BTC, + /* 023 */ BTR, + /* 024 */ BTS, + /* 025 */ CALL, + /* 026 */ CBW, + /* 027 */ CDQ, + /* 028 */ CDQE, + /* 029 */ CLC, + /* 02A */ CLD, + /* 02B */ CLFLUSH, + /* 02C */ CLGI, + /* 02D */ CLI, + /* 02E */ CLTS, + /* 02F */ CMC, + /* 030 */ CMOVA, + /* 031 */ CMOVAE, + /* 032 */ CMOVB, + /* 033 */ CMOVBE, + /* 034 */ CMOVG, + /* 035 */ CMOVGE, + /* 036 */ CMOVL, + /* 037 */ CMOVLE, + /* 038 */ CMOVNO, + /* 039 */ CMOVNP, + /* 03A */ CMOVNS, + /* 03B */ CMOVNZ, + /* 03C */ CMOVO, + /* 03D */ CMOVP, + /* 03E */ CMOVS, + /* 03F */ CMOVZ, + /* 040 */ CMP, + /* 041 */ CMPPD, + /* 042 */ CMPPS, + /* 043 */ CMPSB, + /* 044 */ CMPSD, + /* 045 */ CMPSQ, + /* 046 */ CMPSS, + /* 047 */ CMPSW, + /* 048 */ CMPXCHG, + /* 049 */ CMPXCHG16B, + /* 04A */ CMPXCHG8B, + /* 04B */ COMISD, + /* 04C */ COMISS, + /* 04D */ CPUID, + /* 04E */ CQO, + /* 04F */ CRC32, + /* 050 */ CVTDQ2PD, + /* 051 */ CVTDQ2PS, + /* 052 */ CVTPD2DQ, + /* 053 */ CVTPD2PI, + /* 054 */ CVTPD2PS, + /* 055 */ CVTPI2PD, + /* 056 */ CVTPI2PS, + /* 057 */ CVTPS2DQ, + /* 058 */ CVTPS2PD, + /* 059 */ CVTPS2PI, + /* 05A */ CVTSD2SI, + /* 05B */ CVTSD2SS, + /* 05C */ CVTSI2SD, + /* 05D */ CVTSI2SS, + /* 05E */ CVTSS2SD, + /* 05F */ CVTSS2SI, + /* 060 */ CVTTPD2DQ, + /* 061 */ CVTTPD2PI, + /* 062 */ CVTTPS2DQ, + /* 063 */ CVTTPS2PI, + /* 064 */ CVTTSD2SI, + /* 065 */ CVTTSS2SI, + /* 066 */ CWD, + /* 067 */ CWDE, + /* 068 */ DAA, + /* 069 */ DAS, + /* 06A */ DEC, + /* 06B */ DIV, + /* 06C */ DIVPD, + /* 06D */ DIVPS, + /* 06E */ DIVSD, + /* 06F */ DIVSS, + /* 070 */ DPPD, + /* 071 */ DPPS, + /* 072 */ EMMS, + /* 073 */ ENTER, + /* 074 */ EXTRACTPS, + /* 075 */ F2XM1, + /* 076 */ FABS, + /* 077 */ FADD, + /* 078 */ FADDP, + /* 079 */ FBLD, + /* 07A */ FBSTP, + /* 07B */ FCHS, + /* 07C */ FCLEX, + /* 07D */ FCMOVB, + /* 07E */ FCMOVBE, + /* 07F */ FCMOVE, + /* 080 */ FCMOVNB, + /* 081 */ FCMOVNBE, + /* 082 */ FCMOVNE, + /* 083 */ FCMOVNU, + /* 084 */ FCMOVU, + /* 085 */ FCOM, + /* 086 */ FCOM2, + /* 087 */ FCOMI, + /* 088 */ FCOMIP, + /* 089 */ FCOMP, + /* 08A */ FCOMP3, + /* 08B */ FCOMP5, + /* 08C */ FCOMPP, + /* 08D */ FCOS, + /* 08E */ FDECSTP, + /* 08F */ FDIV, + /* 090 */ FDIVP, + /* 091 */ FDIVR, + /* 092 */ FDIVRP, + /* 093 */ FEMMS, + /* 094 */ FFREE, + /* 095 */ FFREEP, + /* 096 */ FIADD, + /* 097 */ FICOM, + /* 098 */ FICOMP, + /* 099 */ FIDIV, + /* 09A */ FIDIVR, + /* 09B */ FILD, + /* 09C */ FIMUL, + /* 09D */ FINCSTP, + /* 09E */ FIST, + /* 09F */ FISTP, + /* 0A0 */ FISTTP, + /* 0A1 */ FISUB, + /* 0A2 */ FISUBR, + /* 0A3 */ FLD, + /* 0A4 */ FLD1, + /* 0A5 */ FLDCW, + /* 0A6 */ FLDENV, + /* 0A7 */ FLDL2E, + /* 0A8 */ FLDL2T, + /* 0A9 */ FLDLG2, + /* 0AA */ FLDLN2, + /* 0AB */ FLDPI, + /* 0AC */ FLDZ, + /* 0AD */ FMUL, + /* 0AE */ FMULP, + /* 0AF */ FNINIT, + /* 0B0 */ FNOP, + /* 0B1 */ FNSAVE, + /* 0B2 */ FNSTCW, + /* 0B3 */ FNSTENV, + /* 0B4 */ FNSTSW, + /* 0B5 */ FPATAN, + /* 0B6 */ FPREM, + /* 0B7 */ FPREM1, + /* 0B8 */ FPTAN, + /* 0B9 */ FRNDINT, + /* 0BA */ FRSTOR, + /* 0BB */ FSCALE, + /* 0BC */ FSIN, + /* 0BD */ FSINCOS, + /* 0BE */ FSQRT, + /* 0BF */ FST, + /* 0C0 */ FSTP, + /* 0C1 */ FSTP1, + /* 0C2 */ FSTP8, + /* 0C3 */ FSTP9, + /* 0C4 */ FSUB, + /* 0C5 */ FSUBP, + /* 0C6 */ FSUBR, + /* 0C7 */ FSUBRP, + /* 0C8 */ FTST, + /* 0C9 */ FUCOM, + /* 0CA */ FUCOMI, + /* 0CB */ FUCOMIP, + /* 0CC */ FUCOMP, + /* 0CD */ FUCOMPP, + /* 0CE */ FXAM, + /* 0CF */ FXCH, + /* 0D0 */ FXCH4, + /* 0D1 */ FXCH7, + /* 0D2 */ FXRSTOR, + /* 0D3 */ FXSAVE, + /* 0D4 */ FXTRACT, + /* 0D5 */ FYL2X, + /* 0D6 */ FYL2XP1, + /* 0D7 */ GETSEC, + /* 0D8 */ HADDPD, + /* 0D9 */ HADDPS, + /* 0DA */ HLT, + /* 0DB */ HSUBPD, + /* 0DC */ HSUBPS, + /* 0DD */ IDIV, + /* 0DE */ IMUL, + /* 0DF */ IN, + /* 0E0 */ INC, + /* 0E1 */ INSB, + /* 0E2 */ INSD, + /* 0E3 */ INSERTPS, + /* 0E4 */ INSW, + /* 0E5 */ INT, + /* 0E6 */ INT1, + /* 0E7 */ INT3, + /* 0E8 */ INTO, + /* 0E9 */ INVD, + /* 0EA */ INVEPT, + /* 0EB */ INVLPG, + /* 0EC */ INVLPGA, + /* 0ED */ INVVPID, + /* 0EE */ IRETD, + /* 0EF */ IRETQ, + /* 0F0 */ IRETW, + /* 0F1 */ JA, + /* 0F2 */ JAE, + /* 0F3 */ JB, + /* 0F4 */ JBE, + /* 0F5 */ JCXZ, + /* 0F6 */ JECXZ, + /* 0F7 */ JG, + /* 0F8 */ JGE, + /* 0F9 */ JL, + /* 0FA */ JLE, + /* 0FB */ JMP, + /* 0FC */ JNO, + /* 0FD */ JNP, + /* 0FE */ JNS, + /* 0FF */ JNZ, + /* 100 */ JO, + /* 101 */ JP, + /* 102 */ JRCXZ, + /* 103 */ JS, + /* 104 */ JZ, + /* 105 */ LAHF, + /* 106 */ LAR, + /* 107 */ LDDQU, + /* 108 */ LDMXCSR, + /* 109 */ LDS, + /* 10A */ LEA, + /* 10B */ LEAVE, + /* 10C */ LES, + /* 10D */ LFENCE, + /* 10E */ LFS, + /* 10F */ LGDT, + /* 110 */ LGS, + /* 111 */ LIDT, + /* 112 */ LLDT, + /* 113 */ LMSW, + /* 114 */ LOCK, + /* 115 */ LODSB, + /* 116 */ LODSD, + /* 117 */ LODSQ, + /* 118 */ LODSW, + /* 119 */ LOOP, + /* 11A */ LOOPE, + /* 11B */ LOOPNE, + /* 11C */ LSL, + /* 11D */ LSS, + /* 11E */ LTR, + /* 11F */ MASKMOVDQU, + /* 120 */ MASKMOVQ, + /* 121 */ MAXPD, + /* 122 */ MAXPS, + /* 123 */ MAXSD, + /* 124 */ MAXSS, + /* 125 */ MFENCE, + /* 126 */ MINPD, + /* 127 */ MINPS, + /* 128 */ MINSD, + /* 129 */ MINSS, + /* 12A */ MONITOR, + /* 12B */ MONTMUL, + /* 12C */ MOV, + /* 12D */ MOVAPD, + /* 12E */ MOVAPS, + /* 12F */ MOVBE, + /* 130 */ MOVD, + /* 131 */ MOVDDUP, + /* 132 */ MOVDQ2Q, + /* 133 */ MOVDQA, + /* 134 */ MOVDQU, + /* 135 */ MOVHLPS, + /* 136 */ MOVHPD, + /* 137 */ MOVHPS, + /* 138 */ MOVLHPS, + /* 139 */ MOVLPD, + /* 13A */ MOVLPS, + /* 13B */ MOVMSKPD, + /* 13C */ MOVMSKPS, + /* 13D */ MOVNTDQ, + /* 13E */ MOVNTDQA, + /* 13F */ MOVNTI, + /* 140 */ MOVNTPD, + /* 141 */ MOVNTPS, + /* 142 */ MOVNTQ, + /* 143 */ MOVQ, + /* 144 */ MOVQ2DQ, + /* 145 */ MOVSB, + /* 146 */ MOVSD, + /* 147 */ MOVSHDUP, + /* 148 */ MOVSLDUP, + /* 149 */ MOVSQ, + /* 14A */ MOVSS, + /* 14B */ MOVSW, + /* 14C */ MOVSX, + /* 14D */ MOVSXD, + /* 14E */ MOVUPD, + /* 14F */ MOVUPS, + /* 150 */ MOVZX, + /* 151 */ MPSADBW, + /* 152 */ MUL, + /* 153 */ MULPD, + /* 154 */ MULPS, + /* 155 */ MULSD, + /* 156 */ MULSS, + /* 157 */ MWAIT, + /* 158 */ NEG, + /* 159 */ NOP, + /* 15A */ NOT, + /* 15B */ OR, + /* 15C */ ORPD, + /* 15D */ ORPS, + /* 15E */ OUT, + /* 15F */ OUTSB, + /* 160 */ OUTSD, + /* 161 */ OUTSW, + /* 162 */ PABSB, + /* 163 */ PABSD, + /* 164 */ PABSW, + /* 165 */ PACKSSDW, + /* 166 */ PACKSSWB, + /* 167 */ PACKUSDW, + /* 168 */ PACKUSWB, + /* 169 */ PADDB, + /* 16A */ PADDD, + /* 16B */ PADDQ, + /* 16C */ PADDSB, + /* 16D */ PADDSW, + /* 16E */ PADDUSB, + /* 16F */ PADDUSW, + /* 170 */ PADDW, + /* 171 */ PALIGNR, + /* 172 */ PAND, + /* 173 */ PANDN, + /* 174 */ PAUSE, + /* 175 */ PAVGB, + /* 176 */ PAVGUSB, + /* 177 */ PAVGW, + /* 178 */ PBLENDVB, + /* 179 */ PBLENDW, + /* 17A */ PCLMULQDQ, + /* 17B */ PCMPEQB, + /* 17C */ PCMPEQD, + /* 17D */ PCMPEQQ, + /* 17E */ PCMPEQW, + /* 17F */ PCMPESTRI, + /* 180 */ PCMPESTRM, + /* 181 */ PCMPGTB, + /* 182 */ PCMPGTD, + /* 183 */ PCMPGTQ, + /* 184 */ PCMPGTW, + /* 185 */ PCMPISTRI, + /* 186 */ PCMPISTRM, + /* 187 */ PEXTRB, + /* 188 */ PEXTRD, + /* 189 */ PEXTRQ, + /* 18A */ PEXTRW, + /* 18B */ PF2ID, + /* 18C */ PF2IW, + /* 18D */ PFACC, + /* 18E */ PFADD, + /* 18F */ PFCMPEQ, + /* 190 */ PFCMPGE, + /* 191 */ PFCMPGT, + /* 192 */ PFMAX, + /* 193 */ PFMIN, + /* 194 */ PFMUL, + /* 195 */ PFNACC, + /* 196 */ PFPNACC, + /* 197 */ PFRCP, + /* 198 */ PFRCPIT1, + /* 199 */ PFRCPIT2, + /* 19A */ PFRSQIT1, + /* 19B */ PFRSQRT, + /* 19C */ PFSUB, + /* 19D */ PFSUBR, + /* 19E */ PHADDD, + /* 19F */ PHADDSW, + /* 1A0 */ PHADDW, + /* 1A1 */ PHMINPOSUW, + /* 1A2 */ PHSUBD, + /* 1A3 */ PHSUBSW, + /* 1A4 */ PHSUBW, + /* 1A5 */ PI2FD, + /* 1A6 */ PI2FW, + /* 1A7 */ PINSRB, + /* 1A8 */ PINSRD, + /* 1A9 */ PINSRQ, + /* 1AA */ PINSRW, + /* 1AB */ PMADDUBSW, + /* 1AC */ PMADDWD, + /* 1AD */ PMAXSB, + /* 1AE */ PMAXSD, + /* 1AF */ PMAXSW, + /* 1B0 */ PMAXUB, + /* 1B1 */ PMAXUD, + /* 1B2 */ PMAXUW, + /* 1B3 */ PMINSB, + /* 1B4 */ PMINSD, + /* 1B5 */ PMINSW, + /* 1B6 */ PMINUB, + /* 1B7 */ PMINUD, + /* 1B8 */ PMINUW, + /* 1B9 */ PMOVMSKB, + /* 1BA */ PMOVSXBD, + /* 1BB */ PMOVSXBQ, + /* 1BC */ PMOVSXBW, + /* 1BD */ PMOVSXDQ, + /* 1BE */ PMOVSXWD, + /* 1BF */ PMOVSXWQ, + /* 1C0 */ PMOVZXBD, + /* 1C1 */ PMOVZXBQ, + /* 1C2 */ PMOVZXBW, + /* 1C3 */ PMOVZXDQ, + /* 1C4 */ PMOVZXWD, + /* 1C5 */ PMOVZXWQ, + /* 1C6 */ PMULDQ, + /* 1C7 */ PMULHRSW, + /* 1C8 */ PMULHRW, + /* 1C9 */ PMULHUW, + /* 1CA */ PMULHW, + /* 1CB */ PMULLD, + /* 1CC */ PMULLW, + /* 1CD */ PMULUDQ, + /* 1CE */ POP, + /* 1CF */ POPA, + /* 1D0 */ POPAD, + /* 1D1 */ POPCNT, + /* 1D2 */ POPFD, + /* 1D3 */ POPFQ, + /* 1D4 */ POPFW, + /* 1D5 */ POR, + /* 1D6 */ PREFETCH, + /* 1D7 */ PREFETCHNTA, + /* 1D8 */ PREFETCHT0, + /* 1D9 */ PREFETCHT1, + /* 1DA */ PREFETCHT2, + /* 1DB */ PSADBW, + /* 1DC */ PSHUFB, + /* 1DD */ PSHUFD, + /* 1DE */ PSHUFHW, + /* 1DF */ PSHUFLW, + /* 1E0 */ PSHUFW, + /* 1E1 */ PSIGNB, + /* 1E2 */ PSIGND, + /* 1E3 */ PSIGNW, + /* 1E4 */ PSLLD, + /* 1E5 */ PSLLDQ, + /* 1E6 */ PSLLQ, + /* 1E7 */ PSLLW, + /* 1E8 */ PSRAD, + /* 1E9 */ PSRAW, + /* 1EA */ PSRLD, + /* 1EB */ PSRLDQ, + /* 1EC */ PSRLQ, + /* 1ED */ PSRLW, + /* 1EE */ PSUBB, + /* 1EF */ PSUBD, + /* 1F0 */ PSUBQ, + /* 1F1 */ PSUBSB, + /* 1F2 */ PSUBSW, + /* 1F3 */ PSUBUSB, + /* 1F4 */ PSUBUSW, + /* 1F5 */ PSUBW, + /* 1F6 */ PSWAPD, + /* 1F7 */ PTEST, + /* 1F8 */ PUNPCKHBW, + /* 1F9 */ PUNPCKHDQ, + /* 1FA */ PUNPCKHQDQ, + /* 1FB */ PUNPCKHWD, + /* 1FC */ PUNPCKLBW, + /* 1FD */ PUNPCKLDQ, + /* 1FE */ PUNPCKLQDQ, + /* 1FF */ PUNPCKLWD, + /* 200 */ PUSH, + /* 201 */ PUSHA, + /* 202 */ PUSHAD, + /* 203 */ PUSHFD, + /* 204 */ PUSHFQ, + /* 205 */ PUSHFW, + /* 206 */ PXOR, + /* 207 */ RCL, + /* 208 */ RCPPS, + /* 209 */ RCPSS, + /* 20A */ RCR, + /* 20B */ RDMSR, + /* 20C */ RDPMC, + /* 20D */ RDRAND, + /* 20E */ RDTSC, + /* 20F */ RDTSCP, + /* 210 */ REP, + /* 211 */ REPNE, + /* 212 */ RETF, + /* 213 */ RETN, + /* 214 */ ROL, + /* 215 */ ROR, + /* 216 */ ROUNDPD, + /* 217 */ ROUNDPS, + /* 218 */ ROUNDSD, + /* 219 */ ROUNDSS, + /* 21A */ RSM, + /* 21B */ RSQRTPS, + /* 21C */ RSQRTSS, + /* 21D */ SAHF, + /* 21E */ SALC, + /* 21F */ SAR, + /* 220 */ SBB, + /* 221 */ SCASB, + /* 222 */ SCASD, + /* 223 */ SCASQ, + /* 224 */ SCASW, + /* 225 */ SETA, + /* 226 */ SETAE, + /* 227 */ SETB, + /* 228 */ SETBE, + /* 229 */ SETG, + /* 22A */ SETGE, + /* 22B */ SETL, + /* 22C */ SETLE, + /* 22D */ SETNO, + /* 22E */ SETNP, + /* 22F */ SETNS, + /* 230 */ SETNZ, + /* 231 */ SETO, + /* 232 */ SETP, + /* 233 */ SETS, + /* 234 */ SETZ, + /* 235 */ SFENCE, + /* 236 */ SGDT, + /* 237 */ SHL, + /* 238 */ SHLD, + /* 239 */ SHR, + /* 23A */ SHRD, + /* 23B */ SHUFPD, + /* 23C */ SHUFPS, + /* 23D */ SIDT, + /* 23E */ SKINIT, + /* 23F */ SLDT, + /* 240 */ SMSW, + /* 241 */ SQRTPD, + /* 242 */ SQRTPS, + /* 243 */ SQRTSD, + /* 244 */ SQRTSS, + /* 245 */ STC, + /* 246 */ STD, + /* 247 */ STGI, + /* 248 */ STI, + /* 249 */ STMXCSR, + /* 24A */ STOSB, + /* 24B */ STOSD, + /* 24C */ STOSQ, + /* 24D */ STOSW, + /* 24E */ STR, + /* 24F */ SUB, + /* 250 */ SUBPD, + /* 251 */ SUBPS, + /* 252 */ SUBSD, + /* 253 */ SUBSS, + /* 254 */ SWAPGS, + /* 255 */ SYSCALL, + /* 256 */ SYSENTER, + /* 257 */ SYSEXIT, + /* 258 */ SYSRET, + /* 259 */ TEST, + /* 25A */ UCOMISD, + /* 25B */ UCOMISS, + /* 25C */ UD2, + /* 25D */ UNPCKHPD, + /* 25E */ UNPCKHPS, + /* 25F */ UNPCKLPD, + /* 260 */ UNPCKLPS, + /* 261 */ VADDPD, + /* 262 */ VADDPS, + /* 263 */ VADDSD, + /* 264 */ VADDSS, + /* 265 */ VADDSUBPD, + /* 266 */ VADDSUBPS, + /* 267 */ VAESDEC, + /* 268 */ VAESDECLAST, + /* 269 */ VAESENC, + /* 26A */ VAESENCLAST, + /* 26B */ VAESIMC, + /* 26C */ VAESKEYGENASSIST, + /* 26D */ VANDNPD, + /* 26E */ VANDNPS, + /* 26F */ VANDPD, + /* 270 */ VANDPS, + /* 271 */ VBLENDPD, + /* 272 */ VBLENDPS, + /* 273 */ VBLENDVPD, + /* 274 */ VBLENDVPS, + /* 275 */ VBROADCASTSD, + /* 276 */ VBROADCASTSS, + /* 277 */ VCMPPD, + /* 278 */ VCMPPS, + /* 279 */ VCMPSD, + /* 27A */ VCMPSS, + /* 27B */ VCOMISD, + /* 27C */ VCOMISS, + /* 27D */ VCVTDQ2PD, + /* 27E */ VCVTDQ2PS, + /* 27F */ VCVTPD2DQ, + /* 280 */ VCVTPD2PS, + /* 281 */ VCVTPS2DQ, + /* 282 */ VCVTPS2PD, + /* 283 */ VCVTSD2SI, + /* 284 */ VCVTSD2SS, + /* 285 */ VCVTSI2SD, + /* 286 */ VCVTSI2SS, + /* 287 */ VCVTSS2SD, + /* 288 */ VCVTSS2SI, + /* 289 */ VCVTTPD2DQ, + /* 28A */ VCVTTPS2DQ, + /* 28B */ VCVTTSD2SI, + /* 28C */ VCVTTSS2SI, + /* 28D */ VDIVPD, + /* 28E */ VDIVPS, + /* 28F */ VDIVSD, + /* 290 */ VDIVSS, + /* 291 */ VDPPD, + /* 292 */ VDPPS, + /* 293 */ VERR, + /* 294 */ VERW, + /* 295 */ VEXTRACTF128, + /* 296 */ VEXTRACTPS, + /* 297 */ VHADDPD, + /* 298 */ VHADDPS, + /* 299 */ VHSUBPD, + /* 29A */ VHSUBPS, + /* 29B */ VINSERTF128, + /* 29C */ VINSERTPS, + /* 29D */ VLDDQU, + /* 29E */ VMASKMOVDQU, + /* 29F */ VMASKMOVPD, + /* 2A0 */ VMASKMOVPS, + /* 2A1 */ VMAXPD, + /* 2A2 */ VMAXPS, + /* 2A3 */ VMAXSD, + /* 2A4 */ VMAXSS, + /* 2A5 */ VMCALL, + /* 2A6 */ VMCLEAR, + /* 2A7 */ VMINPD, + /* 2A8 */ VMINPS, + /* 2A9 */ VMINSD, + /* 2AA */ VMINSS, + /* 2AB */ VMLAUNCH, + /* 2AC */ VMLOAD, + /* 2AD */ VMMCALL, + /* 2AE */ VMOVAPD, + /* 2AF */ VMOVAPS, + /* 2B0 */ VMOVD, + /* 2B1 */ VMOVDDUP, + /* 2B2 */ VMOVDQA, + /* 2B3 */ VMOVDQU, + /* 2B4 */ VMOVHLPS, + /* 2B5 */ VMOVHPD, + /* 2B6 */ VMOVHPS, + /* 2B7 */ VMOVLHPS, + /* 2B8 */ VMOVLPD, + /* 2B9 */ VMOVLPS, + /* 2BA */ VMOVMSKPD, + /* 2BB */ VMOVMSKPS, + /* 2BC */ VMOVNTDQ, + /* 2BD */ VMOVNTDQA, + /* 2BE */ VMOVNTPD, + /* 2BF */ VMOVNTPS, + /* 2C0 */ VMOVQ, + /* 2C1 */ VMOVSD, + /* 2C2 */ VMOVSHDUP, + /* 2C3 */ VMOVSLDUP, + /* 2C4 */ VMOVSS, + /* 2C5 */ VMOVUPD, + /* 2C6 */ VMOVUPS, + /* 2C7 */ VMPSADBW, + /* 2C8 */ VMPTRLD, + /* 2C9 */ VMPTRST, + /* 2CA */ VMREAD, + /* 2CB */ VMRESUME, + /* 2CC */ VMRUN, + /* 2CD */ VMSAVE, + /* 2CE */ VMULPD, + /* 2CF */ VMULPS, + /* 2D0 */ VMULSD, + /* 2D1 */ VMULSS, + /* 2D2 */ VMWRITE, + /* 2D3 */ VMXOFF, + /* 2D4 */ VMXON, + /* 2D5 */ VORPD, + /* 2D6 */ VORPS, + /* 2D7 */ VPABSB, + /* 2D8 */ VPABSD, + /* 2D9 */ VPABSW, + /* 2DA */ VPACKSSDW, + /* 2DB */ VPACKSSWB, + /* 2DC */ VPACKUSDW, + /* 2DD */ VPACKUSWB, + /* 2DE */ VPADDB, + /* 2DF */ VPADDD, + /* 2E0 */ VPADDQ, + /* 2E1 */ VPADDSB, + /* 2E2 */ VPADDSW, + /* 2E3 */ VPADDUSB, + /* 2E4 */ VPADDUSW, + /* 2E5 */ VPADDW, + /* 2E6 */ VPALIGNR, + /* 2E7 */ VPAND, + /* 2E8 */ VPANDN, + /* 2E9 */ VPAVGB, + /* 2EA */ VPAVGW, + /* 2EB */ VPBLENDVB, + /* 2EC */ VPBLENDW, + /* 2ED */ VPCLMULQDQ, + /* 2EE */ VPCMPEQB, + /* 2EF */ VPCMPEQD, + /* 2F0 */ VPCMPEQQ, + /* 2F1 */ VPCMPEQW, + /* 2F2 */ VPCMPESTRI, + /* 2F3 */ VPCMPESTRM, + /* 2F4 */ VPCMPGTB, + /* 2F5 */ VPCMPGTD, + /* 2F6 */ VPCMPGTQ, + /* 2F7 */ VPCMPGTW, + /* 2F8 */ VPCMPISTRI, + /* 2F9 */ VPCMPISTRM, + /* 2FA */ VPERM2F128, + /* 2FB */ VPERMILPD, + /* 2FC */ VPERMILPS, + /* 2FD */ VPEXTRB, + /* 2FE */ VPEXTRD, + /* 2FF */ VPEXTRQ, + /* 300 */ VPEXTRW, + /* 301 */ VPHADDD, + /* 302 */ VPHADDSW, + /* 303 */ VPHADDW, + /* 304 */ VPHMINPOSUW, + /* 305 */ VPHSUBD, + /* 306 */ VPHSUBSW, + /* 307 */ VPHSUBW, + /* 308 */ VPINSRB, + /* 309 */ VPINSRD, + /* 30A */ VPINSRQ, + /* 30B */ VPINSRW, + /* 30C */ VPMADDUBSW, + /* 30D */ VPMADDWD, + /* 30E */ VPMAXSB, + /* 30F */ VPMAXSD, + /* 310 */ VPMAXSW, + /* 311 */ VPMAXUB, + /* 312 */ VPMAXUD, + /* 313 */ VPMAXUW, + /* 314 */ VPMINSB, + /* 315 */ VPMINSD, + /* 316 */ VPMINSW, + /* 317 */ VPMINUB, + /* 318 */ VPMINUD, + /* 319 */ VPMINUW, + /* 31A */ VPMOVMSKB, + /* 31B */ VPMOVSXBD, + /* 31C */ VPMOVSXBQ, + /* 31D */ VPMOVSXBW, + /* 31E */ VPMOVSXWD, + /* 31F */ VPMOVSXWQ, + /* 320 */ VPMOVZXBD, + /* 321 */ VPMOVZXBQ, + /* 322 */ VPMOVZXBW, + /* 323 */ VPMOVZXDQ, + /* 324 */ VPMOVZXWD, + /* 325 */ VPMOVZXWQ, + /* 326 */ VPMULDQ, + /* 327 */ VPMULHRSW, + /* 328 */ VPMULHUW, + /* 329 */ VPMULHW, + /* 32A */ VPMULLD, + /* 32B */ VPMULLW, + /* 32C */ VPOR, + /* 32D */ VPSADBW, + /* 32E */ VPSHUFB, + /* 32F */ VPSHUFD, + /* 330 */ VPSHUFHW, + /* 331 */ VPSHUFLW, + /* 332 */ VPSIGNB, + /* 333 */ VPSIGND, + /* 334 */ VPSIGNW, + /* 335 */ VPSLLD, + /* 336 */ VPSLLDQ, + /* 337 */ VPSLLQ, + /* 338 */ VPSLLW, + /* 339 */ VPSRAD, + /* 33A */ VPSRAW, + /* 33B */ VPSRLD, + /* 33C */ VPSRLDQ, + /* 33D */ VPSRLQ, + /* 33E */ VPSRLW, + /* 33F */ VPSUBB, + /* 340 */ VPSUBD, + /* 341 */ VPSUBQ, + /* 342 */ VPSUBSB, + /* 343 */ VPSUBSW, + /* 344 */ VPSUBUSB, + /* 345 */ VPSUBUSW, + /* 346 */ VPSUBW, + /* 347 */ VPTEST, + /* 348 */ VPUNPCKHBW, + /* 349 */ VPUNPCKHDQ, + /* 34A */ VPUNPCKHQDQ, + /* 34B */ VPUNPCKHWD, + /* 34C */ VPUNPCKLBW, + /* 34D */ VPUNPCKLDQ, + /* 34E */ VPUNPCKLQDQ, + /* 34F */ VPUNPCKLWD, + /* 350 */ VPXOR, + /* 351 */ VRCPPS, + /* 352 */ VRCPSS, + /* 353 */ VROUNDPD, + /* 354 */ VROUNDPS, + /* 355 */ VROUNDSD, + /* 356 */ VROUNDSS, + /* 357 */ VRSQRTPS, + /* 358 */ VRSQRTSS, + /* 359 */ VSHUFPD, + /* 35A */ VSHUFPS, + /* 35B */ VSQRTPD, + /* 35C */ VSQRTPS, + /* 35D */ VSQRTSD, + /* 35E */ VSQRTSS, + /* 35F */ VSTMXCSR, + /* 360 */ VSUBPD, + /* 361 */ VSUBPS, + /* 362 */ VSUBSD, + /* 363 */ VSUBSS, + /* 364 */ VTESTPD, + /* 365 */ VTESTPS, + /* 366 */ VUCOMISD, + /* 367 */ VUCOMISS, + /* 368 */ VUNPCKHPD, + /* 369 */ VUNPCKHPS, + /* 36A */ VUNPCKLPD, + /* 36B */ VUNPCKLPS, + /* 36C */ VXORPD, + /* 36D */ VXORPS, + /* 36E */ VZEROALL, + /* 36F */ VZEROUPPER, + /* 370 */ WAIT, + /* 371 */ WBINVD, + /* 372 */ WRMSR, + /* 373 */ XADD, + /* 374 */ XCHG, + /* 375 */ XCRYPTCBC, + /* 376 */ XCRYPTCFB, + /* 377 */ XCRYPTCTR, + /* 378 */ XCRYPTECB, + /* 379 */ XCRYPTOFB, + /* 37A */ XGETBV, + /* 37B */ XLATB, + /* 37C */ XOR, + /* 37D */ XORPD, + /* 37E */ XORPS, + /* 37F */ XRSTOR, + /* 380 */ XSAVE, + /* 381 */ XSETBV, + /* 382 */ XSHA1, + /* 383 */ XSHA256, + /* 384 */ XSTORE, +}; + +/** + * @brief Defines an alias representing an opcode tree node. An opcode tree node is a 16 bit + * unsigned integer. + * The first 4 bits are reserved for the node type and the rest contains the actual value. + * In case of an instruction definition node, the 5th bit of the node (or the first bit + * of the value) is used to signal whether the modrm byte is used by the instruction. + */ +typedef uint16_t VXOpcodeTreeNode; + +/** + * @brief Values that represent the type of an opcode tree node. + */ +enum class VXOpcodeTreeNodeType : uint8_t +{ + /** + * @brief Reference to a concrete instruction definition. + */ + INSTRUCTION_DEFINITION = 0, + /** + * @brief Reference to an opcode table. + */ + TABLE = 1, + /** + * @brief Reference to a modrm_mod switch table. + */ + MODRM_MOD = 2, + /** + * @brief Reference to a modrm_reg switch table. + */ + MODRM_REG = 3, + /** + * @brief Reference to a modrm_rm switch table. + */ + MODRM_RM = 4, + /** + * @brief Reference to a mandatory-prefix switch table. + */ + MANDATORY = 5, + /** + * @brief Reference to a x87 opcode table. + */ + X87 = 6, + /** + * @brief Reference to an address-size switch table. + */ + ADDRESS_SIZE = 7, + /** + * @brief Reference to an operand-size switch table. + */ + OPERAND_SIZE = 8, + /** + * @brief Reference to a cpu-mode switch table. + */ + MODE = 9, + /** + * @brief Reference to a vendor switch table. + */ + VENDOR = 10, + /** + * @brief Reference to a 3dnow! opcode table. + */ + AMD3DNOW = 11, + /** + * @brief Reference to a vex-prefix switch table. + */ + VEX = 12, + /** + * @brief Reference to a vex_w switch table. + */ + VEXW = 13, + /** + * @brief Reference to a vex_l switch table. + */ + VEXL = 14 +}; + +/** + * @brief Values that represent the type of an operand in the instruction definition. + */ +enum class VXDefinedOperandType : uint8_t +{ + /* + * @brief No operand. + */ + NONE, + /* + * @brief Direct address. The instruction has no ModR/M byte; the address of the operand is + * encoded in the instruction; no base register, index register, or scaling factor + * can be applied. + */ + A, + /* + * @brief The reg field of the ModR/M byte selects a control register. + */ + C, + /* + * @brief The reg field of the ModR/M byte selects a debug register. + */ + D, + /* + * @brief A ModR/M byte follows the opcode and specifies the operand. The operand is either + * a general-purpose register or a memory address. If it is a memory address, the + * address is computed from a segment register and any of the following values: + * a base register, an index register, a scaling factor, or a displacement. + */ + E, + /* + * @brief rFLAGS register. + */ + F, + /* + * @brief The reg field of the ModR/M byte selects a general register. + */ + G, + /* + * @brief The r/m field of the ModR/M byte always selects a general register, regardless of + * the mod field. + */ + H, + /* + * @brief Immediate data. The operand value is encoded in subsequent bytes of the + * instruction. + */ + I, + /* + * @brief Constant immediate data value of 1. + */ + I1, + /* + * @brief The instruction contains a relative offset to be added to the instruction pointer + * register. + */ + J, + /* + * @brief Source operand is encoded in immediate byte (VEX only). + */ + L, + /* + * @brief The ModR/M byte may refer only to memory: mod != 11bin. + */ + M, + /* + * @brief Combination of M and R. + */ + MR, + /* + * @brief Combination of M and U. + */ + MU, + /* + * @brief The R/M field of the ModR/M byte selects a packed quadword MMX technology register. + */ + N, + /* + * @brief The instruction has no ModR/M byte; the offset of the operand is coded as a word, + * double word or quad word (depending on address size attribute) in the instruction. + * No base register, index register, or scaling factor can be applied. + */ + O, + /* + * @brief The reg field of the ModR/M byte selects a packed quadword MMX technology register. + */ + P, + /* + * @brief A ModR/M byte follows the opcode and specifies the operand. The operand is either + * an MMX technology register or a memory address. If it is a memory address, the + * address is computed from a segment register and any of the following values: + * a base register, an index register, a scaling factor, and a displacement. + */ + Q, + /* + * @brief The mod field of the ModR/M byte may refer only to a general register. + */ + R, + /* + * @brief The reg field of the ModR/M byte selects a segment register. + */ + S, + /* + * @brief The R/M field of the ModR/M byte selects a 128-bit XMM register. + */ + U, + /* + * @brief The reg field of the ModR/M byte selects a 128-bit XMM register. + */ + V, + /* + * @brief A ModR/M byte follows the opcode and specifies the operand. The operand is either + * a 128-bit XMM register or a memory address. If it is a memory address, the address + * is computed from a segment register and any of the following values: + * a base register, an index register, a scaling factor, and a displacement. + */ + W, + /** + * @brief Register 0. + */ + R0, + /** + * @brief Register 1. + */ + R1, + /** + * @brief Register 2. + */ + R2, + /** + * @brief Register 3. + */ + R3, + /** + * @brief Register 4. + */ + R4, + /** + * @brief Register 5. + */ + R5, + /** + * @brief Register 6. + */ + R6, + /** + * @brief Register 7. + */ + R7, + /** + * @brief AL register. + */ + AL, + /** + * @brief CL register. + */ + CL, + /** + * @brief DL register. + */ + DL, + /** + * @brief AX register. + */ + AX, + /** + * @brief CX register. + */ + CX, + /** + * @brief DX register. + */ + DX, + /** + * @brief EAX register. + */ + EAX, + /** + * @brief ECX register. + */ + ECX, + /** + * @brief EDX register. + */ + EDX, + /** + * @brief RAX register. + */ + RAX, + /** + * @brief RCX register. + */ + RCX, + /** + * @brief RDX register. + */ + RDX, + /** + * @brief ES segment register. + */ + ES, + /** + * @brief CS segment register. + */ + CS, + /** + * @brief SS segment register. + */ + SS, + /** + * @brief DS segment register. + */ + DS, + /** + * @brief FS segment register. + */ + FS, + /** + * @brief GS segment register. + */ + GS, + /** + * @brief Floating point register 0. + */ + ST0, + /** + * @brief Floating point register 1. + */ + ST1, + /** + * @brief Floating point register 2. + */ + ST2, + /** + * @brief Floating point register 3. + */ + ST3, + /** + * @brief Floating point register 4. + */ + ST4, + /** + * @brief Floating point register 5. + */ + ST5, + /** + * @brief Floating point register 6. + */ + ST6, + /** + * @brief Floating point register 7. + */ + ST7 +}; + +/** + * @brief Values that represent the size of an operand in the instruction definition. + */ +enum class VXDefinedOperandSize : uint8_t +{ + /** + * @brief No operand. + */ + NA = 0, + /** + * @brief Word, dword or qword. + */ + Z, + /** + * @brief Word, dword or qword. + */ + V, + /** + * @brief Dword or qword. + */ + Y, + /** + * @brief Oword or yword. + */ + X, + /** + * @brief Dword or qword, depending on the disassembler mode. + */ + RDQ, + /* + * @brief Byte, regardless of operand-size attribute. + */ + B, + /* + * @brief Word, regardless of operand-size attribute. + */ + W, + /* + * @brief Doubleword, regardless of operand-size attribute. + */ + D, + /* + * @brief Quadword, regardless of operand-size attribute. + */ + Q, + /* + * @brief 10-byte far pointer. + */ + T, + /** + * @brief TODO: + */ + O, + /* + * @brief Double-quadword, regardless of operand-size attribute. + */ + DQ, + /* + * @brief Quad-quadword, regardless of operand-size attribute. + */ + QQ, + /** + * @brief B sized register or D sized memory operand. + */ + BD = (static_cast(B) << 4) | static_cast(D), + /** + * @brief B sized register or V sized memory operand. + */ + BV = (static_cast(B) << 4) | static_cast(V), + /** + * @brief W sized register or D sized memory operand. + */ + WD = (static_cast(W) << 4) | static_cast(D), + /** + * @brief W sized register or V sized memory operand. + */ + WV = (static_cast(W) << 4) | static_cast(V), + /** + * @brief W sized register or Y sized memory operand. + */ + WY = (static_cast(W) << 4) | static_cast(Y), + /** + * @brief D sized register or Y sized memory operand. + */ + DY = (static_cast(D) << 4) | static_cast(Y), + /** + * @brief W sized register or O sized memory operand. + */ + WO = (static_cast(W) << 4) | static_cast(O), + /** + * @brief D sized register or O sized memory operand. + */ + DO = (static_cast(D) << 4) | static_cast(O), + /** + * @brief Q sized register or O sized memory operand. + */ + QO = (static_cast(Q) << 4) | static_cast(O), +}; + +/** + * @brief Values that represent optional flags in the instruction definition. + * Do not change the order or the values of this enum! + */ +enum VXInstructionDefinitionFlags : uint16_t +{ + IDF_ACCEPTS_REXB = 0x0001, + IDF_ACCEPTS_REXX = 0x0002, + IDF_ACCEPTS_REXR = 0x0004, + IDF_ACCEPTS_REXW = 0x0008, + IDF_ACCEPTS_ADDRESS_SIZE_OVERRIDE = 0x0010, + IDF_ACCEPTS_OPERAND_SIZE_OVERRIDE = 0x0020, + IDF_ACCEPTS_SEGMENT_OVERRIDE = 0x0040, + IDF_ACCEPTS_REP_PREFIX = 0x0080, + IDF_ACCEPTS_VEXL = 0x0100, + IDF_INVALID_64 = 0x0200, + IDF_DEFAULT_64 = 0x0400, + IDF_ACCEPTS_LOCK_PREFIX = 0x0800, // TODO: + IDF_PRIVILEGED_INSTRUCTION = 0x1000 // TODO: +}; + +#pragma pack (push, 1) +/** + * @brief An operand definition. + */ +struct VXOperandDefinition +{ + VXDefinedOperandType type; + VXDefinedOperandSize size; +}; +/** + * @brief An instruction definition. + */ +struct VXInstructionDefinition +{ + VXInstructionMnemonic mnemonic; + VXOperandDefinition operand[4]; + uint16_t flags; +}; +#pragma pack (pop) + +namespace Internal +{ + +/** + * @brief Contains all opcode tables. + * Indexed by the numeric value of the opcode. + */ +extern const VXOpcodeTreeNode optreeTable[][256]; +/** + * @brief Contains all modrm_mod switch tables. + * Index values: + * 0 = [modrm_mod == !11] + * 1 = [modrm_mod == 11] + */ +extern const VXOpcodeTreeNode optreeModrmMod[][2]; +/** + * @brief Contains all modrm_reg switch tables. + * Indexed by the numeric value of the modrm_reg field. + */ +extern const VXOpcodeTreeNode optreeModrmReg[][8]; +/** + * @brief Contains all modrm_rm switch tables. + * Indexed by the numeric value of the modrm_rm field. + */ +extern const VXOpcodeTreeNode optreeModrmRm[][8]; +/** + * @brief Contains all mandatory-prefix switch tables. + * Index values: + * 0 = none + * 1 = F2 + * 2 = F3 + * 3 = 66 + */ +extern const VXOpcodeTreeNode optreeMandatory[][4]; +/** + * @brief Contains all x87 opcode tables. + * Indexed by the numeric value of the 6 lowest bits of the modrm byte (modrm_mod should + * always be 11). + */ +extern const VXOpcodeTreeNode optreeX87[][64]; +/** + * @brief Contains all address-size switch tables. + * Index values: + * 0 = 16 + * 1 = 32 + * 2 = 64 + */ +extern const VXOpcodeTreeNode optreeAddressSize[][3]; +/** + * @brief Contains all operand-size switch tables. + * Index values: + * 0 = 16 + * 1 = 32 + * 2 = 64 + */ +extern const VXOpcodeTreeNode optreeOperandSize[][3]; +/** + * @brief Contains all cpu-mode switch tables. + * Index values: + * 0 = [!= 64] + * 1 = 64 + */ +extern const VXOpcodeTreeNode optreeMode[][2]; +/** + * @brief Contains all vendor switch tables. + * Index values: + * 0 = AMD + * 1 = Intel + */ +extern const VXOpcodeTreeNode optreeVendor[][2]; +/** + * @brief Contains all 3dnow! switch tables. + * Indexed by the numeric value of the 3dnow! opcode. + */ +extern const VXOpcodeTreeNode optree3dnow[][256]; +/** + * @brief Contains all vex switch tables. + * Index values: + * 0 = none + * 1 = 0F + * 2 = 0F38 + * 3 = 0F3A + * 4 = 66 + * 5 = 66_0F + * 6 = 66_0F38 + * 7 = 66_0F3A + * 8 = F3 + * 9 = F3_0F + * A = F3_0F38 + * B = F3_0F3A + * C = F2 + * D = F2_0F + * E = F2_0F38 + * F = F2_0F3A + */ +extern const VXOpcodeTreeNode optreeVex[][16]; +/** + * @brief Contains all vex_w switch tables. + * Indexed by the numeric value of the vex_w field. + */ +extern const VXOpcodeTreeNode optreeVexW[][2]; +/** + * @brief Contains all vex_l switch tables. + * Indexed by the numeric value of the vex_l field. + */ +extern const VXOpcodeTreeNode optreeVexL[][2]; +/** + * @brief Contains all instruction definitions. + */ +extern const VXInstructionDefinition instrDefinitions[]; +/** + * @brief Contains all instruction mnemonic strings. + */ +extern const char* instrMnemonicStrings[]; + +/** + * @brief Returns the type of the specified opcode tree node. + * @param node The node. + * @return The type of the specified opcode tree node. + */ +inline VXOpcodeTreeNodeType GetOpcodeNodeType(VXOpcodeTreeNode node) +{ + return static_cast((node >> 12) & 0x0F); +} + +/** + * @brief Returns the value of the specified opcode tree node. + * @param node The node. + * @return The value of the specified opcode tree node. + */ +inline uint16_t GetOpcodeNodeValue(VXOpcodeTreeNode node) +{ + return (node & 0x0FFF); +} + +/** + * @brief Returns the root node of the opcode tree. + * @return The root node of the opcode tree. + */ +inline VXOpcodeTreeNode GetOpcodeTreeRoot() +{ + return 0x1000; +} + +/** + * @brief Returns a child node of @c parent specified by @c index. + * @param parent The parent node. + * @param index The index of the child node to retrieve. + * @return The specified child node. + */ +inline VXOpcodeTreeNode GetOpcodeTreeChild(VXOpcodeTreeNode parent, uint16_t index) +{ + using namespace Internal; + VXOpcodeTreeNodeType nodeType = GetOpcodeNodeType(parent); + uint16_t tableIndex = GetOpcodeNodeValue(parent); + switch (nodeType) + { + case VXOpcodeTreeNodeType::TABLE: + assert(index < 256); + return optreeTable[tableIndex][index]; + case VXOpcodeTreeNodeType::MODRM_MOD: + assert(index < 2); + return optreeModrmMod[tableIndex][index]; + case VXOpcodeTreeNodeType::MODRM_REG: + assert(index < 8); + return optreeModrmReg[tableIndex][index]; + case VXOpcodeTreeNodeType::MODRM_RM: + assert(index < 8); + return optreeModrmRm[tableIndex][index]; + case VXOpcodeTreeNodeType::MANDATORY: + assert(index < 4); + return optreeMandatory[tableIndex][index]; + case VXOpcodeTreeNodeType::X87: + assert(index < 64); + return optreeX87[tableIndex][index]; + case VXOpcodeTreeNodeType::ADDRESS_SIZE: + assert(index < 3); + return optreeAddressSize[tableIndex][index]; + case VXOpcodeTreeNodeType::OPERAND_SIZE: + assert(index < 3); + return optreeOperandSize[tableIndex][index]; + case VXOpcodeTreeNodeType::MODE: + assert(index < 2); + return optreeMode[tableIndex][index]; + case VXOpcodeTreeNodeType::VENDOR: + assert(index < 3); + return optreeVendor[tableIndex][index]; + case VXOpcodeTreeNodeType::AMD3DNOW: + assert(index < 256); + return optree3dnow[tableIndex][index]; + case VXOpcodeTreeNodeType::VEX: + assert(index < 16); + return optreeVex[tableIndex][index]; + case VXOpcodeTreeNodeType::VEXW: + assert(index < 2); + return optreeVexW[tableIndex][index]; + case VXOpcodeTreeNodeType::VEXL: + assert(index < 2); + return optreeVexL[tableIndex][index]; + default: + assert(0); + } + return 0xFFFF; +} + +/** + * @brief Returns the instruction definition that is linked to the given @c node. + * @param node The instruction definition node. + * @param hasModrm Signals whether the instruction uses the modrm byte. + * @return NULL if it fails, else the instruction definition. + */ +inline const VXInstructionDefinition* GetInstructionDefinition(VXOpcodeTreeNode node, + bool &hasModrm) +{ + assert(GetOpcodeNodeType(node) == VXOpcodeTreeNodeType::INSTRUCTION_DEFINITION); + hasModrm = ((node & 0x0800) == 0x800); + return &instrDefinitions[node & 0x07FF]; +} + +/** + * @brief Returns the instruction definition that is linked to the given @c node. + * @param node The instruction definition node. + * @return NULL if it fails, else the instruction definition. + */ +inline const VXInstructionDefinition* GetInstructionDefinition(VXOpcodeTreeNode node) +{ + bool hasModrm = false; + return GetInstructionDefinition(node, hasModrm); +} + +/** + * @brief Returns the specified instruction mnemonic string. + * @param mnemonic The mnemonic. + * @return The instruction mnemonic string. + */ +inline const char* GetInstructionMnemonicString(VXInstructionMnemonic mnemonic) +{ + return instrMnemonicStrings[static_cast(mnemonic)]; +} + +/** + * @brief Returns the memory size part of the complex operand size. + * @param operandSize The defined operand size. + * @return The defined memory operand size. + */ +inline VXDefinedOperandSize GetComplexOperandMemSize(VXDefinedOperandSize operandSize) +{ + return static_cast(static_cast(operandSize) & 0xF); +} + +/** + * @brief Returns the register size part of the complex operand size. + * @param operandSize The defined operand size. + * @return The defined register operand size. + */ +inline VXDefinedOperandSize GetComplexOperandRegSize(VXDefinedOperandSize operandSize) +{ + return static_cast((static_cast(operandSize) >> 4) & 0xF); +} + +} + +} + +} diff --git a/Verteron Disassembler Engine/VXSymbolResolver.cpp b/Verteron Disassembler Engine/VXSymbolResolver.cpp new file mode 100644 index 0000000..8b6ccfd --- /dev/null +++ b/Verteron Disassembler Engine/VXSymbolResolver.cpp @@ -0,0 +1,88 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 23. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#include "VXSymbolResolver.h" + +namespace Verteron +{ + +namespace Disassembler +{ + +VXBaseSymbolResolver::~VXBaseSymbolResolver() +{ + +} + +const char* VXBaseSymbolResolver::resolveSymbol(const VXInstructionInfo &info, uint64_t address, + uint64_t &offset) +{ + return nullptr; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +VXExactSymbolResolver::~VXExactSymbolResolver() +{ + +} + +const char* VXExactSymbolResolver::resolveSymbol(const VXInstructionInfo &info, uint64_t address, + uint64_t &offset) +{ + std::unordered_map::const_iterator iterator = m_symbolMap.find(address); + return (iterator == m_symbolMap.end()) ? nullptr : iterator->second.c_str(); +} + +void VXExactSymbolResolver::setSymbol(uint64_t address, const char* name) +{ + m_symbolMap[address].assign(name); +} + +void VXExactSymbolResolver::removeSymbol(uint64_t address) +{ + m_symbolMap.erase(address); +} + +void VXExactSymbolResolver::clear() +{ + m_symbolMap.clear(); +} + +bool VXExactSymbolResolver::containsSymbol(uint64_t address) +{ + std::unordered_map::const_iterator iterator = m_symbolMap.find(address); + return (iterator == m_symbolMap.end()) ? false : true; +} + +} + +} diff --git a/Verteron Disassembler Engine/VXSymbolResolver.h b/Verteron Disassembler Engine/VXSymbolResolver.h new file mode 100644 index 0000000..9075c2c --- /dev/null +++ b/Verteron Disassembler Engine/VXSymbolResolver.h @@ -0,0 +1,119 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : Florian Bernd + Modifications : + + Last change : 23. October 2014 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ +#pragma once + +#include +#include +#include "VXDisassemblerTypes.h" + +namespace Verteron +{ + +namespace Disassembler +{ + +/** + * @brief Base class for all symbol resolver implementations. + */ +class VXBaseSymbolResolver +{ +public: + /** + * @brief Destructor. + */ + virtual ~VXBaseSymbolResolver(); +public: + /** + * @brief Resolves a symbol. + * @param info The instruction info. + * @param address The address. + * @param offset Reference to an unsigned 64 bit integer that receives an offset + * relative to the base address of the symbol. + * @return The name of the symbol, if the symbol was found, @c NULL if not. + */ + virtual const char* resolveSymbol(const VXInstructionInfo &info, uint64_t address, + uint64_t &offset); +}; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * @brief Simple symbol resolver that only matches exact addresses. + */ +class VXExactSymbolResolver : public VXBaseSymbolResolver +{ +private: + std::unordered_map m_symbolMap; +public: + /** + * @brief Destructor. + */ + ~VXExactSymbolResolver() override; +public: + /** + * @brief Resolves a symbol. + * @param info The instruction info. + * @param address The address. + * @param offset Reference to an unsigned 64 bit integer that receives an offset + * relative to the base address of the symbol. + * @return The name of the symbol, if the symbol was found, @c NULL if not. + */ + const char* resolveSymbol(const VXInstructionInfo &info, uint64_t address, + uint64_t &offset) override; +public: + /** + * @brief Adds or changes a symbol. + * @param address The address. + * @param name The symbol name. + */ + void setSymbol(uint64_t address, const char* name); + /** + * @brief Removes the symbol described by address. This will invalidate all char pointers + * to the specific symbol name. + * @param address The address. + */ + void removeSymbol(uint64_t address); + /** + * @brief Clears the symbol tree. + */ + void clear(); + /** + * @brief Query if the given address is a known symbol. + * @param address The address. + * @return True if the address is known, false if not. + */ + bool containsSymbol(uint64_t address); +}; + +} + +} diff --git a/Verteron Disassembler Engine/Verteron Disassembler Engine.vcxproj b/Verteron Disassembler Engine/Verteron Disassembler Engine.vcxproj new file mode 100644 index 0000000..c61f9f4 --- /dev/null +++ b/Verteron Disassembler Engine/Verteron Disassembler Engine.vcxproj @@ -0,0 +1,155 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + + + + + + + + + + + {E9860351-F9EA-4D1B-8AE4-188E3212574A} + Win32Proj + VerteronDisassemblerEngine + + + + StaticLibrary + true + v120 + Unicode + + + StaticLibrary + true + v120 + Unicode + + + StaticLibrary + false + v120 + true + Unicode + + + StaticLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + true + + + Windows + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + true + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + + + Windows + true + true + true + + + + + + \ No newline at end of file diff --git a/Verteron Disassembler Engine/Verteron Disassembler Engine.vcxproj.filters b/Verteron Disassembler Engine/Verteron Disassembler Engine.vcxproj.filters new file mode 100644 index 0000000..309156f --- /dev/null +++ b/Verteron Disassembler Engine/Verteron Disassembler Engine.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file