diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..bfdd874 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,71 @@ +2018-10-08 version 2.51 +* fix bug in movq mm0,rax + +2018-08-15 version 2.50 +* minor change in omf2cof + +2018-01-29 version 2.49 +* fixed minor problem with disassembly of DLL + +2017-10-18 version 2.48 +* minor changes + +2017-07-27 version 2.47 +* fixed bug in library manager for long module names + +2017-07-15 version 2.46 +* dump of ELF files improved +* a new unnecessary warnings removed + +2017-04-10 version 2.45 +* support disassembly of forthcoming Control-flow Enforcement instructions + +2016-11-27 version 2.44 +* fixed bug when disassembling file generated by Tiny C compiler + +2016-11-09 version 2.43 +* fixed "string table corrupt" message for ELF files +* support for disassembly of AVX512_4VNNIW, AVX512_4FMAPS instructions + +2016-01-16 version 2.42 +* fixed bugs with disassembly of some AVX512 and BMI2 instructions + +2015-10-15 version 2.41 +* fixed bugs with disassembly of some AVX512 instructions +* fixed missing "ptr" in masm syntax disassembly + +2015-10-15 version 2.40 +* fixed bugs with disassembly of some AVX512 instructions + +2015-09-14 version 2.39 +* fixed bugs with disassembly of some AVX512 instructions + +2014-12-15 version 2.38 +* fixed bugs with disassembly of Knights Corner instruction set +* exe file made compatible with Windows XP + +2014-12-06 version 2.37 +* support for disassembly of AVX512BW/DQ, etc. +* fixed disassembly bug of vpgatherdd on knights corner +* fixed disassembly bug for FMA4 instructions +* improved disassembly of switch/case tables for gcc and clang compilers + +2014-07-21 version 2.36 +* improved execution times for disassembling very big files + +2013-11-27 version 2.32 +* fix bug with .bss section in elf2elf.cpp and elf2coff.cpp + +2013-08-23 version 2.31 +* support for disassembly of AVX512F +* library operations were extremely slow on big libraries because of rebuilding and search for unique names. This problem is fixed. +* long member names allowed in libraries +* option -ls to make member names short. Perhaps good for compatibility with BSD. Member names are made unique just by adding a running hex number, not by comparing with all previous names, which was the cause of slow operations in previous versions. +* option -ns to change symbol suffixes +* options -ap and -as to change prefix or suffix and keep old name as alias +* added missing relocation type in ELF to COFF conversion +* fixed error that often occurred when disassembling .exe files +* fixed minor errors + +2012-08-31 version 2.16 +* support for disassembly of Knights Corner instruction set diff --git a/extras/u2wstub.obj b/extras/u2wstub.obj index dc8ce50..885b4ef 100644 Binary files a/extras/u2wstub.obj and b/extras/u2wstub.obj differ diff --git a/extras/u2wstubvec1.obj b/extras/u2wstubvec1.obj index 5c5fd4e..3aa01f3 100644 Binary files a/extras/u2wstubvec1.obj and b/extras/u2wstubvec1.obj differ diff --git a/extras/u2wstubvec2.obj b/extras/u2wstubvec2.obj index 03e83fd..b0c4e37 100644 Binary files a/extras/u2wstubvec2.obj and b/extras/u2wstubvec2.obj differ diff --git a/extras/w2ustub.o b/extras/w2ustub.o index 3fa661a..68a8ae6 100644 Binary files a/extras/w2ustub.o and b/extras/w2ustub.o differ diff --git a/extras/w2ustubvec.o b/extras/w2ustubvec.o index eca8737..8418213 100644 Binary files a/extras/w2ustubvec.o and b/extras/w2ustubvec.o differ diff --git a/objconv-instructions.pdf b/objconv-instructions.pdf index c5515d5..6b74686 100644 Binary files a/objconv-instructions.pdf and b/objconv-instructions.pdf differ diff --git a/objconv.exe b/objconv.exe new file mode 100644 index 0000000..e44e743 Binary files /dev/null and b/objconv.exe differ diff --git a/src/build.sh b/src/build.sh index e1d524b..3a4f3dc 100644 --- a/src/build.sh +++ b/src/build.sh @@ -14,4 +14,4 @@ # Alternatively, run the following line: -g++ -o objconv -O2 *.cpp \ No newline at end of file +g++ -o objconv -O2 *.cpp diff --git a/src/cmdline.cpp b/src/cmdline.cpp index 4270e8a..dab1c97 100644 --- a/src/cmdline.cpp +++ b/src/cmdline.cpp @@ -1,48 +1,48 @@ /**************************** cmdline.cpp ********************************** * Author: Agner Fog * Date created: 2006-07-25 -* Last modified: 2012-08-23 +* Last modified: 2018-01-29 * Project: objconv * Module: cmdline.cpp * Description: * This module is for interpretation of command line options * Also contains symbol change function * -* Copyright 2006-2012 GNU General Public License http://www.gnu.org/licenses +* Copyright 2006-2018 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" // List of recognized output file type options static SIntTxt TypeOptionNames[] = { - {CMDL_OUTPUT_ELF, "elf"}, - {CMDL_OUTPUT_PE, "pe"}, - {CMDL_OUTPUT_PE, "cof"}, - {CMDL_OUTPUT_PE, "coff"}, - {CMDL_OUTPUT_PE, "win"}, - {CMDL_OUTPUT_OMF, "omf"}, - {CMDL_OUTPUT_MACHO, "mac"}, - {CMDL_OUTPUT_MACHO, "mach"}, - {CMDL_OUTPUT_MACHO, "macho"}, - {CMDL_OUTPUT_MACHO, "mach-o"}, - {CMDL_OUTPUT_MASM, "asm"}, - {CMDL_OUTPUT_MASM, "masm"}, - {CMDL_OUTPUT_MASM, "tasm"}, - {CMDL_OUTPUT_MASM, "nasm"}, - {CMDL_OUTPUT_MASM, "yasm"}, - {CMDL_OUTPUT_MASM, "gasm"}, - {CMDL_OUTPUT_MASM, "gas"} + {CMDL_OUTPUT_ELF, "elf"}, + {CMDL_OUTPUT_PE, "pe"}, + {CMDL_OUTPUT_PE, "coff"}, + {CMDL_OUTPUT_PE, "cof"}, + {CMDL_OUTPUT_PE, "win"}, + {CMDL_OUTPUT_OMF, "omf"}, + {CMDL_OUTPUT_MACHO, "mac"}, + {CMDL_OUTPUT_MACHO, "macho"}, + {CMDL_OUTPUT_MACHO, "mach-o"}, + {CMDL_OUTPUT_MACHO, "mach"}, + {CMDL_OUTPUT_MASM, "asm"}, + {CMDL_OUTPUT_MASM, "masm"}, + {CMDL_OUTPUT_MASM, "tasm"}, + {CMDL_OUTPUT_MASM, "nasm"}, + {CMDL_OUTPUT_MASM, "yasm"}, + {CMDL_OUTPUT_MASM, "gasm"}, + {CMDL_OUTPUT_MASM, "gas"} }; // List of subtype names static SIntTxt SubtypeNames[] = { - {SUBTYPE_MASM, "asm"}, - {SUBTYPE_MASM, "masm"}, - {SUBTYPE_MASM, "tasm"}, - {SUBTYPE_YASM, "nasm"}, - {SUBTYPE_YASM, "yasm"}, - {SUBTYPE_GASM, "gasm"}, - {SUBTYPE_GASM, "gas"} + {SUBTYPE_MASM, "asm"}, + {SUBTYPE_MASM, "masm"}, + {SUBTYPE_MASM, "tasm"}, + {SUBTYPE_YASM, "nasm"}, + {SUBTYPE_YASM, "yasm"}, + {SUBTYPE_GASM, "gasm"}, + {SUBTYPE_GASM, "gas"} }; // List of standard names that are always translated @@ -50,15 +50,15 @@ const uint32 MaxType = FILETYPE_MACHO_LE; // Standard names in 32-bit mode const char * StandardNames32[][MaxType+1] = { -// 0, COFF, OMF, ELF, MACHO - {0,"___ImageBase","___ImageBase","__executable_start","__mh_execute_header"} + // 0, COFF, OMF, ELF, MACHO + {0,"___ImageBase","___ImageBase","__executable_start","__mh_execute_header"} }; // Standard names in 64-bit mode // COFF removes an underscore in 32-bit. There is no 64-bit OMF const char * StandardNames64[][MaxType+1] = { -// 0, COFF, OMF, ELF, MACHO - {0,"__ImageBase", "", "__executable_start","__mh_execute_header"} + // 0, COFF, OMF, ELF, MACHO + {0,"__ImageBase", "", "__executable_start","__mh_execute_header"} }; const int NumStandardNames = sizeof(StandardNames32) / sizeof(StandardNames32[0]); @@ -68,15 +68,15 @@ const int NumStandardNames = sizeof(StandardNames32) / sizeof(StandardNames32[0] CCommandLineInterpreter cmd; // Instantiate command line interpreter CCommandLineInterpreter::CCommandLineInterpreter() { - // Default constructor - memset(this, 0, sizeof(*this)); // Set all to zero - Verbose = CMDL_VERBOSE_YES; // How much diagnostics to print on screen - DumpOptions = DUMP_NONE; // Dump options - DebugInfo = CMDL_DEBUG_DEFAULT; // Strip or convert debug info - ExeptionInfo = CMDL_EXCEPTION_DEFAULT; // Strip or preserve exception handling info - SegmentDot = CMDL_SECTIONDOT_NOCHANGE; // Change underscore/dot in beginning of segment names - Underscore = CMDL_UNDERSCORE_NOCHANGE; // Add/remove underscores in symbol names - LibraryOptions = CMDL_LIBRARY_DEFAULT; // Library options + // Default constructor + memset(this, 0, sizeof(*this)); // Set all to zero + Verbose = CMDL_VERBOSE_YES; // How much diagnostics to print on screen + DumpOptions = DUMP_NONE; // Dump options + DebugInfo = CMDL_DEBUG_DEFAULT; // Strip or convert debug info + ExeptionInfo = CMDL_EXCEPTION_DEFAULT; // Strip or preserve exception handling info + SegmentDot = CMDL_SECTIONDOT_NOCHANGE; // Change underscore/dot in beginning of segment names + Underscore = CMDL_UNDERSCORE_NOCHANGE; // Add/remove underscores in symbol names + LibraryOptions = CMDL_LIBRARY_DEFAULT; // Library options } @@ -86,1092 +86,1151 @@ CCommandLineInterpreter::~CCommandLineInterpreter() { // Destructor void CCommandLineInterpreter::ReadCommandLine(int argc, char * argv[]) { - // Read command line - for (int i = 1; i < argc; i++) { - ReadCommandItem(argv[i]); - } - if (ShowHelp || (InputFile == 0 && OutputFile == 0) || !OutputType) { - // No useful command found. Print help - Help(); ShowHelp = 1; - return; - } - // Check file options - FileOptions = CMDL_FILE_INPUT; - if (LibraryOptions == CMDL_LIBRARY_ADDMEMBER) { - // Adding object files to library. Library may not exist - FileOptions = CMDL_FILE_IN_IF_EXISTS; - } - if (DumpOptions || ((LibraryOptions & CMDL_LIBRARY_EXTRACTMEM) && !(LibraryOptions & CMDL_LIBRARY_ADDMEMBER))) { - // Dumping or extracting. Output file not used - if (OutputFile) err.submit(1103); // Output file name ignored - OutputFile = 0; - } - else { - // Output file required - FileOptions |= CMDL_FILE_OUTPUT; - } - if ((LibraryOptions & CMDL_LIBRARY_ADDMEMBER) && !(LibraryOptions & CMDL_LIBRARY_CONVERT)) { - // Adding library members only. Output file may have same name as input file - FileOptions |= CMDL_FILE_IN_OUT_SAME; - } - // Check output type - if (!OutputType) { - // Output type not defined yet - if (LibraryOptions & (CMDL_LIBRARY_CONVERT | CMDL_LIBRARY_ADDMEMBER)) { - OutputType = FILETYPE_LIBRARY; - } - } + // Read command line + for (int i = 1; i < argc; i++) { + ReadCommandItem(argv[i]); + } + if (ShowHelp || (InputFile == 0 && OutputFile == 0) /* || !OutputType */) { + // No useful command found. Print help + Help(); ShowHelp = 1; + return; + } + // Check file options + FileOptions = CMDL_FILE_INPUT; + if (LibraryOptions == CMDL_LIBRARY_ADDMEMBER) { + // Adding object files to library. Library may not exist + FileOptions = CMDL_FILE_IN_IF_EXISTS; + } + if (DumpOptions || ((LibraryOptions & CMDL_LIBRARY_EXTRACTMEM) && !(LibraryOptions & CMDL_LIBRARY_ADDMEMBER))) { + // Dumping or extracting. Output file not used + if (OutputFile) err.submit(1103); // Output file name ignored + OutputFile = 0; + } + else { + // Output file required + FileOptions |= CMDL_FILE_OUTPUT; + } + if ((LibraryOptions & CMDL_LIBRARY_ADDMEMBER) && !(LibraryOptions & CMDL_LIBRARY_CONVERT)) { + // Adding library members only. Output file may have same name as input file + FileOptions |= CMDL_FILE_IN_OUT_SAME; + } + // Check output type + if (!OutputType) { + // Output type not defined yet + if (LibraryOptions & (CMDL_LIBRARY_CONVERT | CMDL_LIBRARY_ADDMEMBER)) { + OutputType = FILETYPE_LIBRARY; + } + } } void CCommandLineInterpreter::ReadCommandItem(char * string) { - // Read one option from command line - // Skip leading whitespace - while (*string != 0 && *string <= ' ') string++; - if (*string == 0) return; // Empty string + // Read one option from command line + // Skip leading whitespace + while (*string != 0 && *string <= ' ') string++; + if (*string == 0) return; // Empty string - // Look for option prefix and response file prefix - const char OptionPrefix1 = '-'; // Option must begin with '-' + // Look for option prefix and response file prefix + const char OptionPrefix1 = '-'; // Option must begin with '-' #if defined (_WIN32) || defined (__WINDOWS__) - const char OptionPrefix2 = '/'; // '/' allowed instead of '-' in Windows only + const char OptionPrefix2 = '/'; // '/' allowed instead of '-' in Windows only #else - const char OptionPrefix2 = '-'; + const char OptionPrefix2 = '-'; #endif - const char ResponseFilePrefix = '@'; // Response file name prefixed by '@' - if (*string == OptionPrefix1 || *string == OptionPrefix2) { - // Option prefix found. This is a command line option - InterpretCommandOption(string+1); - } - else if (*string == ResponseFilePrefix) { - // Response file prefix found. Read more options from response file - ReadCommandFile(string+1); - } - else { - // No prefix found. This is an input or output file name - InterpretFileName(string); - } + const char ResponseFilePrefix = '@'; // Response file name prefixed by '@' + if (*string == OptionPrefix1 || *string == OptionPrefix2) { + // Option prefix found. This is a command line option + InterpretCommandOption(string+1); + } + else if (*string == ResponseFilePrefix) { + // Response file prefix found. Read more options from response file + ReadCommandFile(string+1); + } + else { + // No prefix found. This is an input or output file name + InterpretFileName(string); + } } void CCommandLineInterpreter::ReadCommandFile(char * filename) { - // Read commands from file - if (*filename <= ' ') { - err.submit(1001); return; // Warning: empty filename - } - - // Check if too many response file buffers (possibly because file includes itself) - if (++NumBuffers > MAX_COMMAND_FILES) {err.submit(2107); return;} - - // Allocate buffer for response files. - if (ResponseFiles.GetNumEntries() == 0) { - ResponseFiles.SetNum(MAX_COMMAND_FILES); - ResponseFiles.SetZero(); - } - - // Read response file into new buffer - ResponseFiles[NumBuffers-1].FileName = filename; - ResponseFiles[NumBuffers-1].Read(); - - // Get buffer with file contents - char * buffer = ResponseFiles[NumBuffers-1].Buf(); - char * ItemBegin, * ItemEnd; // Mark begin and end of token in buffer - - // Check if buffer is allocated - if (buffer) { - - // Parse contents of response file for tokens - while (*buffer) { - - // Skip whitespace - while (*buffer != 0 && uint8(*buffer) <= uint8(' ')) buffer++; - if (*buffer == 0) break; // End of buffer found - ItemBegin = buffer; - - // Find end of token - ItemEnd = buffer+1; - while (uint8(*ItemEnd) > uint8(' ')) ItemEnd++; - if (*ItemEnd == 0) { - buffer = ItemEnd; - } - else { - buffer = ItemEnd + 1; - *ItemEnd = 0; // Mark end of token - } - // Found token. - // Check if it is a comment beginning with '#' or '//' - if (ItemBegin[0] == '#' || (ItemBegin[0] == '/' && ItemBegin[1] == '/' )) { - // This is a comment. Skip to end of line - ItemEnd = buffer; - while (*ItemEnd != 0 && *ItemEnd != '\n') { - ItemEnd++; - } + // Read commands from file + if (*filename <= ' ') { + err.submit(1001); return; // Warning: empty filename + } + + // Check if too many response file buffers (possibly because file includes itself) + if (++NumBuffers > MAX_COMMAND_FILES) {err.submit(2107); return;} + + // Allocate buffer for response files. + if (ResponseFiles.GetNumEntries() == 0) { + ResponseFiles.SetNum(MAX_COMMAND_FILES); + ResponseFiles.SetZero(); + } + + // Read response file into new buffer + ResponseFiles[NumBuffers-1].FileName = filename; + ResponseFiles[NumBuffers-1].Read(); + + // Get buffer with file contents + char * buffer = ResponseFiles[NumBuffers-1].Buf(); + char * ItemBegin, * ItemEnd; // Mark begin and end of token in buffer + + // Check if buffer is allocated + if (buffer) { + + // Parse contents of response file for tokens + while (*buffer) { + + // Skip whitespace + while (*buffer != 0 && uint8(*buffer) <= uint8(' ')) buffer++; + if (*buffer == 0) break; // End of buffer found + ItemBegin = buffer; + + // Find end of token + ItemEnd = buffer+1; + while (uint8(*ItemEnd) > uint8(' ')) ItemEnd++; if (*ItemEnd == 0) { - buffer = ItemEnd; + buffer = ItemEnd; } else { - buffer = ItemEnd + 1; + buffer = ItemEnd + 1; + *ItemEnd = 0; // Mark end of token + } + // Found token. + // Check if it is a comment beginning with '#' or '//' + if (ItemBegin[0] == '#' || (ItemBegin[0] == '/' && ItemBegin[1] == '/' )) { + // This is a comment. Skip to end of line + ItemEnd = buffer; + while (*ItemEnd != 0 && *ItemEnd != '\n') { + ItemEnd++; + } + if (*ItemEnd == 0) { + buffer = ItemEnd; + } + else { + buffer = ItemEnd + 1; + } + continue; } - continue; - } - // Not a comment. Interpret token - ReadCommandItem(ItemBegin); - } - } + // Not a comment. Interpret token + ReadCommandItem(ItemBegin); + } + } } void CCommandLineInterpreter::InterpretFileName(char * string) { - // Interpret input or output filename from command line - - switch (libmode) { - case 1: // First filename after -lib = inputfile and outputfile - InputFile = string; - libmode = 2; - return; - - case 2: // Second or later filename after -lib = object file to add to library - AddObjectToLibrary(string, string); - return; - } - // libmode = 0: Ordinary input or output file - - if (!InputFile) { - // Input file not specified yet - InputFile = string; - } - else if (!OutputFile) { - // Output file not specified yet - OutputFile = string; - } - else { - // Both input and output files already specified - err.submit(2001); - } + // Interpret input or output filename from command line + + switch (libmode) { + case 1: // First filename after -lib = inputfile and outputfile + InputFile = string; + libmode = 2; + return; + + case 2: // Second or later filename after -lib = object file to add to library + AddObjectToLibrary(string, string); + return; + } + // libmode = 0: Ordinary input or output file + + if (!InputFile) { + // Input file not specified yet + InputFile = string; + } + else if (!OutputFile) { + // Output file not specified yet + OutputFile = string; + } + else { + // Both input and output files already specified + err.submit(2001); + } } void CCommandLineInterpreter::InterpretCommandOption(char * string) { - // Interpret one option from command line - if (*string <= ' ') { - err.submit(1001); return; // Warning: empty option - } - - // Detect option type - switch(string[0]) { - case 'f': case 'F': // output file format - if (string[1] == 'd') { - // -fd == deprecated dump option - InterpretDumpOption(string+2); break; - } - InterpretOutputTypeOption(string+1); break; - - case 'v': case 'V': // verbose/silent - InterpretVerboseOption(string+1); break; - - case 'd': case 'D': // dump option - InterpretDumpOption(string+1); break; - // Debug info option - //InterpretDebugInfoOption(string+1); break; - - case 'x': case 'X': // Exception handler info option - InterpretExceptionInfoOption(string+1); break; - - case 'h': case 'H': case '?': // Help - ShowHelp = 1; break; - - case 'e': case 'E': // Error option - case 'w': case 'W': // Warning option - InterpretErrorOption(string); break; - - case 'n': case 'N': // Symbol name change option - case 'a': case 'A': // Symbol name alias option - InterpretSymbolNameChangeOption(string); break; - - case 'i': case 'I': // Imagebase - if ((string[1] | 0x20) == 'm') { - InterpretImagebaseOption(string); - } - break; - - case 'l': case 'L': // Library option - InterpretLibraryOption(string); break; - - case 'c': // Count instruction codes supported - // This is an easter egg: You can only get it if you know it's there - if (strncmp(string,"countinstructions", 17) == 0) { - CDisassembler::CountInstructions(); - exit(0); - } - - default: // Unknown option - err.submit(1002, string); - } + // Interpret one option from command line + if (*string <= ' ') { + err.submit(1001); return; // Warning: empty option + } + + // Detect option type + switch(string[0]) { + case 'f': case 'F': // output file format + if (string[1] == 'd') { + // -fd == deprecated dump option + InterpretDumpOption(string+2); break; + } + InterpretOutputTypeOption(string+1); break; + + case 'v': case 'V': // verbose/silent + InterpretVerboseOption(string+1); break; + + case 'd': case 'D': // dump option + InterpretDumpOption(string+1); break; + // Debug info option + //InterpretDebugInfoOption(string+1); break; + + case 'x': case 'X': // Exception handler info option + InterpretExceptionInfoOption(string+1); break; + + case 'h': case 'H': case '?': // Help + ShowHelp = 1; break; + + case 'e': case 'E': // Error option + case 'w': case 'W': // Warning option + InterpretErrorOption(string); break; + + case 'n': case 'N': // Symbol name change option + case 'a': case 'A': // Symbol name alias option + InterpretSymbolNameChangeOption(string); break; + + case 'i': case 'I': // Imagebase + if ((string[1] | 0x20) == 'm') { + InterpretImagebaseOption(string); + } + break; + + case 'l': case 'L': // Library option + InterpretLibraryOption(string); break; + + case 'c': // Count instruction codes supported + // This is an easter egg: You can only get it if you know it's there + if (strncmp(string,"countinstructions", 17) == 0) { + CDisassembler::CountInstructions(); + exit(0); + } + + default: // Unknown option + err.submit(1002, string); + } } void CCommandLineInterpreter::InterpretLibraryOption(char * string) { - // Interpret options for manipulating library/archive files - - // Check for -lib command - if (stricmp(string, "lib") == 0) { // Found -lib command - if (InputFile) { - libmode = 2; // Input file already specified. Remaining file names are object files to add - } - else { - libmode = 1; // The rest of the command line must be interpreted as library name and object file names - } - return; - } - - SSymbolChange sym = {0,0,0,0}; // Symbol change record - int i; // Loop counter - - // Check for member name and optional new name in this command - char * name1 = 0, * name2 = 0, separator; - if ((string[2] == ':' || string[2] == '|') && string[3]) { - // name1 found - separator = string[2]; - name1 = string+3; - // Search for second separator or end - name2 = name1 + 1; - while (name2[0] != 0) { - if (name2[0] == separator) { - *name2 = 0; // Mark end of name1 - if (name2[1]) { - // name2 found - name2++; // Name2 starts here - break; + // Interpret options for manipulating library/archive files + + // Check for -lib command + if (stricmp(string, "lib") == 0) { // Found -lib command + if (InputFile) { + libmode = 2; // Input file already specified. Remaining file names are object files to add + } + else { + libmode = 1; // The rest of the command line must be interpreted as library name and object file names + } + return; + } + + SSymbolChange sym = {0,0,0,0}; // Symbol change record + int i; // Loop counter + + // Check for member name and optional new name in this command + char * name1 = 0, * name2 = 0, separator; + if ((string[2] == ':' || string[2] == '|') && string[3]) { + // name1 found + separator = string[2]; + name1 = string+3; + // Search for second separator or end + name2 = name1 + 1; + while (name2[0] != 0) { + if (name2[0] == separator) { + *name2 = 0; // Mark end of name1 + if (name2[1]) { + // name2 found + name2++; // Name2 starts here + break; + } } - } - name2++; - } - if (name2 == 0 || name2[0] == 0 || name2[0] == separator) { - // name 2 is blank, set to name1 - name2 = name1; - } - else { - // Check if name2 ends with separator - for (i = 0; i < (int)strlen(name2); i++) { - if (name2[i] == separator) name2[i] = 0; - } - } - } - // Check for duplicate name - if (SymbolIsInList(name1)) { - // This symbol is already in list - err.submit(2017, name1); - return; - } - - sym.Name1 = name1; // Store names in symbol change record - sym.Name2 = name2; - - switch (string[1]) { - case 'a': case 'A': // Add input file to library - if (name1) { - AddObjectToLibrary(name1, name2); - } - else err.submit(2004, string); - break; - - case 'x': case 'X': // Extract member(s) from library - if (name1) { - // Extract specified member - cmd.LibraryOptions = CMDL_LIBRARY_EXTRACTMEM; - sym.Action = SYMA_EXTRACT_MEMBER; - SymbolList.Push(&sym, sizeof(sym)); - } - else { - // Extract all members - cmd.LibraryOptions = CMDL_LIBRARY_EXTRACTALL; - } - break; - - case 'd': case 'D': // Delete member from library - if (name1) { - // Delete specified member - cmd.LibraryOptions = CMDL_LIBRARY_CONVERT; - sym.Action = SYMA_DELETE_MEMBER; - SymbolList.Push(&sym, sizeof(sym)); - } - else err.submit(2004, string); - break; - - default: - err.submit(2004, string); // Unknown option - } + name2++; + } + if (name2 == 0 || name2[0] == 0 || name2[0] == separator) { + // name 2 is blank + //name2 = name1; + name2 = 0; + } + else { + // Check if name2 ends with separator + for (i = 0; i < (int)strlen(name2); i++) { + if (name2[i] == separator) name2[i] = 0; + } + } + } + // Check for duplicate name + if (SymbolIsInList(name1)) { + // This symbol is already in list + err.submit(2017, name1); + return; + } + + sym.Name1 = name1; // Store names in symbol change record + sym.Name2 = name2; + + switch (string[1]) { + case 'a': case 'A': // Add input file to library + if (name1) { + AddObjectToLibrary(name1, name2); + } + else err.submit(2004, string); + break; + + case 'x': case 'X': // Extract member(s) from library + if (name1) { + // Extract specified member + cmd.LibraryOptions = CMDL_LIBRARY_EXTRACTMEM; + sym.Action = SYMA_EXTRACT_MEMBER; + SymbolList.Push(&sym, sizeof(sym)); + } + else { + // Extract all members + cmd.LibraryOptions = CMDL_LIBRARY_EXTRACTALL; + } + break; + + case 'd': case 'D': // Delete member from library + if (name1) { + // Delete specified member + cmd.LibraryOptions = CMDL_LIBRARY_CONVERT; + sym.Action = SYMA_DELETE_MEMBER; + SymbolList.Push(&sym, sizeof(sym)); + } + else err.submit(2004, string); + break; + + case 's': case 'S': // Use short member names for compatibility + cmd.LibrarySubtype = LIBTYPE_SHORTNAMES; + break; + + default: + err.submit(2004, string); // Unknown option + } } void CCommandLineInterpreter::AddObjectToLibrary(char * filename, char * membername) { - // Add object file to library - if (!filename || !*filename) { - err.submit(2004, filename-1); return; // Empty string - } - - if (!membername || !*membername) membername = filename; - - SSymbolChange Sym = {0,0,0,0}; // Symbol change record - - Sym.Name2 = filename; // Object file name - - if (!MemberNamesAllocated) { - // Allocate space for truncated member names - const int SafetySpace = 1024; - - // Get size of response files - if (ResponseFiles.GetNumEntries()) { - MemberNamesAllocated = ResponseFiles[0].GetDataSize() + ResponseFiles[1].GetDataSize(); - } - // Allocate this size + SafetySpace - MemberNames.SetSize(MemberNamesAllocated + SafetySpace); - - // Remember allocated buffer size - MemberNamesAllocated = MemberNames.GetBufferSize(); - } - - // Truncate name and store it in MemberNames - uint32 Name1Offset = MemberNames.PushString(CLibrary::TruncateMemberName(membername)); - Sym.Name1 = (char*)(MemberNames.Buf() + Name1Offset); - - // Note: Sym.Name1 points to allocated memory in violation of good programming practice. - // Check that it is not reallocated: - if (MemberNames.GetBufferSize() != MemberNamesAllocated) { - err.submit(2506); // Cannot reallocate MemberNames because we have pointers to in in SymbolList - return; - } - - // Check for duplicate name - if (SymbolIsInList(Sym.Name1)) { - // This symbol is already in list - err.submit(2017, Sym.Name1); - return; - } - - // Store options - cmd.LibraryOptions |= CMDL_LIBRARY_ADDMEMBER; - Sym.Action = SYMA_ADD_MEMBER; - - // Store SYMA_ADD_MEMBER record in symbol list - SymbolList.Push(&Sym, sizeof(Sym)); + // Add object file to library + if (!filename || !*filename) { + err.submit(2004, filename-1); return; // Empty string + } + + if (!membername || !*membername) membername = filename; + + SSymbolChange Sym = {0,0,0,0}; // Symbol change record + + Sym.Name2 = filename; // Object file name + + if (!MemberNamesAllocated) { + // Allocate space for truncated member names + const int SafetySpace = 1024; + + // Get size of response files + if (ResponseFiles.GetNumEntries()) { + MemberNamesAllocated = ResponseFiles[0].GetDataSize() + ResponseFiles[1].GetDataSize(); + } + // Allocate this size + SafetySpace + MemberNames.SetSize(MemberNamesAllocated + SafetySpace); + + // Remember allocated buffer size + MemberNamesAllocated = MemberNames.GetBufferSize(); + } + + // Truncate name and store it in MemberNames + //uint32 Name1Offset = MemberNames.PushString(CLibrary::TruncateMemberName(membername)); + uint32 Name1Offset = MemberNames.PushString(membername); + Sym.Name1 = (char*)(MemberNames.Buf() + Name1Offset); + CLibrary::StripMemberName(Sym.Name1); + + // Note: Sym.Name1 points to allocated memory in violation of good programming practice. + // Check that it is not reallocated: + if (MemberNames.GetBufferSize() != MemberNamesAllocated) { + err.submit(2506); // Cannot reallocate MemberNames because we have pointers to in in SymbolList + return; + } + + // Check for duplicate name + if (SymbolIsInList(Sym.Name1)) { + // This symbol is already in list + err.submit(2017, Sym.Name1); + return; + } + + // Store options + cmd.LibraryOptions |= CMDL_LIBRARY_ADDMEMBER; + Sym.Action = SYMA_ADD_MEMBER; + + // Store SYMA_ADD_MEMBER record in symbol list + SymbolList.Push(&Sym, sizeof(Sym)); } void CCommandLineInterpreter::InterpretOutputTypeOption(char * string) { - // Interpret output file format option from command line - - int opt; - for (opt = 0; opt < TableSize(TypeOptionNames); opt++) { - int len = (int)strlen(TypeOptionNames[opt].b); - if (strncmp(string, TypeOptionNames[opt].b, len) == 0) { - // Match found - if (OutputType) err.submit(2003, string); // More than one output type specified - if (DumpOptions) err.submit(2007); // Both dump and convert specified - - // Save desired output type - OutputType = TypeOptionNames[opt].a; - - // Check if name is followed by a word size - int wordsize = 0; - if (string[len]) wordsize = atoi(string+len); - switch (wordsize) { - case 0: // No word size specified - break; + // Interpret output file format option from command line - case 32: case 64: // Valid word size - DesiredWordSize = wordsize; - break; - - default: // Illegal word size - err.submit(2002, wordsize); - } - break; // Finished searching - } - } - - // Check if found - if (opt >= TableSize(TypeOptionNames)) err.submit(2004, string-1); - - if (OutputType == CMDL_OUTPUT_MASM) { - // Get subtype - for (opt = 0; opt < TableSize(SubtypeNames); opt++) { - int len = (int)strlen(SubtypeNames[opt].b); - if (strncmp(string, SubtypeNames[opt].b, len) == 0) { + int opt; + for (opt = 0; opt < TableSize(TypeOptionNames); opt++) { + int len = (int)strlen(TypeOptionNames[opt].b); + if (strncmp(string, TypeOptionNames[opt].b, len) == 0) { // Match found - SubType = SubtypeNames[opt].a; break; - } - } - } + if (OutputType) err.submit(2003, string); // More than one output type specified + if (DumpOptions) err.submit(2007); // Both dump and convert specified + + // Save desired output type + OutputType = TypeOptionNames[opt].a; + + // Check if name is followed by a word size + int wordsize = 0; + if (string[len]) wordsize = atoi(string+len); + switch (wordsize) { + case 0: // No word size specified + break; + + case 32: case 64: // Valid word size + DesiredWordSize = wordsize; + break; + + default: // Illegal word size + err.submit(2002, wordsize); + } + break; // Finished searching + } + } + + // Check if found + if (opt >= TableSize(TypeOptionNames)) err.submit(2004, string-1); + + if (OutputType == CMDL_OUTPUT_MASM) { + // Get subtype + for (opt = 0; opt < TableSize(SubtypeNames); opt++) { + int len = (int)strlen(SubtypeNames[opt].b); + if (strncmp(string, SubtypeNames[opt].b, len) == 0) { + // Match found + SubType = SubtypeNames[opt].a; break; + } + } + } } void CCommandLineInterpreter::InterpretVerboseOption(char * string) { - // Interpret silent/verbose option from command line - Verbose = atoi(string); + // Interpret silent/verbose option from command line + Verbose = atoi(string); } void CCommandLineInterpreter::InterpretDumpOption(char * string) { - // Interpret dump option from command line - if (OutputType || DumpOptions) err.submit(2007); // Both dump and convert specified - - char * s1 = string; - while (*s1) { - switch (*(s1++)) { - case 'f': case 'F': // dump file header - DumpOptions |= DUMP_FILEHDR; break; - case 'h': case 'H': // dump section headers - DumpOptions |= DUMP_SECTHDR; break; - case 's': case 'S': // dump symbol table - DumpOptions |= DUMP_SYMTAB; break; - case 'r': case 'R': // dump relocations - DumpOptions |= DUMP_RELTAB; break; - case 'n': case 'N': // dump string table - DumpOptions |= DUMP_STRINGTB; break; - case 'c': case 'C': // dump comment records (currently only for OMF) - DumpOptions |= DUMP_COMMENT; break; - default: - err.submit(2004, string-1); // Unknown option - } - } - if (DumpOptions == 0) DumpOptions = DUMP_FILEHDR; - OutputType = CMDL_OUTPUT_DUMP; - if (OutputType && OutputType != CMDL_OUTPUT_DUMP) err.submit(2007); // Both dump and convert specified - OutputType = CMDL_OUTPUT_DUMP; + // Interpret dump option from command line + if (OutputType || DumpOptions) err.submit(2007); // Both dump and convert specified + + char * s1 = string; + while (*s1) { + switch (*(s1++)) { + case 'f': case 'F': // dump file header + DumpOptions |= DUMP_FILEHDR; break; + case 'h': case 'H': // dump section headers + DumpOptions |= DUMP_SECTHDR; break; + case 's': case 'S': // dump symbol table + DumpOptions |= DUMP_SYMTAB; break; + case 'r': case 'R': // dump relocations + DumpOptions |= DUMP_RELTAB; break; + case 'n': case 'N': // dump string table + DumpOptions |= DUMP_STRINGTB; break; + case 'c': case 'C': // dump comment records (currently only for OMF) + DumpOptions |= DUMP_COMMENT; break; + default: + err.submit(2004, string-1); // Unknown option + } + } + if (DumpOptions == 0) DumpOptions = DUMP_FILEHDR; + OutputType = CMDL_OUTPUT_DUMP; + if (OutputType && OutputType != CMDL_OUTPUT_DUMP) err.submit(2007); // Both dump and convert specified + OutputType = CMDL_OUTPUT_DUMP; } void CCommandLineInterpreter::InterpretDebugInfoOption(char * string) { - // Interpret debug info option from command line - if (strlen(string) > 1) err.submit(2004, string-1); // Unknown option - switch (*string) { - case 's': case 'S': case 'r': case 'R': // Strip (remove) - DebugInfo = CMDL_DEBUG_STRIP; break; - case 'p': case 'P': // Preserve - DebugInfo = CMDL_DEBUG_PRESERVE; break; - case 'l': case 'L': // (Not supported) - DebugInfo = CMDL_DEBUG_LINNUM; break; - case 'c': case 'C': // (Not supported) - DebugInfo = CMDL_DEBUG_SYMBOLS; break; - default: - err.submit(2004, string-1); // Unknown option - } + // Interpret debug info option from command line + if (strlen(string) > 1) err.submit(2004, string-1); // Unknown option + switch (*string) { + case 's': case 'S': case 'r': case 'R': // Strip (remove) + DebugInfo = CMDL_DEBUG_STRIP; break; + case 'p': case 'P': // Preserve + DebugInfo = CMDL_DEBUG_PRESERVE; break; + case 'l': case 'L': // (Not supported) + DebugInfo = CMDL_DEBUG_LINNUM; break; + case 'c': case 'C': // (Not supported) + DebugInfo = CMDL_DEBUG_SYMBOLS; break; + default: + err.submit(2004, string-1); // Unknown option + } } void CCommandLineInterpreter::InterpretExceptionInfoOption(char * string) { - // Interpret exception handler info option from command line - if (strlen(string) > 1) err.submit(2004, string-1); // Unknown option - switch (*string) { - case 's': case 'S': case 'r': case 'R': // Strip (remove) - ExeptionInfo = CMDL_EXCEPTION_STRIP; break; - case 'p': case 'P': // Preserve - ExeptionInfo = CMDL_EXCEPTION_PRESERVE; break; - default: - err.submit(2004, string-1); // Unknown option - } + // Interpret exception handler info option from command line + if (strlen(string) > 1) err.submit(2004, string-1); // Unknown option + switch (*string) { + case 's': case 'S': case 'r': case 'R': // Strip (remove) + ExeptionInfo = CMDL_EXCEPTION_STRIP; break; + case 'p': case 'P': // Preserve + ExeptionInfo = CMDL_EXCEPTION_PRESERVE; break; + default: + err.submit(2004, string-1); // Unknown option + } } void CCommandLineInterpreter::InterpretErrorOption(char * string) { - // Interpret warning/error option from command line - if (strlen(string) < 3) { - err.submit(2004, string); return; // Unknown option - } - int newstatus; // New status for this error number - - switch (string[1]) { - case 'd': case 'D': // Disable - newstatus = 0; break; - - case 'w': case 'W': // Treat as warning - newstatus = 1; break; - - case 'e': case 'E': // Treat as error - newstatus = 2; break; - - default: - err.submit(2004, string); // Unknown option - return; - } - if (string[2] == 'x' || string[2] == 'X') { - // Apply new status to all non-fatal messages - for (SErrorText * ep = ErrorTexts; ep->Status < 9; ep++) { - ep->Status = newstatus; // Change status of all errors - } - } - else { - int ErrNum = atoi(string+2); - if (ErrNum == 0 && string[2] != '0') { - err.submit(2004, string); return; // Unknown option - } - // Search for this error number - SErrorText * ep = err.FindError(ErrNum); - if (ep->Status & 0x100) { - // Error number not found - err.submit(1003, ErrNum); return; // Unknown error number - } - // Change status of this error - ep->Status = newstatus; - } + // Interpret warning/error option from command line + if (strlen(string) < 3) { + err.submit(2004, string); return; // Unknown option + } + int newstatus; // New status for this error number + + switch (string[1]) { + case 'd': case 'D': // Disable + newstatus = 0; break; + + case 'w': case 'W': // Treat as warning + newstatus = 1; break; + + case 'e': case 'E': // Treat as error + newstatus = 2; break; + + default: + err.submit(2004, string); // Unknown option + return; + } + if (string[2] == 'x' || string[2] == 'X') { + // Apply new status to all non-fatal messages + for (SErrorText * ep = ErrorTexts; ep->Status < 9; ep++) { + ep->Status = newstatus; // Change status of all errors + } + } + else { + int ErrNum = atoi(string+2); + if (ErrNum == 0 && string[2] != '0') { + err.submit(2004, string); return; // Unknown option + } + // Search for this error number + SErrorText * ep = err.FindError(ErrNum); + if (ep->Status & 0x100) { + // Error number not found + err.submit(1003, ErrNum); return; // Unknown error number + } + // Change status of this error + ep->Status = newstatus; + } } void CCommandLineInterpreter::InterpretSymbolNameChangeOption(char * string) { - // Interpret various options for changing symbol names - SSymbolChange sym = {0,0,0,0}; // Symbol change record - - // Check for symbol names in this command - char * name1 = 0, * name2 = 0; - if (string[2] == ':' && string[3]) { - // name1 found - name1 = string+3; - // Search for second ':' or end - name2 = name1 + 1; - while (name2[0] != 0) { - if (name2[0] == ':') { - *name2 = 0; // Mark end of name1 - if (name2[1]) { - // name2 found - name2++; // Name2 starts here - break; + // Interpret various options for changing symbol names + SSymbolChange sym = {0,0,0,0}; // Symbol change record + string[0] |= 0x20; // change first letter to lower case + + // Check for symbol names in this command + char * name1 = 0, * name2 = 0; + if (string[2] == ':' && string[3]) { + // name1 found + name1 = string+3; + // Search for second ':' or end + name2 = name1 + 1; + while (name2[0] != 0) { + if (name2[0] == ':') { + *name2 = 0; // Mark end of name1 + if (name2[1]) { + // name2 found + name2++; // Name2 starts here + break; + } + } + name2++; + } + if (name2 && name2[0]) { + // name2 found. check if it ends with ':' + for (uint32 i = 0; i < (uint32)strlen(name2); i++) { + if (name2[i] == ':') name2[i] = 0; } - } - name2++; - } - if (name2 && name2[0]) { - // name2 found. check if it ends with ':' - for (uint32 i = 0; i < (uint32)strlen(name2); i++) { - if (name2[i] == ':') name2[i] = 0; - } - } - if (name2[0] == 0) name2 = 0; - } - // Check for duplicate name - if (name1 && SymbolIsInList(name1)) { - // This symbol is already in list - err.submit(2015, name1); - return; - } - - switch (string[1]) { - case 'u': case 'U': // underscore option - switch (string[2]) { - case 0: - Underscore = CMDL_UNDERSCORE_CHANGE; - if (string[0] == 'a') Underscore |= CMDL_KEEP_ALIAS; - break; - case '+': case 'a': case 'A': - Underscore = CMDL_UNDERSCORE_ADD; - if (string[0] == 'a') Underscore |= CMDL_KEEP_ALIAS; - break; - case '-': case 'r': case 'R': - Underscore = CMDL_UNDERSCORE_REMOVE; - if (string[0] == 'a') Underscore |= CMDL_KEEP_ALIAS; - break; - default: - err.submit(2004, string); // Unknown option - } - break; - - case 'd': case 'D': // section name dot option - SegmentDot = CMDL_SECTIONDOT_CHANGE; - break; - - case 'r': case 'R': // name replace option - if (name1 == 0 || name2 == 0 || *name1 == 0 || *name2 == 0) { - err.submit(2008, string); return; - } - sym.Name1 = name1; - sym.Name2 = name2; - sym.Action = SYMA_CHANGE_NAME; - if (string[0] == 'a') sym.Action = SYMA_CHANGE_ALIAS; - SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; - break; - - case 'p': case 'P': // prefix replace option - if (name1 == 0 || *name1 == 0) { - err.submit(2008, string); return; - } - if (name2 == 0) name2 = (char*)""; - sym.Name1 = name1; - sym.Name2 = name2; - sym.Action = SYMA_CHANGE_PREFIX; - SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; - break; - - case 'w': case 'W': // Weaken symbol - if (name1 == 0 || *name1 == 0 || name2) { - err.submit(2009, string); return; - } - sym.Name1 = name1; - sym.Action = SYMA_MAKE_WEAK; - SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; - break; - - case 'l': case 'L': // Make symbol local or hidden - if (name1 == 0 || *name1 == 0 || name2) { - err.submit(2009, string); return; - } - sym.Name1 = name1; - sym.Action = SYMA_MAKE_LOCAL; - SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; - break; - - default: - err.submit(2004, string); // Unknown option - } + } + if (name2[0] == 0) name2 = 0; + } + // Check for duplicate name + if (name1 && SymbolIsInList(name1)) { + // This symbol is already in list + err.submit(2015, name1); + return; + } + + switch (string[1]) { + case 'u': case 'U': // underscore option + switch (string[2]) { + case 0: + Underscore = CMDL_UNDERSCORE_CHANGE; + if (string[0] == 'a') Underscore |= CMDL_KEEP_ALIAS; + break; + case '+': case 'a': case 'A': + Underscore = CMDL_UNDERSCORE_ADD; + if (string[0] == 'a') Underscore |= CMDL_KEEP_ALIAS; + break; + case '-': case 'r': case 'R': + Underscore = CMDL_UNDERSCORE_REMOVE; + if (string[0] == 'a') Underscore |= CMDL_KEEP_ALIAS; + break; + default: + err.submit(2004, string); // Unknown option + } + break; + + case 'd': case 'D': // section name dot option + SegmentDot = CMDL_SECTIONDOT_CHANGE; + break; + + case 'r': case 'R': // name replace option + if (name1 == 0 || name2 == 0 || *name1 == 0 || *name2 == 0) { + err.submit(2008, string); return; + } + sym.Name1 = name1; + sym.Name2 = name2; + sym.Action = SYMA_CHANGE_NAME; + if (string[0] == 'a') sym.Action |= SYMA_ALIAS; + SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; + break; + + case 'p': case 'P': // prefix replace option + if (name1 == 0 || *name1 == 0) { + err.submit(2008, string); return; + } + if (name2 == 0) name2 = (char*)""; + sym.Name1 = name1; + sym.Name2 = name2; + sym.Action = SYMA_CHANGE_PREFIX; + if (string[0] == 'a') sym.Action |= SYMA_ALIAS; + SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; + break; + + case 's': case 'S': // suffix replace option + if (name1 == 0 || *name1 == 0) { + err.submit(2008, string); return; + } + if (name2 == 0) name2 = (char*)""; + sym.Name1 = name1; + sym.Name2 = name2; + sym.Action = SYMA_CHANGE_SUFFIX; + if (string[0] == 'a') sym.Action |= SYMA_ALIAS; + SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; + break; + + case 'w': case 'W': // Weaken symbol + if (name1 == 0 || *name1 == 0 || name2) { + err.submit(2009, string); return; + } + sym.Name1 = name1; + sym.Action = SYMA_MAKE_WEAK; + SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; + break; + + case 'l': case 'L': // Make symbol local or hidden + if (name1 == 0 || *name1 == 0 || name2) { + err.submit(2009, string); return; + } + sym.Name1 = name1; + sym.Action = SYMA_MAKE_LOCAL; + SymbolList.Push(&sym, sizeof(sym)); SymbolChangeEntries++; + break; + + default: + err.submit(2004, string); // Unknown option + } } void CCommandLineInterpreter::InterpretImagebaseOption(char * string) { - // Interpret image base option - char * p = strchr(string, '='); - if ((strnicmp(string, "imagebase", 9) && strnicmp(string, "image_base", 10)) || !p) { - // Unknown option - err.submit(1002, string); - return; - } - if (ImageBase) err.submit(2330); // Imagebase specified more than once - - p++; // point to number following '=' - // Loop through string to interpret hexadecimal number - while (*p) { - char letter = *p | 0x20; // lower case letter - if (*p >= '0' && *p <= '9') { - // 0 - 9 hexadecimal digit - ImageBase = (ImageBase << 4) + *p - '0'; - } - else if (letter >= 'a' && letter <= 'f') { - // A - F hexadecimal digit - ImageBase = (ImageBase << 4) + letter - 'a' + 10; - } - else if (letter == 'h') { - // Hexadecimal number may end with 'H' - break; - } - else if (letter == 'x' || letter == ' ') { - // Hexadecimal number may begin with 0x - if (ImageBase) { - // 'x' preceded by number other than 0 + // Interpret image base option + char * p = strchr(string, '='); + if ((strnicmp(string, "imagebase", 9) && strnicmp(string, "image_base", 10)) || !p) { + // Unknown option + err.submit(1002, string); + return; + } + if (ImageBase) err.submit(2330); // Imagebase specified more than once + + p++; // point to number following '=' + // Loop through string to interpret hexadecimal number + while (*p) { + char letter = *p | 0x20; // lower case letter + if (*p >= '0' && *p <= '9') { + // 0 - 9 hexadecimal digit + ImageBase = (ImageBase << 4) + *p - '0'; + } + else if (letter >= 'a' && letter <= 'f') { + // A - F hexadecimal digit + ImageBase = (ImageBase << 4) + letter - 'a' + 10; + } + else if (letter == 'h') { + // Hexadecimal number may end with 'H' + break; + } + else if (letter == 'x' || letter == ' ') { + // Hexadecimal number may begin with 0x + if (ImageBase) { + // 'x' preceded by number other than 0 + err.submit(1002, string); break; + } + } + else { + // Any other character not allowed err.submit(1002, string); break; - } - } - else { - // Any other character not allowed - err.submit(1002, string); break; - } - // next character - p++; - } - if (ImageBase & 0xFFF) { - // Must be divisible by page size - err.submit(2331, string); - } - if ((int32)ImageBase <= 0) { - // Cannot be zero or > 2^31 - err.submit(2332, string); - } + } + // next character + p++; + } + if (ImageBase & 0xFFF) { + // Must be divisible by page size + err.submit(2331, string); + } + if ((int32)ImageBase <= 0) { + // Cannot be zero or > 2^31 + err.submit(2332, string); + } } SSymbolChange const * CCommandLineInterpreter::GetMemberToAdd() { - // Get names of object files to add to library - // replaced will be set to 1 if a member with the same name is replaced - - // Search through SymbolList, continuing from last CurrentSymbol - while (CurrentSymbol < SymbolList.GetDataSize()) { - // Get pointer to current symbol record - SSymbolChange * Sym = (SSymbolChange *)(SymbolList.Buf() + CurrentSymbol); - // Increment pointer - CurrentSymbol += sizeof(SSymbolChange); - // Check record type - if (Sym->Action == SYMA_ADD_MEMBER) { - // Name found - return Sym; - } - } - // No more names found - return 0; + // Get names of object files to add to library + // replaced will be set to 1 if a member with the same name is replaced + + // Search through SymbolList, continuing from last CurrentSymbol + while (CurrentSymbol < SymbolList.GetDataSize()) { + // Get pointer to current symbol record + SSymbolChange * Sym = (SSymbolChange *)(SymbolList.Buf() + CurrentSymbol); + // Increment pointer + CurrentSymbol += sizeof(SSymbolChange); + // Check record type + if (Sym->Action == SYMA_ADD_MEMBER) { + // Name found + return Sym; + } + } + // No more names found + return 0; } void CCommandLineInterpreter::CheckExtractSuccess() { - // Check if library members to extract were found - - // Search through SymbolList for extract records - for (uint32 i = 0; i < SymbolList.GetDataSize(); i += sizeof(SSymbolChange)) { - SSymbolChange * Sym = (SSymbolChange *)(SymbolList.Buf() + i); - if (Sym->Action == SYMA_EXTRACT_MEMBER && Sym->Done == 0) { - // Member has not been extracted - err.submit(1104, Sym->Name1); - } - } + // Check if library members to extract were found + + // Search through SymbolList for extract records + for (uint32 i = 0; i < SymbolList.GetDataSize(); i += sizeof(SSymbolChange)) { + SSymbolChange * Sym = (SSymbolChange *)(SymbolList.Buf() + i); + if (Sym->Action == SYMA_EXTRACT_MEMBER && Sym->Done == 0) { + // Member has not been extracted + err.submit(1104, Sym->Name1); + } + } } void CCommandLineInterpreter::CheckSymbolModifySuccess() { - // Check if symbols to modify were found - - // Search through SymbolList for symbol change records - for (uint32 i = 0; i < SymbolList.GetDataSize(); i += sizeof(SSymbolChange)) { - SSymbolChange * Sym = (SSymbolChange *)(SymbolList.Buf() + i); - if (Sym->Action >= SYMA_MAKE_WEAK && Sym->Action <= SYMA_CHANGE_ALIAS && Sym->Done == 0) { - // Member has not been extracted - err.submit(1106, Sym->Name1); - } - } + // Check if symbols to modify were found + + // Search through SymbolList for symbol change records + for (uint32 i = 0; i < SymbolList.GetDataSize(); i += sizeof(SSymbolChange)) { + SSymbolChange * Sym = (SSymbolChange *)(SymbolList.Buf() + i); + if (Sym->Action >= SYMA_MAKE_WEAK && Sym->Action < SYMA_ADD_MEMBER && Sym->Done == 0) { + // Member has not been extracted + err.submit(1106, Sym->Name1); + } + if (Sym->Action == SYMA_DELETE_MEMBER && Sym->Done == 0) { + // Member has not been extracted + err.submit(1105, Sym->Name1); + } + } } int CCommandLineInterpreter::SymbolIsInList(char const * name) { - // Check if name is already in symbol list - int isym, nsym = SymbolList.GetNumEntries(); - SSymbolChange * List = (SSymbolChange *)SymbolList.Buf(), * psym; - - // Search for name in list of names specified by user on command line - for (isym = 0, psym = List; isym < nsym; isym++, psym++) { - if (strcmp(name, psym->Name1) == 0) return 1; // Matching name found - } - return 0; + // Check if name is already in symbol list + int isym, nsym = SymbolList.GetNumEntries(); + SSymbolChange * List = (SSymbolChange *)SymbolList.Buf(), * psym; + + // Search for name in list of names specified by user on command line + for (isym = 0, psym = List; isym < nsym; isym++, psym++) { + if (strcmp(name, psym->Name1) == 0) return 1; // Matching name found + } + return 0; } int CCommandLineInterpreter::SymbolChange(char const * oldname, char const ** newname, int symtype) { - // Check if symbol has to be changed - int action, i, isym; - int nsym = SymbolList.GetNumEntries(); - if (oldname == 0) return SYMA_NOCHANGE; - - // Convert standard names if type conversion - if (cmd.InputType != cmd.OutputType - && uint32(cmd.InputType) <= MaxType && uint32(cmd.OutputType) <= MaxType) { - if (DesiredWordSize == 32) { - // Look for standard names to translate, 32-bit - for (i = 0; i < NumStandardNames; i++) { - if (strcmp(oldname, StandardNames32[i][cmd.InputType]) == 0) { - // Match found - *newname = StandardNames32[i][cmd.OutputType]; - CountSymbolNameChanges++; - return SYMA_CHANGE_NAME; // Change name of symbol + // Check if symbol has to be changed + int action = 0, i, isym; + int nsym = SymbolList.GetNumEntries(); + if (oldname == 0) return SYMA_NOCHANGE; + if (newname) *newname = 0; + + // Convert standard names if type conversion + if (cmd.InputType != cmd.OutputType + && uint32(cmd.InputType) <= MaxType && uint32(cmd.OutputType) <= MaxType) { + if (DesiredWordSize == 32) { + // Look for standard names to translate, 32-bit + for (i = 0; i < NumStandardNames; i++) { + if (strcmp(oldname, StandardNames32[i][cmd.InputType]) == 0) { + // Match found + *newname = StandardNames32[i][cmd.OutputType]; + CountSymbolNameChanges++; + return SYMA_CHANGE_NAME; // Change name of symbol + } + } } - } - } - else { - // Look for standard names to translate, 64-bit - for (i = 0; i < NumStandardNames; i++) { - if (strcmp(oldname, StandardNames64[i][cmd.InputType]) == 0) { - // Match found - *newname = StandardNames64[i][cmd.OutputType]; - CountSymbolNameChanges++; - return SYMA_CHANGE_NAME; // Change name of symbol + else { + // Look for standard names to translate, 64-bit + for (i = 0; i < NumStandardNames; i++) { + if (strcmp(oldname, StandardNames64[i][cmd.InputType]) == 0) { + // Match found + *newname = StandardNames64[i][cmd.OutputType]; + CountSymbolNameChanges++; + return SYMA_CHANGE_NAME; // Change name of symbol + } + } } - } - } - } - - // See if there are other conversions to do - if (Underscore == 0 && SegmentDot == 0 && nsym == 0) return SYMA_NOCHANGE; // Nothing to do - if (oldname == 0 || *oldname == 0) return SYMA_NOCHANGE; // No name - - static char NameBuffer[MAXSYMBOLLENGTH]; - - SSymbolChange * List = (SSymbolChange *)SymbolList.Buf(), * psym; - // search for name in list of names specified by user on command line - for (isym = 0, psym = List; isym < nsym; isym++, psym++) { - if (strcmp(oldname, psym->Name1) == 0) break; // Matching name found - if (psym->Action == SYMA_CHANGE_PREFIX && strncmp(oldname, psym->Name1, strlen(psym->Name1))==0) break; // matching prefix found - } - if (isym < nsym) { - // A matching name was found. - action = psym->Action; - // Whatever action is specified here is overriding any general option - // Statistics counting - switch (action) { - case SYMA_MAKE_WEAK: // Make public symbol weak - if (symtype == SYMT_PUBLIC) { - CountSymbolsWeakened++; psym->Done++; - } - else { // only public symbols can be weakened - err.submit(1020, oldname); // cannot make weak - action = SYMA_NOCHANGE; - } - break; - case SYMA_MAKE_LOCAL: // Hide public or external symbol - if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL) { - CountSymbolsMadeLocal++; psym->Done++; - if (symtype == SYMT_EXTERNAL) err.submit(1023, oldname); - } - else { // only public and external symbols can be made local - err.submit(1021, oldname); // cannot make local - action = SYMA_NOCHANGE; - } - break; - case SYMA_CHANGE_NAME: // Change name of symbol or segment or library member - CountSymbolNameChanges++; psym->Done++; - break; - case SYMA_CHANGE_ALIAS: // Make alias for public symbol - if (symtype == SYMT_PUBLIC) { - CountSymbolNameAliases++; psym->Done++; - } - else { // only public symbols can have aliases - err.submit(1022, oldname); // cannot make alias - action = SYMA_NOCHANGE; - } - break; - case SYMA_CHANGE_PREFIX: // Change beginning of symbol name - if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL || symtype == SYMT_LOCAL || symtype == SYMT_SECTION) { - if (strlen(oldname) - strlen(psym->Name1) + strlen(psym->Name2) >= MAXSYMBOLLENGTH) { - err.submit(2202, oldname); // Name too long - action = SYMA_NOCHANGE; break; + } + + // See if there are other conversions to do + if (Underscore == 0 && SegmentDot == 0 && nsym == 0) return SYMA_NOCHANGE; // Nothing to do + if (oldname == 0 || *oldname == 0) return SYMA_NOCHANGE; // No name + + static char NameBuffer[MAXSYMBOLLENGTH]; + + SSymbolChange * List = (SSymbolChange *)SymbolList.Buf(), * psym; + // search for name in list of names specified by user on command line + for (isym = 0, psym = List; isym < nsym; isym++, psym++) { + if (strcmp(oldname, psym->Name1) == 0) break; // Matching name found + int n1len = (int)strlen(psym->Name1); // Length of string to search for + int onlen = (int)strlen(oldname); // Length of string to match + if ((psym->Action&~SYMA_ALIAS) == SYMA_CHANGE_PREFIX && strncmp(oldname, psym->Name1, n1len)==0) break; // matching prefix found + if ((psym->Action&~SYMA_ALIAS) == SYMA_CHANGE_SUFFIX && strcmp(oldname+onlen-n1len, psym->Name1)==0) break; // matching suffix found + } + if (isym < nsym) { + // A matching name was found. + action = psym->Action; + // Whatever action is specified here is overriding any general option + // Statistics counting + switch (action & ~SYMA_ALIAS) { + + case SYMA_MAKE_WEAK: // Make public symbol weak + if (symtype == SYMT_PUBLIC) { + CountSymbolsWeakened++; psym->Done++; } - strcpy(NameBuffer, psym->Name2); - strcpy(NameBuffer + strlen(psym->Name2), oldname + strlen(psym->Name1)); - action = SYMA_CHANGE_NAME; - *newname = NameBuffer; - CountSymbolNameChanges++; psym->Done++; - return action; - } - else { // only symbols and segments can change prefix - err.submit(1024, oldname); - action = SYMA_NOCHANGE; - } - break; - case SYMA_DELETE_MEMBER: case SYMA_EXTRACT_MEMBER: case SYMA_ADD_MEMBER: - if (symtype == SYMT_LIBRARYMEMBER) { - // Change to library member - psym->Done++; - } - else { - // Ignore action for symbols that have the same name as a library member - action = SYMA_NOCHANGE; - } - } - - // New symbol name - *newname = psym->Name2; - // Action to take - return action; - } - - // Not found in list. Check for section options - if (symtype == SYMT_SECTION) { - if (!strncmp(oldname, ".rela", 5)) { - // ELF relocation section must have same name change as mother section - const char * name2; - int action2 = SymbolChange(oldname+5, &name2, symtype); - if (action2 == SYMA_CHANGE_NAME && strlen(name2) + 6 < MAXSYMBOLLENGTH) { - sprintf(NameBuffer, ".rela%s", name2); - *newname = NameBuffer; - return action2; - } - } - if (!strncmp(oldname, ".rel", 4)) { - // ELF relocation section must have same name change as mother section - const char * name2; - int action2 = SymbolChange(oldname+4, &name2, symtype); - if (action2 == SYMA_CHANGE_NAME && strlen(name2) + 5 < MAXSYMBOLLENGTH) { - sprintf(NameBuffer, ".rel%s", name2); - *newname = NameBuffer; - return action2; - } - } - if (SegmentDot) { - // Change section name - - if (SegmentDot == CMDL_SECTIONDOT_U2DOT && oldname[0] == '_') { - // replace '_' by '.' - strncpy(NameBuffer, oldname, MAXSYMBOLLENGTH-1); + else { // only public symbols can be weakened + err.submit(1020, oldname); // cannot make weak + action = SYMA_NOCHANGE; + } + break; + + case SYMA_MAKE_LOCAL: // Hide public or external symbol + if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL) { + CountSymbolsMadeLocal++; psym->Done++; + if (symtype == SYMT_EXTERNAL) err.submit(1023, oldname); + } + else { // only public and external symbols can be made local + err.submit(1021, oldname); // cannot make local + action = SYMA_NOCHANGE; + } + break; + + case SYMA_CHANGE_NAME: // Change name of symbol or segment or library member + CountSymbolNameChanges++; psym->Done++; + *newname = psym->Name2; + break; + + case SYMA_CHANGE_PREFIX: // Change beginning of symbol name + if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL || symtype == SYMT_LOCAL || symtype == SYMT_SECTION) { + if (strlen(oldname) - strlen(psym->Name1) + strlen(psym->Name2) >= MAXSYMBOLLENGTH) { + err.submit(2202, oldname); // Name too long + action = SYMA_NOCHANGE; break; + } + strcpy(NameBuffer, psym->Name2); + strcpy(NameBuffer + strlen(psym->Name2), oldname + strlen(psym->Name1)); + action = SYMA_CHANGE_NAME; + *newname = NameBuffer; + CountSymbolNameChanges++; psym->Done++; + } + else { // only symbols and segments can change prefix + err.submit(1024, oldname); + action = SYMA_NOCHANGE; + } + break; + + case SYMA_CHANGE_SUFFIX: // Change end of symbol name + if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL || symtype == SYMT_LOCAL || symtype == SYMT_SECTION) { + if (strlen(oldname) - strlen(psym->Name1) + strlen(psym->Name2) >= MAXSYMBOLLENGTH) { + err.submit(2202, oldname); // Name too long + action = SYMA_NOCHANGE; break; + } + strcpy(NameBuffer, oldname); + strcpy(NameBuffer + strlen(oldname) - strlen(psym->Name1), psym->Name2); + action = SYMA_CHANGE_NAME; + *newname = NameBuffer; + CountSymbolNameChanges++; psym->Done++; + } + else { // only symbols and segments can change prefix + err.submit(1024, oldname); + action = SYMA_NOCHANGE; + } + break; + + case SYMA_EXTRACT_MEMBER: + *newname = psym->Name2; + // continue in next case + case SYMA_DELETE_MEMBER: case SYMA_ADD_MEMBER: + if (symtype == SYMT_LIBRARYMEMBER) { + // Change to library member + psym->Done++; + } + else { + // Ignore action for symbols that have the same name as a library member + action = SYMA_NOCHANGE; + } + } + + if (action && (psym->Action & SYMA_ALIAS)) { + // Keep old name as alias + if (symtype == SYMT_PUBLIC) { + CountSymbolNameAliases++; psym->Done++; + action = SYMA_ALIAS; + } + else { // only public symbols can have aliases + CountSymbolNameChanges--; + err.submit(1022, oldname); // cannot make alias + action = SYMA_NOCHANGE; + } + } + + // Action to take + return action; + } + + // Not found in list. Check for section options + if (symtype == SYMT_SECTION) { + if (!strncmp(oldname, ".rela", 5)) { + // ELF relocation section must have same name change as mother section + const char * name2; + int action2 = SymbolChange(oldname+5, &name2, symtype); + if (action2 == SYMA_CHANGE_NAME && strlen(name2) + 6 < MAXSYMBOLLENGTH) { + sprintf(NameBuffer, ".rela%s", name2); + *newname = NameBuffer; + return action2; + } + } + if (!strncmp(oldname, ".rel", 4)) { + // ELF relocation section must have same name change as mother section + const char * name2; + int action2 = SymbolChange(oldname+4, &name2, symtype); + if (action2 == SYMA_CHANGE_NAME && strlen(name2) + 5 < MAXSYMBOLLENGTH) { + sprintf(NameBuffer, ".rel%s", name2); + *newname = NameBuffer; + return action2; + } + } + if (SegmentDot) { + // Change section name + + if (SegmentDot == CMDL_SECTIONDOT_U2DOT && oldname[0] == '_') { + // replace '_' by '.' + strncpy(NameBuffer, oldname, MAXSYMBOLLENGTH-1); + NameBuffer[MAXSYMBOLLENGTH-1] = 0; // Terminate string + NameBuffer[0] = '.'; + *newname = NameBuffer; + CountSectionDotConversions++; + return SYMA_CHANGE_NAME; + } + if (SegmentDot == CMDL_SECTIONDOT_DOT2U && oldname[0] == '.') { + // replace '.' by '_' + // Note: Microsoft and Intel compilers have . on standard names + // and _ on nonstandard names in COFF files + // Borland requires _ on all segment names in OMF files + /* + // Standard section names that should not be changed + static char const * StandardSectionNames[] = { + ".text", ".data", ".bss", ".comment", ".lib" + }; + for (uint32 i = 0; i < sizeof(StandardSectionNames)/sizeof(StandardSectionNames[0]); i++) { + if (stricmp(oldname,StandardSectionNames[i]) == 0) { + // Standard name. Don't change + return SYMA_NOCHANGE; + } + }*/ + strncpy(NameBuffer, oldname, MAXSYMBOLLENGTH-1); + NameBuffer[MAXSYMBOLLENGTH-1] = 0; // Terminate string + NameBuffer[0] = '_'; + *newname = NameBuffer; + CountSectionDotConversions++; + return SYMA_CHANGE_NAME; + } + } + } + + // Check for underscore options + if ((Underscore & 0x0F) == CMDL_UNDERSCORE_REMOVE && oldname[0] == '_') { + // Remove underscore + if ((Underscore & CMDL_KEEP_ALIAS) && symtype == SYMT_PUBLIC) { + // Alias only applicable to public symbols + // Make alias without underscore + *newname = oldname + 1; + CountUnderscoreConversions++; CountSymbolNameAliases++; + return SYMA_ALIAS; + } + // Change name applicable to public and external symbols + if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL) { + // Make new name without underscore + *newname = oldname + 1; + CountUnderscoreConversions++; + return SYMA_CHANGE_NAME; + } + } + if ((Underscore & 0x0F) == CMDL_UNDERSCORE_ADD) { + // Add underscore even if it already has one + if ((Underscore & CMDL_KEEP_ALIAS) && symtype == SYMT_PUBLIC) { + // Alias only applicable to public symbols + // Make alias with underscore + strncpy(NameBuffer+1, oldname, MAXSYMBOLLENGTH-2); NameBuffer[MAXSYMBOLLENGTH-1] = 0; // Terminate string - NameBuffer[0] = '.'; + NameBuffer[0] = '_'; *newname = NameBuffer; - CountSectionDotConversions++; - return SYMA_CHANGE_NAME; - } - if (SegmentDot == CMDL_SECTIONDOT_DOT2U && oldname[0] == '.') { - // replace '.' by '_' - // Note: Microsoft and Intel compilers have . on standard names - // and _ on nonstandard names in COFF files - // Borland requires _ on all segment names in OMF files - /* - // Standard section names that should not be changed - static char const * StandardSectionNames[] = { - ".text", ".data", ".bss", ".comment", ".lib" - }; - for (uint32 i = 0; i < sizeof(StandardSectionNames)/sizeof(StandardSectionNames[0]); i++) { - if (stricmp(oldname,StandardSectionNames[i]) == 0) { - // Standard name. Don't change - return SYMA_NOCHANGE; - } - }*/ - strncpy(NameBuffer, oldname, MAXSYMBOLLENGTH-1); + CountUnderscoreConversions++; CountSymbolNameAliases++; + return SYMA_ALIAS; + } + // Change name applicable to public and external symbols + if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL) { + // Make new name with underscore + strncpy(NameBuffer+1, oldname, MAXSYMBOLLENGTH-2); NameBuffer[MAXSYMBOLLENGTH-1] = 0; // Terminate string NameBuffer[0] = '_'; *newname = NameBuffer; - CountSectionDotConversions++; + CountUnderscoreConversions++; return SYMA_CHANGE_NAME; - } - } - } - - // Check for underscore options - if ((Underscore & 0x0F) == CMDL_UNDERSCORE_REMOVE && oldname[0] == '_') { - // Remove underscore - if ((Underscore & CMDL_KEEP_ALIAS) && symtype == SYMT_PUBLIC) { - // Alias only applicable to public symbols - // Make alias without underscore - *newname = oldname + 1; - CountUnderscoreConversions++; CountSymbolNameAliases++; - return SYMA_CHANGE_ALIAS; - } - // Change name applicable to public and external symbols - if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL) { - // Make new name without underscore - *newname = oldname + 1; - CountUnderscoreConversions++; - return SYMA_CHANGE_NAME; - } - } - if ((Underscore & 0x0F) == CMDL_UNDERSCORE_ADD) { - // Add underscore even if it already has one - if ((Underscore & CMDL_KEEP_ALIAS) && symtype == SYMT_PUBLIC) { - // Alias only applicable to public symbols - // Make alias with underscore - strncpy(NameBuffer+1, oldname, MAXSYMBOLLENGTH-2); - NameBuffer[MAXSYMBOLLENGTH-1] = 0; // Terminate string - NameBuffer[0] = '_'; - *newname = NameBuffer; - CountUnderscoreConversions++; CountSymbolNameAliases++; - return SYMA_CHANGE_ALIAS; - } - // Change name applicable to public and external symbols - if (symtype == SYMT_PUBLIC || symtype == SYMT_EXTERNAL) { - // Make new name with underscore - strncpy(NameBuffer+1, oldname, MAXSYMBOLLENGTH-2); - NameBuffer[MAXSYMBOLLENGTH-1] = 0; // Terminate string - NameBuffer[0] = '_'; - *newname = NameBuffer; - CountUnderscoreConversions++; - return SYMA_CHANGE_NAME; - } - } - return SYMA_NOCHANGE; + } + } + return SYMA_NOCHANGE; } int CCommandLineInterpreter::SymbolChangesRequested() { - // Any kind of symbol change requested on command line - return (Underscore != 0) + // Any kind of symbol change requested on command line + return (Underscore != 0) | (SegmentDot != 0) << 1 | (SymbolChangeEntries != 0) << 2; } void CCommandLineInterpreter::CountDebugRemoved() { - // Count debug sections removed - CountDebugSectionsRemoved++; + // Count debug sections removed + CountDebugSectionsRemoved++; } void CCommandLineInterpreter::CountExceptionRemoved() { - // Count exception handler sections removed - CountExceptionSectionsRemoved++; + // Count exception handler sections removed + CountExceptionSectionsRemoved++; } void CCommandLineInterpreter::CountSymbolsHidden() { - // Count unused external references hidden - CountUnusedSymbolsHidden++; + // Count unused external references hidden + CountUnusedSymbolsHidden++; } void CCommandLineInterpreter::ReportStatistics() { - // Report statistics about name changes etc. - if (DebugInfo == CMDL_DEBUG_STRIP || ExeptionInfo == CMDL_EXCEPTION_STRIP - || Underscore || SegmentDot || SymbolList.GetNumEntries()) { - printf ("\n"); - } - if (DebugInfo == CMDL_DEBUG_STRIP) { - printf ("\n%3i Debug sections removed", CountDebugSectionsRemoved); - } - if (ExeptionInfo == CMDL_EXCEPTION_STRIP) { - printf ("\n%3i Exception sections removed", CountExceptionSectionsRemoved); - } - if ((DebugInfo == CMDL_DEBUG_STRIP || ExeptionInfo == CMDL_EXCEPTION_STRIP) - && CountUnusedSymbolsHidden) { - printf ("\n%3i Unused external symbol references hidden", CountUnusedSymbolsHidden); - } - - if (Underscore || SegmentDot || SymbolList.GetNumEntries()) { - if (CountUnderscoreConversions || Underscore) { - printf ("\n%3i Changes in leading underscores on symbol names", CountUnderscoreConversions); - } - if (CountSectionDotConversions || SegmentDot) { - printf ("\n%3i Changes in leading characters on section names", CountSectionDotConversions); - } - if (CountSymbolNameChanges) { - printf ("\n%3i Symbol names changed", CountSymbolNameChanges); - } - if (CountSymbolNameAliases) { - printf ("\n%3i Public symbol names aliased", CountSymbolNameAliases); - } - if (CountSymbolsWeakened) { - printf ("\n%3i Public symbol names made weak", CountSymbolsWeakened); - } - if (CountSymbolsMadeLocal) { - printf ("\n%3i Public or external symbol names made local", CountSymbolsMadeLocal); - } - if (SymbolChangeEntries && !CountSymbolNameChanges && !CountSymbolNameAliases && !CountSymbolsWeakened && !CountSymbolsMadeLocal) { - printf ("\n No symbols to change were found"); - } - } + // Report statistics about name changes etc. + if (DebugInfo == CMDL_DEBUG_STRIP || ExeptionInfo == CMDL_EXCEPTION_STRIP + || Underscore || SegmentDot || SymbolList.GetNumEntries()) { + printf ("\n"); + } + if (DebugInfo == CMDL_DEBUG_STRIP) { + printf ("\n%3i Debug sections removed", CountDebugSectionsRemoved); + } + if (ExeptionInfo == CMDL_EXCEPTION_STRIP) { + printf ("\n%3i Exception sections removed", CountExceptionSectionsRemoved); + } + if ((DebugInfo == CMDL_DEBUG_STRIP || ExeptionInfo == CMDL_EXCEPTION_STRIP) + && CountUnusedSymbolsHidden) { + printf ("\n%3i Unused external symbol references hidden", CountUnusedSymbolsHidden); + } + + if (Underscore || SegmentDot || SymbolList.GetNumEntries()) { + if (CountUnderscoreConversions || Underscore) { + printf ("\n%3i Changes in leading underscores on symbol names", CountUnderscoreConversions); + } + if (CountSectionDotConversions || SegmentDot) { + printf ("\n%3i Changes in leading characters on section names", CountSectionDotConversions); + } + if (CountSymbolNameChanges) { + printf ("\n%3i Symbol names changed", CountSymbolNameChanges); + } + if (CountSymbolNameAliases) { + printf ("\n%3i Public symbol names aliased", CountSymbolNameAliases); + } + if (CountSymbolsWeakened) { + printf ("\n%3i Public symbol names made weak", CountSymbolsWeakened); + } + if (CountSymbolsMadeLocal) { + printf ("\n%3i Public or external symbol names made local", CountSymbolsMadeLocal); + } + if (SymbolChangeEntries && !CountSymbolNameChanges && !CountSymbolNameAliases && !CountSymbolsWeakened && !CountSymbolsMadeLocal) { + printf ("\n No symbols to change were found"); + } + } } void CCommandLineInterpreter::Help() { - // Print help message - printf("\nObject file converter version %.2f for x86 and x86-64 platforms.", OBJCONV_VERSION); - printf("\nCopyright (c) 2012 by Agner Fog. Gnu General Public License."); - printf("\n\nUsage: objconv options inputfile [outputfile]"); - printf("\n\nOptions:"); - printf("\n-fXXX[SS] Output file format XXX, word size SS. Supported formats:"); - printf("\n PE, COFF, ELF, OMF, MACHO\n"); - printf("\n-fasm Disassemble file (-fmasm, -fnasm, -fyasm, -fgasm)\n"); - printf("\n-dXXX Dump file contents to console."); - printf("\n Values of XXX (can be combined):"); - printf("\n f: File header, h: section Headers, s: Symbol table,"); - printf("\n r: Relocation table, n: string table.\n"); - //printf("\n-ds Strip Debug info."); // default if input and output are different formats - //printf("\n-dp Preserve Debug info, even if it is incompatible."); - printf("\n-xs Strip exception handling info and other incompatible info."); // default if input and output are different formats. Hides unused symbols - printf("\n-xp Preserve exception handling info and other incompatible info.\n"); - - printf("\n-nu change symbol Name Underscores to the default for the target format."); - printf("\n-nu- remove Underscores from symbol Names."); - printf("\n-nu+ add Underscores to symbol Names."); - printf("\n-nd replace Dot/underscore in section names."); - printf("\n-nr:N1:N2 Replace symbol Name N1 with N2."); - printf("\n-ar:N1:N2 make Alias N2 for existing public name N1."); - printf("\n-np:N1:N2 Replace symbol Prefix N1 with N2."); - printf("\n-nw:N1 make public symbol Name N1 Weak (ELF and MAC64 only)."); - printf("\n-nl:N1 make public symbol Name N1 Local (invisible).\n"); - - printf("\n-lx eXtract all members from Library."); - printf("\n-lx:N1:N2 eXtract member N1 from Library to file N2."); - printf("\n-ld:N1 Delete member N1 from Library."); - printf("\n-la:N1:N2 Add object file N1 to Library as member N2."); - printf("\n All library options need -fXXX option."); - printf("\n Alternative: -lib LIBRARYNAME OBJECTFILENAMES.\n"); - - printf("\n-vN Verbose options. Values of N:"); - printf("\n 0: Silent, 1: Print file names and types, 2: Tell about conversions.\n"); - - printf("\n-wdNNN Disable Warning NNN."); - printf("\n-weNNN treat Warning NNN as Error. -wex: treat all warnings as errors."); - printf("\n-edNNN Disable Error number NNN."); - printf("\n-ewNNN treat Error number NNN as Warning.\n"); - - printf("\n-h Print this help screen.\n"); - - printf("\n@RFILE Read additional options from response file RFILE.\n"); - printf("\n\nExample:"); - printf("\nobjconv -felf32 -nu filename.obj filename.o\n\n"); + // Print help message + printf("\nObject file converter version %.2f for x86 and x86-64 platforms.", OBJCONV_VERSION); + printf("\nCopyright (c) 2018 by Agner Fog. Gnu General Public License."); + printf("\n\nUsage: objconv options inputfile [outputfile]"); + printf("\n\nOptions:"); + printf("\n-fXXX[SS] Output file format XXX, word size SS. Supported formats:"); + printf("\n PE, COFF, ELF, OMF, MACHO\n"); + printf("\n-fasm Disassemble file (-fmasm, -fnasm, -fyasm, -fgasm)\n"); + printf("\n-dXXX Dump file contents to console."); + printf("\n Values of XXX (can be combined):"); + printf("\n f: File header, h: section Headers, s: Symbol table,"); + printf("\n r: Relocation table, n: string table.\n"); + + printf("\n-nu change symbol Name Underscores to the default for the target format."); + printf("\n-nu- remove Underscores from symbol Names."); + printf("\n-nu+ add Underscores to symbol Names."); + printf("\n-nd replace Dot/underscore in section names."); + printf("\n-nr:N1:N2 Replace symbol Name N1 with N2."); + printf("\n-np:N1:N2 Replace symbol Prefix N1 with N2."); + printf("\n-ns:N1:N2 Replace symbol Suffix N1 with N2."); + printf("\n-ar:N1:N2 make Alias N2 for existing public name N1."); + printf("\n-ap:N1:N2 Replace symbol Prefix and keep old name as alias."); + printf("\n-as:N1:N2 Replace symbol Suffix and keep old name as alias."); + printf("\n-nw:N1 make public symbol Name N1 Weak (ELF and MAC64 only)."); + printf("\n-nl:N1 make public symbol Name N1 Local (invisible).\n"); + //printf("\n-ds Strip Debug info."); // default if input and output are different formats + //printf("\n-dp Preserve Debug info, even if it is incompatible."); + printf("\n-xs Strip exception handling info and other incompatible info."); // default if input and output are different formats. Hides unused symbols + printf("\n-xp Preserve exception handling info and other incompatible info.\n"); + + printf("\n-lx eXtract all members from Library."); + printf("\n-lx:N1:N2 eXtract member N1 from Library to file N2."); + printf("\n-ld:N1 Delete member N1 from Library."); + printf("\n-la:N1:N2 Add object file N1 to Library as member N2."); + printf("\n Alternative: -lib LIBRARYNAME OBJECTFILENAMES.\n"); + + printf("\n-vN Verbose options. Values of N:"); + printf("\n 0: Silent, 1: Print file names and types, 2: Tell about conversions."); + + printf("\n-wdNNN Disable Warning NNN."); + printf("\n-weNNN treat Warning NNN as Error. -wex: treat all warnings as errors."); + printf("\n-edNNN Disable Error number NNN."); + printf("\n-ewNNN treat Error number NNN as Warning.\n"); + + printf("\n-h Print this help screen.\n"); + + printf("\n@RFILE Read additional options from response file RFILE.\n"); + printf("\n\nExample:"); + printf("\nobjconv -felf32 -nu filename.obj filename.o\n\n"); } diff --git a/src/cmdline.h b/src/cmdline.h index e76e97e..2cb009f 100644 --- a/src/cmdline.h +++ b/src/cmdline.h @@ -60,7 +60,7 @@ #define CMDL_UNDERSCORE_CHANGE 1 // Change underscores to default for target #define CMDL_UNDERSCORE_REMOVE 2 // Remove underscores from symbol names #define CMDL_UNDERSCORE_ADD 3 // Add underscores to symbol names -#define CMDL_KEEP_ALIAS 0x10 // Keep old name as alias +#define CMDL_KEEP_ALIAS 0x100 // Keep old name as alias // Constants for replacing leading dot with underscore or vice versa in section names #define CMDL_SECTIONDOT_NOCHANGE 0 // Don't change section names @@ -96,9 +96,11 @@ #define SYMA_NOCHANGE 0 // Do nothing #define SYMA_MAKE_WEAK 1 // Make symbol weak #define SYMA_MAKE_LOCAL 2 // Make symbol local -#define SYMA_CHANGE_NAME 4 // Change name of symbol -#define SYMA_CHANGE_PREFIX 8 // Change beginning of symbol name -#define SYMA_CHANGE_ALIAS 0x14 // Make alias and keep old name +#define SYMA_CHANGE_NAME 0x10 // Change name of symbol +#define SYMA_CHANGE_PREFIX 0x11 // Change beginning of symbol name +#define SYMA_CHANGE_SUFFIX 0x12 // Change end of symbol name +#define SYMA_ALIAS 0x100 // Make alias of public symbol and keep old name, must be combined + // with SYMA_CHANGE_NAME, SYMA_CHANGE_PREFIX or SYMA_CHANGE_SUFFIX #define SYMA_ADD_MEMBER 0x1001 // Add member to library #define SYMA_DELETE_MEMBER 0x1002 // Remove member from library #define SYMA_EXTRACT_MEMBER 0x1004 // Extract member from library @@ -131,7 +133,7 @@ class CCommandLineInterpreter { char * OutputFile; // Output file name int InputType; // Input file type (detected from file) int OutputType; // Output type (file type or dump) - int SubType; // Subtype of output type. Assembly language dialect + int SubType; // Subtype of output type. Assembly language dialect or library type int MemberType; // File type of library members int DesiredWordSize; // Desired word size for output file uint32 Verbose; // How much diagnostics to print on screen @@ -141,6 +143,7 @@ class CCommandLineInterpreter { uint32 Underscore; // Add/remove underscores in symbol names uint32 SegmentDot; // Change underscore/dot in beginning of segment names uint32 LibraryOptions; // Options for manipulating library + uint32 LibrarySubtype; // Options for manipulating library uint32 FileOptions; // Options for input and output files uint32 ImageBase; // Specified image base int ShowHelp; // Help screen printed diff --git a/src/cof2asm.cpp b/src/cof2asm.cpp index bb19dd1..4a025e6 100644 --- a/src/cof2asm.cpp +++ b/src/cof2asm.cpp @@ -444,6 +444,9 @@ void CCOF2ASM::MakeExportList() { uint32 * pExportAddressTable = &Get(expdir.FileOffset + ExportAddressTableOffset); // Find ExportNameTable + if (pExportDirectory->NamePointerTableRVA == 0) { + return; // I don't know why this happens + } uint32 ExportNameTableOffset = pExportDirectory->NamePointerTableRVA - expdir.VirtualAddress; if (ExportNameTableOffset == 0 || ExportNameTableOffset >= expdir.MaxOffset) { // Points outside section diff --git a/src/cof2cof.cpp b/src/cof2cof.cpp index 4e29978..765740d 100644 --- a/src/cof2cof.cpp +++ b/src/cof2cof.cpp @@ -139,7 +139,7 @@ void CCOF2COF::MakeSymbolTable() { } break; - case SYMA_CHANGE_ALIAS: { + case SYMA_ALIAS: { // Make alias and keep old name SCOFF_SymTableEntry AliasEntry = *OldSymtab.p; AliasEntry.s.Type = 0; // Make alias a label, not a function diff --git a/src/cof2elf.cpp b/src/cof2elf.cpp index c4256df..4511281 100644 --- a/src/cof2elf.cpp +++ b/src/cof2elf.cpp @@ -266,7 +266,7 @@ void CCOF2ELF::MakeSymbolTable() { int numaux; // Number of auxiliary entries in source record int OldSectionIndex; // Index into old section table. 1-based int NewSectionIndex; // Index into new section table. 0-based - const int WordSize = sizeof(NewFileHeader.e_entry) * 8; // word size 32 or 64 bits + //const int WordSize = sizeof(NewFileHeader.e_entry) * 8; // word size 32 or 64 bits TELF_Symbol sym; // Temporary symbol table record const char * name1; // Name of section or main record diff --git a/src/cof2omf.cpp b/src/cof2omf.cpp index 0752528..2e49e0a 100644 --- a/src/cof2omf.cpp +++ b/src/cof2omf.cpp @@ -192,7 +192,7 @@ void CCOF2OMF::MakeSegmentList() { void CCOF2OMF::MakeSymbolList() { // Make temporary symbol conversion list int isym = 0; // current symbol table entry - int jsym = 0; // auxiliary entry number + //int jsym = 0; // auxiliary entry number union { // Pointer to symbol table SCOFF_SymTableEntry * p; // Normal pointer int8 * b; // Used for address calculation @@ -258,7 +258,7 @@ void CCOF2OMF::MakeRelocationsList() { uint32 i; // Relocation number in old file int j; // Section number of relocation source in old file int isym; // Symbol table index in old file - int32 * paddend = 0; // Pointer to inline addend + //int32 * paddend = 0; // Pointer to inline addend uint32 TargetOldSection; // Section number of relocation target in old file SOMFRelocation NewRel; // Entry in RelocationBuffer @@ -285,7 +285,7 @@ void CCOF2OMF::MakeRelocationsList() { // Find symbol table entry isym = Reloc.p->SymbolTableIndex; - if (isym >= NumberOfSymbols) { + if ((uint32)isym >= (uint32)NumberOfSymbols) { err.submit(2040); // SymbolTableIndex points outside Symbol Table isym = 0; } @@ -294,9 +294,9 @@ void CCOF2OMF::MakeRelocationsList() { // Find inline addend if (Reloc.p->Type < COFF32_RELOC_SEG12) { - paddend = (int32*)(Buf()+SectionHeaderp->PRawData+Reloc.p->VirtualAddress); + //paddend = (int32*)(Buf()+SectionHeaderp->PRawData+Reloc.p->VirtualAddress); } - else paddend = 0; + //else paddend = 0; // Make entry in RelocationBuffer // Relocation type @@ -378,7 +378,7 @@ void CCOF2OMF::MakeLNAMES() { // Make first record in output file = Translator header ToFile.StartRecord(OMF_THEADR); // Remove path from file name and limit length - char * ShortName = CLibrary::TruncateMemberName(OutputFileName); + char * ShortName = CLibrary::ShortenMemberName(OutputFileName); ToFile.PutString(ShortName); ToFile.EndRecord(); @@ -617,7 +617,7 @@ relocations with a source address in the current LEDATA record. // Search through SectionBuffer for old sections contributing to this segment for (OldSection = 0; OldSection < SectionBufferNum; OldSection++) { - if (SectionBuffer[OldSection].NewNumber == Segment && SectionBuffer[OldSection].Size) { + if (SectionBuffer[OldSection].NewNumber == (uint32)Segment && SectionBuffer[OldSection].Size) { // This section contributes to Segment. Make LEDATA record(s) if (SectionBuffer[OldSection].Offset > SegOffset) { @@ -663,7 +663,7 @@ relocations with a source address in the current LEDATA record. // Search for last relocation entry while (RelLast < NumRelocations) { - if (RelocationBuffer[RelLast].Section != OldSection) { + if (RelocationBuffer[RelLast].Section != (uint32)OldSection) { break; // Reached end of relocations for this section } if (RelocationBuffer[RelLast].SourceOffset >= CutOff + SectOffset) { diff --git a/src/coff.cpp b/src/coff.cpp index 8ca3dff..b6d42d1 100644 --- a/src/coff.cpp +++ b/src/coff.cpp @@ -188,6 +188,9 @@ void CCOFF::ParseFile(){ FileHeader = &Get(FileHeaderOffset); NSections = FileHeader->NumberOfSections; + // check header integrity + if ((uint64)FileHeader->PSymbolTable + FileHeader->NumberOfSymbols * SIZE_SCOFF_SymTableEntry > GetDataSize()) err.submit(2035); + // Find optional header if executable file if (FileHeader->SizeOfOptionalHeader && FileHeaderOffset) { OptionalHeader = &Get(FileHeaderOffset + sizeof(SCOFF_FileHeader)); @@ -256,9 +259,9 @@ void CCOFF::Dump(int options) { printf("\nFlags: 0x%04X", FileHeader->Flags); // May be removed: - printf("\nSymbol table offset: %i", FileHeader->PSymbolTable); - printf("\nString table offset: %i", FileHeader->PSymbolTable + FileHeader->NumberOfSymbols * SIZE_SCOFF_SymTableEntry); - printf("\nSection headers offset: %i", (uint32)sizeof(SCOFF_FileHeader) + FileHeader->SizeOfOptionalHeader); + printf("\nSymbol table offset: 0x%X", FileHeader->PSymbolTable); + printf("\nString table offset: 0x%X", FileHeader->PSymbolTable + FileHeader->NumberOfSymbols * SIZE_SCOFF_SymTableEntry); + printf("\nSection headers offset: 0x%X", (uint32)sizeof(SCOFF_FileHeader) + FileHeader->SizeOfOptionalHeader); // Optional header if (OptionalHeader) { @@ -424,6 +427,7 @@ char const * CCOFF::GetSymbolName(int8* Symbol) { else { // Longer than 8 bytes. Get offset into string table uint32 offset = *(uint32*)(Symbol + 4); + if (offset >= StringTableSize || offset >= GetDataSize()) {err.submit(2035); return "";} char * s = StringTable + offset; if (*s) return s; // Return string table entry } @@ -611,9 +615,24 @@ void CCOFF::PrintSymbolTable(int symnum) { sa->section.Length, sa->section.NumberOfRelocations, sa->section.NumberOfLineNumbers, sa->section.CheckSum, sa->section.Number, sa->section.Selection); } + else if (s0->s.StorageClass == COFF_CLASS_ALIAS) { + // This is section definition aux record + printf("\n Aux alias definition record:"); + printf("\n symbol index: %i, ", sa->weak.TagIndex); + switch (sa->weak.Characteristics) { + case IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY: + printf("no library search"); break; + case IMAGE_WEAK_EXTERN_SEARCH_LIBRARY: + printf("library search"); break; + case IMAGE_WEAK_EXTERN_SEARCH_ALIAS: + printf("alias symbol"); break; + default: + printf("unknown characteristics 0x%X", sa->weak.Characteristics); + } + } else { // Unknown aux record type - printf("\n Unknown Auxiliary record type."); + printf("\n Unknown Auxiliary record type %i", s0->s.StorageClass); } Symtab.b += SIZE_SCOFF_SymTableEntry; jsym++; @@ -647,7 +666,8 @@ void CCOFF::PublicNames(CMemoryBuffer * Strings, CSList * Index, i } // Search for public symbol - if (Symtab.p->s.SectionNumber > 0 && Symtab.p->s.StorageClass == COFF_CLASS_EXTERNAL) { + if ((Symtab.p->s.SectionNumber > 0 && Symtab.p->s.StorageClass == COFF_CLASS_EXTERNAL) + || Symtab.p->s.StorageClass == COFF_CLASS_ALIAS) { // Public symbol found SStringEntry se; se.Member = m; diff --git a/src/coff.h b/src/coff.h index e4a9ff0..8b6c635 100644 --- a/src/coff.h +++ b/src/coff.h @@ -229,9 +229,9 @@ struct SCOFF_SectionHeader { uint32 VirtualSize; // size of section when loaded. (Should be 0 for object files, but it seems to be accumulated size of all sections) uint32 VirtualAddress; // subtracted from offsets during relocation. preferably 0 uint32 SizeOfRawData; // section size in file - uint32 PRawData; // file ptr to raw data for section - uint32 PRelocations; // file ptr to relocation entries - uint32 PLineNumbers; // file ptr to line number entries + uint32 PRawData; // file to raw data for section + uint32 PRelocations; // file to relocation entries + uint32 PLineNumbers; // file to line number entries uint16 NRelocations; // number of relocation entries uint16 NLineNumbers; // number of line number entries uint32 Flags; // flags @@ -368,13 +368,16 @@ union SCOFF_SymTableEntry { // Use SIZE_SCOFF_SymTableEntry instead of sizeof(SCOFF_SymTableEntry) #define SIZE_SCOFF_SymTableEntry 18 // Size of SCOFF_SymTableEntry packed +// values of weak.Characteristics +#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1 +#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2 +#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3 + /* #define N_BTMASK (0xf) #define N_TMASK (0x30) #define N_BTSHFT (4) -#define N_TSHIFT (2) - - */ +#define N_TSHIFT (2) */ //#pragma pack(pop) diff --git a/src/containers.cpp b/src/containers.cpp index 6551f7f..feca83d 100644 --- a/src/containers.cpp +++ b/src/containers.cpp @@ -1,7 +1,7 @@ /**************************** containers.cpp ********************************** * Author: Agner Fog * Date created: 2006-07-15 -* Last modified: 2007-01-27 +* Last modified: 2016-07-07 * Project: objconv * Module: containers.cpp * Description: @@ -12,691 +12,704 @@ * dynamic memory allocation and file read/write. See containers.h for * further description. * -* Copyright 2006-2008 GNU General Public License http://www.gnu.org/licenses +* Copyright 2006-2016 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" // Names of file formats SIntTxt FileFormatNames[] = { - {FILETYPE_COFF, "COFF"}, - {FILETYPE_OMF, "OMF"}, - {FILETYPE_ELF, "ELF"}, - {FILETYPE_MACHO_LE, "Mach-O Little Endian"}, - {FILETYPE_MACHO_BE, "Mach-O Big Endian"}, - {FILETYPE_DOS, "DOS executable"}, - {FILETYPE_WIN3X, "Windows 3.x executable"}, - {FILETYPE_LIBRARY, "Function library"}, - {FILETYPE_OMFLIBRARY, "Function library (OMF)"}, - {IMPORT_LIBRARY_MEMBER, "Windows import library member"}, - {FILETYPE_MAC_UNIVBIN, "MacIntosh universal binary"}, - {FILETYPE_MS_WPO, "Whole program optimization intermediate file, Microsoft specific"}, - {FILETYPE_INTEL_WPO, "Whole program optimization intermediate file, Intel specific"}, - {FILETYPE_WIN_UNKNOWN, "Unknown subtype, Windows"}, - {FILETYPE_ASM, "Disassembly"} + {FILETYPE_COFF, "COFF"}, + {FILETYPE_OMF, "OMF"}, + {FILETYPE_ELF, "ELF"}, + {FILETYPE_MACHO_LE, "Mach-O Little Endian"}, + {FILETYPE_MACHO_BE, "Mach-O Big Endian"}, + {FILETYPE_DOS, "DOS executable"}, + {FILETYPE_WIN3X, "Windows 3.x executable"}, + {FILETYPE_LIBRARY, "Function library"}, + {FILETYPE_OMFLIBRARY, "Function library (OMF)"}, + {IMPORT_LIBRARY_MEMBER, "Windows import library member"}, + {FILETYPE_MAC_UNIVBIN, "MacIntosh universal binary"}, + {FILETYPE_MS_WPO, "Whole program optimization intermediate file, Microsoft specific"}, + {FILETYPE_INTEL_WPO, "Whole program optimization intermediate file, Intel specific"}, + {FILETYPE_WIN_UNKNOWN, "Unknown subtype, Windows"}, + {FILETYPE_ASM, "Disassembly"} }; // Members of class CMemoryBuffer CMemoryBuffer::CMemoryBuffer() { - // Constructor - buffer = 0; - NumEntries = DataSize = BufferSize = 0; + // Constructor + buffer = 0; + NumEntries = DataSize = BufferSize = 0; } CMemoryBuffer::~CMemoryBuffer() { - // Destructor - SetSize(0); // De-allocate buffer + // Destructor + SetSize(0); // De-allocate buffer } void CMemoryBuffer::SetSize(uint32 size) { - // Allocate, reallocate or deallocate buffer of specified size. - // DataSize is initially zero. It is increased by Push or PushString. - // Setting size > DataSize will allocate more buffer and fill it with zeroes but not increase DataSize. - // Setting size < DataSize will decrease DataSize so that some of the data are discarded. - // Setting size = 0 will discard all data and de-allocate the buffer. - if (size == 0) { - // Deallocate - if (buffer) delete[] buffer; // De-allocate buffer - buffer = 0; - NumEntries = DataSize = BufferSize = 0; - return; - } - if (size < DataSize) { - // Request to delete some data - DataSize = size; - return; - } - if (size <= BufferSize) { - // Request to reduce size but not delete it - return; // Ignore - } - size = (size + 15) & uint32(-16); // Round up size to value divisible by 16 - int8 * buffer2 = 0; // New buffer - buffer2 = new int8[size]; // Allocate new buffer - if (buffer2 == 0) {err.submit(9006); return;} // Error can't allocate - memset (buffer2, 0, size); // Initialize to all zeroes - if (buffer) { - // A smaller buffer is previously allocated - memcpy (buffer2, buffer, BufferSize); // Copy contents of old buffer into new - delete[] buffer; // De-allocate old buffer - } - buffer = buffer2; // Save pointer to buffer - BufferSize = size; // Save size + // Allocate, reallocate or deallocate buffer of specified size. + // DataSize is initially zero. It is increased by Push or PushString. + // Setting size > DataSize will allocate more buffer and fill it with zeroes but not increase DataSize. + // Setting size < DataSize will decrease DataSize so that some of the data are discarded. + // Setting size = 0 will discard all data and de-allocate the buffer. + if (size == 0) { + // Deallocate + if (buffer) delete[] buffer; // De-allocate buffer + buffer = 0; + NumEntries = DataSize = BufferSize = 0; + return; + } + if (size < DataSize) { + // Request to delete some data + DataSize = size; + return; + } + if (size <= BufferSize) { + // Request to reduce size but not delete it + return; // Ignore + } +// size = (size + 15) & uint32(-16); // Round up size to value divisible by 16 + size = (size + BufferSize + 15) & uint32(-16); // Double size and round up to value divisible by 16 + int8 * buffer2 = 0; // New buffer + buffer2 = new int8[size]; // Allocate new buffer + if (buffer2 == 0) {err.submit(9006); return;} // Error can't allocate + memset (buffer2, 0, size); // Initialize to all zeroes + if (buffer) { + // A smaller buffer is previously allocated + memcpy (buffer2, buffer, BufferSize); // Copy contents of old buffer into new + delete[] buffer; // De-allocate old buffer + } + buffer = buffer2; // Save pointer to buffer + BufferSize = size; // Save size } - + uint32 CMemoryBuffer::Push(void const * obj, uint32 size) { - // Add object to buffer, return offset - // Parameters: - // obj = pointer to object, 0 if fill with zeroes - // size = size of object to push - - // Old offset will be offset to new object - uint32 OldOffset = DataSize; - - // New data size will be old data size plus size of new object - uint32 NewOffset = DataSize + size; - - if (NewOffset > BufferSize) { - // Buffer too small, allocate more space. - // We can use SetSize for this only if it is certain that obj is not - // pointing to an object previously allocated in the old buffer - // because it would be deallocated before copied into the new buffer: - // SetSize (NewOffset + NewOffset / 2 + 1024); - - // Allocate more space without using SetSize: - // Double the size + 1 kB, and round up size to value divisible by 16 - uint32 NewSize = (NewOffset * 2 + 1024 + 15) & uint32(-16); - int8 * buffer2 = 0; // New buffer - // Allocate new buffer - buffer2 = new int8[NewSize]; - if (buffer2 == 0) { - // Error can't allocate - err.submit(9006); return 0; - } - // Initialize to all zeroes - memset (buffer2, 0, NewSize); - if (buffer) { - // A smaller buffer is previously allocated - // Copy contents of old buffer into new - memcpy (buffer2, buffer, BufferSize); - } - BufferSize = NewSize; // Save size - if (obj && size) { - // Copy object to new buffer - memcpy (buffer2 + OldOffset, obj, size); - obj = 0; // Prevent copying once more - } - // Delete old buffer after copying object - if (buffer) delete[] buffer; - - // Save pointer to new buffer - buffer = buffer2; - } - // Copy object to buffer if nonzero - if (obj && size) { - memcpy (buffer + OldOffset, obj, size); - } - if (size) { - // Adjust new offset - DataSize = NewOffset; - NumEntries++; - } - // Return offset to allocated object - return OldOffset; + // Add object to buffer, return offset + // Parameters: + // obj = pointer to object, 0 if fill with zeroes + // size = size of object to push + + // Old offset will be offset to new object + uint32 OldOffset = DataSize; + + // New data size will be old data size plus size of new object + uint32 NewOffset = DataSize + size; + + if (NewOffset > BufferSize) { + // Buffer too small, allocate more space. + // We can use SetSize for this only if it is certain that obj is not + // pointing to an object previously allocated in the old buffer + // because it would be deallocated before copied into the new buffer: + // SetSize (NewOffset + NewOffset / 2 + 1024); + + // Allocate more space without using SetSize: + // Double the size + 1 kB, and round up size to value divisible by 16 + uint32 NewSize = (NewOffset * 2 + 1024 + 15) & uint32(-16); + int8 * buffer2 = 0; // New buffer + // Allocate new buffer + buffer2 = new int8[NewSize]; + if (buffer2 == 0) { + // Error can't allocate + err.submit(9006); return 0; + } + // Initialize to all zeroes + memset (buffer2, 0, NewSize); + if (buffer) { + // A smaller buffer is previously allocated + // Copy contents of old buffer into new + memcpy (buffer2, buffer, BufferSize); + } + BufferSize = NewSize; // Save size + if (obj && size) { + // Copy object to new buffer + memcpy (buffer2 + OldOffset, obj, size); + obj = 0; // Prevent copying once more + } + // Delete old buffer after copying object + if (buffer) delete[] buffer; + + // Save pointer to new buffer + buffer = buffer2; + } + // Copy object to buffer if nonzero + if (obj && size) { + memcpy (buffer + OldOffset, obj, size); + } + if (size) { + // Adjust new offset + DataSize = NewOffset; + NumEntries++; + } + // Return offset to allocated object + return OldOffset; } uint32 CMemoryBuffer::PushString(char const * s) { - // Add ASCIIZ string to buffer, return offset - return Push (s, uint32(strlen(s))+1); + // Add ASCIIZ string to buffer, return offset + return Push (s, uint32(strlen(s))+1); } uint32 CMemoryBuffer::GetLastIndex() { - // Index of last object pushed (zero-based) - return NumEntries - 1; + // Index of last object pushed (zero-based) + return NumEntries - 1; } void CMemoryBuffer::Align(uint32 a) { - // Align next entry to address divisible by a - uint32 NewOffset = (DataSize + a - 1) / a * a; - if (NewOffset > BufferSize) { - // Allocate more space - SetSize (NewOffset * 2); - } - // Set DataSize to after alignment space - DataSize = NewOffset; + // Align next entry to address divisible by a + uint32 NewOffset = (DataSize + a - 1) / a * a; + if (NewOffset > BufferSize) { + // Allocate more space + SetSize (NewOffset + 2048); + } + // Set DataSize to after alignment space + DataSize = NewOffset; } // Members of class CFileBuffer CFileBuffer::CFileBuffer() : CMemoryBuffer() { - // Default constructor - FileName = 0; - OutputFileName = 0; - FileType = WordSize = Executable = 0; + // Default constructor + FileName = 0; + OutputFileName = 0; + FileType = WordSize = Executable = 0; } CFileBuffer::CFileBuffer(char const * filename) : CMemoryBuffer() { - // Constructor - FileName = filename; - FileType = WordSize = 0; + // Constructor + FileName = filename; + FileType = WordSize = 0; } void CFileBuffer::Read(int IgnoreError) { - // Read file into buffer - uint32 status; // Error status + // Read file into buffer + uint32 status; // Error status #ifdef _MSC_VER // Microsoft compiler prefers this: - int fh; // File handle - fh = _open(FileName, O_RDONLY | O_BINARY); // Open file in binary mode - if (fh == -1) { - // Cannot read file - if (!IgnoreError) err.submit(2103, FileName); // Error. Input file must be read - SetSize(0); return; // Make empty file buffer - } - DataSize = filelength(fh); // Get file size - if (DataSize <= 0) { - if (!IgnoreError) err.submit(2105, FileName); // Wrong size - return;} - SetSize(DataSize + 1024); // Allocate buffer, 1k extra - status = _read(fh, Buf(), DataSize); // Read from file - if (status != DataSize) err.submit(2103, FileName); - status = _close(fh); // Close file - if (status != 0) err.submit(2103, FileName); + int fh; // File handle + fh = _open(FileName, O_RDONLY | O_BINARY); // Open file in binary mode + if (fh == -1) { + // Cannot read file + if (!IgnoreError) err.submit(2103, FileName); // Error. Input file must be read + SetSize(0); return; // Make empty file buffer + } + DataSize = filelength(fh); // Get file size + if (DataSize <= 0) { + if (!IgnoreError) err.submit(2105, FileName); // Wrong size + return;} + SetSize(DataSize + 2048); // Allocate buffer, 2k extra + status = _read(fh, Buf(), DataSize); // Read from file + if (status != DataSize) err.submit(2103, FileName); + status = _close(fh); // Close file + if (status != 0) err.submit(2103, FileName); #else // Works with most compilers: - FILE * fh = fopen(FileName, "rb"); - if (!fh) { - // Cannot read file - if (!IgnoreError) err.submit(2103, FileName); // Error. Input file must be read - SetSize(0); return; // Make empty file buffer - } - // Find file size - fseek(fh, 0, SEEK_END); - long int fsize = ftell(fh); - if (fsize <= 0 || (unsigned long)fsize >= 0xFFFFFFFF) { - // File too big or zero size - err.submit(2105, FileName); fclose(fh); return; - } - DataSize = (uint32)fsize; - rewind(fh); - // Allocate buffer - SetSize(DataSize + 1024); // Allocate buffer, 1k extra - // Read entire file - status = (uint32)fread(Buf(), 1, DataSize, fh); - if (status != DataSize) err.submit(2103, FileName); - status = fclose(fh); - if (status != 0) err.submit(2103, FileName); + FILE * fh = fopen(FileName, "rb"); + if (!fh) { + // Cannot read file + if (!IgnoreError) err.submit(2103, FileName); // Error. Input file must be read + SetSize(0); return; // Make empty file buffer + } + // Find file size + fseek(fh, 0, SEEK_END); + long int fsize = ftell(fh); + if (fsize <= 0 || (unsigned long)fsize >= 0xFFFFFFFF) { + // File too big or zero size + err.submit(2105, FileName); fclose(fh); return; + } + DataSize = (uint32)fsize; + rewind(fh); + // Allocate buffer + SetSize(DataSize + 2048); // Allocate buffer, 2k extra + // Read entire file + status = (uint32)fread(Buf(), 1, DataSize, fh); + if (status != DataSize) err.submit(2103, FileName); + status = fclose(fh); + if (status != 0) err.submit(2103, FileName); #endif } void CFileBuffer::Write() { - // Write buffer to file: - if (OutputFileName) FileName = OutputFileName; - // Two alternative ways to write a file: + // Write buffer to file: + if (OutputFileName) FileName = OutputFileName; + // Two alternative ways to write a file: #ifdef _MSC_VER // Microsoft compiler prefers this: - int fh; // File handle - uint32 status; // Error status - // Open file in binary mode - fh = _open(FileName, O_RDWR | O_BINARY | O_CREAT | O_TRUNC, _S_IREAD | _S_IWRITE); - // Check if error - if (fh == -1) {err.submit(2104, FileName); return;} - // Write file - status = _write(fh, Buf(), DataSize); - // Check if error - if (status != DataSize) err.submit(2104, FileName); - // Close file - status = _close(fh); - // Check if error - if (status != 0) err.submit(2104, FileName); + int fh; // File handle + uint32 status; // Error status + // Open file in binary mode + fh = _open(FileName, O_RDWR | O_BINARY | O_CREAT | O_TRUNC, _S_IREAD | _S_IWRITE); + // Check if error + if (fh == -1) {err.submit(2104, FileName); return;} + // Write file + status = _write(fh, Buf(), DataSize); + // Check if error + if (status != DataSize) err.submit(2104, FileName); + // Close file + status = _close(fh); + // Check if error + if (status != 0) err.submit(2104, FileName); #else // Works with most compilers: - // Open file in binary mode - FILE * ff = fopen(FileName, "wb"); - // Check if error - if (!ff) {err.submit(2104, FileName); return;} - // Write file - uint32 n = (uint32)fwrite(Buf(), 1, DataSize, ff); - // Check if error - if (n != DataSize) err.submit(2104, FileName); - // Close file - n = fclose(ff); - // Check if error - if (n) {err.submit(2104, FileName); return;} + // Open file in binary mode + FILE * ff = fopen(FileName, "wb"); + // Check if error + if (!ff) {err.submit(2104, FileName); return;} + // Write file + uint32 n = (uint32)fwrite(Buf(), 1, DataSize, ff); + // Check if error + if (n != DataSize) err.submit(2104, FileName); + // Close file + n = fclose(ff); + // Check if error + if (n) {err.submit(2104, FileName); return;} #endif } int CFileBuffer::GetFileType() { - // Detect file type - if (FileType) return FileType; // File type already known - if (!DataSize) return 0; // No file - if (!Buf()) return 0; // No contents - - if (strncmp(Buf(),"!",7) == 0) { - // UNIX style library. Contains members of file type COFF, ELF or MACHO - FileType = FILETYPE_LIBRARY; - } - else if (strncmp(Buf(),ELFMAG,4) == 0) { - // ELF file - FileType = FILETYPE_ELF; - Executable = Get(0).e_type != ET_REL; - switch (Buf()[EI_CLASS]) { - case ELFCLASS32: + // Detect file type + if (FileType) return FileType; // File type already known + if (!DataSize) return 0; // No file + if (!Buf()) return 0; // No contents + + uint32 namelen = FileName ? (uint32)strlen(FileName) : 0; + + if (strncmp(Buf(),"!",7) == 0) { + // UNIX style library. Contains members of file type COFF, ELF or MACHO + FileType = FILETYPE_LIBRARY; + } + else if (strncmp(Buf(),ELFMAG,4) == 0) { + // ELF file + FileType = FILETYPE_ELF; + Executable = Get(0).e_type != ET_REL; + switch (Buf()[EI_CLASS]) { + case ELFCLASS32: WordSize = 32; break; - case ELFCLASS64: + case ELFCLASS64: WordSize = 64; break; - } - } - else if (Get(0) == MAC_MAGIC_32) { - // Mach-O 32 little endian - FileType = FILETYPE_MACHO_LE; - WordSize = 32; - Executable = Get(0).filetype != MAC_OBJECT; - } - else if (Get(0) == MAC_MAGIC_64) { - // Mach-O 64 little endian - FileType = FILETYPE_MACHO_LE; - WordSize = 64; - Executable = Get(0).filetype != MAC_OBJECT; - } - else if (Get(0) == MAC_CIGAM_32) { - // Mach-O 32 big endian - FileType = FILETYPE_MACHO_BE; - WordSize = 32; - } - else if (Get(0) == MAC_CIGAM_64) { - // Mach-O 64 big endian - FileType = FILETYPE_MACHO_BE; - WordSize = 64; - } - else if (Get(0) == MAC_CIGAM_UNIV) { - // MacIntosh universal binary - FileType = FILETYPE_MAC_UNIVBIN; - WordSize = 0; - } - else if (Get(0) == 0xFFFF0000) { - // Windows subtypes: - if (Get(4) == 0) { - // This type only occurs when attempting to extract a member from an import library - FileType = IMPORT_LIBRARY_MEMBER; - } - else if (Get(4) == 1) { - // Whole program optimization intermediate file for MS compiler. Undocumented - FileType = FILETYPE_MS_WPO; - } - else { - // Other subtypes not known - FileType = FILETYPE_WIN_UNKNOWN; - } - // Get word size - if (Get(6) == PE_MACHINE_I386) { - WordSize = 32; - } - else if (Get(6) == PE_MACHINE_X8664) { - WordSize = 64; - } - else { - WordSize = 0; - } - } - else if (Get(0) == PE_MACHINE_I386) { - // COFF/PE 32 - FileType = FILETYPE_COFF; - WordSize = 32; - Executable = (Get(0).Flags & PE_F_EXEC) != 0; - } - else if (Get(0) == PE_MACHINE_X8664) { - // COFF64/PE32+ - FileType = FILETYPE_COFF; - WordSize = 64; - Executable = (Get(0).Flags & PE_F_EXEC) != 0; - } - else if (Get(0) == OMF_THEADR) { - // OMF 16 or 32 - FileType = FILETYPE_OMF; - // Word size can only be determined by searching through records in file: - GetOMFWordSize(); // Determine word size - } - else if (Get(0) == OMF_LIBHEAD) { - // OMF Library 16 or 32 - FileType = FILETYPE_OMFLIBRARY; - } - else if ((Get(0) & 0xFFF9) == 0x5A49) { - // DOS file or file with DOS stub - FileType = FILETYPE_DOS; - WordSize = 16; - Executable = 1; - uint32 Signature = Get(0x3C); - if (Signature + 8 < DataSize) { - if (Get(Signature) == 0x454E) { - // Windows 3.x file - FileType = FILETYPE_WIN3X; - } - else if (Get(Signature) == 0x4550) { - // COFF file - uint16 MachineType = Get(Signature + 4); - if (MachineType == PE_MACHINE_I386) { - FileType = FILETYPE_COFF; - WordSize = 32; + } + } + else if (Get(0) == MAC_MAGIC_32) { + // Mach-O 32 little endian + FileType = FILETYPE_MACHO_LE; + WordSize = 32; + Executable = Get(0).filetype != MAC_OBJECT; + } + else if (Get(0) == MAC_MAGIC_64) { + // Mach-O 64 little endian + FileType = FILETYPE_MACHO_LE; + WordSize = 64; + Executable = Get(0).filetype != MAC_OBJECT; + } + else if (Get(0) == MAC_CIGAM_32) { + // Mach-O 32 big endian + FileType = FILETYPE_MACHO_BE; + WordSize = 32; + } + else if (Get(0) == MAC_CIGAM_64) { + // Mach-O 64 big endian + FileType = FILETYPE_MACHO_BE; + WordSize = 64; + } + else if (Get(0) == MAC_CIGAM_UNIV) { + // MacIntosh universal binary + FileType = FILETYPE_MAC_UNIVBIN; + WordSize = 0; + } + else if (Get(0) == 0xFFFF0000 || Get(0) == 0x10000) { + // Windows subtypes: + if (Get(4) == 0) { + // This type only occurs when attempting to extract a member from an import library + FileType = IMPORT_LIBRARY_MEMBER; + } + else if (Get(4) == 1) { + // Whole program optimization intermediate file for MS compiler. Undocumented + FileType = FILETYPE_MS_WPO; + } + else { + // Other subtypes not known + FileType = FILETYPE_WIN_UNKNOWN; + } + // Get word size + if (Get(6) == PE_MACHINE_I386) { + WordSize = 32; + } + else if (Get(6) == PE_MACHINE_X8664) { + WordSize = 64; + } + else { + WordSize = 0; + } + } + else if (Get(0) == PE_MACHINE_I386) { + // COFF/PE 32 + FileType = FILETYPE_COFF; + WordSize = 32; + Executable = (Get(0).Flags & PE_F_EXEC) != 0; + } + else if (Get(0) == PE_MACHINE_X8664) { + // COFF64/PE32+ + FileType = FILETYPE_COFF; + WordSize = 64; + Executable = (Get(0).Flags & PE_F_EXEC) != 0; + } + else if (Get(0) == OMF_THEADR) { + // OMF 16 or 32 + FileType = FILETYPE_OMF; + // Word size can only be determined by searching through records in file: + GetOMFWordSize(); // Determine word size + } + else if (Get(0) == OMF_LIBHEAD) { + // OMF Library 16 or 32 + FileType = FILETYPE_OMFLIBRARY; + } + else if ((Get(0) & 0xFFF9) == 0x5A49) { + // DOS file or file with DOS stub + FileType = FILETYPE_DOS; + WordSize = 16; + Executable = 1; + uint32 Signature = Get(0x3C); + if (Signature + 8 < DataSize) { + if (Get(Signature) == 0x454E) { + // Windows 3.x file + FileType = FILETYPE_WIN3X; } - else if (MachineType == PE_MACHINE_X8664) { - FileType = FILETYPE_COFF; - WordSize = 64; + else if (Get(Signature) == 0x4550) { + // COFF file + uint16 MachineType = Get(Signature + 4); + if (MachineType == PE_MACHINE_I386) { + FileType = FILETYPE_COFF; + WordSize = 32; + } + else if (MachineType == PE_MACHINE_X8664) { + FileType = FILETYPE_COFF; + WordSize = 64; + } } - } - } - } - else if ((uint32)strlen(FileName) > 4 - && stricmp(FileName + (uint32)strlen(FileName) - 4, ".com") == 0) { - // DOS .com file recognized only from its extension - FileType = FILETYPE_DOS; - WordSize = 16; Executable = 1; - } - else { - // Unknown file type - err.submit(2018, FileName); - return 0; - } - return FileType; + } + } + else if (namelen > 4 && stricmp(FileName + namelen - 4, ".com") == 0) { + // DOS .com file recognized only from its extension + FileType = FILETYPE_DOS; + WordSize = 16; Executable = 1; + } + else if (Get(0) == 0 && namelen > 4 && stricmp(FileName + namelen - 4, ".obj") == 0) { + // Possibly alias record in COFF library + FileType = FILETYPE_COFF; + WordSize = 0; + Executable = 0; + } + else { + // Unknown file type + int utype = Get(0); + err.submit(2018, utype, FileName); + FileType = 0; + } + return FileType; } char const * CFileBuffer::GetFileFormatName(int FileType) { - // Get name of file format type - return Lookup (FileFormatNames, FileType); + // Get name of file format type + return Lookup (FileFormatNames, FileType); } void CFileBuffer::SetFileType(int type) { - // Set file format type - FileType = type; + // Set file format type + FileType = type; } void CFileBuffer::Reset() { - // Set all members to zero - SetSize(0); // Deallocate memory buffer - memset(this, 0, sizeof(*this)); + // Set all members to zero + SetSize(0); // Deallocate memory buffer + memset(this, 0, sizeof(*this)); } -void CFileBuffer::CheckOutputFileName() { - // Make output file name or check that requested name is valid - if (!(cmd.FileOptions & CMDL_FILE_OUTPUT)) { - // No output file - return; - } - - OutputFileName = cmd.OutputFile; - if (OutputFileName == 0) { - // Output file name not specified. Make filename - static char name[MAXFILENAMELENGTH+8]; - strncpy(name, FileName, MAXFILENAMELENGTH); - int i; - // Search for last '.' in file name - for (i = (int)strlen(name)-1; i > 0; i--) if (name[i] == '.') break; - if (i < 1) { - // '.' not found. Append '.' to name - i = (int)strlen(name); if (i > MAXFILENAMELENGTH-4) i = MAXFILENAMELENGTH-4; - } - // Get default extension - if (cmd.OutputType == FILETYPE_ASM) { - strcpy(name+i, ".asm"); // Assembly file - } - else if (cmd.OutputType == FILETYPE_COFF || cmd.OutputType == FILETYPE_OMF) { - if ((FileType & (FILETYPE_LIBRARY | FILETYPE_OMFLIBRARY)) || (cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER)) { +char * CFileBuffer::SetFileNameExtension(const char * f) { + // Set file name extension according to FileType + static char name[MAXFILENAMELENGTH+8]; + int i; + + if (strlen(f) > MAXFILENAMELENGTH) err.submit(2203, f); + strncpy(name, f, MAXFILENAMELENGTH); + + // Search for last '.' in file name + for (i = (int)strlen(name)-1; i > 0; i--) if (name[i] == '.') break; + if (i < 1) { + // '.' not found. Append '.' to name + i = (int)strlen(name); if (i > MAXFILENAMELENGTH-4) i = MAXFILENAMELENGTH-4; + } + // Get default extension + if (cmd.OutputType == FILETYPE_ASM) { + strcpy(name+i, ".asm"); // Assembly file + } + else if (cmd.OutputType == FILETYPE_COFF || cmd.OutputType == FILETYPE_OMF) { + if ((FileType & (FILETYPE_LIBRARY | FILETYPE_OMFLIBRARY)) || (cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER)) { strcpy(name+i, ".lib"); // Windows function library - } - else { + } + else { strcpy(name+i, ".obj"); // Windows object file - } - } - else { // output type is ELF or MACHO - if ((FileType & (FILETYPE_LIBRARY | FILETYPE_OMFLIBRARY)) || (cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER)) { + } + } + else { // output type is ELF or MACHO + if ((FileType & (FILETYPE_LIBRARY | FILETYPE_OMFLIBRARY)) || (cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER)) { strcpy(name+i, ".a"); // Linux/BSD/Mac function library - } - else { + } + else { strcpy(name+i, ".o"); // Linux/BSD/Mac object file - } - } - // Assign new name to OutputFileName - OutputFileName = cmd.OutputFile = name; - } - if (strcmp(FileName,OutputFileName) == 0 && !(cmd.FileOptions & CMDL_FILE_IN_OUT_SAME)) { - // Input and output files have same name - err.submit(2005, FileName); - } + } + } + return name; +} + +void CFileBuffer::CheckOutputFileName() { + // Make output file name or check that requested name is valid + if (!(cmd.FileOptions & CMDL_FILE_OUTPUT)) return; + + OutputFileName = cmd.OutputFile; + if (OutputFileName == 0) { + // Output file name not specified. Make filename + OutputFileName = cmd.OutputFile = SetFileNameExtension(FileName); + } + if (strcmp(FileName,OutputFileName) == 0 && !(cmd.FileOptions & CMDL_FILE_IN_OUT_SAME)) { + // Input and output files have same name + err.submit(2005, FileName); + } } void operator >> (CFileBuffer & a, CFileBuffer & b) { - // Transfer ownership of buffer and other properties from a to b - b.SetSize(0); // De-allocate old buffer from target if it has one - b.buffer = a.buffer; // Transfer buffer - a.buffer = 0; // Remove buffer from source, so that buffer has only one owner - - // Copy properties - b.DataSize = a.GetDataSize(); // Size of data, offset to vacant space - b.BufferSize = a.GetBufferSize(); // Size of allocated buffer - b.NumEntries = a.GetNumEntries(); // Number of objects pushed - b.Executable = a.Executable; // File is executable - if (a.WordSize) b.WordSize = a.WordSize; // Segment word size (16, 32, 64) - if (a.FileName) b.FileName = a.FileName; // Name of input file - if (a.OutputFileName) b.OutputFileName = a.OutputFileName;// Name of output file - if (a.GetFileType()) b.FileType = a.GetFileType(); // Object file type - a.SetSize(0); // Reset a's properties + // Transfer ownership of buffer and other properties from a to b + b.SetSize(0); // De-allocate old buffer from target if it has one + b.buffer = a.buffer; // Transfer buffer + a.buffer = 0; // Remove buffer from source, so that buffer has only one owner + + // Copy properties + b.DataSize = a.GetDataSize(); // Size of data, offset to vacant space + b.BufferSize = a.GetBufferSize(); // Size of allocated buffer + b.NumEntries = a.GetNumEntries(); // Number of objects pushed + b.Executable = a.Executable; // File is executable + if (a.WordSize) b.WordSize = a.WordSize; // Segment word size (16, 32, 64) + if (a.FileName) b.FileName = a.FileName; // Name of input file + if (a.OutputFileName) b.OutputFileName = a.OutputFileName;// Name of output file + if (a.GetFileType()) b.FileType = a.GetFileType(); // Object file type + a.SetSize(0); // Reset a's properties } void CFileBuffer::GetOMFWordSize() { - // Determine word size for OMF file. - // There is no simple way to get the word size. Looking for odd-numbered - // record types is not sufficient. A 32-bit OMF file may use 16-bit SEGDEF - // records. We have to look for segments with the 'P' attribute set. And - // even this is not completely safe, because MASM may generate empty 32-bit - // segments so we have to look only at segments with nonzero size. - // We can still have any mixture of 16- and 32-bit segments, though, so no - // method is absolutely safe. - - // We have to parse through all records in file buffer - uint8 RecordType; // Type of current record - uint32 RecordStart; // Index to start of current record - uint32 RecordEnd; // Index to end of current record - uint32 RecordLength; // Length of current record - uint32 Index = 0; // Current offset from buffer while reading - OMF_SAttrib SegAttr; // Segment attributed - uint32 SegLength; // Segment length - - WordSize = 16; // WordSize = 16 if no 32 bit records found - - while (Index < GetDataSize()) { - RecordStart = Index; // Record starts here - RecordType = Get(Index++); // Get first byte of record = type - RecordLength = Get(Index); // Next two bytes = length - Index += 2; - RecordEnd = RecordStart + RecordLength + 3;// End of record - if (RecordEnd > GetDataSize()) { - // Record goes beyond end of file - err.submit(2301); break; - } - if ((RecordType & 1) && RecordType < OMF_LIBHEAD) { // Odd-numbered type means 32 bit - WordSize = 32; // ..but this method is not safe - } - if ((RecordType & 0xFE) == OMF_SEGDEF) { // Segment definition record - SegAttr.b = Get(Index++); // Get segment attributes - if (SegAttr.u.A == 0) { - // Frame and Offset only included if A = 0 - Index += 2+1; - } - SegLength = (RecordType & 1) ? Get(Index) : Get(Index); // Segment length - - if (SegAttr.u.P && SegLength) { // if segment has P attribute and nonzero length - WordSize = 32; // .. then it is a 32-bit segment - } - } - Index = RecordEnd; // Point to next record - } + // Determine word size for OMF file. + // There is no simple way to get the word size. Looking for odd-numbered + // record types is not sufficient. A 32-bit OMF file may use 16-bit SEGDEF + // records. We have to look for segments with the 'P' attribute set. And + // even this is not completely safe, because MASM may generate empty 32-bit + // segments so we have to look only at segments with nonzero size. + // We can still have any mixture of 16- and 32-bit segments, though, so no + // method is absolutely safe. + + // We have to parse through all records in file buffer + uint8 RecordType; // Type of current record + uint32 RecordStart; // Index to start of current record + uint32 RecordEnd; // Index to end of current record + uint32 RecordLength; // Length of current record + uint32 Index = 0; // Current offset from buffer while reading + OMF_SAttrib SegAttr; // Segment attributed + uint32 SegLength; // Segment length + + WordSize = 16; // WordSize = 16 if no 32 bit records found + + while (Index < GetDataSize()) { + RecordStart = Index; // Record starts here + RecordType = Get(Index++); // Get first byte of record = type + RecordLength = Get(Index); // Next two bytes = length + Index += 2; + RecordEnd = RecordStart + RecordLength + 3;// End of record + if (RecordEnd > GetDataSize()) { + // Record goes beyond end of file + err.submit(2301); break; + } + if ((RecordType & 1) && RecordType < OMF_LIBHEAD) { // Odd-numbered type means 32 bit + WordSize = 32; // ..but this method is not safe + } + if ((RecordType & 0xFE) == OMF_SEGDEF) { // Segment definition record + SegAttr.b = Get(Index++); // Get segment attributes + if (SegAttr.u.A == 0) { + // Frame and Offset only included if A = 0 + Index += 2+1; + } + SegLength = (RecordType & 1) ? Get(Index) : Get(Index); // Segment length + + if (SegAttr.u.P && SegLength) { // if segment has P attribute and nonzero length + WordSize = 32; // .. then it is a 32-bit segment + } + } + Index = RecordEnd; // Point to next record + } } // Class CTextFileBuffer is used for building text files // Constructor CTextFileBuffer::CTextFileBuffer() { - column = 0; - // Use UNIX linefeeds only if GASM output - LineType = (cmd.SubType == SUBTYPE_GASM) ? 1 : 0; + column = 0; + // Use UNIX linefeeds only if GASM output + LineType = (cmd.SubType == SUBTYPE_GASM) ? 1 : 0; } void CTextFileBuffer::Put(const char * text) { - // Write text string to buffer - uint32 len = (uint32)strlen(text); // Length of text - Push(text, len); // Add to buffer without terminating zero - column += len; // Update column + // Write text string to buffer + uint32 len = (uint32)strlen(text); // Length of text + Push(text, len); // Add to buffer without terminating zero + column += len; // Update column } void CTextFileBuffer::Put(const char character) { - // Write single character to buffer - Push(&character, 1); // Add to buffer - column ++; // Update column + // Write single character to buffer + Push(&character, 1); // Add to buffer + column ++; // Update column } void CTextFileBuffer::NewLine() { - // Add linefeed - if (LineType == 0) { - Push("\r\n", 2); // DOS/Windows style linefeed - } - else { - Push("\n", 1); // UNIX style linefeed - } - column = 0; // Reset column + // Add linefeed + if (LineType == 0) { + Push("\r\n", 2); // DOS/Windows style linefeed + } + else { + Push("\n", 1); // UNIX style linefeed + } + column = 0; // Reset column } void CTextFileBuffer::Tabulate(uint32 i) { - // Insert spaces until column i - uint32 j; - if (i > column) { // Only insert spaces if we are not already past i - for (j = column; j < i; j++) Push(" ", 1); // Insert i - column spaces - column = i; // Update column - } + // Insert spaces until column i + uint32 j; + if (i > column) { // Only insert spaces if we are not already past i + for (j = column; j < i; j++) Push(" ", 1); // Insert i - column spaces + column = i; // Update column + } } void CTextFileBuffer::PutDecimal(int32 x, int IsSigned) { - // Write decimal number to buffer, unsigned or signed - char text[16]; - sprintf(text, IsSigned ? "%i" : "%u", x); - Put(text); + // Write decimal number to buffer, unsigned or signed + char text[16]; + sprintf(text, IsSigned ? "%i" : "%u", x); + Put(text); } void CTextFileBuffer::PutHex(uint8 x, int MasmForm) { - // Write hexadecimal 8 bit number to buffer - // If MasmForm >= 1 then the function will write the number in a - // way that can be read by the assembler, e.g. 0FFH or 0xFF - char text[16]; - if (MasmForm && cmd.SubType == SUBTYPE_GASM) { - // Needs 0x prefix - sprintf(text, "0x%02X", x); - Put(text); - return; - } - if (MasmForm && x >= 0xA0) { - Put("0"); // Make sure it doesn't begin with a letter - } - sprintf(text, "%02X", x); - Put(text); - if (MasmForm) Put("H"); + // Write hexadecimal 8 bit number to buffer + // If MasmForm >= 1 then the function will write the number in a + // way that can be read by the assembler, e.g. 0FFH or 0xFF + char text[16]; + if (MasmForm && cmd.SubType == SUBTYPE_GASM) { + // Needs 0x prefix + sprintf(text, "0x%02X", x); + Put(text); + return; + } + if (MasmForm && x >= 0xA0) { + Put("0"); // Make sure it doesn't begin with a letter + } + sprintf(text, "%02X", x); + Put(text); + if (MasmForm) Put("H"); } void CTextFileBuffer::PutHex(uint16 x, int MasmForm) { - // Write hexadecimal 16 bit number to buffer - // If MasmForm >= 1 then the function will write the number in a - // way that can be read by the assembler, e.g. 0FFH or 0xFF - // If MasmForm == 2 then leading zeroes are stripped - char text[16]; - if (MasmForm && cmd.SubType == SUBTYPE_GASM) { - // Needs 0x prefix - sprintf(text, MasmForm==1 ? "0x%04X" : "0x%X", x); - Put(text); - return; - } - sprintf(text, (MasmForm < 2) ? "%04X" : "%X", x); - // Check if leading zero needed - if (MasmForm && text[0] > '9') { - Put("0"); // Leading zero needed - } - Put(text); - if (MasmForm) Put("H"); + // Write hexadecimal 16 bit number to buffer + // If MasmForm >= 1 then the function will write the number in a + // way that can be read by the assembler, e.g. 0FFH or 0xFF + // If MasmForm == 2 then leading zeroes are stripped + char text[16]; + if (MasmForm && cmd.SubType == SUBTYPE_GASM) { + // Needs 0x prefix + sprintf(text, MasmForm==1 ? "0x%04X" : "0x%X", x); + Put(text); + return; + } + sprintf(text, (MasmForm < 2) ? "%04X" : "%X", x); + // Check if leading zero needed + if (MasmForm && text[0] > '9') { + Put("0"); // Leading zero needed + } + Put(text); + if (MasmForm) Put("H"); } void CTextFileBuffer::PutHex(uint32 x, int MasmForm) { - // Write hexadecimal 32 bit number to buffer - // If MasmForm >= 1 then the function will write the number in a - // way that can be read by the assembler, e.g. 0FFH or 0xFF - // If MasmForm == 2 then leading zeroes are stripped - char text[16]; - if (MasmForm && cmd.SubType == SUBTYPE_GASM) { - // Needs 0x prefix - sprintf(text, MasmForm==1 ? "0x%08X" : "0x%X", x); - Put(text); - return; - } - - sprintf(text, (MasmForm < 2) ? "%08X" : "%X", x); - // Check if leading zero needed - if (MasmForm && text[0] > '9') { - Put("0"); // Leading zero needed - } - Put(text); - if (MasmForm) Put("H"); + // Write hexadecimal 32 bit number to buffer + // If MasmForm >= 1 then the function will write the number in a + // way that can be read by the assembler, e.g. 0FFH or 0xFF + // If MasmForm == 2 then leading zeroes are stripped + char text[16]; + if (MasmForm && cmd.SubType == SUBTYPE_GASM) { + // Needs 0x prefix + sprintf(text, MasmForm==1 ? "0x%08X" : "0x%X", x); + Put(text); + return; + } + + sprintf(text, (MasmForm < 2) ? "%08X" : "%X", x); + // Check if leading zero needed + if (MasmForm && text[0] > '9') { + Put("0"); // Leading zero needed + } + Put(text); + if (MasmForm) Put("H"); } void CTextFileBuffer::PutHex(uint64 x, int MasmForm) { - // Write unsigned hexadecimal 64 bit number to buffer - // If MasmForm >= 1 then the function will write the number in a - // way that can be read by the assembler, e.g. 0FFH or 0xFF - // If MasmForm == 2 then leading zeroes are stripped - char text[32]; - if (MasmForm < 2) { // Print all digits - sprintf(text, "%08X%08X", HighDWord(x), uint32(x)); - } - else { // Skip leading zeroes - if (HighDWord(x)) { - sprintf(text, "%X%08X", HighDWord(x), uint32(x)); - } - else { - sprintf(text, "%X", uint32(x)); - } - } - if (MasmForm) { - if (cmd.SubType == SUBTYPE_GASM) { - // Needs 0x prefix - Put("0x"); - Put(text); - } - else { - // use 0FFH form - if (text[0] > '9') Put("0"); // Leading zero needed - Put(text); - Put("H"); - } - } - else { - // write hexadecimal number only - Put(text); - } + // Write unsigned hexadecimal 64 bit number to buffer + // If MasmForm >= 1 then the function will write the number in a + // way that can be read by the assembler, e.g. 0FFH or 0xFF + // If MasmForm == 2 then leading zeroes are stripped + char text[32]; + if (MasmForm < 2) { // Print all digits + sprintf(text, "%08X%08X", HighDWord(x), uint32(x)); + } + else { // Skip leading zeroes + if (HighDWord(x)) { + sprintf(text, "%X%08X", HighDWord(x), uint32(x)); + } + else { + sprintf(text, "%X", uint32(x)); + } + } + if (MasmForm) { + if (cmd.SubType == SUBTYPE_GASM) { + // Needs 0x prefix + Put("0x"); + Put(text); + } + else { + // use 0FFH form + if (text[0] > '9') Put("0"); // Leading zero needed + Put(text); + Put("H"); + } + } + else { + // write hexadecimal number only + Put(text); + } } void CTextFileBuffer::PutFloat(float x) { - // Write floating point number to buffer - char text[64]; - sprintf(text, "%.7G", x); - Put(text); + // Write floating point number to buffer + char text[64]; + sprintf(text, "%.7G", x); + Put(text); } void CTextFileBuffer::PutFloat(double x) { - // Write floating point number to buffer - char text[64]; - sprintf(text, "%.16G", x); - Put(text); + // Write floating point number to buffer + char text[64]; + sprintf(text, "%.16G", x); + Put(text); } diff --git a/src/containers.h b/src/containers.h index f346a75..994de3e 100644 --- a/src/containers.h +++ b/src/containers.h @@ -133,6 +133,7 @@ class CFileBuffer : public CMemoryBuffer { int WordSize; // Segment word size (16, 32, 64) int FileType; // Object file type int Executable; // File is executable + char * SetFileNameExtension(const char * f); // Set file name extension according to FileType protected: void GetOMFWordSize(); // Determine word size for OMF file void CheckOutputFileName(); // Make output file name or check that requested name is valid @@ -323,7 +324,7 @@ class CSList : private CMemoryBuffer { // Returns the record number if a record equal to x exists in the list. // Returns -1 if not. The list must be sorted before calling Exists. // Two records a and b are assumed to be equal if !(a < b || b < a) - int32 i = FindFirst(x); + uint32 i = FindFirst(x); if (i == NumEntries) return -1; if (x < (*this)[i]) return -1; else return i; } diff --git a/src/converters.h b/src/converters.h index 016a75b..e200180 100644 --- a/src/converters.h +++ b/src/converters.h @@ -181,14 +181,14 @@ class CMACHO : public CFileBuffer { uint32 SymTabNumber; // Number of entries in symbol table uint32 StringTabOffset; // File offset of string table uint32 StringTabSize; // Size of string table - uint32 ilocalsym; // index to local symbols - uint32 nlocalsym; // number of local symbols - uint32 iextdefsym; // index to public symbols - uint32 nextdefsym; // number of public symbols - uint32 iundefsym; // index to external symbols - uint32 nundefsym; // number of external symbols - uint32 IndirectSymTabOffset; // file offset to the indirect symbol table - uint32 IndirectSymTabNumber; // number of indirect symbol table entries + uint32 ilocalsym; // index to local symbols + uint32 nlocalsym; // number of local symbols + uint32 iextdefsym; // index to public symbols + uint32 nextdefsym; // number of public symbols + uint32 iundefsym; // index to external symbols + uint32 nundefsym; // number of external symbols + uint32 IndirectSymTabOffset; // file offset to the indirect symbol table + uint32 IndirectSymTabNumber; // number of indirect symbol table entries }; // Class for parsing Macintosh universal binary @@ -436,11 +436,11 @@ class CMAC2MAC : public CMACHO { CMemoryBuffer NewStringTable; // Buffer for building new string table CFileBuffer ToFile; // File buffer for modified PE file uint32 NumOldSymbols; // Size of NewSymbolIndex table - uint32 NewIlocalsym; // index to local symbols - uint32 NewNlocalsym; // number of local symbols - uint32 NewIextdefsym; // index to public symbols - uint32 NewNextdefsym; // number of public symbols - uint32 NewIundefsym; // index to external symbols + uint32 NewIlocalsym; // index to local symbols + uint32 NewNlocalsym; // number of local symbols + uint32 NewIextdefsym; // index to public symbols + uint32 NewNextdefsym; // number of public symbols + uint32 NewIundefsym; // index to external symbols uint32 NewNundefsym; // number of external symbols uint32 NewSymtabOffset; // Offset to new symbol table uint32 NewStringtabOffset; // Offset to new string table diff --git a/src/disasm.h b/src/disasm.h index 6becc50..ce274f0 100644 --- a/src/disasm.h +++ b/src/disasm.h @@ -1,13 +1,13 @@ /**************************** disasm.h ********************************** * Author: Agner Fog * Date created: 2007-02-21 -* Last modified: 2012-08-23 +* Last modified: 2014-12-06 * Project: objconv * Module: disasm.h * Description: * Header file for disassembler * -* Copyright 2007-2012 GNU General Public License http://www.gnu.org/licenses +* Copyright 2007-2014 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #ifndef DISASM_H #define DISASM_H @@ -30,7 +30,8 @@ struct SOpcodeDef { uint16 Source1; // type and size of 1. source operand uint16 Source2; // type and size of 2. source operand uint16 Source3; // type and size of 3. source operand - uint16 Swizzle; // swizzle, convert, mask options if MVEX prefix, may be used for 4. source operand otherwise (unused) + uint16 EVEX; // options for interpreting EVEX prefix, may be used for 4. source operand otherwise (unused) + uint16 MVEX; // options for interpreting MVEX prefix: swizzle, convert, mask options uint16 TableLink; // this entry is a link to another map uint16 Options; // miscellaneous options }; @@ -70,8 +71,14 @@ Opcode mnemonic 0x19: AVX 0x1A: FMA3 0x1C: AVX2 -0x1D: Transactional Synchronization -0x20: Knights corner +0x1D: BMI1, BMI2, ADX, RDRAND, RDSEED, INVPCID, SMAP, PRFCHW, F16C, Transactional Synchronization +0x20: AVX512F,BW,DQ,VL +0x21: AVX512PF,ER,CD +0x22: SHA,TBD +0x23: AVX512IFMA,VBMI +0x24: AVX512_4FMAPS, .. + +0x80: MIC Knights Corner 0x100: 8087 0x101: 80387 0x800: Privileged instruction @@ -80,7 +87,7 @@ Opcode mnemonic 0x1004: AMD SSE4a or AMD virtualization 0x1005: AMD XOP 0x1006: AMD FMA4 -0x1007: AMD CVT16 +0x1007: AMD TBM 0x2001; VIA 0x4000: Only available in 64 bit mode @@ -95,7 +102,7 @@ Opcode mnemonic 1: Address size prefix allowed, even if no mod/reg/rm byte 2: This is a stack operation. Address size prefix will truncate the stack pointer. Make warning if address size prefix or operand size prefix 4: Segment prefix allowed, even if no mod/reg/rm byte -8: Branch prediction hint prefix allowed (on Pentium 4) +8: Branch prediction hint prefix allowed (on Pentium 4) or BND prefix allowed 0x10: LOCK prefix allowed 0x20: REP prefix allowed 0x40: REPE/REPNE prefix allowed @@ -108,19 +115,25 @@ Opcode mnemonic 0x400: F3 prefix allowed for other purpose. Typical = scalar single precision xmm (ss) 0x800: F2 prefix allowed for other purpose. Typical = scalar double precision xmm (sd) 0xC40: F2 and F3 prefix allowed for XACQUIRE and XRELEASE -0xE00: none/66/F2/F3 prefix indicate ps/pd/sd/ss xmm +0xE00: none/66/F2/F3 prefix indicate ps/pd/sd/ss vector + 0x1000: REX.W prefix determines integer g.p. operand size or fp precision or swaps operands or other purpose 0x2000: REX.W prefix allowed but unnecessary -0x3000: REX.W prefix determines integer (vector) operand size -0x4000: REX.W prefix swaps last two operands +0x3000: REX.W prefix determines integer (vector) operand size d/q or ps/pd +0x4000: VEX.W prefix determines integer (vector) operand size b/w +0x5000: VEX.W and 66 prefix determines integer operand size b/w/d/q (mask instructions. B = 66W0, W = _W0, D = 66W1, Q = _W1) +0x7000: REX.W prefix swaps last two operands (AMD) 0x8000: Instruction not allowed without 66/F2/F3 prefix as specified by previous bits + 0x10000: VEX or XOP prefix allowed -0x20000: VEX or MVEX or XOP prefix required +0x20000: VEX or EVEX or XOP prefix required 0x40000: VEX.L prefix allowed 0x80000: VEX.vvvv prefix allowed + 0x100000:VEX.L prefix required 0x200000:VEX.L prefix allowed only if pp bits < 2 0x400000:MVEX prefix allowed +0x800000:EVEX prefix allowed InstructionFormat: (Values can be OR'ed): @@ -129,15 +142,15 @@ Opcode mnemonic 1: No mod/reg/rm byte. Operands are implicit 2: No mod/reg/rm byte. No operands (other than possibly immediate operand) 3: No mod/reg/rm byte. Register operand indicated by bits 0-2 -4: Has VEX or MVEX prefix and no mod/reg/rm byte, Register operand, if any, indicated by VEX.v +4: Has VEX or EVEX prefix and no mod/reg/rm byte, Register operand, if any, indicated by VEX.v 0x10: Has mod/reg/rm byte and possibly a SIB byte 0x11: Has mod/reg/rm byte and one register/memory operand 0x12: Has mod/reg/rm byte, a register destination operand and a register/memory source operand 0x13: Has mod/reg/rm byte, a register/memory destination operand and a register source operand 0x14: Has mod/reg/rm byte and AMD DREX byte. One destination and two source operands and possibly an immediate byte operand (AMD SSE5 instructions never implemened) 0x15: Has mod/reg/rm byte and AMD DREX byte. One destination and three source operands. One of the source operands is equal to the destination operand (AMD SSE5 instructions never implemened) -0x18: Has VEX or MVEX prefix and 2 operands. Dest = VEX.v, src = rm, opcode extension in r bits. Src omitted if no VEX prefix. -0x19: Has VEX or MVEX prefix and 3 operands. Dest = r, src1 = VEX.v, src2 = rm. Src1 omitted if no VEX prefix. May swap src1 and src2 if VEX.W = 0 +0x18: Has VEX or EVEX prefix and 2 operands. (NDD) Dest = VEX.v, src = rm, opcode extension in r bits. Src omitted if no VEX prefix. +0x19: Has VEX or EVEX prefix and 3 operands. (NDS) Dest = r, src1 = VEX.v, src2 = rm. Src1 omitted if no VEX prefix. May swap src1 and src2 if VEX.W = 0 0x1A: Has VEX prefix and 3 operands. Dest = rm, src1 = VEX.v, src2 = r 0x1B: Has VEX prefix and 3 operands. Dest = r, src1 = rm, src2 = VEX.v. 0x1C: Has VEX prefix and 4 operands. Dest = r, src1 = VEX.v, src2 = rm, src3 = bits 4-7 of immediate byte. May swap src2 and src3 if VEX.W @@ -170,7 +183,7 @@ the values for these two operands are OR'ed (e.g. imul eax,ebx,9; shrd eax,ebx,c 6: integer memory, other size 7: 48 bit memory 8: 16 or 32 bit integer, depending on 66 prefix -9: 16, 32 or 64 bit integer, depending on 66 or REX.W prefix +9: 16, 32 or 64 bit integer, depending on 66 or REX.W prefix. (8 bit in some cases as indicated by AllowedPrefixes) 0x0A: 16, 32 or 64 bit integer, default size = address size (REX.W not needed) 0x0B: 16, 32 or 64 bit near indirect pointer (jump) 0x0C: 16, 32 or 64 bit near indirect pointer (call) @@ -214,7 +227,10 @@ the values for these two operands are OR'ed (e.g. imul eax,ebx,9; shrd eax,ebx,c 0x92: control register 0x93: debug register 0x94: test register (obsolete or undocumented) -0x95: k0 - k7 mask register +0x95: k0 - k7 mask register. 16 bits if memory operand, 32-64 bits if register +0x96: (reserved for future mask register > 16 bits) +0x98: bnd0 - bnd3 bounds register + 0xa1: al 0xa2: ax 0xa3: eax @@ -231,12 +247,14 @@ the values for these two operands are OR'ed (e.g. imul eax,ebx,9; shrd eax,ebx,c 0xc2: es:[di], es:[edi] or [rdi] // The following values can be added to specify vectors -0x100: Vector MMX or XMM or YMM or ZMM, depending on 66 prefix and VEX.L prefix and MVEX prefix -0x200: Vector XMM, YMM or ZMM, depending on VEX.L prefix and MVEX prefix +0x100: Vector MMX or XMM or YMM or ZMM, depending on 66 prefix and VEX.L prefix and EVEX.LL prefix +0x200: Vector XMM, YMM or ZMM, depending on VEX.L prefix and EVEX.LL prefix 0x300: Vector MMX (8 bytes) 0x400: Vector XMM (16 bytes) 0x500: Vector YMM (32 bytes) 0x600: Vector ZMM (64 bytes) +0x700: Future ??? (128 bytes) +0xF00: Vector half the size defined by VEX.L prefix and EVEX.LL prefix. Minimum size = 8 bytes for memory, xmm for register // The following values can be added to specify operand type 0x1000: Must be register, memory operand not allowed @@ -261,10 +279,37 @@ the values for these two operands are OR'ed (e.g. imul eax,ebx,9; shrd eax,ebx,c 0x40000000: Gnu indirect function (CPU dispatcher) 0x80000000: Symbol is a segment (in COFF file symbol table) -Swizzle: +EVEX: +-------- +This field indicates the meaning of the z, L'L, b and aaa bits of an EVEX prefix. +(The EVEX field may also be used in the future for indicating an extra operand +if it is not needed for its current purpose). + +Bit 0-3 indicate meaning of L'L, b field: + 0x01 broadcast allowed for memory operand, LL indicate vector length + 0x02 SAE allowed for register operands, no rounding control, LL indicate vector length + 0x06 rounding control and SAE allowed for register operands + 0x08 Scalar. LL ignored + +Bit 4-7 indicate mask use in aaa/kkk field + 0x00 no masking. aaa must be zero + 0x10 allow masking, not zeroing + 0x20 allow masking and zeroing + 0x50 allow masking, not zeroing. aaa must be nonzero + 0x80 mask is modified by instruction + +Bit 12-15 indicate offset multiplier + 0x0000 Multiplier corresponds to memory operand size + 0x1000 Multiplier corresponds to vector element size + 0x2200 Multiplier corresponds to half the size of the largest vector operand + 0x2400 Multiplier corresponds to 1/4 of the size of the largest vector operand + 0x2600 Multiplier corresponds to 1/8 of the size of the largest vector operand + + +MVEX: -------- This field indicates the meaning of the sss, e and kkk bits of an MVEX prefix. -(The Swizzle field may also be used in the future for indicating an extra operand +(The MVEX field may also be used in the future for indicating an extra operand if it is not needed for its current purpose). Bit 0-4 indicate meaning of sss field: 0. none, sss must be 0 @@ -329,17 +374,18 @@ the criterion defined by TableLink. 8: Use operand size as index into next table (0: 16 bits, 1: 32 bits, 2: 64 bits) 9: Use prefixes as index into next table (0: none, 1: 66, 2: F2, 3: F3) 0x0A: Use address size as index into next table (0: 16 bits, 1: 32 bits, 2: 64 bits) -0x0B: Use VEX prefix and VEX.L bit as index into next table (0: VEX absent, 1: VEX.L=0, 2: VEX.L=1) +0x0B: Use VEX prefix and VEX.L bits as index into next table (0: VEX absent, 1: VEX.L=0, 2: VEX.L=1, 3:MVEX or EVEX.LL=2, 4: EVEX.LL=3) 0x0C: Use VEX.W bit as index into next table (0: VEX.W=0, 1: VEX.W=1) -0x0D: Use VEX.L bit and MVEX as index into next table (0: VEX.L=0, 1: VEX.L=1, 2:MVEX.L=0, 3: MVEX.L=1) -0x0E: Use VEX prefix type as index into next table. (0: 2- or 3-bytes VEX or none, 1: 4-bytes MVEX) +0x0D: Use vector size by VEX.L bits as index into next table (0: VEX.L=0, 1: VEX.L=1, 2:MVEX or EVEX.LL=2, 3: EVEX.LL=3) +0x0E: Use VEX prefix type as index into next table. (0: 2- or 3-bytes VEX or none, 1: 4-bytes EVEX or MVEX) 0x0F: Use MVEX.E bit as index into next table. (0: MVEX.E = 0 or no MVEX, 1: MVEX.E = 1) 0x10: Use assembly language dialect as index into next table (0: MASM, 1: NASM/YASM, 2: GAS) +0x11: Use VEX prefix type as index into next table. (0: none, 1: VEX prefix, 2: EVEX prefix, 3: MVEX prefix) Options: (Values can be OR'ed): ---------------------- -1: Append suffix for operand size or type to opcode name (prefix 0x100: b/w/d/q, 0xE00: ps/pd/ss/sd, 0x1000: s/d, 0x3000: d/q) +1: Append suffix for operand size or type to opcode name (prefix 0x100: b/w/d/q, 0xE00: ps/pd/ss/sd, 0x1000: s/d, 0x3000: d/q, 0x4000: b/w) 2: Prepend 'v' to opcode name if VEX prefix present 4: Does not change destination register 8: Can change registers other than explicit destination register (includes call etc.) @@ -350,10 +396,12 @@ the criterion defined by TableLink. 0x100: Aligned. Memory operand must be aligned, even if VEX prefixed 0x200: Unaligned. Unaligned memory operand always allowed. 0x400: Opcode name differs if 64 bits +0x800: Do not write size specifier on memory operand +0x1000: Append alternative suffix to opcode name (prefix 0x3000: "32"/"64") */ -// Structure for opcode swizzle table entries indicating meaning of MVEX.sss bits +// Structure for opcode swizzle table entries indicating meaning of EVEX.sss bits struct SwizSpec { uint32 memop; // memory operand type uint32 memopsize; // memory operand size = byte offset multiplier = required alignment @@ -383,10 +431,10 @@ struct SOpcodeProp { uint32 IndexReg; // Index register + 1. (0 if none) uint32 Scale; // Scale factor = 2^Scale uint32 Vreg; // ~VEX.vvvv or AMD DREX byte - uint32 Kreg; // MVEX.kkk mask register - uint32 Esss; // MVEX.sss and E swizzle and eviction hint bits - SwizSpec const * SwizRecord; // Selected entry in Swizzle table for MVEX code - uint32 OffsetMultiplier; // Multiplier for 1-byte offset obtained from MVEX.sss and table lookup + uint32 Kreg; // EVEX.aaa = MVEX.kkk mask register + uint32 Esss; // EVEX.zLLb = MVEX.Esss option bits + SwizSpec const * SwizRecord; // Selected entry in MVEX table for MVEX code + uint32 OffsetMultiplier; // Multiplier for 1-byte offset calculated from EVEX or obtained from MVEX.sss and table lookup uint32 Operands[5]; // Operand types for destination, source, immediate uint32 OpcodeStart1; // Index to first opcode byte, after prefixes uint32 OpcodeStart2; // Index to last opcode byte, after 0F, 0F 38, etc., before mod/reg/rm byte and operands @@ -407,10 +455,11 @@ struct SOpcodeProp { // 0: Segment prefix (26, 2E, 36, 3E, 64, 65) // 1: Address size prefix (67) // 2: Lock prefix (F0) -// 3: Repeat prefix (F2, F3) or VEX prefix (C4, C5, 62) +// 3: Repeat prefix (F2, F3) or VEX prefix (C4, C5) or EVEX, MVEX (62) or XOP (8F) // 4: Operand size prefix (66, REX.W) // 5: Operand type prefix (66, F2, F3) // 6: VEX prefix: bit 5: VEX.L (vector length), bit 0-4: VEX.mmmmm +// MVEX: bit 5 = 0, bit 6 = 1. EVEX: bit 5 = 1, bit 6 = 1 // 7: Rex prefix (40 - 4F), VEX.W,R,X,B, DREX.W,R,X,B // bit 0: B = extension of mod/rm or base or opcode // bit 1: X = extension of index register @@ -480,6 +529,7 @@ struct SFunctionRecord { uint32 Start; // Offset of function start uint32 End; // Offset of function end uint32 Scope; // Scope of function. 0 = inaccessible, 1 = function local, 2 = file local, 4 = public, 8 = weak public, 0x10 = communal, 0x20 = external + // 0x10000 means End not known, extend it when you pass End uint32 OldSymbolIndex; // Old symbol table index int operator < (const SFunctionRecord & y) const{// Operator for sorting function table by source address return Section < y.Section || (Section == y.Section && Start < y.Start);} @@ -658,9 +708,11 @@ class CDisassembler { void StorePrefix(uint32 Category, uint8 Byte);// Store prefix according to category void FindMapEntry(); // Find entry in opcode maps void FindOperands(); // Interpret mod/reg/rm and SIB bytes and find operand fields - void SwizTableLookup(); // Find swizzle table entry for MVEX code void FindOperandTypes(); // Determine the types of each operand + void FindBroadcast(); // Find broadcast and offset multiplier for EVEX code + void SwizTableLookup(); // Find swizzle table entry for MVEX code void FindLabels(); // Find any labels at current position and next + void CheckForMisplacedLabel(); // Remove any label placed inside function void FindRelocations(); // Find any relocation sources in this instruction void FindWarnings(); // Find any reasons for warnings in code void FindErrors(); // Find any errors in code @@ -718,7 +770,8 @@ class CDisassembler { void WriteRMOperand(uint32 Type); // Write memory or register operand from mod/rm bits of mod/reg/rm byte and possibly SIB byte to OutFile void WriteDREXOperand(uint32 Type); // Write register operand from dest bits of DREX byte void WriteVEXOperand(uint32 Type, int i); // Write register operand from VEX.vvvv bits or immediate bits - void WriteOperandAttribute(int i, int isMem);// Write operand attributes and instruction attributes from MVEX sss, e and kkk bits + void WriteOperandAttributeEVEX(int i, int isMem);// Write operand attributes and instruction attributes from EVEX z, LL, b and aaa bits + void WriteOperandAttributeMVEX(int i, int isMem);// Write operand attributes and instruction attributes from MVEX sss, e and kkk bits void WriteImmediateOperand(uint32 Type); // Write immediate operand or direct jump/call address void WriteOtherOperand(uint32 Type); // Write other type of operand void WriteRegisterName(uint32 Value, uint32 Type); // Write name of register to OutFile @@ -752,7 +805,7 @@ class CDisassembler { // Declare tables in opcodes.cpp: extern SOpcodeDef OpcodeMap0[256]; // First opcode map -extern SOpcodeDef const * OpcodeStartPageVEX[]; // Entries to opcode maps, indexed by VEX.mmmm bits +extern uint32 OpcodeStartPageVEX[]; // Entries to opcode maps, indexed by VEX.mmmm bits extern SOpcodeDef const * OpcodeStartPageXOP[]; // Entries to opcode maps, indexed by XOP.mmmm bits extern const uint32 NumOpcodeStartPageVEX; // Number of entries in OpcodeStartPage @@ -774,6 +827,8 @@ extern const char * RegisterNamesCR[16]; // Names of control registers extern SwizSpec const * SwizTables[][2]; // Pointers to swizzle tables extern SwizSpec const * SwizRoundTables[][2]; // Pointers to swizzle round tables +extern const char * EVEXRoundingNames[5]; // Tables of rounding mode names for EVEX + // Define constants for special section/segment/group values #define ASM_SEGMENT_UNKNOWN 0 // Unknown segment for external symbols diff --git a/src/disasm1.cpp b/src/disasm1.cpp index 1e07b8f..05b1ae6 100644 --- a/src/disasm1.cpp +++ b/src/disasm1.cpp @@ -1,7 +1,7 @@ /**************************** disasm1.cpp ******************************** * Author: Agner Fog * Date created: 2007-02-25 -* Last modified: 2012-08-23 +* Last modified: 2016-11-09 * Project: objconv * Module: disasm1.cpp * Description: @@ -11,7 +11,7 @@ * Instruction tables are in opcodes.cpp. * All functions relating to file output are in disasm2.cpp * -* Copyright 2007-2012 GNU General Public License http://www.gnu.org/licenses +* Copyright 2007-2016 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" @@ -139,7 +139,7 @@ uint32 CSymbolTable::NewSymbol(SASymbol & sym) { // The highest Type value takes precedence, except near indirect jump/call, // which has highest precedence if (((sym.Type & 0xFF) > (List[SIndex].Type & 0xFF) - && (List[SIndex].Type+1 & 0xFE) != 0x0C) || (sym.Type+1 & 0xFE) == 0x0C) { + && ((List[SIndex].Type+1) & 0xFE) != 0x0C) || ((sym.Type+1) & 0xFE) == 0x0C) { // New symbol has higher type List[SIndex].Type = sym.Type; } @@ -222,7 +222,7 @@ void CSymbolTable::AssignNames() { UnnamedNum = (UnnamedNum + 1999) / 1000 * 1000; } -#if 0 //!! +#if 0 // // For debugging: list all symbols printf("\n\nSymbols:"); for (i = 0; i < List.GetNumEntries(); i++) { @@ -692,7 +692,7 @@ void CDisassembler::Go() { // Fix invalid characters in symbol and section names CheckNamesValid(); -#if 0 +#if 0 // // Show function list. For debugging only printf("\n\nFunctionList:"); for (uint32 i = 0; i < FunctionList.GetNumEntries(); i++) { @@ -813,7 +813,7 @@ void CDisassembler::Pass1() { else { // This is a data section // Make a single entry in FunctionList covering the whole section - SFunctionRecord fun = {Section, 0, Sections[Section].TotalSize, 0, 0}; + SFunctionRecord fun = {(int)Section, 0, Sections[Section].TotalSize, 0, 0}; FunctionList.PushUnique(fun); } } @@ -862,6 +862,18 @@ void CDisassembler::FindLabels() { } } +void CDisassembler::CheckForMisplacedLabel() { + // Remove any label placed inside function + // This is called if there appears to be a function end inside an instruction + if (FunctionEnd && FunctionEnd < SectionEnd) { + FunctionEnd = IEnd; + FunctionList[IFunction].Scope |= 0x10000; + } + else { + s.Errors |= 0x10; + } +} + int CDisassembler::NextLabel() { // Loop through labels from IEnd. Pass 2 uint32 sym, sym1, sym2 = 0, sym3 = 0; // Symbol indices @@ -916,7 +928,7 @@ int CDisassembler::NextLabel() { if (!(Symbols[sym].Type & 0x80000000)) { DataType = Symbols[sym].Type; DataSize = GetDataItemSize(DataType); - if ((DataType+1 & 0xFE) == 0x0C && Symbols[sym].Size) { + if (((DataType+1) & 0xFE) == 0x0C && Symbols[sym].Size) { // Jump table can have different sizes for direct or image relative DataSize = Symbols[sym].Size; } @@ -1030,10 +1042,12 @@ void CDisassembler::CheckForFunctionEnd() { err.submit(9000); IFunction = 0; return; } - // Function ends if section ends here or if last instruction was a return + // Function ends if section ends here if (IEnd >= SectionEnd) { // Current function must end because section ends here - FunctionList[IFunction].End = IEnd; + FunctionList[IFunction].End = SectionEnd; + FunctionList[IFunction].Scope &= ~0x10000; + IFunction = 0; // Check if return instruction if (s.OpcodeDef && !(s.OpcodeDef->Options & 0x10) && (Pass & 0x10)) { @@ -1041,9 +1055,6 @@ void CDisassembler::CheckForFunctionEnd() { s.Errors |= 0x10000; WriteErrorsAndWarnings(); } - // Indicate current function ends here - FunctionList[IFunction].End = IEnd; - IFunction = 0; return; } @@ -1062,12 +1073,13 @@ void CDisassembler::CheckForFunctionEnd() { if (IEnd >= FunctionList[IFunction].End) { // Indicate current function ends here FunctionList[IFunction].End = IEnd; + FunctionList[IFunction].Scope &= ~0x10000; IFunction = 0; return; } } - // Function ends at next label if preceding label is inaccessible + // Function ends at next label if preceding label is inaccessible and later end not known if (IFunction && FunctionList[IFunction].Scope == 0 && IEnd >= FunctionList[IFunction].End) { if (Symbols.FindByAddress(Section, IEnd)) { // Previous label was inaccessible. There is a new label here. Begin new function here @@ -1120,19 +1132,19 @@ void CDisassembler::CheckRelocationTarget(uint32 IRel, uint32 TargetType, uint32 // Inline Addend; int32 InlineA = 0; switch (Relocations[IRel].Size) { - case 1: - InlineA = *(int8*)RelSource; break; - case 2: - InlineA = *(int16*)RelSource; break; - case 4: case 8: - InlineA = *(int32*)RelSource; break; + case 1: + InlineA = *(int8*)RelSource; break; + case 2: + InlineA = *(int16*)RelSource; break; + case 4: case 8: + InlineA = *(int32*)RelSource; break; } // Add inline addend to target address TargetOffset += InlineA; if (Relocations[IRel].Type & 2) { // Address is self-relative - if (s.AddressFieldSize && (s.MFlags & 0x100) || s.ImmediateFieldSize) { + if ((s.AddressFieldSize && (s.MFlags & 0x100)) || s.ImmediateFieldSize) { // Relative jump or rip-relative address TargetOffset += IEnd - s.AddressField; InlineA += IEnd - s.AddressField; @@ -1166,13 +1178,13 @@ void CDisassembler::CheckRelocationTarget(uint32 IRel, uint32 TargetType, uint32 // Choose between Symbols[SymNewI].Type and TargetType the one that has the highest priority if ((TargetType & 0xFF) > (Symbols[SymNewI].Type & 0xFF) - || (TargetType+1 & 0xFE) == 0x0C && (Symbols[SymNewI].Type & 0xFF) > 0x0C) { + || (((TargetType+1) & 0xFE) == 0x0C && (Symbols[SymNewI].Type & 0xFF) > 0x0C)) { // No type assigned yet, or new type overrides old type Symbols[SymNewI].Type = TargetType; // Choose biggest size. Size for code pointer takes precedence - if (TargetSize > Symbols[SymNewI].Size || (TargetType+1 & 0xFE) == 0x0C) { + if (TargetSize > Symbols[SymNewI].Size || ((TargetType+1) & 0xFE) == 0x0C) { Symbols[SymNewI].Size = TargetSize; } } @@ -1189,7 +1201,7 @@ void CDisassembler::CheckJumpTarget(uint32 symi) { if (IFunction == 0 || IFunction >= FunctionList.GetNumEntries()) return; // Check if target is in same section - if (Symbols[symi].Section != Section) return; + if (Symbols[symi].Section != (int32)Section) return; // Check if target extends current function if (Symbols[symi].Offset > FunctionList[IFunction].End && Symbols[symi].Offset <= Sections[Section].InitSize) { @@ -1201,8 +1213,9 @@ void CDisassembler::CheckJumpTarget(uint32 symi) { // Target is known as public or a function. No need to extend current function return; } - // Extend current function forward to include at least one instruction after target offset - FunctionList[IFunction].End = Symbols[symi].Offset + 1; + // Extend current function forward to include target offset + FunctionList[IFunction].End = Symbols[symi].Offset; + FunctionList[IFunction].Scope |= 0x10000; } else if (Symbols[symi].Offset < FunctionList[IFunction].Start) { // Target is before tentative begin of current function but within section @@ -1385,7 +1398,13 @@ dd imagerel(Label1) dd imagerel(Label2) dd imagerel(Label3) -In order to recognize that SwitchTable is a switch table, the tracer must +Some other compilers use the beginning of the switch table or the beginning of +the code section as reference point for 32-bit jump addresses. Other +compilers use 64-bit addresses in the switch table. We want to recognize +all these patterns in order to disassemble a switch table in a comprehensible +way and find the case label targets. + +In order to recognize a switch table in the above example, the tracer must do the following tasks: 1. Calculate the rip-relative address in the lea instruction and detect @@ -1492,26 +1511,25 @@ void CDisassembler::UpdateTracer() { // Check the opcode to find out what has happened to this register switch (Opcodei) { - /* This part is currently unused: - case 0xB0: case 0xB1: case 0xB2: case 0xB3: - case 0xB4: case 0xB5: case 0xB6: case 0xB7: - case 0xB8: case 0xB9: case 0xBA: case 0xBB: - case 0xBC: case 0xBD: case 0xBE: case 0xBF: + case 0xB0: case 0xB1: case 0xB2: case 0xB3: + case 0xB4: case 0xB5: case 0xB6: case 0xB7: + case 0xB8: case 0xB9: case 0xBA: case 0xBB: + case 0xBC: case 0xBD: case 0xBE: case 0xBF: // MOV register, constant t.Regist[reg] = 0; if (s.OperandSize < 32) { - // Only part of register is changed - return; + // Only part of register is changed + return; } if (s.ImmediateRelocation) { - if (s.OperandSize < WordSize || !(Relocations[s.ImmediateRelocation].Type & 0x21)) { - // Wrong size or type of relocation - return; - } - // Register contains the address of a symbol - t.Regist[reg] = 0x18; - t.Value [reg] = Relocations[s.ImmediateRelocation].TargetOldIndex; - return; + if (s.OperandSize < WordSize || !(Relocations[s.ImmediateRelocation].Type & 0x21)) { + // Wrong size or type of relocation + return; + } + // Register contains the address of a symbol + t.Regist[reg] = 0x18; + t.Value [reg] = Relocations[s.ImmediateRelocation].TargetOldIndex; + return; } // Register value is a known constant @@ -1519,20 +1537,21 @@ void CDisassembler::UpdateTracer() { // Save value switch (s.ImmediateFieldSize) { case 1: - t.Value[reg] = Get(s.ImmediateField); - break; + t.Value[reg] = Get(s.ImmediateField); + break; case 2: - t.Value[reg] = Get(s.ImmediateField); - break; + t.Value[reg] = Get(s.ImmediateField); + break; case 4: case 8: // 64-bit value truncated to 32 bits - t.Value[reg] = Get(s.ImmediateField); - break; + t.Value[reg] = Get(s.ImmediateField); + break; default: - // Error. Should not occur - t.Regist[reg] = 0; + // Error. Should not occur + t.Regist[reg] = 0; } return; + /* This part is currently unused: case 0x31: case 0x33: case 0x29: case 0x2B: // XOR or SUB. Check if source and destination is same register if ((s.Operands[0] & 0xFFFF) == (s.Operands[1] & 0xFFFF) && s.Reg == s.RM && s.OperandSize >= 32) { @@ -1716,7 +1735,7 @@ void CDisassembler::UpdateSymbols() { OperandType = s.Operands[OpI]; // Operand type // Check if indirect jump/call - if (OpI == 0 && (s.OpcodeDef->Destination + 1 & 0xFE) == 0x0C) { + if (OpI == 0 && ((s.OpcodeDef->Destination + 1) & 0xFE) == 0x0C) { OperandType = s.OpcodeDef->Destination; } @@ -1978,7 +1997,9 @@ void CDisassembler::FollowJumpTable(uint32 symi, uint32 RelType) { SourceSection = Symbols[symi].Section; SourceOffset = Symbols[symi].Offset; SourceSize = Symbols[symi].Size; - TargetType = 0x82; // Target type = jump label + TargetType = 0x82; + + // Target type = jump label if ((Symbols[symi].Type & 0xFF) == 0x0C) TargetType++; // Target type = call label // Find next label @@ -2037,6 +2058,7 @@ void CDisassembler::FollowJumpTable(uint32 symi, uint32 RelType) { Addend = Relocations[Reli].Addend; // Check inline addend if target is section-relative and this is an object file if (!ExeType && Symbols[TargetSymI].Offset == 0) { + switch (SourceSize) { case 2: Addend += *(int16*)(Sections[SourceSection].Start + Pos); @@ -2050,8 +2072,10 @@ void CDisassembler::FollowJumpTable(uint32 symi, uint32 RelType) { if (Addend) { // Make new symbol at target address uint32 NewSymOffset = Addend; - if (Relocations[Reli].Type & 2) { - NewSymOffset -= Relocations[Reli].Offset; + if (Relocations[Reli].Type & 2) { // relative + if (RelType == 0x10) { // arbitrary reference point + NewSymOffset -= (Relocations[Reli].Offset - SourceOffset); + } } uint32 NewSym = Symbols.NewSymbol(Symbols[TargetSymI].Section, NewSymOffset, 2); if (NewSym) TargetSymI = NewSym; @@ -2281,7 +2305,7 @@ void CDisassembler::MarkCodeAsDubious() { uint32 sym1, sym2 = 0, sym3 = 0; // Preceding and succeding symbols // Check likelihood that this is data rather than code - if ((s.Errors & 0x4000) && ((s.Warnings1 & 0x10000000) || CountErrors > 1) + if (((s.Errors & 0x4000) && ((s.Warnings1 & 0x10000000) || CountErrors > 1)) || CountErrors > 5) { // There are more than 5 errors, or consecutive zeroes and at // least one more error or inaccessible code. @@ -2373,12 +2397,18 @@ void CDisassembler::ParseInstruction() { // Find operands FindOperands(); // Interpret mod/reg/rm and SIB bytes and find operands - // Find swizzle table record if MVEX prefix - if (s.Prefixes[3] == 0x62) SwizTableLookup(); - // Determine the types of each operand FindOperandTypes(); + if (s.Prefixes[3] == 0x62) { + if (s.Prefixes[6] & 0x20) { // EVEX + FindBroadcast(); // Find broadcast and offet multiplier for EVEX code + } + else { // MVEX + SwizTableLookup(); // Find swizzle table record if MVEX prefix + } + } + // Find any relocation sources in this instruction FindRelocations(); @@ -2403,8 +2433,8 @@ void CDisassembler::ParseInstruction() { void CDisassembler::ScanPrefixes() { // Scan prefixes - uint32 i; // Index to current byte - uint8 Byte; // Current byte of code + uint32 i; // Index to current byte + uint8 Byte; // Current byte of code for (i = IBegin; i < SectionEnd; i++) { // Read code byte @@ -2416,30 +2446,30 @@ void CDisassembler::ScanPrefixes() { // This is a REX prefix if (Byte & 0x08) { // REX.W prefix - StorePrefix(4, 0x48); // REX.W also in category operand size + StorePrefix(4, 0x48); // REX.W also in category operand size } - StorePrefix(7, Byte); // Store in category REX + StorePrefix(7, Byte); // Store in category REX } else if (i+1 < SectionEnd && ((((Byte & 0xFE) == 0xC4 || Byte == 0x62) && (WordSize == 64 || (Buffer[i+1] >= 0xC0))) || (Byte == 0x8F && (Buffer[i+1] & 0x38)))) { - // This is a VEX prefix or XOP prefix + // This is a VEX, EVEX, MVEX or XOP prefix // Check for invalid prefixes before this if (s.Prefixes[5] | s.Prefixes[7]) s.Warnings1 |= 0x800; // Get equivalent prefixes - uint8 prefix3 = Byte; // Repeat prefix (F2, F3) or VEX prefix (C4, C5, 62) - uint8 prefix4; // 66, 48 Operand size prefix - uint8 prefix5; // 66, F2, F3 operand type prefixes - uint8 prefix6; // VEX.mmmmm and VEX.L - uint8 prefix7; // equivalent to REX prefix - uint8 vvvv; // vvvv register operand + uint8 prefix3 = Byte; // Repeat prefix (F2, F3) or VEX prefix (C4, C5, 62) + uint8 prefix4; // 66, 48 Operand size prefix + uint8 prefix5; // 66, F2, F3 operand type prefixes + uint8 prefix6; // VEX.mmmmm and VEX.L + uint8 prefix7; // equivalent to REX prefix + uint8 vvvv; // vvvv register operand if (Byte == 0xC5) { // 2-bytes VEX prefix if (i+2 >= SectionEnd) { IEnd = i+2; - s.Errors |= 0x10; return; // End of buffer reached + s.Errors |= 0x10; return; // End of buffer reached } Byte = Buffer[++i]; // Second byte prefix5 = Byte & 3; // pp bits @@ -2450,26 +2480,27 @@ void CDisassembler::ScanPrefixes() { prefix7 |= (~Byte >> 5) & 4; // R bit } else { - // 3 or 4-bytes VEX prefix or XOP prefix + // 3 or 4-bytes VEX/EVEX/MVEX prefix or XOP prefix if (i+3+(Byte==0x62) >= SectionEnd) { IEnd = i+3+(Byte==0x62); - s.Errors |= 0x10; return; // End of buffer reached + s.Errors |= 0x10; return; // End of buffer reached } - prefix7 = (Byte == 0x8F) ? 0x80 : 0x20;// Indicate 3-bytes VEX prefix or XOP prefix + prefix7 = (Byte == 0x8F) ? 0x80 : 0x20;// Indicate 3/4-bytes VEX prefix or XOP prefix Byte = Buffer[++i]; // Second byte prefix6 = Byte & 0x1F; // mmmmm bits prefix7 |= (~Byte >> 5) & 7; // R,X,B bits Byte = Buffer[++i]; // Third byte prefix5 = Byte & 3; // pp bits - prefix6 |= (Byte << 3) & 0x20; // L bit + prefix6 |= (Byte << 3) & 0x20; // VEX: L bit, MVEX: 0, EVEX: 1 vvvv = (~Byte >> 3) & 0x0F; // vvvv operand prefix7 |= (Byte >> 4) & 8; // W bit if (prefix3 == 0x62) { - // 4-bytes VEX prefix + // 4-bytes EVEX or MVEX prefix + prefix6 |= 0x40; // Indicates EVEX or MVEX prefix, bit 5 is 0 for MVEX, 1 for EVEX Byte = Buffer[++i]; // Fourth byte s.Kreg = Byte & 0x07; // kkk mask register vvvv |= (~Byte & 8) << 1; // extra v bit - s.Esss = Byte >> 4; // E and sss bits + s.Esss = Byte >> 4; // EVEX: zLLb, MVEX: Esss bits } } StorePrefix(3, prefix3); // VEX prefix @@ -2564,6 +2595,7 @@ void CDisassembler::FindMapEntry() { uint8 Byte = Buffer[i]; // Current byte of code or index into map uint32 MapNumber = 0; // Map number in opcodes.cpp uint32 StartPage; // Index to start page in opcode map + uint32 MapNumber0 = 0; // Fallback start page if no map entry found in StartPage SOpcodeDef const * MapEntry; // Point to current opcode map entry // Get start page from VEX.mmmm or XOP.mmmm bits if any @@ -2572,20 +2604,35 @@ void CDisassembler::FindMapEntry() { StartPage = 0; MapEntry = OpcodeTables[StartPage] + Byte; break; - case 0xC4: case 0xC5: case 0x62: // 2-, 3-, or 4-bytes VEX prefix - StartPage = s.Prefixes[6] & 0x0F; // 4 mmmm bits or 0 if no VEX or XOP prefix + case 0xC4: case 0xC5: case 0x62: // 2-, 3-, or 4-bytes VEX prefix + StartPage = s.Prefixes[6] & 0x0F; // 4 mmmm bits or 0 if no VEX or XOP prefix if (StartPage >= NumOpcodeStartPageVEX) { s.Errors |= 0x10000; StartPage = 0; // mmmm bits out of range } - MapEntry = OpcodeStartPageVEX[StartPage] + Byte; // Get entry [Byte] in map - // There are two entries for StartPage = 1: OpcodeMap1 for legacy code and OpcodeMapB1 - // for VEX-only code. We don't want to have the same code in two different maps - // because this may cause errors if a code is updated only in one of the maps. - // Search OpcodeMapB1 first, then OpcodeMap1 - if (StartPage == 1 && ((MapEntry->Name == 0 && MapEntry->TableLink == 0) || Byte >= OpcodeTableLength[0xB1])) { - // not found here, try in non-VEX map 1 - MapEntry = OpcodeTables[1] + Byte; + MapNumber = OpcodeStartPageVEX[StartPage]; + if (StartPage == 1) MapNumber0 = 1; + if (StartPage == 2 && s.Prefixes[3] == 0x62) { + if ((s.Prefixes[5] & 0xFE) == 0xF2) { // shortcut for EVEX F2 0F 38 and EVEX F3 0F 38 + StartPage = 8 + (s.Prefixes[5] & 1); + MapNumber0 = MapNumber; + MapNumber = OpcodeStartPageVEX[StartPage]; + } } + + // Get entry [Byte] in map + MapEntry = OpcodeTables[MapNumber] + Byte; + + // There are two entries for mm = 1: OpcodeMap1 for legacy code and OpcodeMapB1 for VEX-only code. + // There are two entries for mm = 2: OpcodeMap2 for legacy code and OpcodeMapB2 for EVEX-only code with F3 prefix. + // We don't want to have the same code in two different maps because this may cause errors if a code + // is updated only in one of the maps. + // Search the shortcut map first, then the default map + if ((MapEntry->Name == 0 && MapEntry->TableLink == 0) || Byte >= OpcodeTableLength[MapNumber]) { + // not found here, try in default map + MapNumber = MapNumber0; + MapEntry = OpcodeTables[MapNumber] + Byte; + } + if (MapNumber == 0) s.Errors |= 0x10000; // no map found break; case 0x8F: // XOP prefix StartPage = (s.Prefixes[6] & 0x1F) - 8; // 4 mmmm bits or 0 if no VEX or XOP prefix @@ -2705,12 +2752,19 @@ void CDisassembler::FindMapEntry() { } break; - case 0x0B: // Use VEX prefix and VEX.L bit as index into next table + case 0x0B: // Use VEX prefix and VEX.L bits as index into next table + // 0: VEX absent, 1: VEX.L=0, 2: VEX.L=1, 3:MVEX or EVEX.LL=2, 4: EVEX.LL=3 // (VEX absent, VEX.L=0, VEX.L=1) if ((s.Prefixes[7] & 0xB0) == 0) { Byte = 0; // VEX absent } - else { + else if ((s.Prefixes[6] & 0x60) == 0x60) { // EVEX + Byte = ((s.Esss >> 1) & 3) + 1; // EVEX.LL bits + } + else if ((s.Prefixes[6] & 0x60) == 0x40) { // MVEX + Byte = 3; + } + else { // VEX Byte = 1 + (s.Prefixes[6] >> 5 & 1); // 1 + VEX.L } break; @@ -2719,13 +2773,23 @@ void CDisassembler::FindMapEntry() { Byte = (s.Prefixes[7] & 0x08) >> 3; break; - case 0x0D: // Use VEX.L bit and MVEX as index into next table + case 0x0D: // Use vector size by VEX.L bit and EVEX/MVEX as index into next table + // 0: VEX.L=0, 1: VEX.L=1, 2:MVEX or EVEX.LL=2, 3: EVEX.LL=3 Byte = (s.Prefixes[6] >> 5) & 1; // VEX.L indicates xmm or ymm - if (s.Prefixes[3] == 0x62) Byte |= 2; // MVEX indicates zmm + if (s.Prefixes[3] == 0x62) { + if (s.Prefixes[6] & 0x20) { + // EVEX. Use LL bits + Byte = (s.Esss >> 1) & 3; + } + else { + // MVEX. Always 512 bits + Byte = 2; + } + } break; - case 0x0E: // Use VEX type as index into next table: 0 = 2 or 3 bytes VEX, 1 = 4 bytes MVEX - Byte = (s.Prefixes[3] == 0x62); // MVEX + case 0x0E: // Use VEX type as index into next table: 0 = 2 or 3 bytes VEX, 1 = 4 bytes EVEX + Byte = (s.Prefixes[3] == 0x62); // EVEX break; case 0x0F: // Use MVEX.E bit as index into next table @@ -2736,6 +2800,15 @@ void CDisassembler::FindMapEntry() { Byte = Syntax; break; + case 0x11: // Use VEX prefix type as index into next table. (0: none, 1: VEX prefix, 2: EVEX prefix, 3: MVEX prefix) + if ((s.Prefixes[3] & ~1) == 0xC4) Byte = 1; // 2 or 3-bytes VEX prefix + else if (s.Prefixes[3] == 0x62) { // EVEX or MVEX + if (s.Prefixes[6] & 0x20) Byte = 2; // EVEX + else Byte = 3; // MVEX + } + else Byte = 0; // no VEX + break; + default: // Internal error in map tree err.submit(9007, MapNumber); s.OpcodeStart2 = i; @@ -2790,8 +2863,7 @@ void CDisassembler::FindOperands() { s.MFlags |= 2; if (s.OpcodeStart2 + 1 >= FunctionEnd) { - // extends outside code block - s.Errors |= 0x10; + CheckForMisplacedLabel(); } // Read mod/reg/rm byte @@ -2820,8 +2892,7 @@ void CDisassembler::FindOperands() { } if (s.AddressField > FunctionEnd) { - // instruction extends outside code block - s.Errors |= 0x10; + CheckForMisplacedLabel(); } // Check REX prefix @@ -2922,7 +2993,7 @@ void CDisassembler::FindOperands() { } } if (s.Prefixes[3] == 0x62) { - // MVEX prefix gives another extra register bit + // EVEX prefix gives another extra register bit s.Reg += ~(s.Prefixes[6]) & 0x10; // extra r bit = highest m bit if (s.Mod == 3) { // Register operands only. B bit extended by X bit @@ -2992,17 +3063,61 @@ void CDisassembler::FindOperands() { // Find instruction end IEnd = s.ImmediateField + s.ImmediateFieldSize; - if (IEnd > FunctionEnd) { - // instruction extends outside code block - s.Errors |= 0x10; - IEnd = FunctionEnd; + CheckForMisplacedLabel(); + if (IEnd > SectionEnd) { + // instruction extends outside code block + s.Errors |= 0x10; + IEnd = SectionEnd; + } } } +void CDisassembler::FindBroadcast() { + // Find broadcast and offset multiplier for EVEX code + if (s.Mod != 3) { + // has memory operand + uint32 m; // find memory operand + for (m = 0; m < s.MaxNumOperands; m++) { + if (s.Operands[m] & 0x2000) break; + } + if (m == s.MaxNumOperands) return; // no memory operand found. should not occur + uint32 r; // find largest vector operand + uint32 vectortype = 0; + for (r = 0; r < s.MaxNumOperands; r++) { + if ((s.Operands[r] & 0xF00) > vectortype) vectortype = s.Operands[r] & 0xF00; + } + uint32 vectorsize = GetDataItemSize(vectortype); + if (m < s.MaxNumOperands) { + if ((s.OpcodeDef->EVEX & 1) && (s.Esss & 1)) { + // broadcasting. multiplier = element size + s.OffsetMultiplier = GetDataElementSize(s.Operands[m]); + // operand size = element size + s.Operands[m] &= ~0xF00; + if (s.OffsetMultiplier >= vectorsize) { + s.Warnings2 |= 0x200; // broadcasting to scalar + } + } + else if (s.OpcodeDef->EVEX & 0x1000) { + // multiplier = element size, not broadcasting + s.OffsetMultiplier = GetDataElementSize(s.Operands[m]); + } + else if (s.OpcodeDef->EVEX & 0x2000) { + // multiplier = fraction of largest vector size + s.OffsetMultiplier = vectorsize >> ((s.OpcodeDef->EVEX & 0x600) >> 9); + } + else { + // not broadcasting. multiplier = vector size + s.OffsetMultiplier = GetDataItemSize(s.Operands[m]); + } + } + } +} + + void CDisassembler::SwizTableLookup() { // Find the swizzle table record that correspond to the instruction and the sss bits for MVEX instructions - int sw = (s.OpcodeDef->Swizzle & 0x1F); // swizzle metatable index + int sw = (s.OpcodeDef->MVEX & 0x1F); // swizzle metatable index int opsize = 0; // operand size override if (s.OpcodeDef->Options & 1) { // operand size depends on prefix bits @@ -3019,7 +3134,7 @@ void CDisassembler::SwizTableLookup() { // find record in swizzle tables s.SwizRecord = &(SwizTables[sw | opsize][IsMem][s.Esss & 7]); // find offset multiplier - if (s.OpcodeDef->Swizzle & 0x40) { + if (s.OpcodeDef->MVEX & 0x40) { // address single element s.OffsetMultiplier = s.SwizRecord->elementsize; } @@ -3032,7 +3147,7 @@ void CDisassembler::SwizTableLookup() { if (!(source & 0xF00)) source = s.OpcodeDef->Source1; // if source2 is not a vector, use source1 switch ((source >> 8) & 0xF) { case 2: - // vector size depends on prefixes, currently only zmm supported when MVEX prefix is present + // vector size depends on prefixes, currently only zmm supported when EVEX prefix is present s.OffsetMultiplier = 0x40; break; case 4: s.OffsetMultiplier = 0x10; break; @@ -3049,8 +3164,10 @@ void CDisassembler::FindOperandTypes() { // Determine the type of each operand uint32 i, j, k; // Operands index int nimm = 0; // Number of immediate operands + uint32 AllowedPref = s.OpcodeDef->AllowedPrefixes; + uint32 oper; // current operand definition - s.MaxNumOperands = 4; // may be 5 in the future in cases where Swizzle field is used as an extra operand + s.MaxNumOperands = 4; // may be 5 in the future in cases where EVEX field is used as an extra operand // Copy all operands from opcode map and zero-extend for (i = 0; i < s.MaxNumOperands; i++) { @@ -3120,26 +3237,26 @@ void CDisassembler::FindOperandTypes() { if (s.OpcodeDef->InstructionFormat & 1) { // Four XMM or register operands switch (OperandConfiguration) { - case 0: - s.Operands[1] = s.Operands[0]; // 1. source = same as destination - s.Operands[2] |= 0x40000; // 2. source = reg - s.Operands[3] |= 0x30000; // 3. source = rm - break; - case 1: - s.Operands[1] = s.Operands[0]; // 1. source = same as destination - s.Operands[2] |= 0x30000; // 2. source = rm - s.Operands[3] |= 0x40000; // 3. source = reg - break; - case 2: - s.Operands[1] |= 0x40000; // 1. source = reg - s.Operands[2] |= 0x30000; // 2. source = rm - s.Operands[3] = s.Operands[0]; // 3. source = same as destination - break; - case 3: - s.Operands[1] |= 0x30000; // 1. source = rm - s.Operands[2] |= 0x40000; // 2. source = reg - s.Operands[3] = s.Operands[0]; // 3. source = same as destination - break; + case 0: + s.Operands[1] = s.Operands[0]; // 1. source = same as destination + s.Operands[2] |= 0x40000; // 2. source = reg + s.Operands[3] |= 0x30000; // 3. source = rm + break; + case 1: + s.Operands[1] = s.Operands[0]; // 1. source = same as destination + s.Operands[2] |= 0x30000; // 2. source = rm + s.Operands[3] |= 0x40000; // 3. source = reg + break; + case 2: + s.Operands[1] |= 0x40000; // 1. source = reg + s.Operands[2] |= 0x30000; // 2. source = rm + s.Operands[3] = s.Operands[0]; // 3. source = same as destination + break; + case 3: + s.Operands[1] |= 0x30000; // 1. source = rm + s.Operands[2] |= 0x40000; // 2. source = reg + s.Operands[3] = s.Operands[0]; // 3. source = same as destination + break; } } else { @@ -3179,8 +3296,8 @@ void CDisassembler::FindOperandTypes() { s.Operands[1] = s.Operands[2]; s.Operands[2] = 0; } // Preliminary AMD specification - if ((s.OpcodeDef->AllowedPrefixes & 0x4000) && !(s.Prefixes[7] & 8)) { - // Swap src1 and src2 if XOP.W = 0 + if ((AllowedPref & 0x7000) == 0x7000 && !(s.Prefixes[7] & 8)) { + // Swap src1 and src2 if XOP prefix and XOP.W = 0 k = s.Operands[1]; s.Operands[1] = s.Operands[2]; s.Operands[2] = k; } break; @@ -3213,7 +3330,7 @@ void CDisassembler::FindOperandTypes() { s.Operands[1] |= 0x60000; s.Operands[2] |= 0x30000; s.Operands[3] |= 0x70000; - if ((s.Prefixes[7] & 8) && (s.OpcodeDef->AllowedPrefixes & 0x4000)) { + if ((s.Prefixes[7] & 8) && (AllowedPref & 0x7000) == 0x7000) { // Swap src2 and src3 if VEX.W k = s.Operands[2]; s.Operands[2] = s.Operands[3]; s.Operands[3] = k; } @@ -3226,7 +3343,7 @@ void CDisassembler::FindOperandTypes() { s.Operands[1] |= 0x70000; s.Operands[2] |= 0x30000; s.Operands[3] |= 0x60000; - if ((s.Prefixes[7] & 8) && (s.OpcodeDef->AllowedPrefixes & 0x4000)) { + if ((s.Prefixes[7] & 8) && (AllowedPref & 0x7000) == 0x7000) { // Swap src2 and src3 if VEX.W k = s.Operands[2]; s.Operands[2] = s.Operands[3]; s.Operands[3] = k; } @@ -3327,9 +3444,26 @@ void CDisassembler::FindOperandTypes() { break; case 9: case 0x19: case 0x29: case 0x39: case 0xA9: - // 16, 32 or 64 bits, depending on operand size + // 8, 16, 32 or 64 bits, depending on operand size prefixes s.Operands[i] &= ~0x0F; - s.Operands[i] |= (s.OperandSize == 16) ? 2 : ((s.OperandSize == 64) ? 4 : 3); + switch (AllowedPref & 0x7000) { + case 0x3000: default: // 32 or 64 depending on mode and 66 or REX.W prefix + s.Operands[i] |= (s.OperandSize == 16) ? 2 : ((s.OperandSize == 64) ? 4 : 3); + break; + case 0x4000: // VEX.W prefix determines integer (vector) operand size b/w + if ((s.Prefixes[7] & 8) == 0) { // W bit + s.OperandSize = 8; + s.Operands[i] |= 1; + } + else { + s.OperandSize = 16; + s.Operands[i] |= 2; + } + break; + case 0x5000: // VEX.W and 66 prefix determines integer operand size b/w/d/q (mask instructions. B = 66W0, W = _W0, D = 66W1, Q = _W1) + s.Operands[i] |= (s.Prefixes[5] != 0x66) + ((s.Prefixes[7] & 8) >> 2) + 1; + break; + } break; case 0xB: case 0xC: // 16, 32 or 64 bits. Fixed size = 64 in 64 bit mode @@ -3357,60 +3491,104 @@ void CDisassembler::FindOperandTypes() { s.Operands[i] |= (s.OperandSize == 16) ? 3 : ((s.OperandSize == 64) ? 5 : 7); break; - case 0x4F: // XMM float. Size depends on prefix: none = ps, 66 = pd, F2 = sd, F3 = ss - s.Operands[i] &= ~0x7F; - switch (s.Prefixes[5]) { - case 0: // No prefix = ps - s.Operands[i] |= 0x4B; break; - case 0x66: // 66 prefix = pd - s.Operands[i] |= 0x4C; break; - case 0xF3: // F3 prefix = ss - s.Operands[i] |= 0x4B; goto MAKESCALAR; - case 0xF2: // F2 prefix = sd - s.Operands[i] |= 0x4C; - MAKESCALAR: // Cannot be larger than XMM register - s.Operands[i] &= ~0xF00; + case 0x4F: // XMM float. Size and precision depend on prefix bits + s.Operands[i] &= ~0x7F; // remove type + if ((AllowedPref & 0x1000) && !((AllowedPref & 0xF00) == 0xE00)) { + // precision depends on VEX.W bit + if (s.Prefixes[7] & 8) { + s.Operands[i] |= 0x4C; + } + else { + s.Operands[i] |= 0x4B; + } + } + else { + // Size and precision depend on prefix: none = ps, 66 = pd, F2 = sd, F3 = ss + switch (s.Prefixes[5]) { + case 0: // No prefix = ps + s.Operands[i] |= 0x4B; break; + case 0x66: // 66 prefix = pd + s.Operands[i] |= 0x4C; break; + case 0xF3: // F3 prefix = ss + s.Operands[i] |= 0x4B; + s.Operands[i] &= ~0xF00; // make scalar + break; + case 0xF2: // F2 prefix = sd + s.Operands[i] |= 0x4C; + s.Operands[i] &= ~0xF00; // make scalar + break; + }; break; - }; - break; + } } // Resolve vector size switch (s.Operands[i] & 0xF00) { - case 0x100: - // MMX or XMM or YMM or ZMM depending on 66 prefix and VEX.L prefix and MVEX prefix - s.Operands[i] &= ~0x100; - if (s.Prefixes[3] == 0x62) { - s.Operands[i] |= 0x600; // MVEX prefix: zmm + case 0x100: // MMX or XMM or YMM or ZMM depending on 66 prefix and VEX.L prefix and EVEX prefix + case 0x200: // XMM or YMM or ZMM depending on prefixes + case 0xF00: // Half the size defined by VEX.L prefix and EVEX.LL prefix. Minimum size = 8 bytes for memory, xmm for register + + oper = s.Operands[i] & ~0xF00; // element type + if (s.Prefixes[3] == 0x62) { // EVEX or MVEX prefix + if (s.Prefixes[6] & 0x20) { + // EVEX prefix + // Do LL bits specify vector size when b = 1 for instructions that allow + // sae but not rounding? Perhaps not, because sae is only allowed for + // 512 bit vectors, but manual says otherwise. + // NASM version 2.11.06 sets LL = 0 when b = 1 for vrangeps instruction + //??if ((s.OpcodeDef->EVEX & 4) && (s.Mod == 3) && (s.Esss & 1)) { + if ((s.OpcodeDef->EVEX & 6) && (s.Mod == 3) && (s.Esss & 1)) { + // rounding control, register operand. L'L do not indicate vector size + oper |= 0x600; // zmm + } + else if (s.OpcodeDef->EVEX & 8) { + // scalar + oper |= 0x400; // xmm + } + else { + // L'L indicates vector size + oper |= 0x400 + ((s.Esss & 6) << 7); // xmm, ymm, zmm, + } + } + else { + // MVEX prefix + oper |= 0x600; // zmm + } } else if (s.Prefixes[6] & 0x20) { - s.Operands[i] |= 0x500; // VEX.L: ymm + oper |= 0x500; // VEX.L: ymm } - else if (s.Prefixes[5] == 0x66) { - s.Operands[i] |= 0x400; // 66 prefix: xmm + else if (s.Prefixes[5] == 0x66 || (s.Operands[i] & 0x200)) { + oper |= 0x400; // 66 prefix or mm not allowed: xmm } else { - s.Operands[i] |= 0x300; // no prefix: mm + oper |= 0x300; // no prefix: mm } - break; - case 0x200: - // XMM or YMM or ZMM depending on VEX.L prefix and MVEX prefix - s.Operands[i] &= ~0x200; - if (s.Prefixes[3] == 0x62) s.Operands[i] |= 0x600; // zmm - else if (s.Prefixes[6] & 0x20) s.Operands[i] |= 0x500; // ymm - else s.Operands[i] |= 0x400; // xmm + if ((s.Operands[i] & 0xF00) == 0xF00) { + // half size vector + oper -= 0x100; + if ((oper & 0x1000) || (s.OpcodeDef->InstructionFormat == 0x1E)) { + // is register or vsib index. minimum size is xmm + if ((oper & 0xF00) < 0x400) { + oper = (oper & ~0x300) | 0x400; + } + } + } + s.Operands[i] = oper; // save corrected vector size + break; } + // resolve types that depend on MVEX swizzle - if (s.Prefixes[3] == 0x62 && (s.Operands[i] & 0xF0000) == 0x30000) { - int sw = (s.OpcodeDef->Swizzle & 0x1F); + if ((s.Prefixes[6] & 0x60) == 0x40 && (s.Operands[i] & 0xF0000) == 0x30000) { + int sw = (s.OpcodeDef->MVEX & 0x1F); if (sw) { - int optype = s.SwizRecord->memop; + int optype = s.SwizRecord ? s.SwizRecord->memop : 0; //? if (s.OpcodeDef->InstructionFormat == 0x1E) { // vsib addressing: s.Operands[i] & 0xF00 indicates index register size, s.Operands[i] & 0xFF indicates operand size s.Operands[i] = (s.Operands[i] & ~0xFF) | (optype & 0xFF); } - else if (s.OpcodeDef->Swizzle & 0x40) { + else if (s.OpcodeDef->MVEX & 0x40) { // operand is not a full vector s.Operands[i] = (s.Operands[i] & ~0xFFF) | (optype & 0xFF); } @@ -3448,12 +3626,13 @@ void CDisassembler::FindWarnings() { } // Check if displacement could be made smaller if (s.AddressFieldSize > 0 && s.AddressRelocation == 0 - && (s.BaseReg || (s.IndexReg && !s.BaseReg && s.Scale < 2))) { + && (s.BaseReg || (s.IndexReg && !s.BaseReg && s.Scale < 2)) + && s.OffsetMultiplier <= 1) { // There is a displacement which might be unnecessary switch (s.AddressFieldSize) { case 1: // 1 byte displacement if (Get(s.AddressField) == 0 - && ((s.BaseReg-1 & 7) != 5 || (s.AddressSize == 16 && s.IndexReg))) + && (((s.BaseReg-1) & 7) != 5 || (s.AddressSize == 16 && s.IndexReg))) s.Warnings1 |= 4; // Displacement is 0 and an addressing mode without displacement exists break; case 2: // 2 bytes displacement @@ -3461,8 +3640,10 @@ void CDisassembler::FindWarnings() { else if (Get(s.AddressField) == Get(s.AddressField)) s.Warnings1 |= 8; // Could use sign extension break; case 4: // 4 bytes displacement - if (Get(s.AddressField) == 0) s.Warnings1 |= 4; // Displacement is 0 - else if (Get(s.AddressField) == Get(s.AddressField)) s.Warnings1 |= 8; // Could use sign extension + if (s.OpcodeDef->InstructionFormat != 0x1E) { + if (Get(s.AddressField) == 0) s.Warnings1 |= 4; // Displacement is 0 + else if (Get(s.AddressField) == Get(s.AddressField)) s.Warnings1 |= 8; // Could use sign extension + } break; case 8: // 8 bytes displacement if (Get(s.AddressField) == Get(s.AddressField)) @@ -3474,7 +3655,9 @@ void CDisassembler::FindWarnings() { // Check for unnecessary SIB byte if ((s.MFlags&4) && (s.BaseReg&7)!=4+1 && (s.IndexReg==0 || (s.BaseReg==0 && s.Scale==0))) { if (WordSize == 64 && s.BaseReg==0 && s.IndexReg==0) s.Warnings1 |= 0x4000; // 64-bit address not rip-relative - else s.Warnings1 |= 0x10; // Unnecessary SIB byte + else if ((s.Operands[0] & 0xFF) != 0x98 && (s.Operands[1] & 0xFF) != 0x98 && s.OpcodeDef->InstructionFormat != 0x1E) { // ignore if bounds register used or vsib + s.Warnings1 |= 0x10; // Unnecessary SIB byte + } } // Check if shorter instruction exists for register operands if ((s.OpcodeDef->Options & 0x80) && !(s.OpcodeDef->InstructionFormat & 0xFE0) && s.Mod == 3 @@ -3499,7 +3682,7 @@ void CDisassembler::FindWarnings() { s.Warnings1 |= 0x80; } // Check for unnecessary REX.W prefix - if ((s.OpcodeDef->AllowedPrefixes & 0x2000) && s.Prefixes[7] == 0x48) { + if ((s.OpcodeDef->AllowedPrefixes & 0x7000) == 0x2000 && s.Prefixes[7] == 0x48) { s.Warnings1 |= 0x200; // REX.W prefix valid but unnecessary } // Check for meaningless prefixes @@ -3531,7 +3714,7 @@ void CDisassembler::FindWarnings() { s.Warnings1 |= 0x400; // 66 prefix not allowed here // Check for meaningless F2 prefix - if (s.Prefixes[3] == 0xF2 && !(s.OpcodeDef->AllowedPrefixes & 0x860)) + if (s.Prefixes[3] == 0xF2 && !(s.OpcodeDef->AllowedPrefixes & 0x868)) s.Warnings1 |= 0x400; // F2 prefix not allowed here // Check for meaningless F3 prefix @@ -3573,11 +3756,11 @@ void CDisassembler::FindWarnings() { if (s.IndexReg) RexBits &= ~2; // Check if REX.B bit used for base register if (s.BaseReg) RexBits &= ~1; - // Check if REX.X bit used for base register with MVEX prefix + // Check if REX.X bit used for base register with EVEX prefix if (s.Prefixes[3] == 0x62 && s.Mod == 3) RexBits &= ~2; - // Check if VEX.W bit used for operand swapping - if ((s.OpcodeDef->AllowedPrefixes & 0x3000) && (s.Prefixes[7] & 0xB0)) RexBits &= ~8; + // Check if VEX.W bit used for some purpose + if ((s.OpcodeDef->AllowedPrefixes & 0x7000) != 0 && (s.Prefixes[7] & 0xB0)) RexBits &= ~8; // Any unused bits left? if (RexBits) { @@ -3602,42 +3785,69 @@ void CDisassembler::FindWarnings() { // Check for meaningless VEX prefix bits if (s.Prefixes[7] & 0xB0) { // VEX present - if (s.Prefixes[6] & 0x20) { // VEX.L bit set + if ((s.Prefixes[6] & 0x60) == 0x20) { // VEX.L bit set and not EVEX if (!(s.OpcodeDef->AllowedPrefixes & 0x240000)) s.Warnings1 |= 0x40000000; // L bit not allowed if ((s.OpcodeDef->AllowedPrefixes & 0x200000) && s.Prefixes[5] > 0x66) s.Warnings1 |= 0x40000000; // L bit not allowed with F2 and F3 prefix } - else { // VEX.L bit not set - if (s.OpcodeDef->AllowedPrefixes & 0x100000) s.Warnings1 |= 0x1000; // L bit missing + else { + if ((s.OpcodeDef->AllowedPrefixes & 0x100000) && !(s.Prefixes[6] & 0x20)) s.Warnings1 |= 0x1000; // L bit missing } if ((s.Prefixes[6] & 0x10) && s.Prefixes[3] != 0x62) { - s.Warnings1 |= 0x40000000; // Uppermost m bit only allowed if MVEX prefix + s.Warnings1 |= 0x40000000; // Uppermost m bit only allowed if EVEX prefix } // check VEX.v bits if (s.Prefixes[3] == 0x62 && s.OpcodeDef->InstructionFormat == 0x1E) { - // has MVEX VSIB address + // has EVEX VSIB address if (s.Vreg & 0xF) { s.Warnings1 |= 0x40000000; // vvvv bits not allowed, v' bit allowed } } - else { // not MVEX VSIB + else { // not EVEX VSIB if ((s.Vreg & 0x1F) && !(s.OpcodeDef->AllowedPrefixes & 0x80000)) { s.Warnings1 |= 0x40000000; // vvvvv bits not allowed } } } - // Check for meaningless MVEX prefix bits + // Check for meaningless EVEX and MVEX prefix bits if (s.Prefixes[3] == 0x62) { - if (s.Mod == 3) { - // register operands only - if ((s.Esss & 8) && (s.OpcodeDef->Swizzle & 0x600) == 0) { - s.Warnings1 |= 0x80000000; // E bit not allowed for register operand here + if (s.Prefixes[6] & 0x20) { + // EVEX prefix + if (s.Mod == 3) { + // register operands + if (!(s.OpcodeDef->EVEX & 6) && (s.Esss & 1)) { + s.Warnings2 |= 0x40; // rounding and sae not allowed + } + } + else { + // memory operand + if (!(s.OpcodeDef->EVEX & 1) && (s.Esss & 1)) { + s.Warnings2 |= 0x40; // broadcast not allowed + } + } + if (!(s.OpcodeDef->EVEX & 0x30) && s.Kreg) { + s.Warnings2 |= 0x40; // masking not allowed + } + else if (!(s.OpcodeDef->EVEX & 0x20) && (s.Esss & 8)) { + s.Warnings2 |= 0x40; // zeroing not allowed + } + else if ((s.OpcodeDef->EVEX & 0x40) && s.Kreg == 0) { + s.Warnings2 |= 0x100; // mask register must be nonzero } } - if (((s.OpcodeDef->Swizzle & 0x1F) == 0) && (s.Esss & 7) != 0) { - s.Warnings1 |= 0x80000000; // sss bits not allowed here - } - if (s.Kreg && (s.OpcodeDef->Swizzle & 0x3000) == 0) { - s.Warnings1 |= 0x80000000; // kkk bits not allowed here + else { + // MVEX prefix. + if (s.Mod == 3) { + // register operands only + if ((s.Esss & 8) && (s.OpcodeDef->MVEX & 0x600) == 0) { + s.Warnings2 |= 0x80; // E bit not allowed for register operand here + } + } + if (((s.OpcodeDef->MVEX & 0x1F) == 0) && (s.Esss & 7) != 0) { + s.Warnings2 |= 0x80; // sss bits not allowed here + } + if (s.Kreg && (s.OpcodeDef->MVEX & 0x3000) == 0) { + s.Warnings2 |= 0x80; // kkk bits not allowed here + } } } @@ -3653,12 +3863,19 @@ void CDisassembler::FindWarnings() { s.Warnings1 |= 0x1000; // Required VEX prefix missing // Check for VEX prefix not allowed - if (!(s.OpcodeDef->AllowedPrefixes & 0x30000) && (s.Prefixes[7] & 0xB0)) + if (!(s.OpcodeDef->AllowedPrefixes & 0xC30000) && (s.Prefixes[7] & 0xB0)) s.Warnings1 |= 0x40000000; // VEX prefix not allowed - // Check for MVEX prefix not allowed - if (!(s.OpcodeDef->AllowedPrefixes & 0x400000) && (s.Prefixes[3] == 0x62)) - s.Warnings1 |= 0x80000000; // MVEX prefix not allowed + // Check for EVEX and MVEX prefix allowed + if (s.Prefixes[3] == 0x62) { + + if (s.Prefixes[6] & 0x20) { + if (!(s.OpcodeDef->AllowedPrefixes & 0x800000)) s.Warnings2 |= 0x10; + } + else { + if (!(s.OpcodeDef->AllowedPrefixes & 0x400000)) s.Warnings2 |= 0x20; + } + } // Check for unused SIB scale factor if (s.Scale && s.IndexReg == 0) s.Warnings1 |= 0x2000; // SIB has scale factor but no index register @@ -3748,16 +3965,16 @@ void CDisassembler::FindWarnings() { // Get operand size OperandSize = GetDataItemSize(OperandType); if (s.OffsetMultiplier) OperandSize = s.OffsetMultiplier; - while (OperandSize & OperandSize-1) { + while (OperandSize & (OperandSize-1)) { // Not a power of 2. Get nearest lower power of 2 - OperandSize = OperandSize & OperandSize-1; + OperandSize = OperandSize & (OperandSize-1); } // Check if aligned if ((TargetOffset & (OperandSize-1)) && !(s.Warnings1 & 0x10000)) { // Memory operand is misaligned if (s.OffsetMultiplier) { - // MVEX code with required alignment + // EVEX code with required alignment s.Warnings1 |= 0x800000; // Serious. Generates fault } else if (OperandSize < 16) { @@ -3994,9 +4211,16 @@ void CDisassembler::FindInstructionSet() { // VEX instruction set if VEX prefix InstSet = 0x19; } - if (s.Prefixes[3] == 0x62 && InstSet < 0x40) { - // MVEX instruction set if MVEX prefix - InstSet = 0x40; + if (s.Prefixes[6] & 0x40) { + // EVEX or MVEX prefix + if (s.Prefixes[6] & 0x20) { + // EVEX prefix + if (InstSet < 0x20) InstSet = 0x20; + } + else { + // MVEX prefix + if (InstSet < 0x80) InstSet = 0x80; + } } if ((InstSet & 0xFF00) == 0x1000) { // AMD-specific instruction set @@ -4129,7 +4353,9 @@ void CDisassembler::InitialErrorCheck() { } // Check opcode tables - if (NumOpcodeTables1 != NumOpcodeTables2) err.submit(9007, 0xFFFF); + if (NumOpcodeTables1 != NumOpcodeTables2) { + err.submit(9007, 0xFFFF); + } } @@ -4234,6 +4460,8 @@ void CDisassembler::CheckNamesValid() { ValidCharacters = "_$@?.~#"; break; case SUBTYPE_GASM: ValidCharacters = "_$."; break; + default: + err.submit(9000); } // Loop through sections @@ -4429,6 +4657,8 @@ uint32 CDisassembler::GetDataItemSize(uint32 Type) { Size = 32; break; case 0x600: Size = 64; break; + case 0x700: + Size = 128; break; } return Size; } diff --git a/src/disasm2.cpp b/src/disasm2.cpp index 1598068..ba06a0d 100644 --- a/src/disasm2.cpp +++ b/src/disasm2.cpp @@ -1,7 +1,7 @@ /**************************** disasm2.cpp ******************************** * Author: Agner Fog * Date created: 2007-02-25 -* Last modified: 2012-08-23 +* Last modified: 2016-11-27 * Project: objconv * Module: disasm2.cpp * Description: @@ -9,7 +9,7 @@ * * Changes that relate to assembly language syntax should be done in this file only. * -* Copyright 2007-2011 GNU General Public License http://www.gnu.org/licenses +* Copyright 2007-2016 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" @@ -94,10 +94,9 @@ SIntTxt AsmWarningTexts1[] = { {0x2000000, "Bogus length-changing prefix causes delay on Intel processors here"}, {0x4000000, "Non-default size for stack operation"}, {0x8000000, "Function does not end with ret or jmp"}, - {0x10000000, "Inaccessible code"}, + {0x10000000, "No jump seems to point here"}, {0x20000000, "Full 64-bit address"}, - {0x40000000, "VEX prefix bits not allowed here"}, - {0x80000000, "MVEX option bits not allowed here"} + {0x40000000, "VEX prefix bits not allowed here"} }; // Warning texts 2: Warnings about possible misinterpretation; serious warnings @@ -105,6 +104,12 @@ SIntTxt AsmWarningTexts2[] = { {1, "Label out of phase with instruction. Possibly spurious"}, {2, "Planned future instruction, according to preliminary specification"}, {4, "This instruction has been planned but never implemented because plans were changed. Will not work"}, + {0x10, "EVEX prefix not allowed for this instruction"}, + {0x20, "MVEX prefix not allowed for this instruction"}, + {0x40, "EVEX prefix option bits not allowed here"}, + {0x80, "MVEX prefix option bits not allowed here"}, + {0x100, "Mask register must be nonzero"}, + {0x200, "Broadcasting to scalar not allowd"}, }; @@ -135,16 +140,33 @@ const char * InstructionSetNames[] = { "", "SSE", "SSE2", "SSE3", // 10 - 13 "Supplementary SSE3", "SSE4.1", "SSE4.2", "AES", // 14 - 17 "CLMUL", "AVX", "FMA3", "?", // 18 - 1B - "AVX2", "TSX", "?", "?", // 1C - 1F - "?", "?", "?", "?", // 20 - 23 - "?", "?", "?", "?", // 24 - 27 + "AVX2", "BMI etc.", "?", "?", // 1C - 1F + "AVX-512", "AVX512PF/ER/CD", "MPX,SHA,TBD", "AVX512IFMA/VBMI", // 20 - 23 + "AVX512_4FMAPS", "?", "?", "?", // 24 - 27 "?", "?", "?", "?", // 28 - 2B "?", "?", "?", "?", // 2C - 2F "?", "?", "?", "?", // 30 - 33 "?", "?", "?", "?", // 34 - 37 "?", "?", "?", "?", // 38 - 3B - "?", "?", "?", "?", // 3C - 1F - "Knights corner", "?", "?", "?" // 40 - 43 + "?", "?", "?", "?", // 3C - 3F + "?", "?", "?", "?", // 40 - 43 + "?", "?", "?", "?", // 44 - 47 + "?", "?", "?", "?", // 48 - 4B + "?", "?", "?", "?", // 4C - 4F + "?", "?", "?", "?", // 50 - 53 + "?", "?", "?", "?", // 54 - 57 + "?", "?", "?", "?", // 58 - 5B + "?", "?", "?", "?", // 5C - 5F + "?", "?", "?", "?", // 60 - 63 + "?", "?", "?", "?", // 64 - 67 + "?", "?", "?", "?", // 68 - 6B + "?", "?", "?", "?", // 6C - 6F + "?", "?", "?", "?", // 70 - 73 + "?", "?", "?", "?", // 74 - 77 + "?", "?", "?", "?", // 78 - 7B + "?", "?", "?", "?", // 7C - 7F + "Knights Corner", "?", "?", "?", // 80 - 83 + "?", "?", "?", "?" // 84 - 87 }; const int InstructionSetNamesLen = TableSize(InstructionSetNames); @@ -240,7 +262,7 @@ void CDisassembler::WriteRMOperand(uint32 Type) { if ((s.OpcodeDef->InstructionFormat & 0x1F) == 0x1E) { WriteOperandType(Type & 0xFF); // has vsib address: write element type rather than vector type } - else { + else if (!(s.OpcodeDef->Options & 0x800)) { WriteOperandType(Type); // write operand type } @@ -372,7 +394,7 @@ void CDisassembler::WriteOperandType(uint32 type) { } void CDisassembler::WriteOperandTypeMASM(uint32 type) { - // Write type override before operand, e.g. "dword ptr", MASM syntax + // Write type override before operand, e.g. "dword ", MASM syntax if (type & 0xF00) { type &= 0xF00; // Ignore element type for vectors } @@ -382,57 +404,62 @@ void CDisassembler::WriteOperandTypeMASM(uint32 type) { switch (type) { case 1: // 8 bits - OutFile.Put("byte ptr "); break; + OutFile.Put("byte "); break; case 2: // 16 bits - OutFile.Put("word ptr "); break; + OutFile.Put("word "); break; case 3: // 32 bits - OutFile.Put("dword ptr "); break; + OutFile.Put("dword "); break; case 4: // 64 bits - OutFile.Put("qword ptr "); break; + OutFile.Put("qword "); break; case 5: // 80 bits if ((s.OpcodeDef->Destination & 0xFF) == 0xD) { // 64+16 bit far pointer. Not supported by MASM - OutFile.Put("fword ptr "); + OutFile.Put("fword "); s.OpComment = "64+16 bit. Need REX.W prefix"; } else { - OutFile.Put("tbyte ptr ");} + OutFile.Put("tbyte ");} break; case 6: case 0x40: case 0x48: case 0: // Other size. Write nothing break; case 7: case 0x0D: // 48 bits or far - OutFile.Put("fword ptr "); + OutFile.Put("fword "); if ((s.OpcodeDef->Destination & 0xFF) == 0xD && WordSize == 64) { // All assemblers I have tried forget the REX.W prefix here. Make a notice s.OpComment = "32+16 bit. Possibly forgot REX.W prefix"; } break; case 0x4A: // 16 bits float - OutFile.Put("word ptr "); break; + OutFile.Put("word "); break; case 0x43: // 32 bits float (x87) case 0x4B: // 32 bits float (SSE2) - OutFile.Put("dword ptr "); break; + OutFile.Put("dword "); break; case 0x44: // 64 bits float case 0x4C: // 64 bits float (SSE2) - OutFile.Put("qword ptr "); break; + OutFile.Put("qword "); break; case 0x45: // 80 bits float - OutFile.Put("tbyte ptr "); break; + OutFile.Put("tbyte "); break; case 0x84: case 0x85: // far call - OutFile.Put("far ptr "); break; + OutFile.Put("far "); break; + case 0x95: // 16 bits mask register + OutFile.Put("word "); break; case 0x300: // MMX - OutFile.Put("qword ptr "); break; + OutFile.Put("qword "); break; case 0x400: // XMM - OutFile.Put("xmmword ptr "); break; + OutFile.Put("xmmword "); break; case 0x500: // YMM - OutFile.Put("ymmword ptr "); break; + OutFile.Put("ymmword "); break; case 0x600: // ZMM - OutFile.Put("zmmword ptr "); break; + OutFile.Put("zmmword "); break; + case 0x700: // future 1024 bit + OutFile.Put("?mmword "); break; } + OutFile.Put("ptr "); } void CDisassembler::WriteOperandTypeYASM(uint32 type) { - // Write type override before operand, e.g. "dword", YASM syntax + // Write type override before operand, e.g. "dword", NASM/YASM syntax if (type & 0xF00) { type &= 0xF00; // Ignore element type for vectors } @@ -492,6 +519,8 @@ void CDisassembler::WriteOperandTypeYASM(uint32 type) { OutFile.Put("tbyte "); break; case 0x84: case 0x85: // far call OutFile.Put("far "); break; + case 0x95: // 16 bits mask register + OutFile.Put("word "); break; case 0x300: // MMX OutFile.Put("qword "); break; case 0x400: // XMM @@ -500,12 +529,14 @@ void CDisassembler::WriteOperandTypeYASM(uint32 type) { OutFile.Put("yword "); break; case 0x600: // ZMM OutFile.Put("zword "); break; + case 0x700: // Future 128 bytes + OutFile.Put("?word "); break; default:; // Anything else: write nothing } } void CDisassembler::WriteOperandTypeGASM(uint32 type) { - // Write type override before operand, e.g. "dword ptr", GAS syntax + // Write type override before operand, e.g. "dword ", GAS syntax if (type & 0xF00) { type &= 0xF00; // Ignore element type for vectors } @@ -513,54 +544,58 @@ void CDisassembler::WriteOperandTypeGASM(uint32 type) { type &= 0xFF; // Use operand type only } - switch (type & 0xFF) { + switch (type) { case 1: // 8 bits - OutFile.Put("byte ptr "); break; + OutFile.Put("byte "); break; case 2: // 16 bits - OutFile.Put("word ptr "); break; + OutFile.Put("word "); break; case 3: // 32 bits - OutFile.Put("dword ptr "); break; + OutFile.Put("dword "); break; case 4: // 64 bits - OutFile.Put("qword ptr "); break; + OutFile.Put("qword "); break; case 5: // 80 bits if ((s.OpcodeDef->Destination & 0xFF) == 0xD) { // 64+16 bit far pointer. Not supported by Gas - OutFile.Put("fword ptr "); + OutFile.Put("fword "); s.OpComment = "64+16 bit. Needs REX.W prefix"; } else { - OutFile.Put("tbyte ptr ");} + OutFile.Put("tbyte ");} break; case 6: case 0x40: case 0x48: case 0: // Other size. Write nothing break; case 7: // 48 bits - OutFile.Put("fword ptr "); + OutFile.Put("fword "); if ((s.OpcodeDef->Destination & 0xFF) == 0xD && WordSize == 64) { // All assemblers I have tried forget the REX.W prefix here. Make a notice s.OpComment = "32+16 bit. Possibly forgot REX.W prefix"; } break; case 0x4A: // 16 bits float - OutFile.Put("word ptr "); break; + OutFile.Put("word "); break; case 0x43: // 32 bits float (x87) case 0x4B: // 32 bits float (SSE2) - OutFile.Put("dword ptr "); break; + OutFile.Put("dword "); break; case 0x44: // 64 bits float case 0x4C: // 64 bits float (SSE2) - OutFile.Put("qword ptr "); break; + OutFile.Put("qword "); break; case 0x45: // 80 bits float - OutFile.Put("tbyte ptr "); break; + OutFile.Put("tbyte "); break; case 0x84: case 0x85: // far call - OutFile.Put("far ptr "); break; + OutFile.Put("far "); break; + case 0x95: // 16 bits mask register + OutFile.Put("word "); break; case 0x300: // MMX - OutFile.Put("qword ptr "); break; + OutFile.Put("qword "); break; case 0x400: // XMM - OutFile.Put("xmmword ptr "); break; + OutFile.Put("xmmword "); break; case 0x500: // YMM - OutFile.Put("ymmword ptr "); break; + OutFile.Put("ymmword "); break; case 0x600: // ZMM - OutFile.Put("zmmword ptr "); break; + OutFile.Put("zmmword "); break; + case 0x700: // future 1024 bit + OutFile.Put("?mmword "); break; } } @@ -582,17 +617,86 @@ void CDisassembler::WriteVEXOperand(uint32 Type, int i) { Num = Get(s.ImmediateField) >> 4; break; case 2: // Use immediate bits 0-3 (Unused. For possible future use) Num = Get(s.ImmediateField) & 0x0F; break; + default: + Num = 0; } // Write register name WriteRegisterName(Num, Type); } -void CDisassembler::WriteOperandAttribute(int i, int isMem) { + +void CDisassembler::WriteOperandAttributeEVEX(int i, int isMem) { + // Write operand attributes and instruction attributes from EVEX z, LL, b and aaa bits + // i = operand number (0 = destination, 1 = first source, 2 = second source, + // 98 = after last SIMD operand, 99 = after last operand) + // isMem: true if memory operand, false if register operand + uint32 swiz = s.OpcodeDef->EVEX; // indicates meaning of EVEX attribute bits + + if ((swiz & 0x30) && (i == 0 || (s.OpcodeDef->Destination == 0 && i == 1))) { // first operand + // write mask + if (s.Kreg || (swiz & 0xC0)) { + OutFile.Put(" {k"); + OutFile.PutDecimal(s.Kreg); + OutFile.Put("}"); + if ((swiz & 0x20) && (s.Esss & 8)) { + // zeroing + OutFile.Put("{z}"); + } + } + } + if (swiz & 0x07) { + // broadcast, rounding or sae allowed + if (isMem && i < 8) { + // memory operand + if ((swiz & 0x01) && (s.Esss & 1)) { + // write memory broadcast + // calculate broadcast factor + uint32 op = s.Operands[i]; // operand + uint32 elementsize = GetDataElementSize(op); // element size + uint32 opv = s.Operands[0]; // any vector operand + if (!(opv & 0xF00)) opv = s.Operands[1]; // first operand is not a vector, use next + uint32 vectorsize = GetDataItemSize(opv); // vector size + if (vectorsize > elementsize) { // avoid broadcasting to scalar + if (elementsize) { // avoid division by zero + OutFile.Put(" {1to"); + OutFile.PutDecimal(vectorsize/elementsize); + OutFile.Put("}"); + } + else { + OutFile.Put("{unknown broadcast}"); + } + } + } + } + if (i == 98 && s.Mod == 3) { // after last SIMD operand. no memory operand + // NASM has rounding mode and sae decoration after last SIMD operand with a comma. + // No spec. for other assemblers available yet (2014). + // use i == 99 if it should be placed after last operand. + // Perhaps the comma should be removed for other assemblers? + if ((swiz & 0x4) && (s.Esss & 1)) { + // write rounding mode + uint32 rounding = (s.Esss >> 1) & 3; + OutFile.Put(", {"); + OutFile.Put(EVEXRoundingNames[rounding]); + OutFile.Put("}"); + } + else if ((swiz & 0x2) && (s.Esss & 1)) { + // no rounding mode. write sae + OutFile.Put(", {"); + OutFile.Put(EVEXRoundingNames[4]); + OutFile.Put("}"); + } + } + } +} + + +void CDisassembler::WriteOperandAttributeMVEX(int i, int isMem) { // Write operand attributes and instruction attributes from MVEX sss, e and kkk bits. // i = operand number (0 = destination, 1 = first source, 2 = second source, 99 = after last operand) // isMem: true if memory operand, false if register operand - uint32 swiz = s.OpcodeDef->Swizzle; // indicates meaning of MVEX attribute bits - const int R_sae_syntax = 1; // syntax alternatives for rounding mode + sae + uint32 swiz = s.OpcodeDef->MVEX; // indicates meaning of MVEX attribute bits + const int R_sae_syntax = 0; // syntax alternatives for rounding mode + sae // 0: {rn-sae}, 1: {rn}{sae} const char * text = 0; // temporary text pointer @@ -606,14 +710,15 @@ void CDisassembler::WriteOperandAttribute(int i, int isMem) { } if (swiz & 0x1F) { // swizzle allowed - if (isMem) { + if (isMem && i < 90) { // write memory broadcast/up/down conversion text = s.SwizRecord->name; if (text && *text) { OutFile.Put(" {"); OutFile.Put(text); OutFile.Put("}"); } } - if (i == 2 || ((s.OpcodeDef->Source2 & 0xF0F00) == 0 && i == 1)) { + //if (i == 2 || ((s.OpcodeDef->Source2 & 0xF0F00) == 0 && i == 1)) { + if (i == 98) { // after last SIMD operand // last register or memory operand if (s.Mod == 3 && !((swiz & 0x700) && (s.Esss & 8))) { // skip alternative meaning of sss field for register operand when E=1 // write register swizzle @@ -695,8 +800,16 @@ void CDisassembler::WriteRegisterName(uint32 Value, uint32 Type) { break; } - // Get value limit - uint32 RegNumLimit = WordSize >= 64 ? 15 : 7; + // Get register number limit + uint32 RegNumLimit = 7; // largest register number + if (WordSize >= 64) { + RegNumLimit = 15; + if ((s.Prefixes[6] & 0x40) && (Type & 0xF40)) { + // EVEX or MVEX prefix and vector + RegNumLimit = 31; + } + } + switch (Type) { case 0x91: // segment register RegNumLimit = 5; @@ -706,9 +819,8 @@ void CDisassembler::WriteRegisterName(uint32 Value, uint32 Type) { case 0x95: // k mask register RegNumLimit = 7; break; - case 0x600: // zmm register (packed) - // There are probably only 7 zmm registers in 32 bit mode, though this is undocumented - if (WordSize >= 64) RegNumLimit = 31; else RegNumLimit = 7; + case 0x98: // bounds register + RegNumLimit = 3; break; } if (Value > RegNumLimit) { @@ -735,10 +847,12 @@ void CDisassembler::WriteRegisterName(uint32 Value, uint32 Type) { OutFile.Put("mm"); break; case 0x400: // xmm register OutFile.Put("xmm"); break; - case 0x500: // xmm register + case 0x500: // ymm register OutFile.Put("ymm"); break; - case 0x600: // xmm register + case 0x600: // zmm register OutFile.Put("zmm"); break; + case 0x700: // future 1024 bit register + OutFile.Put("?mm"); break; } OutFile.PutDecimal(Value); } @@ -782,6 +896,11 @@ void CDisassembler::WriteRegisterName(uint32 Value, uint32 Type) { OutFile.PutDecimal(Value); break; + case 0x700: // future 1024 bit register + OutFile.Put("?mm"); + OutFile.PutDecimal(Value); + break; + case 0x40: // st register if (Syntax == SUBTYPE_YASM) { // NASM, YASM and GAS-AT&T use st0 @@ -819,6 +938,11 @@ void CDisassembler::WriteRegisterName(uint32 Value, uint32 Type) { OutFile.PutDecimal(Value); break; + case 0x98: // bounds register + OutFile.Put("bnd"); + OutFile.PutDecimal(Value); + break; + case 0xB1: // 1 OutFile.Put("1"); break; @@ -843,7 +967,7 @@ void CDisassembler::WriteImmediateOperand(uint32 Type) { // Check if far if ((Type & 0xFE) == 0x84) { - // Write far ptr + // Write far WriteOperandType(Type); } @@ -1153,23 +1277,25 @@ void CDisassembler::WriteErrorsAndWarnings() { } } - if (!s.Warnings1 && s.Prefixes[0] && (s.OpcodeDef->AllowedPrefixes & 8)) { - // Branch hint prefix. Write comment - OutFile.Put(CommentSeparator); // Write "; " - switch (s.Prefixes[0]) { - case 0x2E: - OutFile.Put("Branch hint prefix for Pentium 4: Predict no jump"); - break; - case 0x3E: - OutFile.Put("Branch hint prefix for Pentium 4: Predict jump"); - break; - case 0x64: - OutFile.Put("Branch hint prefix for Pentium 4: Predict alternate"); - break; - default: - OutFile.Put("Note: Unrecognized branch hint prefix"); + if (s.OpcodeDef && (s.OpcodeDef->AllowedPrefixes & 8) && !s.Warnings1) { + if (s.Prefixes[0]) { + // Branch hint prefix. Write comment + OutFile.Put(CommentSeparator); // Write "; " + switch (s.Prefixes[0]) { + case 0x2E: + OutFile.Put("Branch hint prefix for Pentium 4: Predict no jump"); + break; + case 0x3E: + OutFile.Put("Branch hint prefix for Pentium 4: Predict jump"); + break; + case 0x64: + OutFile.Put("Branch hint prefix for Pentium 4: Predict alternate"); + break; + default: + OutFile.Put("Note: Unrecognized branch hint prefix"); + } + OutFile.NewLine(); } - OutFile.NewLine(); } } @@ -1328,7 +1454,7 @@ void CDisassembler::WriteDataItems() { || strlen(Symname) > AsmTab1 || sym < sym2 // || (Sections[Section].Type & 0xFF) == 3 - || (Symbols[sym].Type+1 & 0xFE) == 0x0C); + || ((Symbols[sym].Type+1) & 0xFE) == 0x0C); // Write symbol label switch (Syntax) { @@ -1408,7 +1534,7 @@ void CDisassembler::WriteDataItems() { Rel.Section = Section; Rel.Offset = Pos; uint32 irel = Relocations.FindFirst(Rel); - if (irel >= Relocations.GetNumEntries() || Relocations[irel].Section != Section) { + if (irel >= Relocations.GetNumEntries() || Relocations[irel].Section != (int32)Section) { // No relevant relocation irel = 0; } @@ -1439,7 +1565,7 @@ void CDisassembler::WriteDataItems() { } // Check for overlapping relocations if (irel && irel+1 < Relocations.GetNumEntries() - && Relocations[irel+1].Section == Section + && Relocations[irel+1].Section == (int32)Section && Relocations[irel+1].Offset < RelOffset + ElementSize) { // Overlapping relocations s.Errors |= 0x2000; @@ -1501,6 +1627,7 @@ void CDisassembler::WriteDataItems() { case 6: Value = Get(Pos) + ((uint64)Get(Pos+4) << 32); break; case 8: Value = Get(Pos); break; case 10: Value = Get(Pos); break; + default: Value = 0; // should not occur } if (irel) { // There is a relocation here. Write the name etc. @@ -1599,7 +1726,7 @@ void CDisassembler::WriteDataLabelMASM(const char * name, uint32 sym, int line) OutFile.Put("ymmword"); break; } // Check if jump table or call table - if ((Symbols[sym].Type+1 & 0xFE) == 0x0C) { + if (((Symbols[sym].Type+1) & 0xFE) == 0x0C) { OutFile.Tabulate(AsmTab3); OutFile.Put(CommentSeparator); if (Symbols[sym].DLLName) { @@ -1636,7 +1763,7 @@ void CDisassembler::WriteDataLabelYASM(const char * name, uint32 sym, int line) OutFile.Tabulate(AsmTab3); OutFile.Put(CommentSeparator); // Check if jump table or call table - if ((Symbols[sym].Type+1 & 0xFE) == 0x0C) { + if (((Symbols[sym].Type+1) & 0xFE) == 0x0C) { if (Symbols[sym].DLLName) { // DLL import OutFile.Put("import from "); @@ -1696,7 +1823,7 @@ void CDisassembler::WriteDataLabelGASM(const char * name, uint32 sym, int line) OutFile.Tabulate(AsmTab3); OutFile.Put(CommentSeparator); // Check if jump table or call table - if ((Symbols[sym].Type+1 & 0xFE) == 0x0C) { + if (((Symbols[sym].Type+1) & 0xFE) == 0x0C) { if (Symbols[sym].DLLName) { // DLL import OutFile.Put("import from "); @@ -2248,7 +2375,7 @@ int CDisassembler::WriteFillers() { // Write as bytes uint32 Pos; for (Pos = IFillerBegin; Pos < IFillerEnd; Pos++) { - if ((Pos - IFillerBegin & 7) == 0) { + if (((Pos - IFillerBegin) & 7) == 0) { // Start new line OutFile.NewLine(); OutFile.Put(CommentSeparator); @@ -2269,7 +2396,7 @@ int CDisassembler::WriteFillers() { uint32 Alignment = 4; // Limit to 2^4 = 16 // Check if first non-filler is aligned by this value - while (Alignment && (IFillerEnd & (1 << Alignment) - 1)) { + while (Alignment && (IFillerEnd & ((1 << Alignment) - 1))) { // Not aligned by 2^Alignment Alignment--; } @@ -2310,6 +2437,8 @@ void CDisassembler::WriteAlign(uint32 a) { void CDisassembler::WriteFileBegin() { // Write begin of file + OutFile.SetFileType(FILETYPE_ASM); + // Initial comment OutFile.Put(CommentSeparator); OutFile.Put("Disassembly of file: "); @@ -2374,7 +2503,7 @@ void CDisassembler::WriteFileBegin() { case 4: setA = "AMD SSE4a"; break; case 5: setA = "AMD XOP"; break; case 6: setA = "AMD FMA4"; break; - case 7: setA = "AMD CVT16"; break; + case 7: setA = "AMD TBM"; break; } if (*setA) { OutFile.Put(", "); @@ -3008,7 +3137,9 @@ void CDisassembler::WriteSegmentBeginYASM() { case 2: OutFile.Put("data"); break; case 3: OutFile.Put("bss"); break; case 4: OutFile.Put("const"); break; - default: OutFile.Put("unknown"); break; + default: OutFile.Put("unknown type: "); + OutFile.PutHex(Sections[Section].Type & 0xFF); + break; } // New line @@ -3568,7 +3699,12 @@ void CDisassembler::WriteInstruction() { } OutFile.Tabulate(AsmTab3); // Tabulate OutFile.Put(CommentSeparator); - OutFile.Put("Prefix coded explicitly"); // Comment + if ((s.OpcodeDef->AllowedPrefixes & 8) && Get(IBegin) == 0xF2) { + OutFile.Put("BND prefix coded explicitly"); // Comment + } + else { + OutFile.Put("Prefix coded explicitly"); // Comment + } OutFile.NewLine(); } @@ -3625,15 +3761,38 @@ void CDisassembler::WriteInstruction() { // Check suffix option if (s.OpcodeDef->Options & 1) { // Append suffix for operand size or type to name - if ((s.OpcodeDef->AllowedPrefixes & 0x3000) == 0x1000) { + if ((s.OpcodeDef->AllowedPrefixes & 0x7000) == 0x1000) { // F.P. operand size defined by W prefix bit i = s.Prefixes[7] & 8; // W prefix bit OutFile.Put(i ? 'd' : 's'); } - else if ((s.OpcodeDef->AllowedPrefixes & 0x3000) == 0x3000) { + else if ((s.OpcodeDef->AllowedPrefixes & 0x7000) == 0x3000) { + // Integer or f.p. operand size defined by W prefix bit + bool f = false; + // Find out if operands are integer or f.p. + for (i = 0; i < s.MaxNumOperands; i++) { + if ((s.Operands[i] & 0xF0) == 0x40) { + f = true; break; + } + } + i = s.Prefixes[7] & 8; // W prefix bit + if (f) { + OutFile.Put(i ? 'd' : 's'); // float precision suffix + } + else { + OutFile.Put(i ? 'q' : 'd'); // integer size suffix + } + } + else if ((s.OpcodeDef->AllowedPrefixes & 0x7000) == 0x4000) { // Integer operand size defined by W prefix bit i = s.Prefixes[7] & 8; // W prefix bit - OutFile.Put(i ? 'q' : 'd'); + OutFile.Put(i ? 'w' : 'b'); + } + else if ((s.OpcodeDef->AllowedPrefixes & 0x7000) == 0x5000) { + // mask register operand size defined by W prefix bit and 66 prefix + i = (s.Prefixes[7] & 8) >> 2; // W prefix bit + i |= s.Prefixes[5] != 0x66; // 66 prefix bit + OutFile.Put("bwdq"[i]); } else if (s.OpcodeDef->AllowedPrefixes & 0xE00) { // F.P. operand type and size defined by prefixes @@ -3660,6 +3819,19 @@ void CDisassembler::WriteInstruction() { } } } + // Alternative suffix option + if (s.OpcodeDef->Options & 0x1000) { + // Append alternative suffix for vector element size to name + if ((s.OpcodeDef->AllowedPrefixes & 0x7000) == 0x3000) { + // Integer operand size defined by W prefix bit + i = ((s.Prefixes[7] & 8) + 8) * 4; // W prefix bit -> 8 / 16 + OutFile.PutDecimal(i); + } + if ((s.OpcodeDef->AllowedPrefixes & 0x7000) == 0x4000) { // 32 / 64 + i = (s.Prefixes[7] & 8) + 8; // W prefix bit -> 8 / 16 + OutFile.PutDecimal(i); + } + } // More suffix option if ((s.OpcodeDef->Options & 0x400) && s.ImmediateFieldSize == 8) { // 64 bit immediate mov @@ -3671,7 +3843,7 @@ void CDisassembler::WriteInstruction() { // Loop for all operands to write for (i = 0; i < s.MaxNumOperands; i++) { - if (s.Operands[i]) { + if (s.Operands[i] & 0xFFFF) { // Write operand i if (NumOperands++) { @@ -3716,13 +3888,36 @@ void CDisassembler::WriteInstruction() { case 0x8: // Register operand indicated by bits 0-3 of immediate operand WriteVEXOperand(s.Operands[i], 2); break; // Unused. For future use } - if (s.Prefixes[3] == 0x62) { // MVEX prefix can have extra operand attributes - WriteOperandAttribute(i, optype == 3 && s.Mod != 3); + int isMem = optype == 3 && s.Mod != 3; + if (s.Prefixes[3] == 0x62) { // EVEX and MVEX prefix can have extra operand attributes + if (s.Prefixes[6] & 0x20) { + WriteOperandAttributeEVEX(i, isMem); + } + else { + WriteOperandAttributeMVEX(i, isMem); + } + } + if (s.Prefixes[3] == 0x62 && (i == s.MaxNumOperands - 1 || (s.Operands[i+1] & 0xFFF) < 0x40)) { + // This is the last SIMD operand + if (!(s.Operands[4] & 0x80000000)) { + s.Operands[4] |= 0x80000000; // Make sure we don't write this twice + if (s.Prefixes[6] & 0x20) { + WriteOperandAttributeEVEX(98, isMem); + } + else { + WriteOperandAttributeMVEX(98, isMem); + } + } } } } - if (s.Prefixes[3] == 0x62) { // MVEX prefix can have extra instruction attributes - WriteOperandAttribute(99, 0); + if (s.Prefixes[3] == 0x62) { // EVEX and MVEX prefix can have extra attributes after operands + if (s.Prefixes[6] & 0x20) { + WriteOperandAttributeEVEX(99, 0); + } + else { + WriteOperandAttributeMVEX(99, 0); + } } if (s.OpComment) { // Write opcode comment @@ -3790,6 +3985,8 @@ void CDisassembler::WriteStringInstruction() { PointerRegisterNames = RegisterNames32; break; case 64: PointerRegisterNames = RegisterNames64; break; + default: + PointerRegisterNames = 0; // should not occur } // Loop for possibly two operands @@ -3804,13 +4001,13 @@ void CDisassembler::WriteStringInstruction() { // Write operand size for first operand switch (s.OperandSize) { case 8: - OutFile.Put("byte ptr "); break; + OutFile.Put("byte "); break; case 16: - OutFile.Put("word ptr "); break; + OutFile.Put("word "); break; case 32: - OutFile.Put("dword ptr "); break; + OutFile.Put("dword "); break; case 64: - OutFile.Put("qword ptr "); break; + OutFile.Put("qword "); break; } } // Get segment @@ -3993,7 +4190,9 @@ void CDisassembler::CountInstructions() { uint32 AVXinstr = 0; // Number of AVX instructions uint32 FMAinstr = 0; // Number of FMA3 and later instructions uint32 AVX2instr = 0; // Number of AVX2 instructions - uint32 Knightinstr = 0; // Number of Knights Corner instructions + uint32 BMIinstr = 0; // Number of BMI instructions and other small instruction sets + uint32 AVX512instr = 0; // Number of AVX-512 instructions + uint32 MICinstr = 0; // Number of MIC instructions uint32 AMDinstr = 0; // Number of AMD instructions uint32 VIAinstr = 0; // Number of AMD instructions uint32 privilinstr = 0; // Number of privileged instructions @@ -4061,10 +4260,14 @@ void CDisassembler::CountInstructions() { AVXinstr += n; break; case 0x1A: case 0x1B: // FMA and later instructions FMAinstr += n; break; - case 0x1C: case 0x1D: case 0x1E: // AVX2 and later instructions + case 0x1C: // AVX2 instructions AVX2instr += n; break; - case 0x20: // Knights corner instructions - Knightinstr += n; break; + case 0x1D: case 0x1E: // BMI and other small instruction sets + BMIinstr += n; break; + case 0x20: // AVX-512 instructions + AVX512instr += n; break; + case 0x80: // MIC instructions + MICinstr += n; break; case 0x1001: case 0x1002: case 0x1004: case 0x1005: case 0x1006: // AMD AMDinstr += n; break; case 0x2001: // VIA @@ -4078,21 +4281,55 @@ void CDisassembler::CountInstructions() { printf("\n\nNumber of instruction opcodes supported by disassembler:\n%5i Total, including:", instructions); printf("\n%5i Privileged instructions", privilinstr); - printf("\n%5i MMX instructions", mmxinstr); - printf("\n%5i SSE instructions", sseinstr); - printf("\n%5i SSE2 instructions", sse2instr); - printf("\n%5i SSE3 instructions", sse3instr); - printf("\n%5i SSSE3 instructions", ssse3instr); + printf("\n%5i MMX instructions", mmxinstr); + printf("\n%5i SSE instructions", sseinstr); + printf("\n%5i SSE2 instructions", sse2instr); + printf("\n%5i SSE3 instructions", sse3instr); + printf("\n%5i SSSE3 instructions", ssse3instr); printf("\n%5i SSE4.1 instructions", sse41instr); printf("\n%5i SSE4.2 instructions", sse42instr); - printf("\n%5i AVX instructions etc.", AVXinstr); - printf("\n%5i AVX2 and later instructions", AVX2instr); - printf("\n%5i FMA3 instructions", FMAinstr); - printf("\n%5i Knights Corner instructions", Knightinstr); - printf("\n%5i AMD instructions", AMDinstr); - printf("\n%5i VIA instructions", VIAinstr); + printf("\n%5i AVX instructions etc.", AVXinstr); + printf("\n%5i AVX2 instructions", AVX2instr); + printf("\n%5i FMA3 instructions", FMAinstr); + printf("\n%5i BMI/micsellaneous instr.", BMIinstr); + printf("\n%5i AVX-512 instructions", AVX512instr); + printf("\n%5i MIC/Xeon Phi instructions", MICinstr); + printf("\n%5i AMD instructions", AMDinstr); + printf("\n%5i VIA instructions", VIAinstr); printf("\n%5i instructions planned but never implemented in any CPU", droppedinstr); printf("\n%5i undocumented or illegal instructions", undocinstr); printf("\n%5i instructions have both VEX and non-VEX versions", VEXdouble); - printf("\n"); + printf("\n"); + +#if 0 // temporary test code + + // find entries with 0x2000 prefix code + printf("\n\nInstructions with operand swap flag:\n"); + // Loop through all maps + for (map = 0; map < NumOpcodeTables1; map++) { + // Loop through each map + for (index = 0; index < OpcodeTableLength[map]; index++) { + opcode = OpcodeTables[map] + index; + if ((opcode->AllowedPrefixes & 0x2000) == 0x2000) { + printf("\n%04X %02X %s", map, index, opcode->Name); + } + } + } + + /* + printf("\n\nTables linked by type 0x0E:\n"); + // Loop through all maps + for (map = 0; map < NumOpcodeTables1; map++) { + // Loop through each map + for (index = 0; index < OpcodeTableLength[map]; index++) { + opcode = OpcodeTables[map] + index; + if (opcode->TableLink == 0x0E) { + printf(" 0x%02X", opcode->InstructionSet); + } + } + }*/ + + printf("\n"); + +#endif } diff --git a/src/elf.cpp b/src/elf.cpp index 5573914..d32cfcc 100644 --- a/src/elf.cpp +++ b/src/elf.cpp @@ -1,7 +1,7 @@ /**************************** elf.cpp ********************************* * Author: Agner Fog * Date created: 2006-07-18 -* Last modified: 2009-07-15 +* Last modified: 2017-10-18 * Project: objconv * Module: elf.cpp * Description: @@ -9,7 +9,7 @@ * * Class CELF is used for reading, interpreting and dumping ELF files. * -* Copyright 2006-2009 GNU General Public License http://www.gnu.org/licenses +* Copyright 2006-2017 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" // All functions in this module are templated to make two versions: 32 and 64 bits. @@ -211,6 +211,17 @@ SIntTxt ELFMachineNames[] = { {EM_ALPHA, "Alpha"} }; +// Program header type names +SIntTxt ELFPTypeNames[] = { + {PT_NULL, "Unused"}, + {PT_LOAD, "Loadable program segment"}, + {PT_DYNAMIC, "Dynamic linking information"}, + {PT_INTERP, "Program interpreter"}, + {PT_NOTE, "Auxiliary information"}, + {PT_SHLIB, "Reserved"}, + {PT_PHDR, "Entry for header table itself"} +}; + // Class CELF members: // Constructor @@ -230,6 +241,10 @@ void CELF::ParseFile(){ SectionHeaders.SetZero(); uint32 Symtabi = 0; // Index to symbol table + // check header integrity + if (FileHeader.e_phoff > GetDataSize() || FileHeader.e_phoff + FileHeader.e_phentsize > GetDataSize()) err.submit(2035); + if (FileHeader.e_shoff > GetDataSize() || FileHeader.e_shoff + FileHeader.e_shentsize > GetDataSize()) err.submit(2035); + // Find section headers SectionHeaderSize = FileHeader.e_shentsize; if (SectionHeaderSize <= 0) err.submit(2033); @@ -237,15 +252,24 @@ void CELF::ParseFile(){ for (i = 0; i < NSections; i++) { SectionHeaders[i] = Get(SectionOffset); + // check section header integrity + if (SectionHeaders[i].sh_type != SHT_NOBITS && (SectionHeaders[i].sh_offset > GetDataSize() + || SectionHeaders[i].sh_offset + SectionHeaders[i].sh_size > GetDataSize() + || SectionHeaders[i].sh_offset + SectionHeaders[i].sh_entsize > GetDataSize())) { + err.submit(2035); + } SectionOffset += SectionHeaderSize; - if (SectionHeaders[i].sh_type == SHT_SYMTAB) { // Symbol table found Symtabi = i; } } - SecStringTable = Buf() + uint32(SectionHeaders[FileHeader.e_shstrndx].sh_offset); - SecStringTableLen = uint32(SectionHeaders[FileHeader.e_shstrndx].sh_size); + + // if (Buf() && GetNumEntries()) { + if (Buf() && GetDataSize()) { + SecStringTable = Buf() + uint32(SectionHeaders[FileHeader.e_shstrndx].sh_offset); + SecStringTableLen = uint32(SectionHeaders[FileHeader.e_shstrndx].sh_size); + } if (SectionOffset > GetDataSize()) { err.submit(2110); // Section table points to outside file } @@ -271,6 +295,7 @@ void CELF::ParseFile(){ // Dump template void CELF::Dump(int options) { + uint32 i; if (options & DUMP_FILEHDR) { // File header printf("\nDump of ELF file %s", FileName); @@ -292,6 +317,39 @@ void CELF::Dump(int options) { NSections, FileHeader.e_flags); } + if ((options & DUMP_SECTHDR) && FileHeader.e_phnum) { + // Dump program headers + uint32 nProgramHeaders = FileHeader.e_phnum; + uint32 programHeaderSize = FileHeader.e_phentsize; + if (programHeaderSize <= 0) err.submit(2033); + uint32 programHeaderOffset = (uint32)FileHeader.e_phoff; + Elf64_Phdr pHeader; + for (i = 0; i < nProgramHeaders; i++) { + if (WordSize == 32) { + Elf32_Phdr pHeader32 = Get(programHeaderOffset); + pHeader.p_type = pHeader32.p_type; + pHeader.p_offset = pHeader32.p_offset; + pHeader.p_vaddr = pHeader32.p_vaddr; + pHeader.p_paddr = pHeader32.p_paddr; + pHeader.p_filesz = pHeader32.p_filesz; + pHeader.p_memsz = pHeader32.p_memsz; + pHeader.p_flags = pHeader32.p_flags; + pHeader.p_align = pHeader32.p_align; + } + else { + pHeader = Get(programHeaderOffset); + } + printf("\nProgram header Type: %s, flags 0x%X", + Lookup(ELFPTypeNames, (uint32)pHeader.p_type), (uint32)pHeader.p_flags); + printf("\noffset = 0x%X, vaddr = 0x%X, paddr = 0x%X, filesize = 0x%X, memsize = 0x%X, align = 0x%X", + (uint32)pHeader.p_offset, (uint32)pHeader.p_vaddr, (uint32)pHeader.p_paddr, (uint32)pHeader.p_filesz, (uint32)pHeader.p_memsz, (uint32)pHeader.p_align); + programHeaderOffset += programHeaderSize; + if (pHeader.p_filesz < 0x100 && (int32)pHeader.p_offset < GetDataSize() && memchr(Buf()+pHeader.p_offset, 0, (uint32)pHeader.p_filesz)) { + printf("\nContents: %s", Buf()+(int32)pHeader.p_offset); + } + } + } + if (options & DUMP_SECTHDR) { // Dump section headers printf("\n\nSection headers:"); diff --git a/src/elf2asm.cpp b/src/elf2asm.cpp index 5371cb9..eb76179 100644 --- a/src/elf2asm.cpp +++ b/src/elf2asm.cpp @@ -1,13 +1,13 @@ -/**************************** elf2cof.cpp ********************************* +/**************************** elf2asm.cpp ********************************* * Author: Agner Fog * Date created: 2007-04-22 -* Last modified: 2011-08-22 +* Last modified: 2016-11-06 * Project: objconv * Module: elf2asm.cpp * Description: * Module for disassembling ELF * -* Copyright 2007-2011 GNU General Public License http://www.gnu.org/licenses +* Copyright 2007-2016 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" // All functions in this module are templated to make two versions: 32 and 64 bits. @@ -100,7 +100,7 @@ void CELF2ASM::MakeSectionList() { for (uint32 sc = 0; sc < this->NSections; sc++) { // Get copy of 32-bit header or converted 64-bit header TELF_SectionHeader sheader = this->SectionHeaders[sc]; - int entrysize = (uint32)(sheader.sh_entsize); + //int entrysize = (uint32)(sheader.sh_entsize); uint32 namei = sheader.sh_name; if (namei >= this->SecStringTableLen) {err.submit(2112); break;} @@ -119,7 +119,7 @@ void CELF2ASM::MakeSectionList() { uint32 TotalSize = (uint32)sheader.sh_size; uint32 SectionAddress = (uint32)sheader.sh_addr - (uint32)ImageBase; uint32 Align = FloorLog2((uint32)sheader.sh_addralign); - const char * Name = this->SecStringTable + namei; + const char * Name = this->SecStringTableLen ? this->SecStringTable + namei : "???"; // Detect segment type uint32 Type = 0; @@ -178,7 +178,7 @@ void CELF2ASM::MakeSymbolList() { uint32 symtabsize = (uint32)(sheader.sh_size); int8 * symtab = this->Buf() + uint32(sheader.sh_offset); int8 * symtabend = symtab + symtabsize; - if (entrysize < sizeof(TELF_Symbol)) {err.submit(2033); entrysize = sizeof(TELF_Symbol);} + if (entrysize < (int)sizeof(TELF_Symbol)) {err.submit(2033); entrysize = (int)sizeof(TELF_Symbol);} // Loop through symbol table uint32 symi1; // Symbol number in this table diff --git a/src/elf2cof.cpp b/src/elf2cof.cpp index c80bded..4f961ae 100644 --- a/src/elf2cof.cpp +++ b/src/elf2cof.cpp @@ -1,13 +1,13 @@ /**************************** elf2cof.cpp ********************************* * Author: Agner Fog * Date created: 2006-08-19 -* Last modified: 2009-07-15 +* Last modified: 2013-11-27 * Project: objconv * Module: elf2cof.cpp * Description: * Module for converting ELF file to PE/COFF file * -* Copyright 2006-2009 GNU General Public License http://www.gnu.org/licenses +* Copyright 2006-2013 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" // All functions in this module are templated to make two versions: 32 and 64 bits. @@ -164,8 +164,8 @@ void CELF2COF::MakeSections() { // Raw data NewHeader.SizeOfRawData = uint32(OldHeader.sh_size); // section size in file - if (OldHeader.sh_size) { - // File ptr to raw data for section + if (OldHeader.sh_size && OldHeader.sh_type != SHT_NOBITS) { + // File to raw data for section NewHeader.PRawData = NewRawData.GetDataSize() + RawDataOffset; // Copy raw data @@ -210,7 +210,7 @@ void CELF2COF::MakeSections() { if (entrysize < expectedentrysize) {err.submit(2033); entrysize = expectedentrysize;} // File pointer for new relocations - NewHeader.PRelocations = NewRawData.GetDataSize() + RawDataOffset; // file ptr to relocation entries + NewHeader.PRelocations = NewRawData.GetDataSize() + RawDataOffset; // file to relocation entries // Loop through relocation table entries for (; reltab < reltabend; reltab += entrysize) { @@ -300,7 +300,8 @@ void CELF2COF::MakeSections() { case R_X86_64_IRELATIVE: err.submit(1063); // Warning: Gnu indirect function cannot be converted // continue in next case?: - case R_X86_64_32: // 32 bit absolute virtual address + case R_X86_64_32S: // 32 bit absolute virtual address, sign extended + case R_X86_64_32: // 32 bit absolute virtual address, zero extended NewRelocation.Type = COFF64_RELOC_ABS32; *piaddend += uint32(OldRelocation.r_addend); break; @@ -338,6 +339,12 @@ void CELF2COF::MakeSections() { err.ClearError(2043); // report this error only once NewRelocation.Type = 0; break; + + default: // Unknown or unsupported relocation method + err.submit(2030, OldRelocation.r_type); + err.ClearError(2030); // report this error only once + NewRelocation.Type = 0; + break; } } @@ -452,6 +459,7 @@ void CELF2COF::MakeSymbolTable() { // Get symbol name if (OldSym.st_name < stringtabsize) { symname = strtab + OldSym.st_name; + if (symname && *symname && type != STT_FILE) { // Symbol has a name that we want to store COFF_PutNameInSymbolTable(NewSym, symname, NewStringTable); @@ -530,7 +538,7 @@ void CELF2COF::MakeSymbolTable() { if (len > 1) { // Scan backwards for last '/' for (int scan = len-2; scan >= 0; scan--) { - if (symname[scan] == '/') { + if (symname[scan] == '/' || symname[scan] == '\\') { // Path found. Short name starts after this character shortname = symname + scan + 1; break; @@ -538,6 +546,7 @@ void CELF2COF::MakeSymbolTable() { } } len = (uint32)strlen(shortname); + if (len > 35) len = 35; // arbitrary limit to file name length // Number of auxiliary records for storing file name numaux = (len + SIZE_SCOFF_SymTableEntry - 1) / SIZE_SCOFF_SymTableEntry; @@ -545,11 +554,12 @@ void CELF2COF::MakeSymbolTable() { // Store regular record NewSymbolTable.Push(&NewSym, SIZE_SCOFF_SymTableEntry); // Store numaux auxiliary records for file name - if (numaux < 15) { - int8 * PointAux = NewSymbolTable.Buf() + NewSymbolTable.GetDataSize(); - NewSymbolTable.Push(0, numaux * SIZE_SCOFF_SymTableEntry); - memcpy(PointAux, shortname, strlen(shortname)); + for (uint32 i = 0; i < numaux; i++) { // Can't push all in one operation because NumEntries will be wrong + NewSymbolTable.Push(0, SIZE_SCOFF_SymTableEntry); } + // copy name into NewSymbolTable aux records + int8 * PointAux = NewSymbolTable.Buf() + NewSymbolTable.GetDataSize(); + memcpy(PointAux - numaux*SIZE_SCOFF_SymTableEntry, shortname, len); break;} case STT_SECTION: { diff --git a/src/elf2elf.cpp b/src/elf2elf.cpp index be9ea48..55c6f2a 100644 --- a/src/elf2elf.cpp +++ b/src/elf2elf.cpp @@ -1,13 +1,13 @@ /**************************** elf2elf.cpp ***************************** * Author: Agner Fog * Date created: 2006-01-13 -* Last modified: 2006-01-13 +* Last modified: 2013-11-27 * Project: objconv * Module: elf2elf.cpp * Description: * Module for changing symbol names in ELF file * -* Copyright 2006-2008 GNU General Public License http://www.gnu.org/licenses +* Copyright 2006-2013 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" // All functions in this module are templated to make two versions: 32 and 64 bits. @@ -70,8 +70,8 @@ void CELF2ELF::MakeSymbolTable() { case SHT_STRTAB: SecNamei = sheader.sh_name; - if (SecNamei >= this->SecStringTableLen) - err.submit(2112); + if (SecNamei >= this->SecStringTableLen) { + err.submit(2112); return;} SectionName = this->SecStringTable + SecNamei; if (SectionNumber == this->FileHeader.e_shstrndx || !strcmp(SectionName,".shstrtab")) { istrtab[2] = SectionNumber; // Section header string table found @@ -183,7 +183,7 @@ void CELF2ELF::MakeSymbolTable() { name1 = name2; name2 = 0; break; - case SYMA_CHANGE_ALIAS: + case SYMA_ALIAS: // Make alias and keep old name if (isymt != 0) err.submit(1033, name1); // alias in dynsym not supported yet AliasEntry = sym; @@ -220,7 +220,7 @@ void CELF2ELF::MakeSymbolTable() { // Insert into symbol index translation table NewSymbolIndex[OldSymi] = NewSymi; - if (action == SYMA_CHANGE_ALIAS && name2 && *name2) { + if (action == SYMA_ALIAS && name2 && *name2) { // Make one more entry for new alias symnamei = NewStringTable[isymt].PushString(name2); AliasEntry.st_name = symnamei; @@ -282,7 +282,8 @@ void CELF2ELF::ChangeSections() { // Section name namei = sheaderp->sh_name; - if (namei >= this->SecStringTableLen) err.submit(2112); + if (namei >= this->SecStringTableLen) { + err.submit(2112); sheaderp->sh_name = 0; return;} name1 = this->SecStringTable + namei; // Check if name change @@ -390,6 +391,10 @@ void CELF2ELF::MakeBinaryFile() { sheader.sh_offset = ToFile.Push(NewStringTable[2].Buf(), NewStringTable[2].GetDataSize()); sheader.sh_size = NewStringTable[2].GetDataSize(); } + else if (sheader.sh_type == SHT_NOBITS) { + // BSS section. Nothing + ; + } else { // Any other section (including istrtab[3] = .stabstr) sheader.sh_offset = ToFile.Push(this->Buf() + (uint32)sheader.sh_offset, (uint32)sheader.sh_size); diff --git a/src/elf2mac.cpp b/src/elf2mac.cpp index bfec0b0..e089c13 100644 --- a/src/elf2mac.cpp +++ b/src/elf2mac.cpp @@ -893,7 +893,7 @@ void CELF2MAC::MakeSections() { // Raw data NewHeader.size = OldHeader.sh_size; // section size in file - // File ptr to raw data for section + // File to raw data for section NewHeader.offset = NewRawData.GetDataSize() + RawDataOffset; if (OldHeader.sh_size && OldHeader.sh_type != SHT_NOBITS) { // Not for .bss segment diff --git a/src/error.cpp b/src/error.cpp index 2bb20c7..a5df7f0 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -1,13 +1,13 @@ /**************************** error.cpp ********************************** * Author: Agner Fog * Date created: 2006-07-15 -* Last modified: 2009-12-20 +* Last modified: 2017-10-18 * Project: objconv * Module: error.cpp * Description: * Standard procedure for error reporting to stderr * -* Copyright 2006-2009 GNU General Public License http://www.gnu.org/licenses +* Copyright 2006-2017 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ // Define this if you get problems: @@ -60,9 +60,11 @@ SErrorText ErrorTexts[] = { {1102, 1, "Library members have different type"}, {1103, 1, "Output file name ignored"}, {1104, 1, "Library member %s not found. Extraction failed"}, + {1105, 1, "Library member %s not found. Deletion failed"}, {1106, 1, "Symbol %s not found. Modification of this symbol failed"}, {1107, 1, "Name of library member %s should have extension .o or .obj"}, {1108, 1, "Name of library member %s too long. Truncating to 15 characters"}, + {1109, 1, "Library member %s has unknown type. Possibly alias record without code"}, {1150, 1, "Universal binary contains more than one component that can be converted. Specify desired word size or use lipo to extract desired component"}, {1151, 1, "Skipping component with wordsize %i"}, @@ -79,7 +81,7 @@ SErrorText ErrorTexts[] = { {1214, 1, "Symbol %s defined in both modules %s"}, {1215, 1, "More than 251 blocks required in symbol hash table. May fail with some linkers"}, {1300, 1, "File contains 32-bit absolute address. Must link with option -image_base %s -pagezero_size 1000"}, - {1301, 1, "Image-relative address converted to absolute. Assumes image base = %s"}, + {1301, 1, "Image-relative address converted to absolute. Assumes image base = "}, {1302, 1, "64-bit relocation with arbitrary reference point converted to 32-bit self-relative. Will fail if offset is negative"}, {1303, 1, "Cannot find imported symbol"}, {1304, 1, "Unknown relocation address"}, @@ -102,7 +104,7 @@ SErrorText ErrorTexts[] = { {2015, 2, "More than one option specified for symbol %s"}, {2016, 2, "Index out of range"}, {2017, 2, "File name %s specified more than once"}, - {2018, 2, "Unknown type for file: %s"}, + {2018, 2, "Unknown type 0x%X for file: %s"}, {2020, 2, "Overflow when converting value of symbol %s to 32 bits"}, {2021, 2, "File contains information for objective-C runtime code. Cannot convert"}, {2022, 2, "Cannot convert executable file"}, @@ -133,8 +135,9 @@ SErrorText ErrorTexts[] = { {2110, 2, "COFF file section table corrupt"}, {2112, 2, "String table corrupt"}, {2114, 2, "This is an intermediate file for whole-program-optimization in Intel compiler"}, - {2201, 2, "Not enough space for new file name %s. Please make this name shorter"}, + {2200, 2, "Weak public symbols not supported in this file format"}, {2202, 2, "Symbol name %s too long. Cannot change prefix"}, + {2203, 2, "File name %s too long"}, {2210, 2, "File contains overlapping relocation sources"}, {2301, 2, "OMF Record extends beyond end of file"}, {2302, 2, "Fixup source extends beyond end of section"}, @@ -248,9 +251,9 @@ void CErrorReporter::submit(int ErrorNumber, char const * extra) { // Print error message with extra text info // ErrorTexts[ErrorNumber] must contain %s where extra is to be inserted char text[MAX_ERROR_TEXT_LENGTH]; - if (extra == 0) extra = "???"; SErrorText * err = FindError(ErrorNumber); - sprintf(text, err->Text, extra); + strcpy (text, err->Text); + strncat( text, extra, MAX_ERROR_TEXT_LENGTH/2); HandleError(err, text); } diff --git a/src/library.cpp b/src/library.cpp index dd8dd51..896025a 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1,1775 +1,2105 @@ /**************************** library.cpp ********************************** * Author: Agner Fog * Date created: 2006-08-27 -* Last modified: 2012-08-31 +* Last modified: 2017-07-27 * Project: objconv * Module: library.cpp * Description: * This module contains code for reading, writing and manipulating function * libraries (archives) of the UNIX type and OMF type. * -* Copyright 2006-2012 GNU General Public License http://www.gnu.org/licenses +* Copyright 2006-2017 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" // OMF Library flag names SIntTxt OMFLibraryFlags[] = { - {0, "Flag = 0"}, - {1, "Case sensitive"} + {0, "Flag = 0"}, + {1, "Case sensitive"} }; CLibrary::CLibrary() { - // Constructor - CurrentOffset = 0; - CurrentNumber = 0; - LongNames = 0; - LongNamesSize = 0; - AlignBy = 0; - MemberFileType = 0; - RepressWarnings = 0; - PageSize = 16; + // Constructor + CurrentOffset = 0; + CurrentNumber = 0; + LongNames = 0; + LongNamesSize = 0; + AlignBy = 0; + MemberFileType = 0; + RepressWarnings = 0; + PageSize = 16; } void CLibrary::Go() { - // Do to library whatever the command line says - char const * MemberName1 = 0; // Name of library member - char const * MemberName2 = 0; // Modified name of library member - int action = 0; // Action to take on member - int FileType1 = 0; // File type of current member - int WordSize1 = 0; // Word size of current member - - // check LibraryOptions and whether an output file is specified - if (cmd.FileOptions & CMDL_FILE_OUTPUT) { - // Output is a library file - if ((cmd.OutputFile == 0 || cmd.OutputFile[0] == 0) && !(cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER)) { - err.submit(2503); // Output file name missing - return; - } - // Check extension - if (strstr(cmd.OutputFile, ".lib") && strstr(cmd.OutputFile, ".LIB") && strstr(cmd.OutputFile, ".a")) { - err.submit(1101); // Warning wrong extension - } - // Check if valid output type - if (cmd.OutputType >= IMPORT_LIBRARY_MEMBER) { - // Wrong output type - if (cmd.OutputType == FILETYPE_ASM) { - // Attempt to disassemble whole library - err.submit(2620); - } - else { - err.submit(2621); - } - return; - } - } - - // Desired alignment = 2 for COFF and ELF, 8 for Mach-O - AlignBy = 2; - if (cmd.OutputType == FILETYPE_MACHO_LE) AlignBy = 8; - - if (cmd.DumpOptions && !(cmd.LibraryOptions & CMDL_LIBRARY_EXTRACTMEM)) { - // Dump library, but not its members - Dump(); - return; - } - - // Reserve space for data buffer - DataBuffer.SetSize(GetBufferSize()); - - // Fix member names before extracting or adding members - if (GetDataSize()) Rebuild(); - - if (err.Number()) return; // Stop if error - - // Check options - if (!cmd.LibraryOptions) cmd.LibraryOptions = CMDL_LIBRARY_CONVERT; - - if (cmd.Verbose) { - // Tell what we are doing - if ((cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER) && GetDataSize() == 0) { - // Creating library - printf("\nCreating library %s (%s)", FileName, GetFileFormatName(cmd.OutputType)); - } - else if (OutputFileName) { - // Print input file name - printf("\nInput library: %s", FileName); - if (cmd.InputType != cmd.OutputType) { - // Converting library type. Print input file type - int InType = cmd.InputType; - if (InType == FILETYPE_LIBRARY || InType == FILETYPE_OMFLIBRARY) InType = cmd.MemberType; - printf(", Format: %s", GetFileFormatName(InType)); - } - // Print output file name and type - printf(", Output: %s, Format: %s", - OutputFileName, GetFileFormatName(cmd.OutputType)); - } - else { - printf("\nExtracting from library file: %s", FileName); - } - } - - // Convert library or extract or add or dump all members - StartExtracting(); // Initialize before ExtractMember() - - // Loop through input library - while ((MemberName1 = ExtractMember(&MemberBuffer)) != 0) { - - // Check if any specific action required for this member - action = cmd.SymbolChange(MemberName1, &MemberName2, SYMT_LIBRARYMEMBER); - if ((action != SYMA_CHANGE_NAME && action != SYMA_EXTRACT_MEMBER) || MemberName2 == 0) { - MemberName2 = MemberName1; // No name change - } - MemberBuffer.FileName = MemberName1; - MemberBuffer.OutputFileName = MemberName2; - - if (action == SYMA_DELETE_MEMBER) { - // Remove this member from library - if (cmd.Verbose) { - printf("\nRemoving member %s from library", MemberName1); - } - continue; - } - if (action == SYMA_ADD_MEMBER) { - // Replace this member with new file - // (Message comes later when adding new member) - continue; - } - - // Check type of this member - FileType1 = MemberBuffer.GetFileType(); - if (FileType1 == 0) continue; - WordSize1 = MemberBuffer.WordSize; - - // if (!(cmd.LibraryOptions & (CMDL_LIBRARY_EXTRACTMEM | CMDL_LIBRARY_ADDMEMBER))) { - // Not adding or extracting members. Apply conversion options to all members - if (cmd.SymbolChangesRequested() || FileType1 != cmd.OutputType) { - - // Conversion or name change requested - MemberBuffer.Go(); // Do required conversion - if (err.Number()) break; // Stop if error - } - // } - // Check type again after conversion - FileType1 = MemberBuffer.GetFileType(); - - if (MemberFileType == 0) MemberFileType = FileType1; - if (WordSize == 0) WordSize = WordSize1; - if (FileType1 != MemberFileType || WordSize1 != WordSize) { - // Library members have different type or word size - err.submit(1102); - } - - if (cmd.LibraryOptions & CMDL_LIBRARY_EXTRACTMEM) { - // Extract member(s) - if (action == SYMA_EXTRACT_MEMBER || cmd.LibraryOptions == CMDL_LIBRARY_EXTRACTALL) { - // Extract this member - if (cmd.DumpOptions == 0 && cmd.OutputType != CMDL_OUTPUT_DUMP) { - // Write this member to file - if (err.Number()) return; // Check first if error - - if (cmd.SymbolChangesRequested()) { - // Conversion or name change requested - MemberBuffer.Go(); - if (err.Number()) return; // Stop if error - } - - if (cmd.Verbose) { - // Tell what we are doing - if (MemberName1 == MemberName2) { - printf("\nExtracting file %s from library", MemberName1); - } - else { - printf("\nExtracting library member %s to file %s", MemberName1, MemberName2); - } - } - // Write this member to file - if (MemberName2) MemberBuffer.OutputFileName = MemberName2; - MemberBuffer.Write(); + // Do to library whatever the command line says + char const * MemberName1 = 0; // Name of library member + char const * MemberName2 = 0; // Modified name of library member + int action = 0; // Action to take on member + int FileType1 = 0; // File type of current member + int WordSize1 = 0; // Word size of current member + + if (cmd.DumpOptions && !(cmd.LibraryOptions & CMDL_LIBRARY_EXTRACTMEM)) { + // Dump library, but not its members + Dump(); + return; + } + + // Remove path form member names and check member type before extracting or adding members + AlignBy = 2; + if (GetDataSize()) FixNames(); + + if (err.Number()) return; // Stop if error + + // check LibraryOptions and whether an output file is specified + if (cmd.FileOptions & CMDL_FILE_OUTPUT) { + // Output is a library file + if ((cmd.OutputFile == 0 || cmd.OutputFile[0] == 0) && !(cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER)) { + err.submit(2503); // Output file name missing + return; + } + // Check extension + if (strstr(cmd.OutputFile, ".lib") && strstr(cmd.OutputFile, ".LIB") && strstr(cmd.OutputFile, ".a")) { + err.submit(1101); // Warning wrong extension + } + if (cmd.OutputType >= IMPORT_LIBRARY_MEMBER) { + // Wrong output type + if (cmd.OutputType == FILETYPE_ASM) { + // Attempt to disassemble whole library + err.submit(2620); } else { - // Dump this member - MemberBuffer.Go(); + err.submit(2621); } - } - } - else if (cmd.DumpOptions == 0) { - // Add member to new library - if (cmd.Verbose) { - // Tell what we are doing - if (strcmp(MemberName1, MemberName2) != 0) { - printf("\nRenaming member %s to %s", MemberName1, MemberName2); + return; + } + } + + // Desired alignment = 2 for COFF and ELF, 8 for Mach-O + AlignBy = 2; + if (cmd.OutputType == FILETYPE_MACHO_LE) AlignBy = 8; + + // Determine library type and subtype + if (cmd.LibrarySubtype == 0) { + switch (cmd.OutputType) { + case FILETYPE_OMF: case FILETYPE_OMFLIBRARY: + cmd.LibrarySubtype = LIBTYPE_OMF; break; + case FILETYPE_COFF: case FILETYPE_DOS: + cmd.LibrarySubtype = LIBTYPE_WINDOWS; break; + case FILETYPE_ELF: + cmd.LibrarySubtype = LIBTYPE_LINUX; break; + case FILETYPE_MACHO_LE: case FILETYPE_MACHO_BE: + cmd.LibrarySubtype = LIBTYPE_BSD_MAC; break; + case FILETYPE_LIBRARY: + switch (cmd.InputType) { + case FILETYPE_COFF: case FILETYPE_DOS: + cmd.LibrarySubtype = LIBTYPE_WINDOWS; break; + case FILETYPE_ELF: + cmd.LibrarySubtype = LIBTYPE_LINUX; break; + case FILETYPE_MACHO_LE: case FILETYPE_MACHO_BE: + cmd.LibrarySubtype = LIBTYPE_BSD_MAC; break; } - } - // Put into new library - InsertMember(&MemberBuffer); - } - } // End of loop through library - // Stop if error - if (err.Number()) return; - - if (cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER) { - // Add object files to library - SSymbolChange const * sym; - // Loop through file names to add - while ((sym = cmd.GetMemberToAdd()) != 0) { - MemberBuffer.Reset(); // Reset MemberBuffer - // Name of object file - MemberBuffer.FileName = sym->Name2; // Name of object file - MemberBuffer.OutputFileName = sym->Name1; // Name of new member - // Read object file - MemberBuffer.Read(); - // Stop if read failed - if (err.Number()) continue; - // Detect file type - int NewMemberType = MemberBuffer.GetFileType(); - if (cmd.Verbose) { - // Tell what we are doing - if (sym->Done) { - printf("\nReplacing member %s with file %s", sym->Name1, sym->Name2); + break; + default: + cmd.LibrarySubtype = LIBTYPE_SHORTNAMES; + } + } + + // Reserve space for data buffer + DataBuffer.SetSize(GetBufferSize()); + + // Check options + if (!cmd.LibraryOptions) cmd.LibraryOptions = CMDL_LIBRARY_CONVERT; + + if (cmd.Verbose) { + // Tell what we are doing + if ((cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER) && GetDataSize() == 0) { + // Creating library + printf("\nCreating library %s (%s)", FileName, GetFileFormatName(cmd.OutputType)); + } + else if (OutputFileName) { + // Print input file name + printf("\nInput library: %s", FileName); + if (cmd.InputType != cmd.OutputType) { + // Converting library type. Print input file type + int InType = cmd.InputType; + if (InType == FILETYPE_LIBRARY || InType == FILETYPE_OMFLIBRARY) InType = cmd.MemberType; + printf(", Format: %s", GetFileFormatName(InType)); + if (cmd.DesiredWordSize) printf("%i", cmd.DesiredWordSize); + } + // Print output file name and type + printf(", Output: %s, Format: %s", OutputFileName, GetFileFormatName(cmd.OutputType)); + if (cmd.DesiredWordSize) printf("%i", cmd.DesiredWordSize); + } + else { + printf("\nExtracting from library file: %s", FileName); + } + } + + // Convert library or extract or add or dump all members + StartExtracting(); // Initialize before ExtractMember() + + // Loop through input library + while ((MemberName1 = ExtractMember(&MemberBuffer)) != 0) { + + // Check if any specific action required for this member + action = cmd.SymbolChange(MemberName1, &MemberName2, SYMT_LIBRARYMEMBER); + /* + if ((action != SYMA_CHANGE_NAME && action != SYMA_EXTRACT_MEMBER) || MemberName2 == 0) { + MemberName2 = MemberName1; // No name change + } */ + MemberBuffer.FileName = MemberName1; + MemberBuffer.OutputFileName = MemberName2 ? MemberName2 : MemberName1; + + if (action == SYMA_DELETE_MEMBER) { + // Remove this member from library + if (cmd.Verbose) { + printf("\nRemoving member %s from library", MemberName1); + } + continue; + } + if (action == SYMA_ADD_MEMBER) { + // Replace this member with new file + // (Message comes later when adding new member) + continue; + } + + // Check type of this member + FileType1 = MemberBuffer.GetFileType(); + if (FileType1 == 0) continue; + WordSize1 = MemberBuffer.WordSize; + + if (!(cmd.LibraryOptions & (CMDL_LIBRARY_EXTRACTMEM | CMDL_LIBRARY_ADDMEMBER))) { + // Not adding or extracting members. Apply conversion options to all members + if (cmd.SymbolChangesRequested() || FileType1 != cmd.OutputType) { + + // Check file type before conversion + int FileType0 = MemberBuffer.GetFileType(); + // Conversion or name change requested + MemberBuffer.Go(); // Do required conversion + if (err.Number()) break; // Stop if error + // Check type again after conversion + FileType1 = MemberBuffer.GetFileType(); + if (MemberBuffer.OutputFileName == 0 || FileType1 != FileType0) { + MemberBuffer.OutputFileName = MemberBuffer.SetFileNameExtension(MemberBuffer.FileName); + } + MemberBuffer.FileName = MemberBuffer.OutputFileName; + } + } + if (MemberFileType == 0) MemberFileType = FileType1; + if (WordSize == 0) WordSize = WordSize1; + if (FileType1 != MemberFileType || WordSize1 != WordSize) { + if (WordSize1 == 0) { + // Library member has no wordsize + err.submit(1109, MemberBuffer.FileName); } else { - printf("\nAdding member %s from file %s", sym->Name1, sym->Name2); + // Library members have different type or word size + err.submit(1102); + } + } + + if (cmd.LibraryOptions & CMDL_LIBRARY_EXTRACTMEM) { + // Extract member(s) + if (action == SYMA_EXTRACT_MEMBER || cmd.LibraryOptions == CMDL_LIBRARY_EXTRACTALL) { + // Extract this member + if (cmd.DumpOptions == 0 && cmd.OutputType != CMDL_OUTPUT_DUMP) { + // Write this member to file + if (err.Number()) return; // Check first if error + + if (cmd.SymbolChangesRequested() || FileType1 != cmd.OutputType) { + // Conversion or name change requested + + // Check type before conversion + int FileType0 = MemberBuffer.GetFileType(); + MemberBuffer.Go(); + if (err.Number()) return; // Stop if error + // Check type after conversion + FileType1 = MemberBuffer.GetFileType(); + if (MemberBuffer.OutputFileName == 0 /*|| FileType1 != FileType0*/) { + MemberBuffer.OutputFileName = MemberBuffer.SetFileNameExtension(MemberBuffer.FileName); + } + } + if (MemberBuffer.OutputFileName == 0) { + MemberBuffer.OutputFileName = MemberBuffer.FileName; + } + if (cmd.Verbose) { + // Tell what we are doing + if (MemberName1 == MemberName2) { + printf("\nExtracting file %s from library", MemberName1); + } + else { + printf("\nExtracting library member %s to file %s", MemberName1, MemberBuffer.OutputFileName); + } + } + if (WordSize1 == 0) { + err.submit(1109, MemberName1); + } + // Write this member to file + MemberBuffer.Write(); + } + else { + // Dump this member + MemberBuffer.Go(); + } + } + } + else if (cmd.DumpOptions == 0) { + // Add member to new library + if (MemberName2 == 0) MemberName2 = MemberName1; + if (cmd.Verbose) { + // Tell what we are doing + if (strcmp(MemberName1, MemberName2) != 0) { + printf("\nRenaming member %s to %s", MemberName1, MemberName2); + } + } + // Put into new library + InsertMember(&MemberBuffer); + } + } // End of loop through library + // Stop if error + if (err.Number()) return; + + if (cmd.LibraryOptions & CMDL_LIBRARY_ADDMEMBER) { + // Add object files to library + SSymbolChange const * sym; + // Loop through file names to add + while ((sym = cmd.GetMemberToAdd()) != 0) { + MemberBuffer.Reset(); // Reset MemberBuffer + // Name of object file + MemberBuffer.FileName = sym->Name2; // Name of object file + MemberBuffer.OutputFileName = sym->Name1; // Name of new member + // Read object file + MemberBuffer.Read(); + // Stop if read failed + if (err.Number()) continue; + // Detect file type + int NewMemberType = MemberBuffer.GetFileType(); + if (cmd.Verbose) { + // Tell what we are doing + if (sym->Done) { + printf("\nReplacing member %s with file %s", sym->Name1, sym->Name2); + } + else { + printf("\nAdding member %s from file %s", sym->Name1, sym->Name2); + } + if (NewMemberType != cmd.OutputType) { + // Converting type + printf(". Converting from %s.", GetFileFormatName(NewMemberType)); + } } - if (NewMemberType != cmd.OutputType) { - // Converting type - printf(". Converting from %s.", GetFileFormatName(NewMemberType)); + // Do any conversion required + MemberBuffer.Go(); + + // Stop if error + if (err.Number()) continue; + + // Check if file type is right after conversion + MemberFileType = MemberBuffer.FileType; + if (WordSize == 0) WordSize = MemberBuffer.WordSize; + if (MemberFileType != cmd.OutputType) { + // Library members have different type + err.submit(2504, GetFileFormatName(MemberBuffer.FileType)); continue; } - } - // Do any conversion required - MemberBuffer.Go(); - - // Stop if error - if (err.Number()) continue; - - // Check if file type is right after conversion - MemberFileType = MemberBuffer.FileType; - if (WordSize == 0) WordSize = MemberBuffer.WordSize; - if (MemberFileType != cmd.OutputType) { - // Library members have different type - err.submit(2504, GetFileFormatName(MemberBuffer.FileType)); continue; - } - if (MemberBuffer.WordSize != WordSize) { - // Library members have different word size - err.submit(2505, MemberBuffer.WordSize); continue; - } - // Put into library - MemberBuffer.FileName = MemberBuffer.OutputFileName; - InsertMember(&MemberBuffer); - } // End of loop through object file names - } - // Stop if error - if (err.Number()) return; - - if (cmd.LibraryOptions & CMDL_LIBRARY_EXTRACTMEM) { - cmd.CheckExtractSuccess(); // Check if members to extract were found - } - - if (cmd.FileOptions & CMDL_FILE_OUTPUT) { - // Make output library - MakeBinaryFile(); - // Take over OutFile buffer - *this << OutFile; - } - else { - // No output library - OutputFileName = 0; - } + if (MemberBuffer.WordSize != WordSize) { + // Library members have different word size + err.submit(2505, MemberBuffer.WordSize); continue; + } + // Put into library + MemberBuffer.FileName = MemberBuffer.OutputFileName; + InsertMember(&MemberBuffer); + } // End of loop through object file names + } + // Stop if error + if (err.Number()) return; + + if (cmd.LibraryOptions & CMDL_LIBRARY_EXTRACTMEM) { + cmd.CheckExtractSuccess(); // Check if members to extract were found + } + + if (cmd.FileOptions & CMDL_FILE_OUTPUT) { + // Make output library + MakeBinaryFile(); + // Take over OutFile buffer + *this << OutFile; + } + else { + // No output library + OutputFileName = 0; + } } +void CLibrary::FixNames() { + // Rebuild library or fix member names + // Dispatch according to library type + switch (cmd.InputType) { + case FILETYPE_OMF: case FILETYPE_OMFLIBRARY: + // Rebuild OMF style library and fix long member names + RebuildOMF(); break; + + case FILETYPE_LIBRARY: + default: + // Fix names in UNIX style library + StripMemberNamesUNIX(); break; + } +} +/* Unused: void CLibrary::Rebuild() { - // Rebuild library: fix member names - // Dispatch according to library type - switch (cmd.InputType) { - case FILETYPE_OMF: case FILETYPE_OMFLIBRARY: - // Rebuild OMF style library - RebuildOMF(); break; - - case FILETYPE_LIBRARY: - default: - // Rebuild UNIX style library - RebuildUNIX(); break; - } + // Rebuild library: fix member names + // Dispatch according to library type + switch (cmd.InputType) { + case FILETYPE_OMF: case FILETYPE_OMFLIBRARY: + // Rebuild OMF style library + RebuildOMF(); break; + + case FILETYPE_LIBRARY: + default: + // Rebuild UNIX style library + RebuildUNIX(); break; + } } -void CLibrary::RebuildOMF() { - // Rebuild OMF style library. - // Removes paths from member names, truncates to 16 characters, and makes unique. - // Symbol table is removed, not remade - - SOMFRecordPointer rec; // Current OMF record - char * ModuleName; // Module name - SStringEntry se; // String entry record to save - COMFFileBuilder NewBuffer; // Buffer for rebuilt library - uint32 Align; // Alignment - - // Remember member file type - cmd.MemberType = FILETYPE_OMF; - - // Initialize record pointer - rec.Start(Buf(), 0, GetDataSize()); - - // Read header - if (rec.Type2 != OMF_LIBHEAD) {err.submit(2500); return;} // Does not start with library header - - // Read library header - DictionaryOffset = rec.GetDword(); - DictionarySize = rec.GetWord(); - rec.GetByte(); // Ignore flag - // Page size / alignment for members - PageSize = rec.End + 1; - Align = 1 << FloorLog2(PageSize); // Make power of 2 - if (PageSize != Align) { - err.submit(2601, PageSize); // Error: not a power of 2 - } - - // Copy library header to new buffer - NewBuffer.Push(Buf(), PageSize); - - // Reset record loop end when DictionaryOffset is known - rec.FileEnd = DictionaryOffset; - - // Next record is start of first module - rec.GetNext(); - if (rec.Type2 != OMF_THEADR) err.submit(2500); // Member does not start with THEADR - - // Loop through the records of all OMF modules - do { - // Check record type - switch (rec.Type2) { - - case OMF_THEADR: // Start of module - - // Get name - ModuleName = rec.GetString(); - - // Remove path, truncate name and make unique - ModuleName = FixMemberNameOMF(ModuleName); - - // Remember name to check for duplicates - se.String = StringBuffer.PushString(ModuleName); - se.Member = NewBuffer.GetDataSize(); - StringEntries.Push(se); - - // Make new THEADR record - NewBuffer.StartRecord(OMF_THEADR); - NewBuffer.PutString(ModuleName); - NewBuffer.EndRecord(); - break; - - case OMF_MODEND: case OMF_LIBEND: // End of module or library - // Copy MODEND record - NewBuffer.Push(Buf() + rec.FileOffset, rec.End + 1); - - // Align output file by PageSize - NewBuffer.Align(PageSize); - break; - - default: // Any other record in module - // Copy record unchanged - NewBuffer.Push(Buf() + rec.FileOffset, rec.End + 1); - break; - } - } // Point to next record - while (rec.GetNext(PageSize)); // End of loop through records - - // Put dictionary offset in LIBHEAD record - DictionaryOffset = NewBuffer.GetDataSize(); - NewBuffer.Get(3) = DictionaryOffset; - - // Take over modified library file - *this << NewBuffer; - - // Empty used buffers - StringEntries.SetNum(0); - StringBuffer.SetSize(0); +void CLibrary::RebuildUNIX() { + // Rebuild UNIX style library + // Make member names unique and without path. Rebuild symbol table + char const * MemberName1 = 0; // Name of library member + uint32 OutputFileType; + + // Save OutputType before changing it + OutputFileType = cmd.OutputType; + + // Loop through input library + CurrentOffset = 8; CurrentNumber = 0; + while ((MemberName1 = ExtractMember(&MemberBuffer)) != 0) { + // Properties of member + MemberBuffer.FileName = MemberBuffer.OutputFileName = MemberName1; + // Check if import library + if (MemberBuffer.Get(0) == 0xFFFF0000) { + // Import library. Cannot do anything sensible + err.submit(2507, cmd.InputFile); return; + } + // Remember member type + cmd.MemberType = MemberBuffer.GetFileType(); + // Temporarily set OutputType to MemberType + cmd.OutputType = cmd.MemberType; + // Put into new library + InsertMember(&MemberBuffer); + } + // Avoid getting warnings twice for duplicate symbols + RepressWarnings = 1; + // Make library header etc. and add all members to OutFile + MakeBinaryFile(); + RepressWarnings = 0; + + // Restore OutputType + cmd.OutputType = OutputFileType; + + // Replace file buffer by OutFile + *this << OutFile; + + // Clear buffers used for building OutFile + StringBuffer.SetSize(0); + StringEntries.SetNum(0); + Indexes.SetNum(0); + DataBuffer.SetSize(0); } +*/ +void CLibrary::RebuildOMF() { + // Rebuild OMF style library. + // Removes paths from member names, truncates to 16 characters, and makes unique. + // Symbol table is removed, not remade + + SOMFRecordPointer rec; // Current OMF record + char * ModuleName; // Module name + SStringEntry se; // String entry record to save + COMFFileBuilder NewBuffer; // Buffer for rebuilt library + uint32 Align; // Alignment + + // Remember member file type + cmd.MemberType = FILETYPE_OMF; + + // Initialize record pointer + rec.Start(Buf(), 0, GetDataSize()); + + // Read header + if (rec.Type2 != OMF_LIBHEAD) {err.submit(2500); return;} // Does not start with library header + + // Read library header + DictionaryOffset = rec.GetDword(); + DictionarySize = rec.GetWord(); + if ((uint64)DictionaryOffset + DictionarySize >= GetDataSize()) {err.submit(2035); return;} + + rec.GetByte(); // Ignore flag + // Page size / alignment for members + PageSize = rec.End + 1; + Align = 1 << FloorLog2(PageSize); // Make power of 2 + if (PageSize != Align) { + err.submit(2601, PageSize); // Error: not a power of 2 + } + + // Copy library header to new buffer + NewBuffer.Push(Buf(), PageSize); + + // Reset record loop end when DictionaryOffset is known + rec.FileEnd = DictionaryOffset; + + // Next record is start of first module + rec.GetNext(); + if (rec.Type2 != OMF_THEADR) err.submit(2500); // Member does not start with THEADR + + // Loop through the records of all OMF modules + do { + // Check record type + switch (rec.Type2) { + + case OMF_THEADR: // Start of module + + // Get name + ModuleName = rec.GetString(); + + // Remove path, truncate name and make unique + ModuleName = ShortenMemberName(ModuleName); + + // Remember name to check for duplicates + // Not needed any more: + se.String = StringBuffer.PushString(ModuleName); + se.Member = NewBuffer.GetDataSize(); + StringEntries.Push(se); + + // Make new THEADR record + NewBuffer.StartRecord(OMF_THEADR); + NewBuffer.PutString(ModuleName); + NewBuffer.EndRecord(); + break; -void CLibrary::RebuildUNIX() { - // Rebuild UNIX style library - // Make member names unique and without path. Rebuild symbol table - char const * MemberName1 = 0; // Name of library member - uint32 OutputFileType; - - // Save OutputType before changing it - OutputFileType = cmd.OutputType; - - // Loop through input library - CurrentOffset = 8; CurrentNumber = 0; - while ((MemberName1 = ExtractMember(&MemberBuffer)) != 0) { - // Properties of member - MemberBuffer.FileName = MemberBuffer.OutputFileName = MemberName1; - // Check if import library - if (MemberBuffer.Get(0) == 0xFFFF0000) { - // Import library. Cannot do anything sensible - err.submit(2507, cmd.InputFile); return; - } - // Remember member type - cmd.MemberType = MemberBuffer.GetFileType(); - // Temporarily set OutputType to MemberType - cmd.OutputType = cmd.MemberType; - // Put into new library - InsertMember(&MemberBuffer); - } - // Avoid getting warnings twice for duplicate symbols - RepressWarnings = 1; - // Make library header etc. and add all members to OutFile - MakeBinaryFile(); - RepressWarnings = 0; - - // Restore OutputType - cmd.OutputType = OutputFileType; - - // Replace file buffer by OutFile - *this << OutFile; - - // Clear buffers used for building OutFile - StringBuffer.SetSize(0); - StringEntries.SetNum(0); - Indexes.SetNum(0); - DataBuffer.SetSize(0); -} + case OMF_MODEND: case OMF_LIBEND: // End of module or library + // Copy MODEND record + NewBuffer.Push(Buf() + rec.FileOffset, rec.End + 1); + // Align output file by PageSize + NewBuffer.Align(PageSize); + break; -void CLibrary::Dump() { - // Print contents of library - printf("\nDump of library %s\nExported symbols by member:\n", cmd.InputFile); + default: // Any other record in module + // Copy record unchanged + NewBuffer.Push(Buf() + rec.FileOffset, rec.End + 1); + break; + } + } // Point to next record + while (rec.GetNext(PageSize)); // End of loop through records - // Dispatch according to library type - switch (cmd.InputType) { - case FILETYPE_LIBRARY: - DumpUNIX(); break; // Print contents of UNIX style library + // Put dictionary offset in LIBHEAD record + DictionaryOffset = NewBuffer.GetDataSize(); + NewBuffer.Get(3) = DictionaryOffset; - case FILETYPE_OMFLIBRARY: - DumpOMF(); break; // Print contents of OMF style library + // Take over modified library file + *this << NewBuffer; - default: - err.submit(9000); // Should not occur - } + // Empty used buffers + StringEntries.SetNum(0); + StringBuffer.SetSize(0); } -void CLibrary::DumpOMF() { - // Print contents of OMF style library - uint8 Flags; // Dictionary flags - uint32 i; // Loop counter - uint32 Align; // Member alignment - uint32 RecordEnd; // End of OMF record - SOMFRecordPointer rec; // Current OMF record - char * MemberName; // Name of library member - char * SymbolName; // Name of public symbol in member - uint32 MemberStart; // Start of member - uint32 MemberEnd; // End of member - uint32 MemberNum = 0; // Member number - uint32 FirstPublic; // Index to first public name of current member - CMemoryBuffer Strings; // Local string buffer - CSList MemberIndex; // Local member index buffer - COMF Member; // Local buffer for member - - DictionaryOffset = GetDataSize(); // Loop end. This value is changed when library header is read - rec.Start(Buf(), 0, DictionaryOffset); // Initialize record pointer - - PageSize = 0; - - // Loop through the records of all OMF modules - do { - // Check record type - switch (rec.Type2) { - - case OMF_LIBHEAD: // Library header. This should be the first record - if (PageSize || rec.FileOffset > 0) { - err.submit(2600); break; // More than one header - } - // Read library header - DictionaryOffset = rec.GetDword(); - DictionarySize = rec.GetWord(); - Flags = rec.GetByte(); - // Page size / alignment for members - PageSize = rec.End + 1; - Align = 1 << FloorLog2(PageSize); // Make power of 2 - if (PageSize != Align) { - err.submit(2601, PageSize); // Error: not a power of 2 - } - // Reset record loop end when DictionaryOffset is known - rec.FileEnd = DictionaryOffset; - - // Print values from LIBHEAD - printf("\nOMF Library. Page size %i. %s.", - PageSize, Lookup(OMFLibraryFlags, Flags)); - break; - - case OMF_THEADR: // Module header. Member starts here - MemberName = rec.GetString(); // Get name - MemberStart = rec.FileOffset; // Get start address - printf("\nMember %s Offset 0x%X", MemberName, MemberStart);// Print member name - break; - - case OMF_MODEND: // Member ends here. - RecordEnd = rec.FileOffset + rec.End + 1;// End of record - MemberEnd = RecordEnd; // = member end address - - // Store member in temporary buffer - Member.SetSize(0); - Member.Push(Buf() + MemberStart, MemberEnd - MemberStart); - - // Get public names from member - FirstPublic = MemberIndex.GetNumEntries(); - Member.PublicNames(&Strings, &MemberIndex, ++MemberNum); - - // Print public names - for (i = FirstPublic; i < MemberIndex.GetNumEntries(); i++) { - SymbolName = Strings.Buf() + MemberIndex[i].String; - printf("\n %s", SymbolName); - } - // Align next member by PageSize; - MemberEnd = (MemberEnd + PageSize - 1) & - (int32)PageSize; - rec.End = MemberEnd - rec.FileOffset - 1; - break; - - case OMF_LIBEND: // Last member should end here - RecordEnd = rec.FileOffset + rec.End + 1;// End of record - if (RecordEnd != DictionaryOffset) err.submit(2602); - break; - } - } // Go to next record - while (rec.GetNext()); // End of loop through records - - // Check hash table integrity - CheckOMFHash(Strings, MemberIndex); - - // Check if there is an extended library dictionary - uint32 ExtendedDictionaryOffset = DictionaryOffset + DictionarySize * 512; - - if (ExtendedDictionaryOffset > GetDataSize()) { - err.submit(2500); // File is truncated - } - if (ExtendedDictionaryOffset < GetDataSize()) { - // Library contains extended dictionary - uint32 ExtendedDictionarySize = GetDataSize() - ExtendedDictionaryOffset; - uint8 DictionaryType = Get(ExtendedDictionaryOffset); // Read first byte of extended dictionary - if (DictionaryType == OMF_LIBEXT) { - // Extended dictionary in the official format - printf("\nExtended dictionary IBM/MS format. size %i", ExtendedDictionarySize); - } - else if (ExtendedDictionarySize >= 10 && (DictionaryType == 0xAD || Get(ExtendedDictionaryOffset + 2) == MemberNum)) { - // Extended dictionary in the proprietary Borland format, documented only in US Patent 5408665, 1995 - printf("\nExtended dictionary Borland format. size %i", ExtendedDictionarySize); - } - else { - // Unknown format - printf("\nExtended dictionary size %i, unknown type 0x%02X", - ExtendedDictionarySize, DictionaryType); - } - } + +void CLibrary::StripMemberNamesUNIX() { + // Remove path from member names, set extension to default + char * MemberName1 = 0; // Name of library member + + // Loop through input library + CurrentOffset = 8; CurrentNumber = 0; + while ((MemberName1 = ExtractMember(&MemberBuffer)) != 0) { + // Properties of member + // Check if import library + if (MemberBuffer.Get(0) == 0xFFFF0000) { + // Import library. Cannot do anything sensible + err.submit(2507, cmd.InputFile); return; + } + if (MemberName1[0] == '/') continue; // names record + // remember member type + if (cmd.MemberType == 0) { + cmd.MemberType = MemberBuffer.GetFileType(); + } + // Fix name + StripMemberName(MemberName1); + // Check word size + if (cmd.DesiredWordSize == 0) { + cmd.DesiredWordSize = MemberBuffer.WordSize; + } + else if (cmd.DesiredWordSize != MemberBuffer.WordSize && MemberBuffer.WordSize != 0) { + err.submit(2012, MemberBuffer.WordSize, cmd.DesiredWordSize); // wrong word size + return; + } + if (cmd.OutputType == FILETYPE_LIBRARY || cmd.OutputType == FILETYPE_OMFLIBRARY) { + cmd.OutputType = cmd.MemberType; + } + } } -void CLibrary::DumpUNIX() { - // Print contents of UNIX style library +void CLibrary::Dump() { + // Print contents of library - const char * MemberName = 0; - CurrentOffset = 8; CurrentNumber = 0; + // Dispatch according to library type + switch (cmd.InputType) { + case FILETYPE_LIBRARY: + DumpUNIX(); break; // Print contents of UNIX style library - // Loop through library - while (CurrentOffset + sizeof(SUNIXLibraryHeader) < DataSize) { + case FILETYPE_OMFLIBRARY: + DumpOMF(); break; // Print contents of OMF style library - // Reset buffers - StringBuffer.SetSize(0); - MemberBuffer.Reset(); - StringEntries.SetNum(0); + default: + err.submit(9000); // Should not occur + } +} - // Get member name - MemberName = ExtractMember(&MemberBuffer); - if (MemberName == 0) break; - printf("\nMember %s", MemberName); +void CLibrary::DumpOMF() { + // Print contents of OMF style library + uint8 Flags; // Dictionary flags + uint32 i; // Loop counter + uint32 Align; // Member alignment + uint32 RecordEnd; // End of OMF record + SOMFRecordPointer rec; // Current OMF record + char * MemberName; // Name of library member + char * SymbolName; // Name of public symbol in member + uint32 MemberStart = 0; // Start of member + uint32 MemberEnd; // End of member + uint32 MemberNum = 0; // Member number + uint32 FirstPublic; // Index to first public name of current member + CMemoryBuffer Strings; // Local string buffer + CSList MemberIndex; // Local member index buffer + COMF Member; // Local buffer for member + + DictionaryOffset = GetDataSize(); // Loop end. This value is changed when library header is read + rec.Start(Buf(), 0, DictionaryOffset); // Initialize record pointer + + PageSize = 0; + + printf("\nDump of library %s\nExported symbols by member:\n", cmd.InputFile); + + // Loop through the records of all OMF modules + do { + // Check record type + switch (rec.Type2) { + + case OMF_LIBHEAD: // Library header. This should be the first record + if (PageSize || rec.FileOffset > 0) { + err.submit(2600); break; // More than one header + } + // Read library header + DictionaryOffset = rec.GetDword(); + DictionarySize = rec.GetWord(); + if ((uint64)DictionaryOffset + DictionarySize >= GetDataSize()) {err.submit(2035); return;} + Flags = rec.GetByte(); + // Page size / alignment for members + PageSize = rec.End + 1; + Align = 1 << FloorLog2(PageSize); // Make power of 2 + if (PageSize != Align) { + err.submit(2601, PageSize); // Error: not a power of 2 + } + // Reset record loop end when DictionaryOffset is known + rec.FileEnd = DictionaryOffset; - // Detect file type of member - MemberFileType = MemberBuffer.GetFileType(); + // Print values from LIBHEAD + printf("\nOMF Library. Page size %i. %s.", + PageSize, Lookup(OMFLibraryFlags, Flags)); + break; - WordSize = MemberBuffer.WordSize; - printf (" - %s", GetFileFormatName(MemberFileType)); - if (WordSize) printf("-%i", MemberBuffer.WordSize); + case OMF_THEADR: // Module header. Member starts here + MemberName = rec.GetString(); // Get name + MemberStart = rec.FileOffset; // Get start address + printf("\nMember %s Offset 0x%X", MemberName, MemberStart);// Print member name + break; - // Get symbol table for specific file type - switch (MemberFileType) { - case FILETYPE_ELF: - if (WordSize == 32) { - // Make instance of file parser, 32 bit template - CELF elf; - MemberBuffer >> elf; // Transfer MemberBuffer to elf object - elf.PublicNames(&StringBuffer, &StringEntries, 0); + case OMF_MODEND: // Member ends here. + RecordEnd = rec.FileOffset + rec.End + 1;// End of record + MemberEnd = RecordEnd; // = member end address + + // Store member in temporary buffer + Member.SetSize(0); + Member.Push(Buf() + MemberStart, MemberEnd - MemberStart); + + // Get public names from member + FirstPublic = MemberIndex.GetNumEntries(); + Member.PublicNames(&Strings, &MemberIndex, ++MemberNum); + + // Print public names + for (i = FirstPublic; i < MemberIndex.GetNumEntries(); i++) { + SymbolName = Strings.Buf() + MemberIndex[i].String; + printf("\n %s", SymbolName); + } + // Align next member by PageSize; + MemberEnd = (MemberEnd + PageSize - 1) & - (int32)PageSize; + rec.End = MemberEnd - rec.FileOffset - 1; break; - } - else { - // Make instance of file parser, 64 bit template - CELF elf; - MemberBuffer >> elf; // Transfer MemberBuffer to elf object - elf.PublicNames(&StringBuffer, &StringEntries, 0); + + case OMF_LIBEND: // Last member should end here + RecordEnd = rec.FileOffset + rec.End + 1;// End of record + if (RecordEnd != DictionaryOffset) err.submit(2602); break; - } + } + } // Go to next record + while (rec.GetNext()); // End of loop through records + + // Check hash table integrity + CheckOMFHash(Strings, MemberIndex); + + // Check if there is an extended library dictionary + uint32 ExtendedDictionaryOffset = DictionaryOffset + DictionarySize * 512; + + if (ExtendedDictionaryOffset > GetDataSize()) { + err.submit(2500); // File is truncated + } + if (ExtendedDictionaryOffset < GetDataSize()) { + // Library contains extended dictionary + uint32 ExtendedDictionarySize = GetDataSize() - ExtendedDictionaryOffset; + uint8 DictionaryType = Get(ExtendedDictionaryOffset); // Read first byte of extended dictionary + if (DictionaryType == OMF_LIBEXT) { + // Extended dictionary in the official format + printf("\nExtended dictionary IBM/MS format. size %i", ExtendedDictionarySize); + } + else if (ExtendedDictionarySize >= 10 && (DictionaryType == 0xAD || Get(ExtendedDictionaryOffset + 2) == MemberNum)) { + // Extended dictionary in the proprietary Borland format, documented only in US Patent 5408665, 1995 + printf("\nExtended dictionary Borland format. size %i", ExtendedDictionarySize); + } + else { + // Unknown format + printf("\nExtended dictionary size %i, unknown type 0x%02X", + ExtendedDictionarySize, DictionaryType); + } + } +} - case FILETYPE_COFF: { - CCOFF coff; - MemberBuffer >> coff; // Transfer MemberBuffer to coff object - coff.PublicNames(&StringBuffer, &StringEntries, 0); - break;} +void CLibrary::DumpUNIX() { + // Print contents of UNIX style library + + const char * MemberName = 0; + CurrentOffset = 8; CurrentNumber = 0; + + printf("\nDump of library %s", cmd.InputFile); + + if (cmd.DumpOptions & DUMP_SECTHDR) { + // dump headers + SUNIXLibraryHeader * Header = 0; // Member header + uint32 MemberSize = 0; // Size of member + //uint32 HeaderExtra = 0; // Extra added to size of header + //uint32 NameIndex; // Index into long names member + char * Name = 0; // Name of member + int symindex = 0; // count symbol index records + int i; // loop counter + + // Search for member + while (CurrentOffset) { + //HeaderExtra = 0; + // Extract next library member from input library + Header = &Get(CurrentOffset); + // Size of member + MemberSize = (uint32)atoi(Header->FileSize); + // Member name + Name = Header->Name; + // Terminate name + for (i = 0; i < 15; i++) { + if (Name[i] == ' ') { + Name[i+1] = 0; break; + } + } + if (i == 16) Name[i] = 0; - case FILETYPE_MACHO_LE: - if (WordSize == 32) { - // Make instance of file parser, 32 bit template - CMACHO mac; - MemberBuffer >> mac; // Transfer MemberBuffer to coff object - mac.PublicNames(&StringBuffer, &StringEntries, 0); - break; - } - else { - // Make instance of file parser, 64 bit template - CMACHO mac; - MemberBuffer >> mac; // Transfer MemberBuffer to coff object - mac.PublicNames(&StringBuffer, &StringEntries, 0); + if (strncmp(Name, "//", 2) == 0) { + // This is the long names member. + printf("\nLongnames header \"%s\". Offset 0x%X, size 0x%X", Name, + CurrentOffset + (uint32)sizeof(SUNIXLibraryHeader), MemberSize); + } + else if (Name[0] == '/' && Name[1] <= ' ') { + // Symbol index + printf("\nSymbol index %i, \"%s\"", ++symindex, Name); + } + else if (strncmp(Name, "__.SYMDEF", 9) == 0) { + // Mac/BSD Symbol index + printf("\nSymbol index %i, \"%s\"", ++symindex, Name); + } + else if (strncmp(Name, "#1/", 3) == 0) { + // Name refers to long name after the header + // This variant is used by Mac and some versions of BSD + //HeaderExtra = atoi(Name+3); + Name += sizeof(SUNIXLibraryHeader); + if (strncmp(Name, "__.SYMDEF", 9) == 0) { + // Symbol table "__.SYMDEF SORTED" as long name + printf("\nSymbol index %i, \"%s\"", ++symindex, Name); + } + } + else break; + // Point to next member + CurrentOffset = NextHeader(CurrentOffset); + } + CurrentOffset = 8; CurrentNumber = 0; + } + + printf("\n\nExported symbols by member:\n"); + + // Loop through library + while (CurrentOffset + sizeof(SUNIXLibraryHeader) < DataSize) { + + // Reset buffers + StringBuffer.SetSize(0); + MemberBuffer.Reset(); + StringEntries.SetNum(0); + + // Get member name + MemberName = ExtractMember(&MemberBuffer); + if (MemberName == 0) break; + printf("\nMember %s", MemberName); + MemberBuffer.FileName = MemberName; + + // Detect file type of member + MemberFileType = MemberBuffer.GetFileType(); + + WordSize = MemberBuffer.WordSize; + printf (" - %s", GetFileFormatName(MemberFileType)); + if (WordSize) { + printf("-%i", MemberBuffer.WordSize); + } + else { + printf(". Type not specified. Possibly alias record"); + } + + // Get symbol table for specific file type + switch (MemberFileType) { + case FILETYPE_ELF: + if (WordSize == 32) { + // Make instance of file parser, 32 bit template + CELF elf; + MemberBuffer >> elf; // Transfer MemberBuffer to elf object + elf.PublicNames(&StringBuffer, &StringEntries, 0); + break; + } + else { + // Make instance of file parser, 64 bit template + CELF elf; + MemberBuffer >> elf; // Transfer MemberBuffer to elf object + elf.PublicNames(&StringBuffer, &StringEntries, 0); + break; + } + + case FILETYPE_COFF: { + CCOFF coff; + MemberBuffer >> coff; // Transfer MemberBuffer to coff object + coff.PublicNames(&StringBuffer, &StringEntries, 0); + break;} + + case FILETYPE_MACHO_LE: + if (WordSize == 32) { + // Make instance of file parser, 32 bit template + CMACHO mac; + MemberBuffer >> mac; // Transfer MemberBuffer to coff object + mac.PublicNames(&StringBuffer, &StringEntries, 0); + break; + } + else { + // Make instance of file parser, 64 bit template + CMACHO mac; + MemberBuffer >> mac; // Transfer MemberBuffer to coff object + mac.PublicNames(&StringBuffer, &StringEntries, 0); + break; + } + + case IMPORT_LIBRARY_MEMBER: { + // This is an import library + char * name1 = MemberBuffer.Buf() + 20; + printf("\n Import %s from %s", name1, name1 + strlen(name1) + 1); + break;} + + default: + printf("\n Cannot extract symbol names from this file type"); break; - } - - case IMPORT_LIBRARY_MEMBER: { - // This is an import library - char * name1 = MemberBuffer.Buf() + 20; - printf("\n Import %s from %s", name1, name1 + strlen(name1) + 1); - break;} - - default: - printf("\n Cannot extract symbol names from this file type"); - break; - } - - // Loop through table of public names - for (uint32 i = 0; i < StringEntries.GetNumEntries(); i++) { - uint32 j = StringEntries[i].String; - printf("\n %s", StringBuffer.Buf() + j); - } - } + } + + // Loop through table of public names + for (uint32 i = 0; i < StringEntries.GetNumEntries(); i++) { + uint32 j = StringEntries[i].String; + printf("\n %s", StringBuffer.Buf() + j); + } + } } uint32 CLibrary::NextHeader(uint32 Offset) { - // Loop through library headers. - // Input = current offset. Output = next offset - SUNIXLibraryHeader * Header; // Member header - int32 MemberSize; // Size of member - //uint32 HeaderExtra = 0; // Extra added to size of header - uint32 NextOffset; // Offset of next header - - if (Offset + sizeof(SUNIXLibraryHeader) >= DataSize) { - // No more members - return 0; - } - // Find header - Header = &Get(Offset); - - // Size of member - MemberSize = atoi(Header->FileSize); - if (MemberSize < 0 || MemberSize + Offset + sizeof(SUNIXLibraryHeader) > DataSize) { - err.submit(2500); // Points outside file - return 0; - } - if (strncmp(Header->Name, "#1/", 3) == 0) { - // Name refers to long name after the header - // This variant is used by Mac and some versions of BSD. - // HeaderExtra is included in MemberSize: - // HeaderExtra = atoi(Header->Name+3); - } - - // Get next offset - NextOffset = Offset + sizeof(SUNIXLibraryHeader) + MemberSize; - // Round up to align by 2 - NextOffset = (NextOffset + 1) & ~ 1; - // Check if last - if (NextOffset >= DataSize) NextOffset = 0; - return NextOffset; + // Loop through library headers. + // Input = current offset. Output = next offset + SUNIXLibraryHeader * Header; // Member header + int32 MemberSize; // Size of member + //uint32 HeaderExtra = 0; // Extra added to size of header + uint32 NextOffset; // Offset of next header + + if (Offset + sizeof(SUNIXLibraryHeader) >= DataSize) { + // No more members + return 0; + } + // Find header + Header = &Get(Offset); + + // Size of member + MemberSize = atoi(Header->FileSize); + if (MemberSize < 0 || MemberSize + Offset + sizeof(SUNIXLibraryHeader) > DataSize) { + err.submit(2500); // Points outside file + return 0; + } + if (strncmp(Header->Name, "#1/", 3) == 0) { + // Name refers to long name after the header + // This variant is used by Mac and some versions of BSD. + // HeaderExtra is included in MemberSize: + // HeaderExtra = atoi(Header->Name+3); + } + + // Get next offset + NextOffset = Offset + sizeof(SUNIXLibraryHeader) + MemberSize; + // Round up to align by 2 + NextOffset = (NextOffset + 1) & ~ 1; + // Check if last + if (NextOffset >= DataSize) NextOffset = 0; + return NextOffset; } void CLibrary::StartExtracting() { - // Initialize before ExtractMember() - if (cmd.InputType == FILETYPE_OMFLIBRARY) { - SOMFRecordPointer rec; // OMF records - rec.Start(Buf(), 0, GetDataSize()); // Initialize record pointer - if (rec.Type2 != OMF_LIBHEAD) { - err.submit(2500); return; // This should not happen - } - // Read library header - DictionaryOffset = rec.GetDword(); // Read dictionary offset - DictionarySize = rec.GetWord(); // Read dictionary size - rec.GetByte(); // Read flag - // Page size / alignment for members - PageSize = rec.End + 1; - uint32 align = 1 << FloorLog2(PageSize); // Make power of 2 - if (PageSize != align) { - err.submit(2601, PageSize); // Error: not a power of 2 - } - CurrentOffset = PageSize; // Offset to first library member - } - else { - // Unix style library. First header at offset 8 - CurrentOffset = 8; - } - // Current member number - CurrentNumber = 0; + // Initialize before ExtractMember() + if (cmd.InputType == FILETYPE_OMFLIBRARY) { + SOMFRecordPointer rec; // OMF records + rec.Start(Buf(), 0, GetDataSize()); // Initialize record pointer + if (rec.Type2 != OMF_LIBHEAD) { + err.submit(2500); return; // This should not happen + } + // Read library header + DictionaryOffset = rec.GetDword(); // Read dictionary offset + DictionarySize = rec.GetWord(); // Read dictionary size + rec.GetByte(); // Read flag + // Page size / alignment for members + PageSize = rec.End + 1; + uint32 align = 1 << FloorLog2(PageSize); // Make power of 2 + if (PageSize != align) { + err.submit(2601, PageSize); // Error: not a power of 2 + } + CurrentOffset = PageSize; // Offset to first library member + } + else { + // Unix style library. First header at offset 8 + CurrentOffset = 8; + } + // Current member number + CurrentNumber = 0; } -const char * CLibrary::ExtractMember(CFileBuffer * Destination) { - // Extract library member - // Dispatch according to library type - if (cmd.InputType == FILETYPE_OMFLIBRARY || cmd.InputType == FILETYPE_OMF) { - return ExtractMemberOMF(Destination); - } - else { - return ExtractMemberUNIX(Destination); - } +char * CLibrary::ExtractMember(CFileBuffer * Destination) { + // Extract library member + // Dispatch according to library type + if (cmd.InputType == FILETYPE_OMFLIBRARY || cmd.InputType == FILETYPE_OMF) { + return ExtractMemberOMF(Destination); + } + else { + return ExtractMemberUNIX(Destination); + } } -const char * CLibrary::ExtractMemberOMF(CFileBuffer * Destination) { - // Extract member of OMF style library +char * CLibrary::ExtractMemberOMF(CFileBuffer * Destination) { + // Extract member of OMF style library - uint32 RecordEnd; // End of OMF record - SOMFRecordPointer rec; // Current OMF record - const char * MemberName = 0; // Name of library member - uint32 MemberStart = 0; // Start of member - uint32 MemberEnd = 0; // End of member + uint32 RecordEnd; // End of OMF record + SOMFRecordPointer rec; // Current OMF record + char * MemberName = 0; // Name of library member + uint32 MemberStart = 0; // Start of member + uint32 MemberEnd = 0; // End of member - if (CurrentOffset >= DictionaryOffset) return 0;// No more members + if (CurrentOffset >= DictionaryOffset) return 0;// No more members - rec.Start(Buf(), CurrentOffset, DictionaryOffset);// Initialize record pointer + rec.Start(Buf(), CurrentOffset, DictionaryOffset);// Initialize record pointer - // Loop through the records of all OMF modules - do { - // Check record type - switch (rec.Type2) { + // Loop through the records of all OMF modules + do { + // Check record type + switch (rec.Type2) { - case OMF_THEADR: // Module header. Member starts here - MemberName = rec.GetString(); // Get name - MemberStart = rec.FileOffset; // Get start address - break; + case OMF_THEADR: // Module header. Member starts here + MemberName = rec.GetString(); // Get name + MemberStart = rec.FileOffset; // Get start address + break; - case OMF_MODEND: // Member ends here. - RecordEnd = rec.FileOffset + rec.End +1;// End of record - MemberEnd = RecordEnd; // = member end address + case OMF_MODEND: // Member ends here. + RecordEnd = rec.FileOffset + rec.End +1;// End of record + MemberEnd = RecordEnd; // = member end address - // Save member as raw data - if (Destination) { - Destination->SetSize(0); // Make sure destination buffer is empty - Destination->FileType = Destination->WordSize = 0; - Destination->Push(Buf() + MemberStart, MemberEnd - MemberStart); - } + // Save member as raw data + if (Destination) { + Destination->SetSize(0); // Make sure destination buffer is empty + Destination->FileType = Destination->WordSize = 0; + Destination->Push(Buf() + MemberStart, MemberEnd - MemberStart); + } - // Align next member by PageSize; - rec.GetNext(PageSize); - CurrentOffset = rec.FileOffset; + // Align next member by PageSize; + rec.GetNext(PageSize); + CurrentOffset = rec.FileOffset; - // Check name - if (MemberName[0] == 0) MemberName = "NoName!"; + // Check name + //!!if (MemberName[0] == 0) MemberName = (char*)"NoName!"; - // Return member name - return MemberName; + // Return member name + return MemberName; - case OMF_LIBEND: // Last member should end here - RecordEnd = rec.FileOffset + rec.End + 1;// End of record - if (RecordEnd != DictionaryOffset) err.submit(2602); + case OMF_LIBEND: // Last member should end here + RecordEnd = rec.FileOffset + rec.End + 1;// End of record + if (RecordEnd != DictionaryOffset) err.submit(2602); - // No more members: - return 0; - } - } // Go to next record - while (rec.GetNext()); // End of loop through records + // No more members: + return 0; + } + } // Go to next record + while (rec.GetNext()); // End of loop through records - err.submit(2610); // Library end record not found - return 0; + err.submit(2610); // Library end record not found + return 0; } -const char * CLibrary::ExtractMemberUNIX(CFileBuffer * Destination) { - // Extract member of UNIX style library - // This function is called repeatedly to get each member of library/archive - SUNIXLibraryHeader * Header = 0; // Member header - uint32 MemberSize = 0; // Size of member - uint32 HeaderExtra = 0; // Extra added to size of header - uint32 NameIndex; // Index into long names member - char * Name = 0; // Name of member - int Skip = 1; // Skip record and search for next - int i; // Loop counter - char * p; // Used for loop through string - - if (CurrentOffset == 0 || CurrentOffset + sizeof(SUNIXLibraryHeader) >= DataSize) { - // No more members - return 0; - } - - // Search for member - while (Skip && CurrentOffset) { - HeaderExtra = 0; - // Extract next library member from input library - Header = &Get(CurrentOffset); - // Size of member - MemberSize = (uint32)atoi(Header->FileSize); - if (MemberSize + CurrentOffset + sizeof(SUNIXLibraryHeader) > DataSize) { - err.submit(2500); // Points outside file - return 0; - } - // Member name - Name = Header->Name; - if (strncmp(Name, "// ", 3) == 0) { - // This is the long names member. Remember its position - LongNames = CurrentOffset + sizeof(SUNIXLibraryHeader); - LongNamesSize = MemberSize; - // The long names are terminated by '/' or 0, depending on system, - // but may contain non-terminating '/'. Find out which type we have: - // Pointer to LongNames record - p = Buf() + LongNames; - // Find out whether we have terminating zeroes: - if ((LongNamesSize > 1 && p[LongNamesSize-1] == '/') || (p[LongNamesSize-1] <= ' ' && p[LongNamesSize-2] == '/')) { - // Names are terminated by '/'. Replace all '/' by 0 in the longnames record - for (uint32 j = 0; j < LongNamesSize; j++, p++) { - if (*p == '/') *p = 0; +char * CLibrary::ExtractMemberUNIX(CFileBuffer * Destination) { + // Extract member of UNIX style library + // This function is called repeatedly to get each member of library/archive + SUNIXLibraryHeader * Header = 0; // Member header + uint32 MemberSize = 0; // Size of member + uint32 HeaderExtra = 0; // Extra added to size of header + uint32 NameIndex; // Index into long names member + char * Name = 0; // Name of member + int Skip = 1; // Skip record and search for next + int i; // Loop counter + char * p; // Used for loop through string + + if (CurrentOffset == 0 || CurrentOffset + sizeof(SUNIXLibraryHeader) >= DataSize) { + // No more members + return 0; + } + + // Search for member + while (Skip && CurrentOffset) { + HeaderExtra = 0; + // Extract next library member from input library + Header = &Get(CurrentOffset); + // Size of member + MemberSize = (uint32)atoi(Header->FileSize); + if (MemberSize + CurrentOffset + sizeof(SUNIXLibraryHeader) > DataSize) { + err.submit(2500); // Points outside file + return 0; + } + // Member name + Name = Header->Name; + if (strncmp(Name, "// ", 3) == 0) { + // This is the long names member. Remember its position + LongNames = CurrentOffset + sizeof(SUNIXLibraryHeader); + LongNamesSize = MemberSize; + // The long names are terminated by '/' or 0, depending on system, + // but may contain non-terminating '/'. Find out which type we have: + // Pointer to LongNames record + p = Buf() + LongNames; + // Find out whether we have terminating zeroes: + if ((LongNamesSize > 1 && p[LongNamesSize-1] == '/') || (p[LongNamesSize-1] <= ' ' && p[LongNamesSize-2] == '/')) { + // Names are terminated by '/'. Replace all '/' by 0 in the longnames record + for (uint32 j = 0; j < LongNamesSize; j++, p++) { + if (*p == '/') *p = 0; + } + } + } + else if (strncmp(Name, "/ ", 2) == 0 + || strncmp(Name, "__.SYMDEF", 9) == 0) { + // This is a symbol index member. + // The symbol index is not used because we are always building a new symbol index. + } + else if (Name[0] == '/' && Name[1] >= '0' && Name[1] <= '9' && LongNames) { + // Name contains index into LongNames record + NameIndex = atoi(Name+1); + if (NameIndex < LongNamesSize) { + Name = Buf() + LongNames + NameIndex; + } + else { + Name = (char*)"NoName!"; } - } - } - else if (strncmp(Name, "/ ", 2) == 0 - || strncmp(Name, "__.SYMDEF", 9) == 0) { - // This is a symbol index member. - // The symbol index is not used because we are always building a new symbol index. - } - else if (Name[0] == '/' && Name[1] >= '0' && Name[1] <= '9' && LongNames) { - // Name contains index into LongNames record - NameIndex = atoi(Name+1); - if (NameIndex < LongNamesSize) { - Name = Buf() + LongNames + NameIndex; - } - else { - Name = (char*)"NoName!"; - } - Skip = 0; - } - else if (strncmp(Name, "#1/", 3) == 0) { - // Name refers to long name after the header - // This variant is used by Mac and some versions of BSD - HeaderExtra = atoi(Name+3); - Name += sizeof(SUNIXLibraryHeader); - if (MemberSize > HeaderExtra) { - // The length of the name, HeaderExtra, is included in the - // Header->FileSize field. Subtract to get the real file size - MemberSize -= HeaderExtra; - } - if (strncmp(Name, "__.SYMDEF", 9) == 0) { - // Symbol table "__.SYMDEF SORTED" as long name - Skip = 1; - } - else { Skip = 0; - } - } - else { - // Ordinary short name - // Name may be terminated by '/' or space. Replace termination char by 0 - for (i = 15; i >= 0; i--) { - if (Name[i] == ' ' || Name[i] == '/') Name[i] = 0; - else break; - } - // Terminate name with max length by overwriting Date field, which we are not using - Name[16] = 0; - Skip = 0; - } - // Point to next member - CurrentOffset = NextHeader(CurrentOffset); - // Increment number - CurrentNumber += !Skip; - } // End of while loop - - // Save member as raw data - if (Destination) { - Destination->SetSize(0); // Make sure destination buffer is empty - Destination->FileType = Destination->WordSize = 0; - Destination->Push((int8*)Header + sizeof(SUNIXLibraryHeader) + HeaderExtra, MemberSize); - } - - // Check name - if (Name[0] == 0) Name = (char*)"NoName!"; - - // Return member name - return Name; + } + else if (strncmp(Name, "#1/", 3) == 0) { + // Name refers to long name after the header + // This variant is used by Mac and some versions of BSD + HeaderExtra = atoi(Name+3); + Name += sizeof(SUNIXLibraryHeader); + if (MemberSize > HeaderExtra) { + // The length of the name, HeaderExtra, is included in the + // Header->FileSize field. Subtract to get the real file size + MemberSize -= HeaderExtra; + } + if (strncmp(Name, "__.SYMDEF", 9) == 0) { + // Symbol table "__.SYMDEF SORTED" as long name + Skip = 1; + } + else { + Skip = 0; + } + } + else { + // Ordinary short name + // Name may be terminated by '/' or space. Replace termination char by 0 + for (i = 15; i >= 0; i--) { + if (Name[i] == ' ' || Name[i] == '/') Name[i] = 0; + else break; + } + // Terminate name with max length by overwriting Date field, which we are not using + Name[16] = 0; + Skip = 0; + } + // Point to next member + CurrentOffset = NextHeader(CurrentOffset); + // Increment number + CurrentNumber += !Skip; + } // End of while loop + + // Save member as raw data + if (Destination) { + Destination->SetSize(0); // Make sure destination buffer is empty + Destination->FileType = Destination->WordSize = 0; + Destination->Push((int8*)Header + sizeof(SUNIXLibraryHeader) + HeaderExtra, MemberSize); + } + + // Check name + if (Name[0] == 0) Name = (char*)"NoName!"; + + // Return member name + return Name; } void CLibrary::InsertMember(CFileBuffer * member) { - // Add member to output library - if (cmd.OutputType == FILETYPE_OMF) { - InsertMemberOMF(member); // OMF style output library - } - else { - InsertMemberUNIX(member); // UNIX style output library - } + // Add member to output library + if (cmd.OutputType == FILETYPE_OMF) { + InsertMemberOMF(member); // OMF style output library + } + else { + InsertMemberUNIX(member); // UNIX style output library + } } void CLibrary::InsertMemberOMF(CFileBuffer * member) { - // Add member to OMF library + // Add member to OMF library - // Check file type - if (member->GetFileType() != FILETYPE_OMF) err.submit(9000); + // Check file type + if (member->GetFileType() != FILETYPE_OMF) err.submit(9000); - // Get word size - WordSize = member->WordSize; + // Get word size + WordSize = member->WordSize; - // Store offset - uint32 offset = DataBuffer.GetDataSize(); - Indexes.Push(offset); + // Store offset + uint32 offset = DataBuffer.GetDataSize(); + Indexes.Push(offset); - // Store member - DataBuffer.Push(member->Buf(), member->GetDataSize()); - DataBuffer.Align(PageSize); + // Store member + DataBuffer.Push(member->Buf(), member->GetDataSize()); + DataBuffer.Align(PageSize); - // Member index - uint32 mindex = Indexes.GetNumEntries() - 1; + // Member index + uint32 mindex = Indexes.GetNumEntries() - 1; - // Get public string table - COMF omf; - *member >> omf; // Translate member to class OMF - omf.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names - *member << omf; // Return buffer to member + // Get public string table + COMF omf; + *member >> omf; // Translate member to class OMF + omf.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names + *member << omf; // Return buffer to member } void CLibrary::InsertMemberUNIX(CFileBuffer * member) { - // Add next library member to output library - uint32 RawSize = 0; // Size of binary file - uint32 AlignmentPadding = 0; // Padding after file - - // Get word size - WordSize = member->WordSize; - - // Make member header - SUNIXLibraryHeader header; - memset(&header, ' ', sizeof(SUNIXLibraryHeader)); // Fill with spaces - - // Name of member - if (member->OutputFileName == 0 || *member->OutputFileName == 0) member->OutputFileName = member->FileName; - char * name = FixMemberNameUNIX(member->OutputFileName); - - // Set length of member string after header - int NameLength = 0; - if (cmd.OutputType == FILETYPE_MACHO_LE) { - // Mach-O library stores name after header record. - // Name is zero padded to length NameLength = 20 - NameLength = 20; - strcpy(header.Name, "#1/20"); - } - else { - // ELF and COFF library store names < 16 characters in the name field - strncpy(header.Name, name, 16); - //memcpy (header.Name, name, 16); - } - // Date - sprintf(header.Date, "%u", (uint32)time(0)); - // User and group id - header.UserID[0] = '0'; - header.GroupID[0] = '0'; - // File mode - strcpy(header.FileMode, "100666"); - // Size of binary file - RawSize = member->GetDataSize(); - // Calculate alignment padding - if (AlignBy) { - AlignmentPadding = uint32(-int32(RawSize)) & (AlignBy-1); - } - - // File size including name string - sprintf(header.FileSize, "%u", NameLength + RawSize + AlignmentPadding); - - // Header end - header.HeaderEnd[0] = '`'; - header.HeaderEnd[1] = '\n'; - // Remove terminating zeroes - for (uint32 i = 0; i < sizeof(SUNIXLibraryHeader); i++) { - if (((char*)&header)[i] == 0) ((char*)&header)[i] = ' '; - } - - // Store offset - uint32 offset = DataBuffer.GetDataSize(); - Indexes.Push(offset); - - // Store member header - DataBuffer.Push(&header, sizeof(header)); - - // Store member name after header if Mach-O - if (NameLength) { - // Mach-O library stores name after header record. - char membernamebuffer[32]; - memset (membernamebuffer, 0, sizeof(membernamebuffer)); - strncpy (membernamebuffer, name, 16); - DataBuffer.Push(membernamebuffer, NameLength); - } - - // Store member - DataBuffer.Push(member->Buf(), RawSize); - - // Align by padding with '\n' - for (uint32 i = 0; i < AlignmentPadding; i++) { - DataBuffer.Push("\n", 1); - } - - // Member index - uint32 mindex = Indexes.GetNumEntries() - 1; - - // Get public string table - switch(member->GetFileType()) { - case FILETYPE_COFF: { - CCOFF coff; - *member >> coff; // Translate member to type COFF - coff.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names - *member << coff; // Return buffer to member - break;} - - case FILETYPE_OMF: { - COMF omf; - *member >> omf; // Translate member to type COFF - omf.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names - *member << omf; // Return buffer to member - break;} - - case FILETYPE_ELF: - if (WordSize == 32) { - // Make instance of file parser, 32 bit template - CELF elf; - *member >> elf; // Translate member to type ELF - elf.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names - *member << elf; // Return buffer to member - break; - } - else { - // Make instance of file parser, 64 bit template - CELF elf; - *member >> elf; // Translate member to type ELF - elf.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names - *member << elf; // Return buffer to member - break; - } - - case FILETYPE_MACHO_LE: - if (WordSize == 32) { - // Make instance of file parser, 32 bit template - CMACHO mac; - *member >> mac; // Translate member to type ELF - mac.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names - *member << mac; // Return buffer to member - break; - } - else { - // Make instance of file parser, 64 bit template - CMACHO mac; - *member >> mac; // Translate member to type ELF - mac.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names - *member << mac; // Return buffer to member - break; - } - - default: // Type not supported - err.submit(2501, GetFileFormatName(member->GetFileType())); - break; - } -} + // Add next library member to output library + uint32 RawSize = 0; // Size of binary file + uint32 AlignmentPadding = 0; // Padding after file + char * name = 0; // Name of member + int NameLength = 0; // length of name + int NameAfter = 0; // length of name after MachO header + int i; // loop counter, index + + // Get word size + WordSize = member->WordSize; + + // Make member header + SUNIXLibraryHeader header; + memset(&header, ' ', sizeof(SUNIXLibraryHeader)); // Fill with spaces + + // Name of member + if (member->OutputFileName == 0 || *member->OutputFileName == 0) member->OutputFileName = member->FileName; + + if (cmd.LibrarySubtype == LIBTYPE_SHORTNAMES) { + // Make short name + name = ShortenMemberName(member->OutputFileName); + } + else { + // Remove path from library member name. Original long name is overwritten + name = StripMemberName((char*)(member->OutputFileName)); + } + NameLength = strlen(name); + + if (cmd.OutputType == FILETYPE_MACHO_LE && cmd.LibrarySubtype != LIBTYPE_SHORTNAMES) { + // Mach-O library stores name after header record. + // Name is zero padded to length 4 modulo 8 to align by 8 + int pad = 8 - ((NameLength + 4) & 7); + NameAfter = NameLength + pad; + sprintf(header.Name, "#1/%i ", NameAfter); + } + else { + // ELF and COFF library store names < 16 characters in the name field + if (NameLength < 16) { + // (Don't use sprintf to write header.Name here: It seems that Gnu sprintf checks the size of the + // buffer it is writing to. Gives buffer overrun error when termniating zero goes beyond the name field) + memset(header.Name, ' ', 16); + memcpy(header.Name, name, NameLength); + header.Name[NameLength] = '/'; + } + else { + // store in LongNamesBuffer + if (cmd.OutputType == FILETYPE_COFF) { + // COFF: Name is zero-terminated + i = LongNamesBuffer.PushString(name); + } + else { + // ELF: Name terminated by "/\n" + i = LongNamesBuffer.Push(name, NameLength); + LongNamesBuffer.Push("/\n", 2); + } + // store index into long names member + sprintf(header.Name, "/%i ", i); + } + } + + // Date + sprintf(header.Date, "%u ", (uint32)time(0)); + + // User and group id + header.UserID[0] = '0'; + header.GroupID[0] = '0'; + // File mode + strcpy(header.FileMode, "100666"); + // Size of binary file + RawSize = member->GetDataSize(); + // Calculate alignment padding + if (AlignBy) { + AlignmentPadding = uint32(-int32(RawSize)) & (AlignBy-1); + } + + // File size including name string + sprintf(header.FileSize, "%u ", NameAfter + RawSize + AlignmentPadding); + + // Header end + header.HeaderEnd[0] = '`'; + header.HeaderEnd[1] = '\n'; + + // Remove terminating zeroes + for (uint32 i = 0; i < sizeof(SUNIXLibraryHeader); i++) { + if (((char*)&header)[i] == 0) ((char*)&header)[i] = ' '; + } + + // Store offset + uint32 offset = DataBuffer.GetDataSize(); + Indexes.Push(offset); + + // Store member header + DataBuffer.Push(&header, sizeof(header)); + + if (cmd.OutputType == FILETYPE_MACHO_LE) { + // Store member name after header if Mach-O + if (NameAfter) { + // Mach-O library stores name after header record. + DataBuffer.PushString(name); + } + DataBuffer.Align(AlignBy); + } + + // Store member + DataBuffer.Push(member->Buf(), RawSize); + + // Align by padding with '\n' + for (uint32 i = 0; i < AlignmentPadding; i++) { + DataBuffer.Push("\n", 1); + } + + // Member index + uint32 mindex = Indexes.GetNumEntries() - 1; + + // Get public string table + switch(member->GetFileType()) { + case FILETYPE_COFF: { + CCOFF coff; + *member >> coff; // Translate member to type COFF + coff.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names + *member << coff; // Return buffer to member + break;} + + case FILETYPE_OMF: { + COMF omf; + *member >> omf; // Translate member to type COFF + omf.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names + *member << omf; // Return buffer to member + break;} + + case FILETYPE_ELF: + if (WordSize == 32) { + // Make instance of file parser, 32 bit template + CELF elf; + *member >> elf; // Translate member to type ELF + elf.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names + *member << elf; // Return buffer to member + break; + } + else { + // Make instance of file parser, 64 bit template + CELF elf; + *member >> elf; // Translate member to type ELF + elf.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names + *member << elf; // Return buffer to member + break; + } + case FILETYPE_MACHO_LE: + if (WordSize == 32) { + // Make instance of file parser, 32 bit template + CMACHO mac; + *member >> mac; // Translate member to type ELF + mac.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names + *member << mac; // Return buffer to member + break; + } + else { + // Make instance of file parser, 64 bit template + CMACHO mac; + *member >> mac; // Translate member to type ELF + mac.PublicNames(&StringBuffer, &StringEntries, mindex); // Make list of public names + *member << mac; // Return buffer to member + break; + } -char * CLibrary::TruncateMemberName(char const * name) { - // Remove path and truncate object file name to 15 characters - // This function removes any path from the member name, - // changes the extension to the default for the the output file type, - // changes any spaces to underscores, and - // truncates the member name to 15 characters for the sake of compatibility. - // The return value is an ASCII string in a static buffer - static char TruncName[32]; // Truncated name - int maxlen; // Max length, not including extension - char const * p1; // Point to start of name without path - char const * extension; // Default extension for file type - int i; // Loop counter - int len; // String length - static int DummyNumber = 0; // Count invalid/null names - int FileType; // File type - - // Remove path - len = (int)strlen(name); p1 = name; - for (i = len-1; i >= 0; i--) { - if (name[i] == '/' || name[i] == '\\' || name[i] == ':') { - p1 = name + i + 1; break; - } - } - // Remove extension - len = (int)strlen(p1); - for (i = len-1; i >= 0; i--) { - if (p1[i] == '.') { - len = i; break; - } - } - - // Check if any name remains - if (len == 0) { // No name. Make one - sprintf(TruncName, "NoName%i", ++DummyNumber); - p1 = TruncName; len = (int)strlen(p1); - } - - // Get file type - FileType = cmd.OutputType; - if (FileType == CMDL_OUTPUT_DUMP || FileType == 0) FileType = cmd.InputType; - if (FileType >= FILETYPE_LIBRARY) FileType = cmd.MemberType; - - // Get default extension and max length of name without extension - if (FileType == FILETYPE_COFF || FileType == FILETYPE_OMF) { - maxlen = 11; extension = ".obj"; - } - else { - maxlen = 13; extension = ".o"; - } - if (len > maxlen) len = maxlen; - - // Truncate name - strncpy(TruncName, p1, len); - TruncName[len] = 0; - - // Remove any spaces or other illegal characters - len = (int)strlen(TruncName); - for (i = 0; i < len; i++) { - if ((uint8)TruncName[i] <= 0x20) TruncName[i] = '_'; - } - - // Add default extension - strcpy(TruncName+strlen(TruncName), extension); - - // Terminate - TruncName[15] = 0; - return TruncName; + default: // Type not supported + err.submit(2501, GetFileFormatName(member->GetFileType())); + break; + } } - -char * CLibrary::FixMemberNameOMF(char const *name) { - // Truncate library member name to 15 characters and make unique - uint32 i; // Loop counter - uint32 IsDuplicate = 0; // Name is duplicate - uint32 Len; // String length - uint32 n; // Number appended to name - uint32 np; // Position of number in case number is appended to name - static char FixedName[32]; // Modified name - - // Truncate name and copy to FixedName buffer - strcpy(FixedName, TruncateMemberName(name)); - - // Find extension - Len = (uint32)strlen(FixedName); - for (np = 0; np < Len; np++) if (FixedName[np] == '.') break; - // Where to place number in case number is appended to name - if (np > 8) np = 8; - - // Loop to find unique name - while (1) { - IsDuplicate = 0; - // Check if unique - for (i = 0; i < StringEntries.GetNumEntries(); i++) { - if (strcmp(FixedName, StringBuffer.Buf() + StringEntries[i].String) == 0) { - // Duplicate name found - IsDuplicate = 1; +/* unused: +char * CLibrary::TruncateMemberName(char const * name) { + // Remove path and truncate object file name to 15 characters + // This function removes any path from the member name, + // changes the extension to the default for the the output file type, + // changes any spaces to underscores, and + // truncates the member name to 15 characters for the sake of compatibility. + // The return value is an ASCII string in a static buffer + static char TruncName[32]; // Truncated name + int maxlen; // Max length, not including extension + char const * p1; // Point to start of name without path + char const * extension; // Default extension for file type + int i; // Loop counter + int len; // String length + static int DummyNumber = 0; // Count invalid/null names + int FileType; // File type + + // Remove path + len = (int)strlen(name); p1 = name; + for (i = len-1; i >= 0; i--) { + if (name[i] == '/' || name[i] == '\\' || name[i] == ':') { + p1 = name + i + 1; break; + } + } + // Remove extension + len = (int)strlen(p1); + for (i = len-1; i >= 0; i--) { + if (p1[i] == '.') { + len = i; break; + } + } + + // Check if any name remains + if (len == 0) { // No name. Make one + sprintf(TruncName, "NoName%i", ++DummyNumber); + p1 = TruncName; len = (int)strlen(p1); + } + + // Get file type + FileType = cmd.OutputType; + if (FileType == CMDL_OUTPUT_DUMP || FileType == 0) FileType = cmd.InputType; + if (FileType >= FILETYPE_LIBRARY) FileType = cmd.MemberType; + + // Get default extension and max length of name without extension + if (FileType == FILETYPE_COFF || FileType == FILETYPE_OMF) { + maxlen = 11; extension = ".obj"; + } + else { + maxlen = 13; extension = ".o"; + } + if (len > maxlen) len = maxlen; + + // Truncate name + strncpy(TruncName, p1, len); + TruncName[len] = 0; + + // Remove any spaces or other illegal characters + len = (int)strlen(TruncName); + for (i = 0; i < len; i++) { + if ((uint8)TruncName[i] <= 0x20) TruncName[i] = '_'; + } + + // Add default extension + strcpy(TruncName+strlen(TruncName), extension); + + // Terminate + TruncName[15] = 0; + return TruncName; +} +*/ + +char * CLibrary::StripMemberName(char * name) { + // Remove path from zero-terminated library member name and set extension to default. + // Note: Original long name is overwritten + char * p1; // Point to start of name without path + const char * extension = 0; // Default extension for file type + int i; // Loop counter + int len0; // Original string length + int len; // String length + int nlen; // length of name without extension + int elen = 0; // length of extension + static int DummyNumber = 0; // Count invalid/null names + int FileType; // File type + + // Length + len0 = len = (int)strlen(name); + + // Remove path + p1 = name; + for (i = len-1; i >= 0; i--) { + if (name[i] == '/' || name[i] == '\\' || name[i] == ':') { + p1 = name + i + 1; break; + } + } + // move to begin of buffer + if (p1 > name) { + strcpy(name, p1); + } + + // Get file type + if (cmd.MemberType) { + FileType = cmd.MemberType; + } + else if (cmd.LibraryOptions & CMDL_LIBRARY_EXTRACTMEM) { + FileType = cmd.InputType; + } + else { + FileType = cmd.OutputType; + } + if (FileType == CMDL_OUTPUT_DUMP || FileType == 0) FileType = cmd.InputType; + if (FileType >= FILETYPE_LIBRARY) FileType = cmd.MemberType; + + // Get default extension and max length of name without extension + if (FileType == FILETYPE_COFF || FileType == FILETYPE_OMF) { + extension = ".obj"; elen = 4; + } + else if (FileType == FILETYPE_ELF || FileType == FILETYPE_MACHO_LE || FileType == FILETYPE_MACHO_BE) { + extension = ".o"; elen = 2; + } + + // find extension + len = (int)strlen(name); + for (nlen = len-1; nlen >= 0; nlen--) { + if (name[nlen] == '.') { break; - } - } - if (!IsDuplicate) break; // Name is unique - - // Name is duplicate. Modify name. - n = atoi(FixedName+np); // Get any number in the end of name - sprintf(FixedName+np, "%i.obj", n+1); // .. and add 1. Append extension - } - return FixedName; + } + } + + // Remove any spaces or other illegal characters + len = (int)strlen(name); + for (i = 0; i < nlen; i++) { + if ((uint8)name[i] <= 0x20 || name[i] == '.') name[i] = '_'; + } + + // Check if any name remains + if ((len == 0 && len0 > 12) || nlen == 0) { // No name. Make one + sprintf(name, "NoName%i", ++DummyNumber); + len = (int)strlen(name); + } + + // Replace extension + if (len + elen <= len0 && extension != 0) { + strcpy(name + nlen, extension); + } + // Terminate + return name; } -char * CLibrary::FixMemberNameUNIX(char const * name) { - // This function does the same as TruncateMemberName(name). - // In addition, it makes the name unique and terminates it with a '/' - - static char TruncName[32]; // Store truncated name - uint32 len, maxlen; // Length and maximum length of name - char const * extension; // Default extension for file type - uint32 i, n; // Temporary - uint32 np; // Position of number in case number is appended to name - - strcpy(TruncName, TruncateMemberName(name)); // Truncate name - TruncName[16] = 0; - - // Get default extension and max length of name without extension - if (cmd.OutputType == FILETYPE_COFF || cmd.OutputType == FILETYPE_OMF) { - maxlen = 11; extension = ".obj"; - } - else { - maxlen = 13; extension = ".o"; - } - - // Find extension - len = (uint32)strlen(TruncName); - for (np = 0; np < len; np++) if (TruncName[np] == '.') break; - // Where to place number in case number is appended to name - if (np > maxlen - 3) np = maxlen - 3; - - // Check if another member has the same truncated name - while (MemberNameExistsUNIX(TruncName)) { - // Another member has the same name. Make name unique - n = atoi(TruncName+np); // Get any number in the end of name - // Increment number and re-insert extension - sprintf(TruncName+np, "%i%s", n+1, extension); - } - - // Terminate - len = (int)strlen(TruncName); - TruncName[len] = '/'; // Terminate with '/' - if (cmd.OutputType == FILETYPE_MACHO_LE) { - // Mach-O library stores name differently - TruncName[len] = 0; // Terminate with 0 - } - - for (i = len+1; i < 16; i++) TruncName[i] = ' '; // Pad with spaces - TruncName[16] = 0; // Terminate with 0 - - return TruncName; -} +char * CLibrary::ShortenMemberName(char const *name) { + // Truncate library member name to 15 characters and make unique + // The path is removed and the extension set to default. + // The original long name is not overwritten + static char fixedName[32]; // Modified name + char const * p1; // Point to start of name without path + char const * extension; // Default extension for file type + int i; // Loop counter + int len; // Filename length + int len0; // Filename length without extension + int elen; // length of extension + static int RunningNumber = 0; // Enumerate truncated names + int FileType; // File type + + // Length + len = (int)strlen(name); + + // Skip path + p1 = name; + for (i = len-1; i >= 0; i--) { + if (name[i] == '/' || name[i] == '\\' || name[i] == ':') { + p1 = name + i + 1; break; + } + } + len = (int)strlen(name); + + // move to static buffer + if (len > 15) len = 15; + memcpy(fixedName, p1, len); + fixedName[len] = 0; + + // find extension + for (i = len-1; i >= 0; i--) { + if (fixedName[i] == '.') { + fixedName[i] = 0; break; + } + } + // length without extension + len0 = (int)strlen(fixedName); + + // Remove any spaces or other illegal characters + for (i = 0; i < len0; i++) { + if ((uint8)fixedName[i] <= 0x20 || fixedName[i] == '.') fixedName[i] = '_'; + } + + // Check if any name remains + if (len0 == 0) { // No name. Make one + sprintf(fixedName, "NoName_%X", RunningNumber++); + len0 = (int)strlen(fixedName); + } + + // Get file type + FileType = cmd.OutputType; + if (FileType == CMDL_OUTPUT_DUMP || FileType == 0) FileType = cmd.InputType; + if (FileType >= FILETYPE_LIBRARY) FileType = cmd.MemberType; + + // Get default extension and max length of name without extension + if (FileType == FILETYPE_COFF || FileType == FILETYPE_OMF) { + extension = ".obj"; elen = 4; + } + else { + extension = ".o"; elen = 2; + } + + // Make unique and add extension + if (len0 + elen >= 15) { + // Name is truncated or possibly identical to some other truncated name. + // Insert 2-, 3- or 4-digit running hexadecimal number. + if (RunningNumber < 0x100) { + sprintf(fixedName + 12 - elen, "_%02X%s", RunningNumber++, extension); + } + else if (RunningNumber < 0x1000) { + sprintf(fixedName + 12 - elen, "%03X%s", RunningNumber++, extension); + } + else { + sprintf(fixedName + 11 - elen, "%04X%s", (RunningNumber++ & 0xFFFF), extension); + } + } + else { + // Short name. Just add extension + strcpy(fixedName + len0, extension); + } + + // Return static name buffer + return fixedName; +} +/* Unused: int CLibrary::MemberNameExistsUNIX(char * name) { - // Check if DataBuffer contains a member with this name - char Name1[20], Name2[20]; - uint32 i, j; - - // Terminate name without extension - memcpy(Name1, name, 16); - for (j = 0; j < 16; j++) { - if (Name1[j] == '.' || Name1[j] == '/') Name1[j] = 0; - } - - // Loop through previous members in DataBuffer - for (i = 0; i < Indexes.GetNumEntries(); i++) { - uint32 offset = Indexes[i]; - // Copy name of member i - memcpy(Name2, DataBuffer.Buf() + offset, 16); - // Terminate name2 - for (j = 0; j < 16; j++) { - if (Name2[j] == '.' || Name2[j] == '/') Name2[j] = 0; - } - // Case-insensitive compare of names - if (stricmp(Name1, Name2) == 0) { - // Identical name found - return i + 1; - } - } - // No identical name found - return 0; -} + // Check if DataBuffer contains a member with this name + char Name1[20], Name2[20]; + uint32 i, j; + + // Terminate name without extension + memcpy(Name1, name, 16); + for (j = 0; j < 16; j++) { + if (Name1[j] == '.' || Name1[j] == '/') Name1[j] = 0; + } + + // Loop through previous members in DataBuffer + for (i = 0; i < Indexes.GetNumEntries(); i++) { + uint32 offset = Indexes[i]; + // Copy name of member i + memcpy(Name2, DataBuffer.Buf() + offset, 16); + // Terminate name2 + for (j = 0; j < 16; j++) { + if (Name2[j] == '.' || Name2[j] == '/') Name2[j] = 0; + } + // Case-insensitive compare of names + if (stricmp(Name1, Name2) == 0) { + // Identical name found + return i + 1; + } + } + // No identical name found + return 0; +}*/ void CLibrary::SortStringTable() { - // Sort the string table in ASCII order - - // Length of table - int32 n = StringEntries.GetNumEntries(); - if (n <= 0) return; - - // Point to table of SStringEntry records - SStringEntry * Table = &StringEntries[0]; - // String pointers - char * s1, * s2; - // Temporary record for swapping - SStringEntry temp; - - // Simple Bubble sort: - int32 i, j; - for (i = 0; i < n; i++) { - for (j = 0; j < n - i - 1; j++) { - s1 = StringBuffer.Buf() + Table[j].String; - s2 = StringBuffer.Buf() + Table[j+1].String; - if (strcmp(s1, s2) > 0) { - // Swap records - temp = Table[j]; - Table[j] = Table[j+1]; - Table[j+1] = temp; - } - } - } - // Now StringEntries has been sorted. Reorder StringBuffer to the sort order. - CMemoryBuffer SortedStringBuffer; // Temporary buffer for strings in sort order - for (i = 0; i < n; i++) { - // Pointer to old string - s1 = StringBuffer.Buf() + Table[i].String; - // Update table to point to new string - Table[i].String = SortedStringBuffer.GetDataSize(); - // Put string into SortedStringBuffer - SortedStringBuffer.PushString(s1); - } - if (SortedStringBuffer.GetDataSize() != StringBuffer.GetDataSize()) { - // The two string buffers should be same size - err.submit(9000); return; - } - // Copy SortedStringBuffer into StringBuffer - memcpy(StringBuffer.Buf(), SortedStringBuffer.Buf(), StringBuffer.GetDataSize()); - - // Check for duplicate symbols - for (i = 0; i < n-1; i++) { - s1 = StringBuffer.Buf() + Table[i].String; - for (j = i + 1; j < n; j++) { - s2 = StringBuffer.Buf() + Table[j].String; - if (strcmp(s1,s2) == 0) { - // Duplicate found - // Compose error string "Modulename1 and Modulename2" - char ErrorModuleNames[64]; - strcpy(ErrorModuleNames, GetModuleName(Table[i].Member)); - strcpy(ErrorModuleNames + strlen(ErrorModuleNames), " and "); - strcpy(ErrorModuleNames + strlen(ErrorModuleNames), GetModuleName(Table[j].Member)); - // submit error message - err.submit(1214, s1, ErrorModuleNames); - // Prevent excessive messages - i++; - } - else { - break; - } - } - } + // Sort the string table in ASCII order + + // Length of table + int32 n = StringEntries.GetNumEntries(); + if (n <= 0) return; + + // Point to table of SStringEntry records + SStringEntry * Table = &StringEntries[0]; + // String pointers + char * s1, * s2; + // Temporary record for swapping + SStringEntry temp; + + // Simple Bubble sort: + int32 i, j; + for (i = 0; i < n; i++) { + for (j = 0; j < n - i - 1; j++) { + s1 = StringBuffer.Buf() + Table[j].String; + s2 = StringBuffer.Buf() + Table[j+1].String; + if (strcmp(s1, s2) > 0) { + // Swap records + temp = Table[j]; + Table[j] = Table[j+1]; + Table[j+1] = temp; + } + } + } + // Now StringEntries has been sorted. Reorder StringBuffer to the sort order. + CMemoryBuffer SortedStringBuffer; // Temporary buffer for strings in sort order + for (i = 0; i < n; i++) { + // Pointer to old string + s1 = StringBuffer.Buf() + Table[i].String; + // Update table to point to new string + Table[i].String = SortedStringBuffer.GetDataSize(); + // Put string into SortedStringBuffer + SortedStringBuffer.PushString(s1); + } + if (SortedStringBuffer.GetDataSize() != StringBuffer.GetDataSize()) { + // The two string buffers should be same size + err.submit(9000); return; + } + // Copy SortedStringBuffer into StringBuffer + memcpy(StringBuffer.Buf(), SortedStringBuffer.Buf(), StringBuffer.GetDataSize()); + + // Check for duplicate symbols + for (i = 0; i < n-1; i++) { + s1 = StringBuffer.Buf() + Table[i].String; + for (j = i + 1; j < n; j++) { + s2 = StringBuffer.Buf() + Table[j].String; + if (strcmp(s1,s2) == 0) { + // Duplicate found + // Compose error string "Modulename1 and Modulename2" + uint32 errstring = LongNamesBuffer.GetDataSize(); + LongNamesBuffer.PushString(GetModuleName(Table[i].Member)); + LongNamesBuffer.SetSize(LongNamesBuffer.GetDataSize()-1); // remove terminating zero + LongNamesBuffer.Push(" and ", 5); + LongNamesBuffer.PushString(GetModuleName(Table[j].Member)); + err.submit(1214, s1, (char*)LongNamesBuffer.Buf() + errstring); + LongNamesBuffer.SetSize(errstring); // remove string again + i++; // Prevent excessive messages + } + else { + break; + } + } + } } uint32 EndianChange(uint32 n) { - // Convert little-endian to big-endian number, or vice versa - return (n << 24) | ((n & 0x0000FF00) << 8) | ((n & 0x00FF0000) >> 8) | (n >> 24); + // Convert little-endian to big-endian number, or vice versa + return (n << 24) | ((n & 0x0000FF00) << 8) | ((n & 0x00FF0000) >> 8) | (n >> 24); } uint32 RoundEven(uint32 n) { - // Round up number to nearest even - return (n + 1) & uint32(-2); + // Round up number to nearest even + return (n + 1) & uint32(-2); } uint32 Round4(uint32 n) { - // Round up number to nearest multiple of 4 - return (n + 3) & uint32(-4); + // Round up number to nearest multiple of 4 + return (n + 3) & uint32(-4); } void CLibrary::MakeSymbolTableUnix() { - // Make symbol table for COFF, ELF or MACHO library - // Uses UNIX archive format for COFF, BSD and Mac - uint32 i; // Loop counter - uint32 MemberOffset; // Offset to member - uint32 LongNameSize = 0; // Length of symbol table name if stored after record - - int SymbolTableType = cmd.OutputType; // FILETYPE_COFF = 1: COFF - // FILETYPE_ELF = 3: ELF - // FILETYPE_MACHO_LE = 4: Mac, unsorted - // 0x10000004: Mac, sorted - // Newer Mac tools require the sorted type, unless there are multiple publics with same name - if (SymbolTableType == FILETYPE_MACHO_LE) SymbolTableType |= 0x10000000; - - // Make symbol table header - SUNIXLibraryHeader SymTab; // Symbol table header - memset(&SymTab, 0, sizeof(SymTab)); // Fill with spaces - SymTab.Name[0] = '/'; // Name = '/' - // The silly Mac linker requires that the symbol table has a date stamp not - // older than the .a file. Fix this by post-dating the symbol table: - uint32 PostDate = 0; - if (SymbolTableType & 0x10000000) PostDate = 100; // Post-date if mac sorted symbol table - sprintf(SymTab.Date, "%u", (uint32)time(0) + PostDate); // Date stamp for symbol table - SymTab.UserID[0] = '0'; // UserID = 0 - SymTab.GroupID[0] = '0'; // GroupID = 0 - strcpy(SymTab.FileMode, "100666"); // FileMode = 0100666 - SymTab.HeaderEnd[0] = '`'; // End with "`\n" - SymTab.HeaderEnd[1] = '\n'; - - // File header - OutFile.Push("!\n", 8); - - uint32 NumMembers = Indexes.GetNumEntries(); // Number of members - uint32 NumStrings = StringEntries.GetNumEntries(); // Number of symbol names - uint32 StringsLen = StringBuffer.GetDataSize(); // Size of string table - - // Calculate sizes of string index records, not including header - // Unsorted index, used in ELF and COFF libraries - uint32 Index1Size = (NumStrings+1)*4 + StringsLen; - // Sorted index, used in COFF libraries as second member - uint32 Index2Size = (NumMembers+2)*4 + NumStrings*2 + StringsLen; - // Sorted index, used in Mach-O libraries - uint32 Index3Size = Round4(NumStrings*8 + 8 + StringsLen); - - // Offset to first member - uint32 FirstMemberOffset = 0; - switch (SymbolTableType) { - case FILETYPE_COFF: - FirstMemberOffset = 8 + 2*sizeof(SUNIXLibraryHeader) + RoundEven(Index1Size) + RoundEven(Index2Size); - break; - case FILETYPE_ELF: - FirstMemberOffset = 8 + sizeof(SUNIXLibraryHeader) + RoundEven(Index1Size); - break; - case FILETYPE_MACHO_LE: - FirstMemberOffset = 8 + sizeof(SUNIXLibraryHeader) + Index3Size; - break; - case FILETYPE_MACHO_LE | 0x10000000: // Mac, sorted - LongNameSize = 20; - FirstMemberOffset = 8 + sizeof(SUNIXLibraryHeader) + Index3Size + LongNameSize; - break; - default: - err.submit(2501, GetFileFormatName(cmd.OutputType)); - } - - // Make unsorted symbol table for COFF or ELF output - if (SymbolTableType == FILETYPE_COFF || SymbolTableType == FILETYPE_ELF) { - - // Put file size into symbol table header - sprintf(SymTab.FileSize, "%u", Index1Size); - // Remove terminating zeroes - for (i = 0; i < sizeof(SymTab); i++) { - if (((char*)&SymTab)[i] == 0) ((char*)&SymTab)[i] = ' '; - } - - // Store header - OutFile.Push(&SymTab, sizeof(SymTab)); - - // Store table of offsets - uint32 BigEndian; // Number converted to big-endian - BigEndian = EndianChange(NumStrings); - OutFile.Push(&BigEndian, sizeof(BigEndian)); // Number of symbols - - // Loop through strings - for (i = 0; i < NumStrings; i++) { - // Get record in temporary symbol table - SStringEntry * psym = &StringEntries[i]; - // Get offset of member in DataBuffer - MemberOffset = Indexes[psym->Member]; - // Add size of headers to compute member offset in final file - BigEndian = EndianChange(MemberOffset + FirstMemberOffset); - // Store offset as big endian number - OutFile.Push(&BigEndian, sizeof(BigEndian)); - } - - // Store strings - OutFile.Push(StringBuffer.Buf(), StringBuffer.GetDataSize()); - // Align by 2 - if (OutFile.GetDataSize() & 1) { - OutFile.Push("\n", 1); - } - } - - // Sort string table - if (!RepressWarnings && SymbolTableType != FILETYPE_MACHO_LE) SortStringTable(); - - // Make sorted symbol table, COFF style - if (SymbolTableType == FILETYPE_COFF) { - if (NumMembers > 0xFFFF) err.submit(2502); // Too many members - - // Reuse symbol table header, change size entry - sprintf(SymTab.FileSize, "%u", Index2Size); - - // Remove terminating zeroes - for (i = 0; i < sizeof(SymTab); i++) { - if (((char*)&SymTab)[i] == 0) ((char*)&SymTab)[i] = ' '; - } - // Store header - OutFile.Push(&SymTab, sizeof(SymTab)); - - // Store number of members - OutFile.Push(&NumMembers, sizeof(NumMembers)); - - // Store member offsets - for (i = 0; i < NumMembers; i++) { - MemberOffset = Indexes[i] + FirstMemberOffset; - OutFile.Push(&MemberOffset, sizeof(MemberOffset)); - } - - // Store number of symbols - OutFile.Push(&NumStrings, sizeof(NumStrings)); - - // Store member index for each string - // Loop through strings - for (i = 0; i < NumStrings; i++) { - // Get record in temporary symbol table - SStringEntry * psym = &StringEntries[i]; - // Get member index, 16 bits - uint16 MemberI = (uint16)(psym->Member + 1); - OutFile.Push(&MemberI, sizeof(MemberI)); - } - - // Store strings - OutFile.Push(StringBuffer.Buf(), StringBuffer.GetDataSize()); - // Align by 2 - if (OutFile.GetDataSize() & 1) { - OutFile.Push("\n", 1); - } - } - - // Make sorted or unsorted symbol table, Mach-O style - if ((SymbolTableType & 0xFFFF) == FILETYPE_MACHO_LE) { - - if (SymbolTableType & 0x10000000) { - // Sorted table. "__.SYMDEF SORTED" stored as long name - memcpy(SymTab.Name, "#1/20 ", 16); - // Put file size into symbol table header, including long name length - sprintf(SymTab.FileSize, "%u", Index3Size + LongNameSize); - } - else { - // Unsorted table. "__.SYMDEF" stored as short name - memcpy(SymTab.Name, "__.SYMDEF ", 16); - // Put file size into symbol table header - sprintf(SymTab.FileSize, "%u", Index3Size); - } - - // Remove terminating zeroes - for (i = 0; i < sizeof(SymTab); i++) { - if (((char*)&SymTab)[i] == 0) ((char*)&SymTab)[i] = ' '; - } - - // Store header - OutFile.Push(&SymTab, sizeof(SymTab)); - - if (SymbolTableType & 0x10000000) { - // Store long name "__.SYMDEF SORTED" - OutFile.Push("__.SYMDEF SORTED\0\0\0\0", LongNameSize); - } - - // Store an array of records of string index and member offsets - // Store length first - uint32 ArrayLength = NumStrings * sizeof(SStringEntry); - OutFile.Push(&ArrayLength, sizeof(ArrayLength)); - - // Loop through strings - for (i = 0; i < NumStrings; i++) { - // Get record in temporary symbol table - SStringEntry * psym = &StringEntries[i]; - SStringEntry Record; - Record.String = psym->String; - Record.Member = Indexes[psym->Member] + FirstMemberOffset; - // Store symbol record - OutFile.Push(&Record, sizeof(Record)); - } - - // Store length of string table - StringsLen = Round4(StringsLen); // Round up to align by 4 - OutFile.Push(&StringsLen, sizeof(StringsLen)); - // Store strings - OutFile.Push(StringBuffer.Buf(), StringBuffer.GetDataSize()); - // Align by 4 - OutFile.Align(4); - // Cross check precalculated size (8 is the size of "!\n" file identifier) - if (OutFile.GetDataSize() != Index3Size + sizeof(SymTab) + 8 + LongNameSize) err.submit(9000); - } + // Make symbol table for COFF, ELF or MACHO library + // Uses UNIX archive format for COFF, BSD and Mac + uint32 i; // Loop counter + uint32 MemberOffset; // Offset to member + uint32 LongNameSize = 0; // Length of symbol table name if stored after record + + int SymbolTableType = cmd.OutputType; // FILETYPE_COFF = 1: COFF + // FILETYPE_ELF = 3: ELF + // FILETYPE_MACHO_LE = 4: Mac, unsorted + // 0x10000004: Mac, sorted + // Newer Mac tools require the sorted type, unless there are multiple publics with same name + if (SymbolTableType == FILETYPE_MACHO_LE) SymbolTableType |= 0x10000000; + + // Make symbol table header + SUNIXLibraryHeader SymTab; // Symbol table header + memset(&SymTab, ' ', sizeof(SymTab)); // Fill with spaces + SymTab.Name[0] = '/'; // Name = '/' + // The silly Mac linker requires that the symbol table has a date stamp not + // older than the .a file. Fix this by post-dating the symbol table: + uint32 PostDate = 0; + if (SymbolTableType & 0x10000000) PostDate = 100; // Post-date if mac sorted symbol table + sprintf(SymTab.Date, "%u ", (uint32)time(0) + PostDate); // Date stamp for symbol table + + SymTab.UserID[0] = '0'; // UserID = 0 (may be omitted in COFF) + SymTab.GroupID[0] = '0'; // GroupID = 0 (may be omitted in COFF) + strcpy(SymTab.FileMode, "100666"); // FileMode = 0100666 (may be 0 in COFF) + + SymTab.HeaderEnd[0] = '`'; // End with "`\n" + SymTab.HeaderEnd[1] = '\n'; + + // File header + OutFile.Push("!\n", 8); + + uint32 NumMembers = Indexes.GetNumEntries(); // Number of members + uint32 NumStrings = StringEntries.GetNumEntries(); // Number of symbol names + uint32 StringsLen = StringBuffer.GetDataSize(); // Size of string table + + // Calculate sizes of string index records, not including header + // Unsorted index, used in ELF and COFF libraries + uint32 Index1Size = (NumStrings+1)*4 + StringsLen; + // Sorted index, used in COFF libraries as second member + uint32 Index2Size = (NumMembers+2)*4 + NumStrings*2 + StringsLen; + // Sorted index, used in Mach-O libraries + uint32 Index3Size = Round4(NumStrings*8 + 8 + StringsLen); + // Longnames member + uint32 LongnamesMemberSize = 0; + // Official MS COFF reference says that the "//" longnames member must be present, + // even if it is unused, but MS LIB does not make it unless it is needed. + // Here, we will include the longnames member only if it is needed + if ((SymbolTableType == FILETYPE_COFF || SymbolTableType == FILETYPE_ELF) && LongNamesBuffer.GetDataSize()) { + LongnamesMemberSize = sizeof(SUNIXLibraryHeader) + LongNamesBuffer.GetDataSize(); + } + + // Offset to first member + uint32 FirstMemberOffset = 0; + switch (SymbolTableType) { + case FILETYPE_COFF: + FirstMemberOffset = 8 + 2*sizeof(SUNIXLibraryHeader) + RoundEven(Index1Size) + + RoundEven(Index2Size) + RoundEven(LongnamesMemberSize); + break; + case FILETYPE_ELF: + FirstMemberOffset = 8 + sizeof(SUNIXLibraryHeader) + RoundEven(Index1Size) + + RoundEven(LongnamesMemberSize); + break; + case FILETYPE_MACHO_LE: + FirstMemberOffset = 8 + sizeof(SUNIXLibraryHeader) + Index3Size; + break; + case FILETYPE_MACHO_LE | 0x10000000: // Mac, sorted + LongNameSize = 20; + FirstMemberOffset = 8 + sizeof(SUNIXLibraryHeader) + Index3Size + LongNameSize; + break; + default: + err.submit(2501, GetFileFormatName(cmd.OutputType)); + } + + // Make unsorted symbol table for COFF or ELF output + if (SymbolTableType == FILETYPE_COFF || SymbolTableType == FILETYPE_ELF) { + + // Put file size into symbol table header + sprintf(SymTab.FileSize, "%u ", Index1Size); + // Remove terminating zeroes + for (i = 0; i < sizeof(SymTab); i++) { + if (((char*)&SymTab)[i] == 0) ((char*)&SymTab)[i] = ' '; + } + + // Store header + OutFile.Push(&SymTab, sizeof(SymTab)); + + // Store table of offsets + uint32 BigEndian; // Number converted to big-endian + BigEndian = EndianChange(NumStrings); + OutFile.Push(&BigEndian, sizeof(BigEndian)); // Number of symbols + + // Loop through strings + for (i = 0; i < NumStrings; i++) { + // Get record in temporary symbol table + SStringEntry * psym = &StringEntries[i]; + // Get offset of member in DataBuffer + MemberOffset = Indexes[psym->Member]; + // Add size of headers to compute member offset in final file + BigEndian = EndianChange(MemberOffset + FirstMemberOffset); + // Store offset as big endian number + OutFile.Push(&BigEndian, sizeof(BigEndian)); + } + + // Store strings + OutFile.Push(StringBuffer.Buf(), StringBuffer.GetDataSize()); + // Align by 2 + if (OutFile.GetDataSize() & 1) { + OutFile.Push("\n", 1); + } + } + + // Sort string table + if (!RepressWarnings && SymbolTableType != FILETYPE_MACHO_LE) SortStringTable(); + + // Make sorted symbol table, COFF style + if (SymbolTableType == FILETYPE_COFF) { + if (NumMembers > 0xFFFF) err.submit(2502); // Too many members + + // Reuse symbol table header, change size entry + sprintf(SymTab.FileSize, "%u ", Index2Size); + + // Remove terminating zeroes + for (i = 0; i < sizeof(SymTab); i++) { + if (((char*)&SymTab)[i] == 0) ((char*)&SymTab)[i] = ' '; + } + // Store header + OutFile.Push(&SymTab, sizeof(SymTab)); + + // Store number of members + OutFile.Push(&NumMembers, sizeof(NumMembers)); + + // Store member offsets + for (i = 0; i < NumMembers; i++) { + MemberOffset = Indexes[i] + FirstMemberOffset; + OutFile.Push(&MemberOffset, sizeof(MemberOffset)); + } + + // Store number of symbols + OutFile.Push(&NumStrings, sizeof(NumStrings)); + + // Store member index for each string + // Loop through strings + for (i = 0; i < NumStrings; i++) { + // Get record in temporary symbol table + SStringEntry * psym = &StringEntries[i]; + // Get member index, 16 bits + uint16 MemberI = (uint16)(psym->Member + 1); + OutFile.Push(&MemberI, sizeof(MemberI)); + } + + // Store strings + OutFile.Push(StringBuffer.Buf(), StringBuffer.GetDataSize()); + // Align by 2 + if (OutFile.GetDataSize() & 1) { + OutFile.Push("\n", 1); + } + } + + // Make longnames table member for COFF or ELF output + // (The decision whether to include a "//" longnames member is taken above) + if (LongnamesMemberSize) { + // reuse SymTab + strcpy(SymTab.Name, "// "); // Name = "//" + memset(SymTab.FileSize, ' ', 10); + sprintf(SymTab.FileSize, "%u", LongNamesBuffer.GetDataSize()); + + // Remove terminating zeroes + for (i = 0; i < sizeof(SymTab); i++) { + if (((char*)&SymTab)[i] == 0) ((char*)&SymTab)[i] = ' '; + } + // Store header + OutFile.Push(&SymTab, sizeof(SymTab)); + // Store data + OutFile.Push(LongNamesBuffer.Buf(), LongNamesBuffer.GetDataSize()); + // Align by 2 + if (OutFile.GetDataSize() & 1) { + OutFile.Push("\n", 1); + } + } + + // Make sorted or unsorted symbol table, Mach-O style + if ((SymbolTableType & 0xFFFF) == FILETYPE_MACHO_LE) { + + if (SymbolTableType & 0x10000000) { + // Sorted table. "__.SYMDEF SORTED" stored as long name + memcpy(SymTab.Name, "#1/20 ", 16); + // Put file size into symbol table header, including long name length + sprintf(SymTab.FileSize, "%u ", Index3Size + LongNameSize); + } + else { + // Unsorted table. "__.SYMDEF" stored as short name + memcpy(SymTab.Name, "__.SYMDEF ", 16); + // Put file size into symbol table header + sprintf(SymTab.FileSize, "%u ", Index3Size); + } + + // Remove terminating zeroes + for (i = 0; i < sizeof(SymTab); i++) { + if (((char*)&SymTab)[i] == 0) ((char*)&SymTab)[i] = ' '; + } + + // Store header + OutFile.Push(&SymTab, sizeof(SymTab)); + + if (SymbolTableType & 0x10000000) { + // Store long name "__.SYMDEF SORTED" + OutFile.Push("__.SYMDEF SORTED\0\0\0\0", LongNameSize); + } + + // Store an array of records of string index and member offsets + // Store length first + uint32 ArrayLength = NumStrings * sizeof(SStringEntry); + OutFile.Push(&ArrayLength, sizeof(ArrayLength)); + + // Loop through strings + for (i = 0; i < NumStrings; i++) { + // Get record in temporary symbol table + SStringEntry * psym = &StringEntries[i]; + SStringEntry Record; + Record.String = psym->String; + Record.Member = Indexes[psym->Member] + FirstMemberOffset; + // Store symbol record + OutFile.Push(&Record, sizeof(Record)); + } + + // Store length of string table + StringsLen = Round4(StringsLen); // Round up to align by 4 + OutFile.Push(&StringsLen, sizeof(StringsLen)); + // Store strings + OutFile.Push(StringBuffer.Buf(), StringBuffer.GetDataSize()); + // Align by 4 + OutFile.Align(4); + // Cross check precalculated size (8 is the size of "!\n" file identifier) + if (OutFile.GetDataSize() != Index3Size + sizeof(SymTab) + 8 + LongNameSize) err.submit(9000); + } } void CLibrary::MakeBinaryFile() { - if (cmd.OutputType == FILETYPE_OMF) { - MakeBinaryFileOMF(); // OMF style output library - } - else { - MakeBinaryFileUNIX(); // UNIX style output library - } + if (cmd.OutputType == FILETYPE_OMF) { + MakeBinaryFileOMF(); // OMF style output library + } + else { + MakeBinaryFileUNIX(); // UNIX style output library + } } void CLibrary::MakeBinaryFileOMF() { - // Make OMF library - uint32 PageSize; // Page size / alignment for output library - uint32 temp; // Temporary - uint16 temp16; // Temporary - uint8 temp8; // Temporary - uint32 MemberI; // Member number - uint32 MemberOffset; // File offset of member in output file - uint32 MemberStart; // Start of member in DataBuffer - uint32 MemberEnd; // End of member in DataBuffer - uint32 SymbolI; // Public symbol number - uint32 DictionaryOffset2; // Offset to hash table - CSList MemberPageIndex; // Remember page index of each member - - // Check number of entries - if (DataBuffer.GetNumEntries() >= 0x8000) { - err.submit(2606); return; // Error: too big - } - - // Find optimal page size - PageSize = DataBuffer.GetDataSize() / (0x8000 - DataBuffer.GetNumEntries()); - // Make power of 2, minimum 16 - temp = FloorLog2(PageSize) + 1; - if (temp < 4) temp = 4; - PageSize = 1 << temp; - - // Make library header - temp8 = OMF_LIBHEAD; - OutFile.Push(&temp8, 1); // Library header type byte - temp16 = PageSize - 3; - OutFile.Push(&temp16, 2); // Record length - OutFile.Push(0, 6); // Dictionary offset and size: insert later - temp8 = 1; - OutFile.Push(&temp8, 1); // Flag: case sensitive - OutFile.Align(PageSize); // Align for first member - - // Allocate MemberPageIndex - MemberPageIndex.SetNum(Indexes.GetNumEntries()); - - // Insert members - for (MemberI = 0; MemberI < Indexes.GetNumEntries(); MemberI++) { - - // Find member in DataBuffer - MemberStart = Indexes[MemberI]; // Start of member in DataBuffer - if (MemberI+1 < Indexes.GetNumEntries()) { - // Not last member - MemberEnd = Indexes[MemberI+1]; // End of member in DataBuffer = start of next member - } - else { - // Last member - MemberEnd = DataBuffer.GetDataSize(); // End of member in DataBuffer = end of DataBuffer - } - - // Put member into output file - MemberOffset = OutFile.Push(DataBuffer.Buf() + MemberStart, MemberEnd - MemberStart); - - // Align next member - OutFile.Align(PageSize); - - // Member page index - MemberPageIndex[MemberI] = MemberOffset / PageSize; - } - - // Change member index to member page index in StringEntries - // Loop through StringEntries - for (SymbolI = 0; SymbolI < StringEntries.GetNumEntries(); SymbolI++) { - // Member index - MemberI = StringEntries[SymbolI].Member; - if (MemberI < MemberPageIndex.GetNumEntries()) { - // Change to member page - StringEntries[SymbolI].Member = MemberPageIndex[MemberI]; - } - } - - // Make OMF_LIBEND record - temp8 = OMF_LIBEND; - OutFile.Push(&temp8, 1); // Library header type byte - temp16 = PageSize - 3; // Length of rest of record - OutFile.Push(&temp16, 2); // Record length - OutFile.Align(PageSize); // Align - - // Offset to hash table - DictionaryOffset2 = OutFile.GetDataSize(); - - // Make hash table for public symbols - COMFHashTable HashTable; - HashTable.MakeHashTable(StringEntries, StringBuffer, OutFile, this); // Make hash table - - // Insert missing values in library header - // Hash table offset - OutFile.Get(3) = DictionaryOffset2; - - // Hash table size - OutFile.Get(7) = (OutFile.GetDataSize() - DictionaryOffset2) / OMFBlockSize; + // Make OMF library + uint32 PageSize; // Page size / alignment for output library + uint32 temp; // Temporary + uint16 temp16; // Temporary + uint8 temp8; // Temporary + uint32 MemberI; // Member number + uint32 MemberOffset; // File offset of member in output file + uint32 MemberStart; // Start of member in DataBuffer + uint32 MemberEnd; // End of member in DataBuffer + uint32 SymbolI; // Public symbol number + uint32 DictionaryOffset2; // Offset to hash table + CSList MemberPageIndex; // Remember page index of each member + + // Check number of entries + if (DataBuffer.GetNumEntries() >= 0x8000) { + err.submit(2606); return; // Error: too big + } + + // Find optimal page size + PageSize = DataBuffer.GetDataSize() / (0x8000 - DataBuffer.GetNumEntries()); + // Make power of 2, minimum 16 + temp = FloorLog2(PageSize) + 1; + if (temp < 4) temp = 4; + PageSize = 1 << temp; + + // Make library header + temp8 = OMF_LIBHEAD; + OutFile.Push(&temp8, 1); // Library header type byte + temp16 = PageSize - 3; + OutFile.Push(&temp16, 2); // Record length + OutFile.Push(0, 6); // Dictionary offset and size: insert later + temp8 = 1; + OutFile.Push(&temp8, 1); // Flag: case sensitive + OutFile.Align(PageSize); // Align for first member + + // Allocate MemberPageIndex + MemberPageIndex.SetNum(Indexes.GetNumEntries()); + + // Insert members + for (MemberI = 0; MemberI < Indexes.GetNumEntries(); MemberI++) { + + // Find member in DataBuffer + MemberStart = Indexes[MemberI]; // Start of member in DataBuffer + if (MemberI+1 < Indexes.GetNumEntries()) { + // Not last member + MemberEnd = Indexes[MemberI+1]; // End of member in DataBuffer = start of next member + } + else { + // Last member + MemberEnd = DataBuffer.GetDataSize(); // End of member in DataBuffer = end of DataBuffer + } + + // Put member into output file + MemberOffset = OutFile.Push(DataBuffer.Buf() + MemberStart, MemberEnd - MemberStart); + + // Align next member + OutFile.Align(PageSize); + + // Member page index + MemberPageIndex[MemberI] = MemberOffset / PageSize; + } + + // Change member index to member page index in StringEntries + // Loop through StringEntries + for (SymbolI = 0; SymbolI < StringEntries.GetNumEntries(); SymbolI++) { + // Member index + MemberI = StringEntries[SymbolI].Member; + if (MemberI < MemberPageIndex.GetNumEntries()) { + // Change to member page + StringEntries[SymbolI].Member = MemberPageIndex[MemberI]; + } + } + + // Make OMF_LIBEND record + temp8 = OMF_LIBEND; + OutFile.Push(&temp8, 1); // Library header type byte + temp16 = PageSize - 3; // Length of rest of record + OutFile.Push(&temp16, 2); // Record length + OutFile.Align(PageSize); // Align + + // Offset to hash table + DictionaryOffset2 = OutFile.GetDataSize(); + + // Make hash table for public symbols + COMFHashTable HashTable; + HashTable.MakeHashTable(StringEntries, StringBuffer, OutFile, this); // Make hash table + + // Insert missing values in library header + // Hash table offset + OutFile.Get(3) = DictionaryOffset2; + + // Hash table size + OutFile.Get(7) = (OutFile.GetDataSize() - DictionaryOffset2) / OMFBlockSize; } void CLibrary::MakeBinaryFileUNIX() { - // Make UNIX library - // Combine string index and members into binary file + // Make UNIX library + // Combine string index and members into binary file - // Reserve file buffer for output file - OutFile.SetSize(GetBufferSize()); + // Reserve file buffer for output file + OutFile.SetSize(GetBufferSize()); - if (cmd.OutputType == FILETYPE_COFF || cmd.OutputType == FILETYPE_ELF || cmd.OutputType == FILETYPE_MACHO_LE) { - // COFF, ELF and MAach-O libraries all use Unix-style archive with - // differences in symbol table format + if (cmd.OutputType == FILETYPE_COFF || cmd.OutputType == FILETYPE_ELF || cmd.OutputType == FILETYPE_MACHO_LE) { + // COFF, ELF and MAach-O libraries all use Unix-style archive with + // differences in symbol table format - // Make symbol table - MakeSymbolTableUnix(); + // Make symbol table + MakeSymbolTableUnix(); - // Store all members - OutFile.Push(DataBuffer.Buf(), DataBuffer.GetDataSize()); - } - else { - err.submit(2501, GetFileFormatName(cmd.OutputType)); - } + // Store all members + OutFile.Push(DataBuffer.Buf(), DataBuffer.GetDataSize()); + } + else { + err.submit(2501, GetFileFormatName(cmd.OutputType)); + } } void CLibrary::CheckOMFHash(CMemoryBuffer &stringbuf, CSList &index) { - // Check if OMF library hash table has correct entries for all symbol names - uint32 i; // Loop counter - int8 * Name; // Public symbol name - COMFHashTable HashTab; // OMF hash table interpreter - uint32 NString; // Number of occurrences of Name in hash table - uint32 Module; // Module with first occurrence of Name - uint32 Conf, ConfSum = 0; // Count number of conflicting entries in hash table - - // Initialize hash table interpreter - HashTab.Init(&Get(DictionaryOffset), DictionarySize); - - // Loop through public symbol names - for (i = 0; i < index.GetNumEntries(); i++) { - // Get public name - Name = stringbuf.Buf() + index[i].String; - // Make hash - HashTab.MakeHash(Name); - // Search for string - NString = HashTab.FindString(Module, Conf); - // Count conflicting strings - ConfSum += Conf; - - // Make error message if not 1 occurrence of Name - if (NString == 0) err.submit(2603, Name); // Error if not found - if (NString > 1) err.submit(1213, NString, Name); // Warning more than one occurrence - - //printf("\n%i occurence of %s, module offset %i", NString, Name, Module); - } - printf("\n\nHash table %i blocks x 37 buckets at offet 0x%X.\n Efficiency: %i conflicts for %i entries", - DictionarySize, DictionaryOffset, ConfSum, index.GetNumEntries()); + // Check if OMF library hash table has correct entries for all symbol names + uint32 i; // Loop counter + int8 * Name; // Public symbol name + COMFHashTable HashTab; // OMF hash table interpreter + uint32 NString; // Number of occurrences of Name in hash table + uint32 Module; // Module with first occurrence of Name + uint32 Conf, ConfSum = 0; // Count number of conflicting entries in hash table + + // Initialize hash table interpreter + HashTab.Init(&Get(DictionaryOffset), DictionarySize); + + // Loop through public symbol names + for (i = 0; i < index.GetNumEntries(); i++) { + // Get public name + Name = stringbuf.Buf() + index[i].String; + // Make hash + HashTab.MakeHash(Name); + // Search for string + NString = HashTab.FindString(Module, Conf); + // Count conflicting strings + ConfSum += Conf; + + // Make error message if not 1 occurrence of Name + if (NString == 0) err.submit(2603, Name); // Error if not found + if (NString > 1) err.submit(1213, NString, Name); // Warning more than one occurrence + + //printf("\n%i occurence of %s, module offset %i", NString, Name, Module); + } + printf("\n\nHash table %i blocks x 37 buckets at offet 0x%X.\n Efficiency: %i conflicts for %i entries", + DictionarySize, DictionaryOffset, ConfSum, index.GetNumEntries()); } const char * CLibrary::GetModuleName(uint32 Index) { - // Get name of module from index (UNIX) or page index (OMF) - static char name[32]; - if (cmd.OutputType == FILETYPE_OMF || cmd.OutputType == FILETYPE_OMFLIBRARY) { - // Get name of module in OMF library - if (Index * PageSize < OutFile.GetDataSize() && OutFile.Get(Index * PageSize) == OMF_THEADR) { - SOMFRecordPointer rec; // Record pointer - rec.Start(OutFile.Buf(), Index * PageSize, OutFile.GetDataSize()); - if (rec.Type2 == OMF_THEADR) { - // Get module name from THEADR record - strncpy(name, rec.GetString(), 16); + // Get name of module from index (UNIX) or page index (OMF) + static char name[32]; + if (cmd.OutputType == FILETYPE_OMF || cmd.OutputType == FILETYPE_OMFLIBRARY) { + // Get name of module in OMF library + if (Index * PageSize < OutFile.GetDataSize() && OutFile.Get(Index * PageSize) == OMF_THEADR) { + SOMFRecordPointer rec; // Record pointer + rec.Start(OutFile.Buf(), Index * PageSize, OutFile.GetDataSize()); + if (rec.Type2 == OMF_THEADR) { + // Get module name from THEADR record + strncpy(name, rec.GetString(), 16); + // Make sure name is not too long + name[16] = 0; + // Return name + return name; + } + } + // No module starts here + return "?"; + } + // UNIX style library. + if (Index < Indexes.GetNumEntries()) { + // Get offset from Index + uint32 Offset = Indexes[Index]; + if (Offset < DataBuffer.GetDataSize()) { + // Copy name from header + memcpy(name, DataBuffer.Buf() + Offset, 16); + // Check for long name + if (strncmp(name, "#1/", 3) == 0) { + // Long name after record + memcpy(name, DataBuffer.Buf()+Offset+sizeof(SUNIXLibraryHeader), 16); + } + else if (name[0] == '/') { + // Long name in longnames record + uint32 NameIndex = atoi(name+1); + if (NameIndex < LongNamesSize) { + return Buf() + LongNames + NameIndex; + } + else { + return "?"; + } + } + + // Find terminating '/' + for (int i = 0; i < 16; i++) if (name[i] == '/') name[i] = 0; // Make sure name is not too long name[16] = 0; - // Return name + // return name return name; - } - } - // No module starts here - return "?"; - } - // UNIX style library. - if (Index < Indexes.GetNumEntries()) { - // Get offset from Index - uint32 Offset = Indexes[Index]; - if (Offset < DataBuffer.GetDataSize()) { - // Copy name from header - memcpy(name, DataBuffer.Buf() + Offset, 16); - // Check for long name - if (strncmp(name, "#1/", 3) == 0) { - // Long name format - memcpy(name, DataBuffer.Buf()+Offset+sizeof(SUNIXLibraryHeader), 16); - } - // Find terminating '/' - for (int i = 0; i < 16; i++) if (name[i] == '/') name[i] = 0; - // Make sure name is not too long - name[16] = 0; - // return name - return name; - } - } - // Error - return "?"; + } + } + // Error + return "?"; } diff --git a/src/library.h b/src/library.h index 0efdc19..4a55c1a 100644 --- a/src/library.h +++ b/src/library.h @@ -1,14 +1,14 @@ /**************************** library.h ******************************** * Author: Agner Fog * Date created: 2006-07-15 -* Last modified: 2007-02-14 +* Last modified: 2013-08-22 * Project: objconv * Module: library.h * Description: * Header file defining classes for reading and writing UNIX and OMF style * libraries. * -* Copyright 2007-2008 GNU General Public License http://www.gnu.org/licenses +* Copyright 2007-2013 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #ifndef LIBRARY_H @@ -21,69 +21,69 @@ uint32 EndianChange(uint32); // Convert little-endian to big-endian nu // Define UNIX library member header struct SUNIXLibraryHeader { - char Name[16]; // Member name - char Date[12]; // Member date, seconds, decimal ASCII - char UserID[6]; // Member User ID, decimal ASCII - char GroupID[6]; // Member Group ID, decimal ASCII - char FileMode[8]; // Member file mode, octal - char FileSize[10]; // Member file size, decimal ASCII - char HeaderEnd[2]; // "`\n" + char Name[16]; // Member name + char Date[12]; // Member date, seconds, decimal ASCII + char UserID[6]; // Member User ID, decimal ASCII + char GroupID[6]; // Member Group ID, decimal ASCII + char FileMode[8]; // Member file mode, octal + char FileSize[10]; // Member file size, decimal ASCII + char HeaderEnd[2]; // "`\n" }; // Class for extracting members from library or building a library class CLibrary : public CFileBuffer { public: - CLibrary(); // Constructor - void Go(); // Do whatever the command line says - void Dump(); // Print contents of library - static char *TruncateMemberName(char const*); // Remove path and truncate object file name to 15 characters - const char * GetModuleName(uint32 Index); // Get name of module from index or page index + CLibrary(); // Constructor + void Go(); // Do whatever the command line says + void Dump(); // Print contents of library + //static char *TruncateMemberName(char const*);// Remove path and truncate object file name to 15 characters + static char * ShortenMemberName(char const *name); // Truncate library member name to 15 characters and make unique. The original long name is not overwritten + static char * StripMemberName(char *); // Remove path from library member name. Original long name is overwritten + const char * GetModuleName(uint32 Index); // Get name of module from index or page index protected: - // Properties for UNIX input libraries only - uint32 LongNames; // Offset to long names member - uint32 LongNamesSize; // Size of long names member - uint32 AlignBy; // Member alignment - - // Properties for OMF input libraries only - uint32 PageSize; // Alignment of members - uint32 DictionaryOffset; // Offset to hash table - uint32 DictionarySize; // Dictionary size, in 512 bytes blocks - - // Methods and properties for reading library: - void DumpUNIX(); // Print contents of UNIX style library - void DumpOMF(); // Print contents of OMF style library - void CheckOMFHash(CMemoryBuffer &stringbuf, CSList &index);// Check if OMF library hash table has correct entries for all symbol names - void StartExtracting(); // Initialize before ExtractMember() - const char * ExtractMember(CFileBuffer*); // Extract next library member from input library - const char * ExtractMemberUNIX(CFileBuffer*); // Extract member of UNIX style library - const char * ExtractMemberOMF(CFileBuffer*); // Extract member of OMF style library - uint32 NextHeader(uint32 Offset); // Loop through library headers - CConverter MemberBuffer; // Buffer containing single library member - uint32 CurrentOffset; // Offset to current member - uint32 CurrentNumber; // Number of current member - int MemberFileType; // File type of members - // Methods and properties for modifying or writing library - void Rebuild(); // Make member names unique and without path. Rebuild symbol table - void RebuildUNIX(); // Rebuild UNIX style library - void RebuildOMF(); // Rebuild OMF style library - void InsertMember(CFileBuffer*); // Add next library member to output library - void InsertMemberUNIX(CFileBuffer*);// Add member to UNIX library - void InsertMemberOMF(CFileBuffer*); // Add member to OMF library - void MakeBinaryFile(); // Combine string index and members into binary file - void MakeBinaryFileUNIX(); // Make UNIX library - void MakeBinaryFileOMF(); // Make OMF library - char * FixMemberNameUNIX(char const *name); // Truncate library member name to 15 characters and make unique - char * FixMemberNameOMF(char const *name); // Truncate library member name to 15 characters and make unique - void SortStringTable(); // Sort the string table - void MakeSymbolTableUnix(); // Make symbol table for COFF, ELF or MACHO library - CFileBuffer OutFile; // Buffer for building output file - CSList StringEntries; // String table using SStringEntry - CMemoryBuffer StringBuffer; // Buffer containing strings - CMemoryBuffer DataBuffer; // Buffer containing raw members - CSList Indexes; // Buffer containing indexes into DataBuffer - int MemberNameExistsUNIX(char * name);// Check if DataBuffer contains a member with this name - int RepressWarnings; // Repress warnings when rebuilding library + // Properties for UNIX input libraries only + uint32 LongNames; // Offset to long names member + uint32 LongNamesSize; // Size of long names member + uint32 AlignBy; // Member alignment + + // Properties for OMF input libraries only + uint32 PageSize; // Alignment of members + uint32 DictionaryOffset; // Offset to hash table + uint32 DictionarySize; // Dictionary size, in 512 bytes blocks + + // Methods and properties for reading library: + void DumpUNIX(); // Print contents of UNIX style library + void DumpOMF(); // Print contents of OMF style library + void CheckOMFHash(CMemoryBuffer &stringbuf, CSList &index);// Check if OMF library hash table has correct entries for all symbol names + void StartExtracting(); // Initialize before ExtractMember() + char * ExtractMember(CFileBuffer*); // Extract next library member from input library + char * ExtractMemberUNIX(CFileBuffer*); // Extract member of UNIX style library + char * ExtractMemberOMF(CFileBuffer*); // Extract member of OMF style library + uint32 NextHeader(uint32 Offset); // Loop through library headers + CConverter MemberBuffer; // Buffer containing single library member + uint32 CurrentOffset; // Offset to current member + uint32 CurrentNumber; // Number of current member + int MemberFileType; // File type of members + // Methods and properties for modifying or writing library + void FixNames(); // Calls StripMemberNamesUNIX or RebuildOMF + void StripMemberNamesUNIX(); // Remove path from member names + void RebuildOMF(); // Rebuild OMF style library to make member names short + void InsertMember(CFileBuffer*); // Add next library member to output library + void InsertMemberUNIX(CFileBuffer*);// Add member to UNIX library + void InsertMemberOMF(CFileBuffer*); // Add member to OMF library + void MakeBinaryFile(); // Combine string index and members into binary file + void MakeBinaryFileUNIX(); // Make UNIX library + void MakeBinaryFileOMF(); // Make OMF library + void SortStringTable(); // Sort the string table + void MakeSymbolTableUnix(); // Make symbol table for COFF, ELF or MACHO library + CFileBuffer OutFile; // Buffer for building output file + CSList StringEntries; // String table using SStringEntry + CMemoryBuffer LongNamesBuffer; // Buffer for building the "//" longnames member + CMemoryBuffer StringBuffer; // Buffer containing strings + CMemoryBuffer DataBuffer; // Buffer containing raw members + CSList Indexes; // Buffer containing indexes into DataBuffer + int RepressWarnings; // Repress warnings when rebuilding library }; @@ -95,32 +95,32 @@ class CLibrary : public CFileBuffer { // Structure of hash table block union SOMFHashBlock { - struct { - uint8 Buckets[OMFNumBuckets]; // Indicators for each bucket - uint8 FreeSpace; // Pointer to free space - uint8 Data[OMFBlockSize-OMFNumBuckets-1]; // Contains strings and module indices - } b; - uint8 Strings[OMFBlockSize]; // Start of each string = length + struct { + uint8 Buckets[OMFNumBuckets]; // Indicators for each bucket + uint8 FreeSpace; // Pointer to free space + uint8 Data[OMFBlockSize-OMFNumBuckets-1]; // Contains strings and module indices + } b; + uint8 Strings[OMFBlockSize]; // Start of each string = length }; // Hash table handler class COMFHashTable { public: - void Init(SOMFHashBlock * blocks, uint32 NumBlocks); // Initialize - void MakeHash(int8 * name); // Compute hash - int FindString(uint32 & ModulePage, uint32 & Conflicts); // Search for string. Get number of occurrences, module, number of conflicting strings - int InsertString(uint16 & ModulePage); // Insert string in hash table. Return 0 if success - void MakeHashTable(CSList & StringEntries, CMemoryBuffer & StringBuffer, CMemoryBuffer & HashTable, CLibrary * Library); // Make hash table + void Init(SOMFHashBlock * blocks, uint32 NumBlocks); // Initialize + void MakeHash(int8 * name); // Compute hash + int FindString(uint32 & ModulePage, uint32 & Conflicts); // Search for string. Get number of occurrences, module, number of conflicting strings + int InsertString(uint16 & ModulePage); // Insert string in hash table. Return 0 if success + void MakeHashTable(CSList & StringEntries, CMemoryBuffer & StringBuffer, CMemoryBuffer & HashTable, CLibrary * Library); // Make hash table protected: - uint8 * String; // String to search for or insert - uint32 StringLength; // Length of string - SOMFHashBlock * blocks; // Pointer to blocks - uint32 NumBlocks; // Number of blocks - uint16 StartBlock; // Start block for search - uint16 StartBucket; // Start bucket for search - uint16 BlockD; // Block step size in search - uint16 BucketD; // Bucket step size in search + uint8 * String; // String to search for or insert + uint32 StringLength; // Length of string + SOMFHashBlock * blocks; // Pointer to blocks + uint32 NumBlocks; // Number of blocks + uint16 StartBlock; // Start block for search + uint16 StartBucket; // Start bucket for search + uint16 BlockD; // Block step size in search + uint16 BucketD; // Bucket step size in search }; #endif // #ifndef LIBRARY_H diff --git a/src/mac2asm.cpp b/src/mac2asm.cpp index ef31f67..eb3c966 100644 --- a/src/mac2asm.cpp +++ b/src/mac2asm.cpp @@ -189,7 +189,7 @@ void CMAC2ASM::MakeRelocations() { int32 Inline = 0; // Inline addend at relocation source uint32 TargetAddress; // Base-relative address of relocation target uint32 TargetSymbol; // Symbol index of target - int32 TargetSection; // Target section + //int32 TargetSection; // Target section int32 Addend; // Offset to add to target uint32 ReferenceAddress; // Base-relative address of reference point uint32 ReferenceSymbol; // Symbol index of reference point @@ -246,7 +246,7 @@ void CMAC2ASM::MakeRelocations() { TargetSymbol = relp.r->r_symbolnum + 1; } else { - TargetSection = relp.r->r_symbolnum; + //TargetSection = relp.r->r_symbolnum; } TargetAddress = 0; } @@ -290,7 +290,7 @@ void CMAC2ASM::MakeRelocations() { TargetSymbol = relp.r->r_symbolnum + 1; } else { - TargetSection = relp.r->r_symbolnum; + //TargetSection = relp.r->r_symbolnum; } TargetAddress = 0; } diff --git a/src/mac2mac.cpp b/src/mac2mac.cpp index a05fe40..102409d 100644 --- a/src/mac2mac.cpp +++ b/src/mac2mac.cpp @@ -118,7 +118,7 @@ void CMAC2MAC::MakeSymbolTable() { Name1 = Name2; Name2 = 0; break; - case SYMA_CHANGE_ALIAS: + case SYMA_ALIAS: // Make alias and keep old name if (OldScope != 1) { err.submit(1022, Name1); break; diff --git a/src/macho.cpp b/src/macho.cpp index 73dc4d7..890741d 100644 --- a/src/macho.cpp +++ b/src/macho.cpp @@ -77,7 +77,7 @@ SIntTxt Mac32RelocationTypeNames[] = { {MAC32_RELOC_VANILLA, "Generic"}, {MAC32_RELOC_PAIR, "Second entry of a pair"}, {MAC32_RELOC_SECTDIFF, "Section diff"}, - {MAC32_RELOC_PB_LA_PTR, "Prebound lazy ptr"}, + {MAC32_RELOC_PB_LA_PTR, "Prebound lazy "}, {MAC32_RELOC_LOCAL_SECTDIFF, "SectDif local"} }; @@ -179,14 +179,14 @@ void CMACHO::ParseFile(){ case MAC_LC_DYSYMTAB: { MAC_dysymtab_command * sh = (MAC_dysymtab_command*)currentp; - ilocalsym = sh->ilocalsym; // index to local symbols - nlocalsym = sh->nlocalsym; // number of local symbols - iextdefsym = sh->iextdefsym; // index to externally defined symbols - nextdefsym = sh->nextdefsym; // number of externally defined symbols - iundefsym = sh->iundefsym; // index to undefined symbols - nundefsym = sh->nundefsym; // number of undefined symbols - IndirectSymTabOffset = sh->indirectsymoff;// file offset to the indirect symbol table - IndirectSymTabNumber = sh->nindirectsyms; // number of indirect symbol table entries + ilocalsym = sh->ilocalsym; // index to local symbols + nlocalsym = sh->nlocalsym; // number of local symbols + iextdefsym = sh->iextdefsym; // index to externally defined symbols + nextdefsym = sh->nextdefsym; // number of externally defined symbols + iundefsym = sh->iundefsym; // index to undefined symbols + nundefsym = sh->nundefsym; // number of undefined symbols + IndirectSymTabOffset = sh->indirectsymoff;// file offset to the indirect symbol table + IndirectSymTabNumber = sh->nindirectsyms; // number of indirect symbol table entries break;} } currentoffset += cmdsize; @@ -241,7 +241,7 @@ void CMACHO::Dump(int options) { "\n File offset 0x%X, File size 0x%X, Maxprot 0x%X, Initprot 0x%X" "\n Number of sections %i, Flags 0x%X", sh->segname, sh->vmaddr, sh->vmsize, - sh->fileoff, sh->filesize, sh->maxprot, sh->initprot, + sh->fileoff, sh->filesize, sh->maxprot, sh->initprot, sh->nsects, sh->flags); break;} @@ -252,9 +252,9 @@ void CMACHO::Dump(int options) { "\n Number of sections %i, Flags 0x%X", sh->segname, (uint32)(sh->vmaddr>>32), (uint32)sh->vmaddr, (uint32)(sh->vmsize>>32), (uint32)sh->vmsize, - (uint32)(sh->fileoff>>32), (uint32)sh->fileoff, - (uint32)(sh->filesize>>32), (uint32)sh->filesize, - sh->maxprot, sh->initprot, + (uint32)(sh->fileoff>>32), (uint32)sh->fileoff, + (uint32)(sh->filesize>>32), (uint32)sh->filesize, + sh->maxprot, sh->initprot, sh->nsects, sh->flags); break;} @@ -271,16 +271,16 @@ void CMACHO::Dump(int options) { "\n Index to external symbols %i, number of external symbols %i," "\n Index to undefined symbols %i, number of undefined symbols %i," "\n File offset to TOC 0x%X, number of entries in TOC %i,", - sh->ilocalsym, sh->nlocalsym, sh->iextdefsym, sh->nextdefsym, - sh->iundefsym, sh->nundefsym, sh->tocoff, sh->ntoc); + sh->ilocalsym, sh->nlocalsym, sh->iextdefsym, sh->nextdefsym, + sh->iundefsym, sh->nundefsym, sh->tocoff, sh->ntoc); printf("\n File offset to module table 0x%X, Number of module table entries %i," "\n Offset to referenced symbol table 0x%X, Number of referenced symtab entries %i" "\n Offset to indirect symbol table 0x%X, Number of indirect symtab entries %i" "\n Offset to external relocation entries 0x%X, Number of external reloc. entries %i" "\n Offset to local relocation entries 0x%X, Number of local reloc. entries %i", - sh->modtaboff, sh->nmodtab, sh->extrefsymoff, sh->nextrefsyms, - sh->indirectsymoff, sh->nindirectsyms, sh->extreloff, sh->nextrel, - sh->locreloff, sh->nlocrel); + sh->modtaboff, sh->nmodtab, sh->extrefsymoff, sh->nextrefsyms, + sh->indirectsymoff, sh->nindirectsyms, sh->extreloff, sh->nextrel, + sh->locreloff, sh->nlocrel); break;} } @@ -316,8 +316,8 @@ void CMACHO::Dump(int options) { printf("\n Memory address 0x%X, Size 0x%X, File offset 0x%X" "\n Alignment %i, Reloc. ent. offset 0x%X, Num reloc. %i" "\n Flags 0x%X, reserved1 0x%X, reserved2 0x%X", - sectp->addr, sectp->size, sectp->offset, 1 << sectp->align, - sectp->reloff, sectp->nreloc, sectp->flags, + sectp->addr, sectp->size, sectp->offset, 1 << sectp->align, + sectp->reloff, sectp->nreloc, sectp->flags, sectp->reserved1, sectp->reserved2); if (sectp->nreloc && (options & DUMP_RELTAB)) { @@ -333,17 +333,17 @@ void CMACHO::Dump(int options) { if (!(scatp->r_type & MAC32_RELOC_PAIR)) { printf ("\n Offset: 0x%X, Value: 0x%X, Length: %i, Scat. Type: %s", scatp->r_address, scatp->r_value, 1 << scatp->r_length, - Lookup(Mac32RelocationTypeNames, scatp->r_type)); - if (scatp->r_address < sectp->size) { - printf(", Inline: 0x%X", *(int32*)(Buf()+sectp->offset+scatp->r_address)); - } - } - else { - // Second entry of a pair + Lookup(Mac32RelocationTypeNames, scatp->r_type)); + if (scatp->r_address < sectp->size) { + printf(", Inline: 0x%X", *(int32*)(Buf()+sectp->offset+scatp->r_address)); + } + } + else { + // Second entry of a pair printf ("\n Offset2: 0x%X, Value2: 0x%X, Length2: %i", scatp->r_address, scatp->r_value, 1 << scatp->r_length); - } - if (scatp->r_pcrel) printf(", PC relative"); + } + if (scatp->r_pcrel) printf(", PC relative"); } else { // non-scattered @@ -353,12 +353,12 @@ void CMACHO::Dump(int options) { if (relp->r_pcrel) printf ("PC relative, "); printf ("\n Length: %i, Extern: %i, Type: %s", 1 << relp->r_length, relp->r_extern, - Lookup(Mac32RelocationTypeNames, relp->r_type)); - if (relp->r_address < sectp->size) { - printf(", Inline: 0x%X", *(int32*)(Buf()+sectp->offset+relp->r_address)); - } + Lookup(Mac32RelocationTypeNames, relp->r_type)); + if (relp->r_address < sectp->size) { + printf(", Inline: 0x%X", *(int32*)(Buf()+sectp->offset+relp->r_address)); + } } - } + } } } } @@ -377,8 +377,8 @@ void CMACHO::Dump(int options) { printf("\n Memory address 0x%X, Size 0x%X, File offset 0x%X" "\n Alignment %i, Reloc. ent. offset 0x%X, Num reloc. %i" "\n Flags 0x%X, reserved1 0x%X, reserved2 0x%X", - (uint32)sectp->addr, (uint32)sectp->size, sectp->offset, 1 << sectp->align, - sectp->reloff, sectp->nreloc, sectp->flags, + (uint32)sectp->addr, (uint32)sectp->size, sectp->offset, 1 << sectp->align, + sectp->reloff, sectp->nreloc, sectp->flags, sectp->reserved1, sectp->reserved2); if (sectp->nreloc && (options & DUMP_RELTAB)) { @@ -392,17 +392,17 @@ void CMACHO::Dump(int options) { if (!(scatp->r_type & MAC32_RELOC_PAIR)) { printf ("\n Unexpected scattered relocation. Offset: 0x%X, Value: 0x%X, Length: %i, Scat. Type: %s", scatp->r_address, scatp->r_value, 1 << scatp->r_length, - Lookup(Mac64RelocationTypeNames, scatp->r_type)); - if (scatp->r_address < sectp->size) { - printf(", Inline: 0x%X", *(int32*)(Buf()+sectp->offset+scatp->r_address)); - } - } - else { - // Second entry of a pair + Lookup(Mac64RelocationTypeNames, scatp->r_type)); + if (scatp->r_address < sectp->size) { + printf(", Inline: 0x%X", *(int32*)(Buf()+sectp->offset+scatp->r_address)); + } + } + else { + // Second entry of a pair printf ("\n Offset2: 0x%X, Value2: 0x%X, Length2: %i", scatp->r_address, scatp->r_value, 1 << scatp->r_length); - } - if (scatp->r_pcrel) printf(", PC relative"); + } + if (scatp->r_pcrel) printf(", PC relative"); } else { // non-scattered @@ -412,20 +412,20 @@ void CMACHO::Dump(int options) { if (relp->r_pcrel) printf ("PC relative, "); printf ("\n Length: %i, Extern: %i, Type: %s", 1 << relp->r_length, relp->r_extern, - Lookup(Mac64RelocationTypeNames, relp->r_type)); - if (relp->r_type != MAC64_RELOC_SUBTRACTOR && relp->r_address < sectp->size) { - // Print inline addend - if (relp->r_length == 3) { - // 8 bytes inline addend - printf(", Inline: 0x%08X%08X", *(int32*)(Buf()+sectp->offset+relp->r_address+4), *(int32*)(Buf()+sectp->offset+relp->r_address)); - } - else { - // 4 bytes inline addend - printf(", Inline: 0x%08X", *(int32*)(Buf()+sectp->offset+relp->r_address)); - } - } + Lookup(Mac64RelocationTypeNames, relp->r_type)); + if (relp->r_type != MAC64_RELOC_SUBTRACTOR && relp->r_address < sectp->size) { + // Print inline addend + if (relp->r_length == 3) { + // 8 bytes inline addend + printf(", Inline: 0x%08X%08X", *(int32*)(Buf()+sectp->offset+relp->r_address+4), *(int32*)(Buf()+sectp->offset+relp->r_address)); + } + else { + // 4 bytes inline addend + printf(", Inline: 0x%08X", *(int32*)(Buf()+sectp->offset+relp->r_address)); + } + } } - } + } } } } diff --git a/src/macho.h b/src/macho.h index 101260c..73e5da5 100644 --- a/src/macho.h +++ b/src/macho.h @@ -1,22 +1,22 @@ -/**************************** macho.h **************************************** -* Author: Agner Fog -* Date created: 2007-01-06 -* Last modified: 2008-05-23 -* Project: objconv -* Module: macho.h -* Description: -* Header file for definition of data structures in 32 bit Mach-O object file. -* Also defines class MacSymbolTableBuilder -* Also defines structures for MacIntosh universal binaries -* -* Copyright 2006-2008 GNU General Public License http://www.gnu.org/licenses -* Parts (c) 2003 Apple public source license http://www.opensource.apple.com/apsl/ -***********************************************************************************/ -#ifndef MACHO_H -#define MACHO_H - -/********************** FILE HEADER **********************/ - +/**************************** macho.h **************************************** +* Author: Agner Fog +* Date created: 2007-01-06 +* Last modified: 2008-05-23 +* Project: objconv +* Module: macho.h +* Description: +* Header file for definition of data structures in 32 bit Mach-O object file. +* Also defines class MacSymbolTableBuilder +* Also defines structures for MacIntosh universal binaries +* +* Copyright 2006-2008 GNU General Public License http://www.gnu.org/licenses +* Parts (c) 2003 Apple public source license http://www.opensource.apple.com/apsl/ +***********************************************************************************/ +#ifndef MACHO_H +#define MACHO_H + +/********************** FILE HEADER **********************/ + struct MAC_header_32 { uint32 magic; // mach magic number identifier uint32 cputype; // cpu specifier @@ -77,16 +77,16 @@ struct MAC_header_64 { #define MAC_DYLDLINK 0x4 // the object file is input for the dynamic linker and can't be staticly link edited again #define MAC_BINDATLOAD 0x8 // the object file's undefined references are bound by the dynamic linker when loaded. #define MAC_PREBOUND 0x10 // the file has it's dynamic undefined references prebound. -#define MAC_SPLIT_SEGS 0x20 // the file has its read-only and read-write segments split -#define MAC_LAZY_INIT 0x40 // the shared library init routine is to be run lazily via catching memory faults to its writeable segments (obsolete) -#define MAC_TWOLEVEL 0x80 // the image is using two-level name space bindings -#define MAC_FORCE_FLAT 0x100 // the executable is forcing all images to use flat name space bindings -#define MAC_NOMULTIDEFS 0x200 // this umbrella guarantees no multiple defintions of symbols in its sub-images so the two-level namespace hints can always be used -#define MAC_NOFIXPREBINDING 0x400 // do not have dyld notify the prebinding agent about this executable -#define MAC_PREBINDABLE 0x800 // the binary is not prebound but can have its prebinding redone. only used when MH_PREBOUND is not set -#define MAC_ALLMODSBOUND 0x1000 // indicates that this binary binds to all two-level namespace modules of its dependent libraries. only used when MH_PREBINDABLE and MH_TWOLEVEL are both set -#define MAC_SUBSECTIONS_VIA_SYMBOLS 0x2000 // safe to divide up the sections into sub-sections via symbols for dead code stripping -#define MAC_CANONICAL 0x4000 // the binary has been canonicalized via the unprebind operation +#define MAC_SPLIT_SEGS 0x20 // the file has its read-only and read-write segments split +#define MAC_LAZY_INIT 0x40 // the shared library init routine is to be run lazily via catching memory faults to its writeable segments (obsolete) +#define MAC_TWOLEVEL 0x80 // the image is using two-level name space bindings +#define MAC_FORCE_FLAT 0x100 // the executable is forcing all images to use flat name space bindings +#define MAC_NOMULTIDEFS 0x200 // this umbrella guarantees no multiple defintions of symbols in its sub-images so the two-level namespace hints can always be used +#define MAC_NOFIXPREBINDING 0x400 // do not have dyld notify the prebinding agent about this executable +#define MAC_PREBINDABLE 0x800 // the binary is not prebound but can have its prebinding redone. only used when MH_PREBOUND is not set +#define MAC_ALLMODSBOUND 0x1000 // indicates that this binary binds to all two-level namespace modules of its dependent libraries. only used when MH_PREBINDABLE and MH_TWOLEVEL are both set +#define MAC_SUBSECTIONS_VIA_SYMBOLS 0x2000 // safe to divide up the sections into sub-sections via symbols for dead code stripping +#define MAC_CANONICAL 0x4000 // the binary has been canonicalized via the unprebind operation //?? #define MAC_VM_PROT_NONE 0x00 @@ -500,91 +500,91 @@ struct MAC_dysymtab_command { #define MAC_INDIRECT_SYMBOL_ABS 0x40000000 // Relocation entries -/* Format of a relocation entry of a Mach-O file. Modified from the 4.3BSD - * format. The modifications from the original format were changing the value - * of the r_symbolnum field for "local" (r_extern == 0) relocation entries. - * This modification is required to support symbols in an arbitrary number of - * sections not just the three sections (text, data and bss) in a 4.3BSD file. - * Also the last 4 bits have had the r_type tag added to them. */ - -#define R_SCATTERED 0x80000000 // mask to be applied to the r_address field of a relocation_info structure to tell that - // is is really a scattered_relocation_info stucture - -struct MAC_relocation_info { - uint32 r_address; // offset in the section to what is being relocated (source) - uint32 r_symbolnum:24, // symbol table index (0-based) if r_extern == 1 or section number (1-based) if r_extern == 0 - r_pcrel:1, // pc relative. The target address (inline) is already pc relative - r_length:2, // 0=byte, 1=word, 2=dword - r_extern:1, // r_extern = 1 for symbols in symbol table - r_type:4; // if not 0, machine specific relocation type -}; // The inline value of the source is the target address (pc-relative - // or absolute) if r_extern = 0, or an addend if r_extern = 1. +/* Format of a relocation entry of a Mach-O file. Modified from the 4.3BSD + * format. The modifications from the original format were changing the value + * of the r_symbolnum field for "local" (r_extern == 0) relocation entries. + * This modification is required to support symbols in an arbitrary number of + * sections not just the three sections (text, data and bss) in a 4.3BSD file. + * Also the last 4 bits have had the r_type tag added to them. */ + +#define R_SCATTERED 0x80000000 // mask to be applied to the r_address field of a relocation_info structure to tell that + // is is really a scattered_relocation_info stucture + +struct MAC_relocation_info { + uint32 r_address; // offset in the section to what is being relocated (source) + uint32 r_symbolnum:24, // symbol table index (0-based) if r_extern == 1 or section number (1-based) if r_extern == 0 + r_pcrel:1, // pc relative. The target address (inline) is already pc relative + r_length:2, // 0=byte, 1=word, 2=dword + r_extern:1, // r_extern = 1 for symbols in symbol table + r_type:4; // if not 0, machine specific relocation type +}; // The inline value of the source is the target address (pc-relative + // or absolute) if r_extern = 0, or an addend if r_extern = 1. struct MAC_scattered_relocation_info { - uint32 r_address:24, // offset in the section to what is being relocated (source) - r_type:4, // if not 0, machine specific relocation type - r_length:2, // 0=byte, 1=word, 2=dword, 3=qword - r_pcrel:1, // pc relative. The target address is already pc relative - r_scattered:1; // 1=scattered, 0=non-scattered (see above) + uint32 r_address:24, // offset in the section to what is being relocated (source) + r_type:4, // if not 0, machine specific relocation type + r_length:2, // 0=byte, 1=word, 2=dword, 3=qword + r_pcrel:1, // pc relative. The target address is already pc relative + r_scattered:1; // 1=scattered, 0=non-scattered (see above) int32 r_value; // target address (without any offset added. The offset is stored inline in the source) }; // 32-bit relocation types: -/* Relocation types used in a generic implementation. Relocation entries for - * normal things use the generic relocation as discribed above and their r_type - * is GENERIC_RELOC_VANILLA (a value of zero). - * - * Another type of generic relocation, GENERIC_RELOC_SECTDIFF, is to support - * the difference of two symbols defined in different sections. That is the - * expression "symbol1 - symbol2 + constant" is a relocatable expression when - * both symbols are defined in some section. For this type of relocation - * both relocations entries are scattered relocation entries. The value of - * symbol1 is stored in the first relocation entry's r_value field and the - * value of symbol2 is stored in the pair's r_value field. - * - * A special case for a prebound lazy pointer is needed to be able to set the - * value of the lazy pointer back to its non-prebound state. This is done - * using the GENERIC_RELOC_PB_LA_PTR r_type. This is a scattered relocation - * entry where the r_value field is the value of the lazy pointer not prebound. */ - -/* My interpretation (A Fog): - 32-bit: Objects are not addressed by their offset into the section but by - their "absolute" address. This "absolute" address has no reality. - It is the address that the object would have if the section was placed - at the address specified in the addr field of the section header. - Scattered: - The first record, of type MAC32_RELOC_SECTDIFF or MAC32_RELOC_LOCAL_SECTDIFF - contains the "absolute" address of a first reference point, let's call it ref1, - in the r_value field. The second record, of type MAC32_RELOC_PAIR contains the - "absolute" address of a second reference point, ref2, in the r_value field. - The inline value is the "absolute" address of the relocation target minus ref2. - ref1 is often = target, but may be any label preceding the target. The linker - has to add (ref1 - ref2) in image minus (ref1 - ref2) in object file to the - inline value. The relocation source (the position of the inline field) is - given in r_address in the first record, relative the the section. - Non-scattered, absolute, r_extern = 1: - r_symbolnum = symbol index (0-based) - Non-scattered, absolute, r_extern = 0: - r_symbolnum = section index, inline = absolute address of target? - Non-scattered, r_pcrel = 1, r_extern = 1: - r_symbolnum = symbol index (0-based) - Inline = source absolute address - 4 - Non-scattered, r_pcrel = 1, r_extern = 0: - r_symbolnum = section index, - inline = absolute address of target - absolute address of source - 4 -*/ - -#define MAC32_RELOC_VANILLA 0 // A generic relocation entry for both addresses contained in data - // and addresses contained in CPU instructions. -#define MAC32_RELOC_PAIR 1 // The second relocation entry of a pair. Only follows a GENERIC_RELOC_SECTDIFF -#define MAC32_RELOC_SECTDIFF 2 // A relocation entry for an item that contains the difference of - // two section addresses. This is generally used for position-independent code generation. -#define MAC32_RELOC_PB_LA_PTR 3 // PTR—Arelocation entry for a prebound lazy pointer. This is always - // a scattered relocation entry. The r_value field contains the non-prebound value of the lazy pointer. -#define MAC32_RELOC_LOCAL_SECTDIFF 4 // SECTDIFF—Similar to GENERIC_RELOC_SECTDIFF except that this entry refers specifically to the address in this item. - // If the address is that of a globally visible coalesced symbol, this relocation entry does not change if the symbol is overridden. - // This is used to associate stack unwinding information with the object code this relocation entry describes. - +/* Relocation types used in a generic implementation. Relocation entries for + * normal things use the generic relocation as discribed above and their r_type + * is GENERIC_RELOC_VANILLA (a value of zero). + * + * Another type of generic relocation, GENERIC_RELOC_SECTDIFF, is to support + * the difference of two symbols defined in different sections. That is the + * expression "symbol1 - symbol2 + constant" is a relocatable expression when + * both symbols are defined in some section. For this type of relocation + * both relocations entries are scattered relocation entries. The value of + * symbol1 is stored in the first relocation entry's r_value field and the + * value of symbol2 is stored in the pair's r_value field. + * + * A special case for a prebound lazy pointer is needed to be able to set the + * value of the lazy pointer back to its non-prebound state. This is done + * using the GENERIC_RELOC_PB_LA_PTR r_type. This is a scattered relocation + * entry where the r_value field is the value of the lazy pointer not prebound. */ + +/* My interpretation (A Fog): + 32-bit: Objects are not addressed by their offset into the section but by + their "absolute" address. This "absolute" address has no reality. + It is the address that the object would have if the section was placed + at the address specified in the addr field of the section header. + Scattered: + The first record, of type MAC32_RELOC_SECTDIFF or MAC32_RELOC_LOCAL_SECTDIFF + contains the "absolute" address of a first reference point, let's call it ref1, + in the r_value field. The second record, of type MAC32_RELOC_PAIR contains the + "absolute" address of a second reference point, ref2, in the r_value field. + The inline value is the "absolute" address of the relocation target minus ref2. + ref1 is often = target, but may be any label preceding the target. The linker + has to add (ref1 - ref2) in image minus (ref1 - ref2) in object file to the + inline value. The relocation source (the position of the inline field) is + given in r_address in the first record, relative the the section. + Non-scattered, absolute, r_extern = 1: + r_symbolnum = symbol index (0-based) + Non-scattered, absolute, r_extern = 0: + r_symbolnum = section index, inline = absolute address of target? + Non-scattered, r_pcrel = 1, r_extern = 1: + r_symbolnum = symbol index (0-based) + Inline = source absolute address - 4 + Non-scattered, r_pcrel = 1, r_extern = 0: + r_symbolnum = section index, + inline = absolute address of target - absolute address of source - 4 +*/ + +#define MAC32_RELOC_VANILLA 0 // A generic relocation entry for both addresses contained in data + // and addresses contained in CPU instructions. +#define MAC32_RELOC_PAIR 1 // The second relocation entry of a pair. Only follows a GENERIC_RELOC_SECTDIFF +#define MAC32_RELOC_SECTDIFF 2 // A relocation entry for an item that contains the difference of + // two section addresses. This is generally used for position-independent code generation. +#define MAC32_RELOC_PB_LA_PTR 3 // —Arelocation entry for a prebound lazy pointer. This is always + // a scattered relocation entry. The r_value field contains the non-prebound value of the lazy pointer. +#define MAC32_RELOC_LOCAL_SECTDIFF 4 // SECTDIFF—Similar to GENERIC_RELOC_SECTDIFF except that this entry refers specifically to the address in this item. + // If the address is that of a globally visible coalesced symbol, this relocation entry does not change if the symbol is overridden. + // This is used to associate stack unwinding information with the object code this relocation entry describes. + // 64-bit relocation types: // Scattered relocations are not used in 64-bit Mach-O. // reloc.h says that references to local symbols are made by the nearest @@ -605,187 +605,187 @@ struct MAC_scattered_relocation_info { #define MAC64_RELOC_SIGNED_1 6 // signed 32-bit displacement with implicit -4 addend and explicit -1 addend #define MAC64_RELOC_SIGNED_2 7 // signed 32-bit displacement with implicit -4 addend and explicit -2 addend #define MAC64_RELOC_SIGNED_4 8 // signed 32-bit displacement with implicit -4 addend and explicit -4 addend - + // Symbol table entries -/* Format of a symbol table entry of a Mach-O file. Modified from the BSD - * format. The modifications from the original format were changing n_other - * (an unused field) to n_sect and the addition of the N_SECT type. These - * modifications are required to support symbols in an arbitrary number of - * sections not just the three sections (text, data and bss) in a BSD file. */ - -struct MAC_nlist_32 { - uint32 n_strx; // index into the string table - uint8 n_type; // type flag, see below - uint8 n_sect; // section number or NO_SECT - int16 n_desc; // see - uint32 n_value; // value of this symbol (or stab offset) -}; - -struct MAC_nlist_64 { - uint32 n_strx; // index into the string table - uint8 n_type; // type flag, see below - uint8 n_sect; // section number or NO_SECT - int16 n_desc; // see - uint64 n_value; // value of this symbol (or stab offset) -}; - -/* Symbols with a index into the string table of zero are - * defined to have a null, "", name. */ - -/* The n_type field really contains three fields: -* unsigned char N_STAB:3, -* N_PEXT:1, -* N_TYPE:3, -* N_EXT:1; -* which are used via the following masks. */ - -#define MAC_N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */ -#define MAC_N_PEXT 0x10 /* private external symbol bit */ -#define MAC_N_TYPE 0x0e /* mask for the type bits */ -#define MAC_N_EXT 0x01 /* external symbol bit, set for external symbols */ - -/* Only symbolic debugging entries have some of the N_STAB bits set and if any - * of these bits are set then it is a symbolic debugging entry (a stab). In - * which case then the values of the n_type field (the entire field) are given - * in */ - -// Values for N_TYPE bits of the n_type field. -#define MAC_N_UNDF 0x0 // undefined, n_sect == NO_SECT -#define MAC_N_ABS 0x2 // absolute, n_sect == NO_SECT -#define MAC_N_SECT 0xe // defined in section number n_sect -#define MAC_N_PBUD 0xc // prebound undefined (defined in a dylib) -#define MAC_N_INDR 0xa // indirect - -/* If the type is MAC_N_INDR then the symbol is defined to be the same as another - * symbol. In this case the n_value field is an index into the string table - * of the other symbol's name. When the other symbol is defined then they both - * take on the defined type and value. */ - -/* If the type is MAC_N_SECT then the n_sect field contains an ordinal of the - * section the symbol is defined in. The sections are numbered from 1 and - * refer to sections in order they appear in the load commands for the file - * they are in. This means the same ordinal may very well refer to different - * sections in different files. - * - * The n_value field for all symbol table entries (including N_STAB's) gets - * updated by the link editor based on the value of it's n_sect field and where - * the section n_sect references gets relocated. If the value of the n_sect - * field is NO_SECT then it's n_value field is not changed by the link editor. */ - -#define MAC_NO_SECT 0 // symbol is not in any section -#define MAC_MAX_SECT 255 // 1 thru 255 inclusive - -/* Common symbols are represented by undefined (N_UNDF) external (N_EXT) types - * who's values (n_value) are non-zero. In which case the value of the n_value - * field is the size (in bytes) of the common symbol. The n_sect field is set - * to NO_SECT. */ - -/* To support the lazy binding of undefined symbols in the dynamic link-editor, - * the undefined symbols in the symbol table (the nlist structures) are marked - * with the indication if the undefined reference is a lazy reference or - * non-lazy reference. If both a non-lazy reference and a lazy reference is - * made to the same symbol the non-lazy reference takes precedence. A reference - * is lazy only when all references to that symbol are made through a symbol - * pointer in a lazy symbol pointer section. - * - * The implementation of marking nlist structures in the symbol table for - * undefined symbols will be to use some of the bits of the n_desc field as a - * reference type. The mask REFERENCE_TYPE will be applied to the n_desc field - * of an nlist structure for an undefined symbol to determine the type of - * undefined reference (lazy or non-lazy). - * - * The constants for the REFERENCE FLAGS are propagated to the reference table - * in a shared library file. In that case the constant for a defined symbol, - * REFERENCE_FLAG_DEFINED, is also used. */ - -/* Reference type bits of the n_desc field of undefined symbols */ -#define MAC_REF_TYPE 0xf -/* types of references */ -#define MAC_REF_FLAG_UNDEFINED_NON_LAZY 0 -#define MAC_REF_FLAG_UNDEFINED_LAZY 1 -#define MAC_REF_FLAG_DEFINED 2 -#define MAC_REF_FLAG_PRIVATE_DEFINED 3 -#define MAC_REF_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4 -#define MAC_REF_FLAG_PRIVATE_UNDEFINED_LAZY 5 - -/* To simplify stripping of objects that use are used with the dynamic link - * editor, the static link editor marks the symbols defined an object that are - * referenced by a dynamicly bound object (dynamic shared libraries, bundles). - * With this marking strip knows not to strip these symbols. */ - -/* The non-reference type bits of the n_desc field for global symbols are - * reserved for the dynamic link editor. All of these bits must start out - * zero in the object file. */ - - -// Additional n_desc flags -#define MAC_REFERENCED_DYNAMICALLY 0x10 // Must be set for any defined symbol that is referenced by dynamic-loader APIs (such as dlsym and NSLookupSymbolInImage) and not ordinary - // undefined symbol references. The strip tool uses this bit to avoid removing symbols that must exist: If the symbol has this bit set, strip does not strip it. - -#define MAC_N_DESC_DISCARDED 0x20 // Sometimes used by the dynamic linker at runtime in a fully linked image. Do not set this bit in a fully linked image. -//#define MAC_N_DESC_DISCARDED 0x8000 - -#define MAC_N_NO_DEAD_STRIP 0x20 // When set in a relocatable object file (file type MH_OBJECT) on a defined symbol, - // indicates to the static linker to never dead-strip the symbol. (Note that the same bit (0x20) is used for two nonoverlapping purposes.) - -#define MAC_N_WEAK_REF 0x40 // Indicates that this undefined symbol is aweak reference. If the dynamic linker cannot find a definition - // for this symbol, it sets the address of this symbol to 0. The static linker sets this symbol given the appropriate weak-linking flags. - -#define MAC_N_WEAK_DEF 0x80 // Indicates that this symbol is a weak definition. If the static linker or the dynamic linker finds another - // (non-weak) definition for this symbol, theweak definition is ignored. Only symbols in a coalesced section (page 21) can be marked as a weak definition. - -// Data structure used when sorting symbol table for Mach-O file in MacSymbolTableBuilder -template -struct MacSymbolRecord : public TMAC_nlist { - uint32 Name; // Index into MacSymbolTableBuilder::StringBuffer - int OldIndex; // Old symbol index -}; - -// Class for building and storing symbol table, sorted or unsorted -template -class MacSymbolTableBuilder : public CMemoryBuffer { - int sorted; // Remember if list is sorted - CMemoryBuffer StringBuffer; // Temporary storage of symbol names -public: - MacSymbolTableBuilder(); // Constructor - void AddSymbol(int OldIndex, const char * name, int type, int Desc, int section, MInt value); // Add symbol to list - void SortList(); // Sort the list - int TranslateIndex(int OldIndex); // Translate old index to new index, after sorting - void StoreList(CMemoryBuffer * SymbolTable, CMemoryBuffer * StringTable); // Store sorted list in buffers - int Search(const char * name); // Search for name. -1 if not found - MacSymbolRecord & operator[] (uint32 i); // Access member -}; - -// structures for MacIntosh universal binaries -struct MAC_UNIV_FAT_HEADER { // File header for universal binary - uint32 magic; // Magic number 0xCAFEBABE, big endian - uint32 num_arch; // Number of members, big endian -}; - -struct MAC_UNIV_FAT_ARCH { // Member pointer - uint32 cputype; // cpu type - uint32 cpusubtype; // cpu subtype - uint32 offset; // file offset of member - uint32 size; // size of member - uint32 align; // alignment in file = 2^align -}; - -// Structure used for list of sections that have relocations during disassembly -struct MAC_SECT_WITH_RELOC { - int32 Section; // Section index - uint32 SectOffset; // File offset of section binary data - uint32 NumReloc; // Number of relocations records for this section - uint32 ReltabOffset; // File offset of relocation table for this section -}; - -/********************** Strings **********************/ -#define MAC_CONSTRUCTOR_NAME "__mod_init_func" // Name of constructors section - - -// Macros listing all word-size dependent structures, used as template parameter list -#define MACSTRUCTURES TMAC_header, TMAC_segment_command, TMAC_section, TMAC_nlist, MInt -#define MAC32STRUCTURES MAC_header_32, MAC_segment_command_32, MAC_section_32, MAC_nlist_32, int32 -#define MAC64STRUCTURES MAC_header_64, MAC_segment_command_64, MAC_section_64, MAC_nlist_64, int64 - -#endif // #ifndef MACHO_H +/* Format of a symbol table entry of a Mach-O file. Modified from the BSD + * format. The modifications from the original format were changing n_other + * (an unused field) to n_sect and the addition of the N_SECT type. These + * modifications are required to support symbols in an arbitrary number of + * sections not just the three sections (text, data and bss) in a BSD file. */ + +struct MAC_nlist_32 { + uint32 n_strx; // index into the string table + uint8 n_type; // type flag, see below + uint8 n_sect; // section number or NO_SECT + int16 n_desc; // see + uint32 n_value; // value of this symbol (or stab offset) +}; + +struct MAC_nlist_64 { + uint32 n_strx; // index into the string table + uint8 n_type; // type flag, see below + uint8 n_sect; // section number or NO_SECT + int16 n_desc; // see + uint64 n_value; // value of this symbol (or stab offset) +}; + +/* Symbols with a index into the string table of zero are + * defined to have a null, "", name. */ + +/* The n_type field really contains three fields: +* unsigned char N_STAB:3, +* N_PEXT:1, +* N_TYPE:3, +* N_EXT:1; +* which are used via the following masks. */ + +#define MAC_N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */ +#define MAC_N_PEXT 0x10 /* private external symbol bit */ +#define MAC_N_TYPE 0x0e /* mask for the type bits */ +#define MAC_N_EXT 0x01 /* external symbol bit, set for external symbols */ + +/* Only symbolic debugging entries have some of the N_STAB bits set and if any + * of these bits are set then it is a symbolic debugging entry (a stab). In + * which case then the values of the n_type field (the entire field) are given + * in */ + +// Values for N_TYPE bits of the n_type field. +#define MAC_N_UNDF 0x0 // undefined, n_sect == NO_SECT +#define MAC_N_ABS 0x2 // absolute, n_sect == NO_SECT +#define MAC_N_SECT 0xe // defined in section number n_sect +#define MAC_N_PBUD 0xc // prebound undefined (defined in a dylib) +#define MAC_N_INDR 0xa // indirect + +/* If the type is MAC_N_INDR then the symbol is defined to be the same as another + * symbol. In this case the n_value field is an index into the string table + * of the other symbol's name. When the other symbol is defined then they both + * take on the defined type and value. */ + +/* If the type is MAC_N_SECT then the n_sect field contains an ordinal of the + * section the symbol is defined in. The sections are numbered from 1 and + * refer to sections in order they appear in the load commands for the file + * they are in. This means the same ordinal may very well refer to different + * sections in different files. + * + * The n_value field for all symbol table entries (including N_STAB's) gets + * updated by the link editor based on the value of it's n_sect field and where + * the section n_sect references gets relocated. If the value of the n_sect + * field is NO_SECT then it's n_value field is not changed by the link editor. */ + +#define MAC_NO_SECT 0 // symbol is not in any section +#define MAC_MAX_SECT 255 // 1 thru 255 inclusive + +/* Common symbols are represented by undefined (N_UNDF) external (N_EXT) types + * who's values (n_value) are non-zero. In which case the value of the n_value + * field is the size (in bytes) of the common symbol. The n_sect field is set + * to NO_SECT. */ + +/* To support the lazy binding of undefined symbols in the dynamic link-editor, + * the undefined symbols in the symbol table (the nlist structures) are marked + * with the indication if the undefined reference is a lazy reference or + * non-lazy reference. If both a non-lazy reference and a lazy reference is + * made to the same symbol the non-lazy reference takes precedence. A reference + * is lazy only when all references to that symbol are made through a symbol + * pointer in a lazy symbol pointer section. + * + * The implementation of marking nlist structures in the symbol table for + * undefined symbols will be to use some of the bits of the n_desc field as a + * reference type. The mask REFERENCE_TYPE will be applied to the n_desc field + * of an nlist structure for an undefined symbol to determine the type of + * undefined reference (lazy or non-lazy). + * + * The constants for the REFERENCE FLAGS are propagated to the reference table + * in a shared library file. In that case the constant for a defined symbol, + * REFERENCE_FLAG_DEFINED, is also used. */ + +/* Reference type bits of the n_desc field of undefined symbols */ +#define MAC_REF_TYPE 0xf +/* types of references */ +#define MAC_REF_FLAG_UNDEFINED_NON_LAZY 0 +#define MAC_REF_FLAG_UNDEFINED_LAZY 1 +#define MAC_REF_FLAG_DEFINED 2 +#define MAC_REF_FLAG_PRIVATE_DEFINED 3 +#define MAC_REF_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4 +#define MAC_REF_FLAG_PRIVATE_UNDEFINED_LAZY 5 + +/* To simplify stripping of objects that use are used with the dynamic link + * editor, the static link editor marks the symbols defined an object that are + * referenced by a dynamicly bound object (dynamic shared libraries, bundles). + * With this marking strip knows not to strip these symbols. */ + +/* The non-reference type bits of the n_desc field for global symbols are + * reserved for the dynamic link editor. All of these bits must start out + * zero in the object file. */ + + +// Additional n_desc flags +#define MAC_REFERENCED_DYNAMICALLY 0x10 // Must be set for any defined symbol that is referenced by dynamic-loader APIs (such as dlsym and NSLookupSymbolInImage) and not ordinary + // undefined symbol references. The strip tool uses this bit to avoid removing symbols that must exist: If the symbol has this bit set, strip does not strip it. + +#define MAC_N_DESC_DISCARDED 0x20 // Sometimes used by the dynamic linker at runtime in a fully linked image. Do not set this bit in a fully linked image. +//#define MAC_N_DESC_DISCARDED 0x8000 + +#define MAC_N_NO_DEAD_STRIP 0x20 // When set in a relocatable object file (file type MH_OBJECT) on a defined symbol, + // indicates to the static linker to never dead-strip the symbol. (Note that the same bit (0x20) is used for two nonoverlapping purposes.) + +#define MAC_N_WEAK_REF 0x40 // Indicates that this undefined symbol is aweak reference. If the dynamic linker cannot find a definition + // for this symbol, it sets the address of this symbol to 0. The static linker sets this symbol given the appropriate weak-linking flags. + +#define MAC_N_WEAK_DEF 0x80 // Indicates that this symbol is a weak definition. If the static linker or the dynamic linker finds another + // (non-weak) definition for this symbol, theweak definition is ignored. Only symbols in a coalesced section (page 21) can be marked as a weak definition. + +// Data structure used when sorting symbol table for Mach-O file in MacSymbolTableBuilder +template +struct MacSymbolRecord : public TMAC_nlist { + uint32 Name; // Index into MacSymbolTableBuilder::StringBuffer + int OldIndex; // Old symbol index +}; + +// Class for building and storing symbol table, sorted or unsorted +template +class MacSymbolTableBuilder : public CMemoryBuffer { + int sorted; // Remember if list is sorted + CMemoryBuffer StringBuffer; // Temporary storage of symbol names +public: + MacSymbolTableBuilder(); // Constructor + void AddSymbol(int OldIndex, const char * name, int type, int Desc, int section, MInt value); // Add symbol to list + void SortList(); // Sort the list + int TranslateIndex(int OldIndex); // Translate old index to new index, after sorting + void StoreList(CMemoryBuffer * SymbolTable, CMemoryBuffer * StringTable); // Store sorted list in buffers + int Search(const char * name); // Search for name. -1 if not found + MacSymbolRecord & operator[] (uint32 i); // Access member +}; + +// structures for MacIntosh universal binaries +struct MAC_UNIV_FAT_HEADER { // File header for universal binary + uint32 magic; // Magic number 0xCAFEBABE, big endian + uint32 num_arch; // Number of members, big endian +}; + +struct MAC_UNIV_FAT_ARCH { // Member pointer + uint32 cputype; // cpu type + uint32 cpusubtype; // cpu subtype + uint32 offset; // file offset of member + uint32 size; // size of member + uint32 align; // alignment in file = 2^align +}; + +// Structure used for list of sections that have relocations during disassembly +struct MAC_SECT_WITH_RELOC { + int32 Section; // Section index + uint32 SectOffset; // File offset of section binary data + uint32 NumReloc; // Number of relocations records for this section + uint32 ReltabOffset; // File offset of relocation table for this section +}; + +/********************** Strings **********************/ +#define MAC_CONSTRUCTOR_NAME "__mod_init_func" // Name of constructors section + + +// Macros listing all word-size dependent structures, used as template parameter list +#define MACSTRUCTURES TMAC_header, TMAC_segment_command, TMAC_section, TMAC_nlist, MInt +#define MAC32STRUCTURES MAC_header_32, MAC_segment_command_32, MAC_section_32, MAC_nlist_32, int32 +#define MAC64STRUCTURES MAC_header_64, MAC_segment_command_64, MAC_section_64, MAC_nlist_64, int64 + +#endif // #ifndef MACHO_H diff --git a/src/main.cpp b/src/main.cpp index ca1e73f..11a0cf5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -113,6 +113,10 @@ void CMain::Go() { Read(IgnoreError); // Read input file GetFileType(); // Determine file type cmd.InputType = FileType; // Save input file type in cmd for access from other modules + if (cmd.OutputType == 0) { + // desired type not specified + cmd.OutputType = FileType; + } if (err.Number()) return; // Return if error CheckOutputFileName(); // Construct output file name with default extension if (err.Number()) return; diff --git a/src/maindef.h b/src/maindef.h index d95742d..10a25eb 100644 --- a/src/maindef.h +++ b/src/maindef.h @@ -1,19 +1,19 @@ /**************************** maindef.h ********************************** * Author: Agner Fog * Date created: 2006-08-26 -* Last modified: 2012-08-23 +* Last modified: 2018-10-08 * Project: objconv * Module: maindef.h * Description: * Header file for type definitions and other main definitions. * -* Copyright 2006-2012 GNU General Public License http://www.gnu.org/licenses +* Copyright 2006-2018 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #ifndef MAINDEF_H #define MAINDEF_H // Program version -#define OBJCONV_VERSION 2.16 +#define OBJCONV_VERSION 2.51 // Integer type definitions with platform-independent sizes: @@ -41,18 +41,18 @@ typedef long long int64; // 64 bit signed integer typedef unsigned long long uint64; // 64 bit unsigned integer #else - // Compilers supporting C99 or C++0x or C++1x have inttypes.h defining these integer types - // This is the preferred solution: - #include - //typedef int8_t int8; // Gnu compiler can't convert int8_t to char - typedef char int8; // 8 bit signed integer - typedef uint8_t uint8; // 8 bit unsigned integer - typedef int16_t int16; // 16 bit signed integer - typedef uint16_t uint16; // 16 bit unsigned integer - typedef int32_t int32; // 32 bit signed integer - typedef uint32_t uint32; // 32 bit unsigned integer - typedef int64_t int64; // 64 bit signed integer - typedef uint64_t uint64; // 64 bit unsigned integer + // Compilers supporting C99 or C++0x or C++1x have inttypes.h defining these integer types + // This is the preferred solution: + #include + //typedef int8_t int8; // Gnu compiler can't convert int8_t to char + typedef char int8; // 8 bit signed integer + typedef uint8_t uint8; // 8 bit unsigned integer + typedef int16_t int16; // 16 bit signed integer + typedef uint16_t uint16; // 16 bit unsigned integer + typedef int32_t int32; // 32 bit signed integer + typedef uint32_t uint32; // 32 bit unsigned integer + typedef int64_t int64; // 64 bit signed integer + typedef uint64_t uint64; // 64 bit unsigned integer #endif @@ -89,6 +89,12 @@ static inline uint32 HighDWord (uint64 x) { #define FILETYPE_LIBRARY 0x1000 // UNIX-style library/archive #define FILETYPE_OMFLIBRARY 0x2000 // OMF-style library +// Library subtypes +#define LIBTYPE_OMF 0x01 // OMF library +#define LIBTYPE_SHORTNAMES 0x10 // Short member names only, compatible with all systems +#define LIBTYPE_WINDOWS 0x11 // Long member names in "//" member, terminated by 0 +#define LIBTYPE_LINUX 0x12 // Long member names in "//" member, terminated by '/'+LF +#define LIBTYPE_BSD_MAC 0x13 // Long member name after header. Length indicated by #1/ // Define constants for symbol scope #define S_LOCAL 0 // Local symbol. Accessed only internally @@ -97,20 +103,20 @@ static inline uint32 HighDWord (uint64 x) { // Macro to calculate the size of an array -#define TableSize(x) (sizeof(x)/sizeof(x[0])) +#define TableSize(x) ((int)(sizeof(x)/sizeof(x[0]))) // Structures and functions used for lookup tables: // Structure of integers and char *, used for tables of text strings struct SIntTxt { - int a; + uint32 a; const char * b; }; // Translate integer value to text string by looking up in table of SIntTxt. // Parameters: p = table, n = length of table, x = value to find in table -static inline char const * LookupText(SIntTxt const * p, int n, int x) { +static inline char const * LookupText(SIntTxt const * p, int n, uint32 x) { for (int i=0; ia == x) return p->b; } diff --git a/src/omf.cpp b/src/omf.cpp index 615d061..eb309d6 100644 --- a/src/omf.cpp +++ b/src/omf.cpp @@ -1,7 +1,7 @@ /**************************** omf.cpp ********************************* * Author: Agner Fog * Date created: 2007-01-29 -* Last modified: 2009-07-17 +* Last modified: 2018-05-26 * Project: objconv * Module: omf.cpp * Description: @@ -9,7 +9,7 @@ * * Class COMF is used for reading, interpreting and dumping OMF files. * -* Copyright 2007-2009 GNU General Public License http://www.gnu.org/licenses +* Copyright 2007-2018 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" @@ -93,7 +93,7 @@ COMF::COMF() { void COMF::ParseFile() { // Parse file buffer - uint8 RecordType; // Type of current record + //uint8 RecordType; // Type of current record uint32 Checksum; // Record checksum uint32 ChecksumZero = 0; // Count number of records with zero checksum SOMFRecordPointer rec; // Current record pointer @@ -110,7 +110,7 @@ void COMF::ParseFile() { // Loop through records to set record pointers and store names do { // Read record - RecordType = rec.Type2; // First byte of record = type + //RecordType = rec.Type2; // First byte of record = type // Compute checksum Checksum = 0; rec.Index = 0; @@ -414,7 +414,7 @@ void COMF::DumpSegments() { void COMF::DumpRelocations() { // Dump all LEDATA, LIDATA, COMDAT and FIXUPP records - uint32 LastDataRecord = 0; // Index to the data record that relocations refer to + //uint32 LastDataRecord = 0; // Index to the data record that relocations refer to uint32 LastDataRecordSize = 0; // Size of the data record that relocations refer to int8 * LastDataRecordPointer = 0; // Pointer to data in the data record that relocations refer to uint32 i; // Loop counter @@ -435,7 +435,7 @@ void COMF::DumpRelocations() { Segment = Records[i].GetIndex(); // Read segment and offset Offset = Records[i].GetNumeric(); Size = Records[i].End - Records[i].Index; // Calculate size of data - LastDataRecord = i; // Save for later FIXUPP that refers to this record + //LastDataRecord = i; // Save for later FIXUPP that refers to this record LastDataRecordSize = Size; LastDataRecordPointer = Records[i].buffer + Records[i].FileOffset + Records[i].Index; if (Segment < 0x4000) { @@ -454,7 +454,7 @@ void COMF::DumpRelocations() { // LIDATA record Segment = Records[i].GetIndex(); Offset = Records[i].GetNumeric(); - LastDataRecord = i; + //LastDataRecord = i; LastDataRecordSize = Records[i].End - Records[i].Index; // Size before expansion of repeat blocks LastDataRecordPointer = Records[i].buffer + Records[i].FileOffset + Records[i].Index; printf("\n LIDATA: segment %s, Offset 0x%X, Size ", @@ -716,14 +716,13 @@ void COMF::PublicNames(CMemoryBuffer * Strings, CSList * Index, in while (rec.GetNext()); // End of loop through records } - char * COMF::GetLocalName(uint32 i) { // Get section name or class name by name index - if (i == 0) return (char*)"null"; - if (i < LocalNameOffset.GetNumEntries()) { - return NameBuffer.Buf() + LocalNameOffset[i]; - } - return (char*)"?"; + if (i == 0 || i >= LocalNameOffset.GetNumEntries()) { + i = NameBuffer.PushString("null"); + return NameBuffer.Buf() + i; + } + return NameBuffer.Buf() + LocalNameOffset[i]; } uint32 COMF::GetLocalNameO(uint32 i) { @@ -845,7 +844,7 @@ char * SOMFRecordPointer::GetString() { // Read string and return as ASCIIZ string in static buffer static char String[256]; uint8 Length = GetByte(); - if (Length == 0) { + if (Length == 0 /*|| Length >= sizeof(String)*/) { String[0] = 0; } else { @@ -889,7 +888,7 @@ uint8 SOMFRecordPointer::GetNext(uint32 align) { Type2 = Type; if (Type2 < OMF_LIBHEAD) Type2 &= ~1; // Make even uint16 RecordSize = GetWord(); // Get record size End = Index + RecordSize - 1; // Point to checksum byte - if (FileOffset + RecordSize + 3 > FileEnd) err.submit(2301); // Extends beyond end of file + if ((uint64)FileOffset + RecordSize + 3 > FileEnd) err.submit(2301); // Extends beyond end of file return Type2; } diff --git a/src/omf2asm.cpp b/src/omf2asm.cpp index 21d156c..93ac72f 100644 --- a/src/omf2asm.cpp +++ b/src/omf2asm.cpp @@ -1,13 +1,13 @@ /**************************** omf2asm.cpp ********************************* * Author: Agner Fog, modified by Don Clugston * Date created: 2007-05-27 -* Last modified: 2009-07-17 +* Last modified: 2014-05-32 * Project: objconv * Module: omf2asm.cpp * Description: * Module for disassembling OMF object files * -* (c) 2009 GNU General Public License www.gnu.org/copyleft/gpl.html +* (c) 2007-2014 GNU General Public License www.gnu.org/copyleft/gpl.html *****************************************************************************/ #include "stdafx.h" @@ -176,7 +176,7 @@ void COMF2ASM::CountSegments() { Records[i].Index = 3; uint8 flags = Records[i].GetByte(); - if ((flags & 2)!= 0) { + if ((flags & 2) != 0) { // don't support iterated data yet err.submit(2318); // Error message: not supported continue; @@ -185,7 +185,7 @@ void COMF2ASM::CountSegments() { uint8 align = Records[i].GetByte(); uint32 ofs = Records[i].GetNumeric(); Records[i].GetIndex(); // type (ignore) - uint16 publicBase = 0; + //uint16 publicBase = 0; uint16 publicSegment = 0; // From the OMF Spec 1.1: "If alloc type is EXPLICIT, public base is present and is // identical to public base fields BaseGroup, Base Segment & BaseFrame in the PUBDEF." @@ -193,9 +193,13 @@ void COMF2ASM::CountSegments() { // but in PUBDEF, those fields are Index, Index, or Index, zero, Index. (2-5 bytes) // The diagram appears to be erroneous. if ((attribs & 0xF) == 0){ - publicBase = Records[i].GetIndex(); + //publicBase = Records[i].GetIndex(); publicSegment = Records[i].GetIndex(); - if (publicSegment == 0) Records[i].GetIndex(); // skip frame in this case + if (publicSegment == 0) { + //Records[i].GetIndex(); // skip frame in this case + // I don't have the Digital Mars obj spec, but this seems to help ?? + publicSegment = Records[i].GetIndex(); // ?? + } } uint16 publicName = Records[i].GetIndex(); uint32 RecSize = Records[i].End - Records[i].Index; // Calculate size of data @@ -208,6 +212,9 @@ void COMF2ASM::CountSegments() { SegRecord.Type = 0x1000 | Segments[publicSegment].Type; SegRecord.WordSize = Segments[publicSegment].WordSize; } + + //SegRecord.Type |= 1;//!! + if (align != 0) { // alignment: (none), byte, word, paragraph, page, dword, arbitrary, arbitrary. static const int alignvalues[] = {0, 0, 1, 4, 16, 2, 3, 3}; @@ -359,7 +366,9 @@ void COMF2ASM::MakePublicSymbolsTable() { for (i = 0; i < NumRecords; i++) { if (Records[i].Type2 == OMF_COMDEF) { // COMDEF record, Borland communal name - uint32 DType, DSize, DNum; + uint32 DType; + //uint32 DSize; + //uint32 DNum; Records[i].Index = 3; // Loop through possibly multiple entries in record @@ -369,14 +378,14 @@ void COMF2ASM::MakePublicSymbolsTable() { DType = Records[i].GetByte(); // Data type switch (DType) { case 0x61: - DNum = Records[i].GetLength(); - DSize = Records[i].GetLength(); + //DNum = Records[i].GetLength(); + //DSize = Records[i].GetLength(); continue; // Don't know what to do with this type. Ignore case 0x62: - DSize = Records[i].GetLength(); + //DSize = Records[i].GetLength(); continue; // Don't know what to do with this type. Ignore default: - DSize = Records[i].GetLength(); + //DSize = Records[i].GetLength(); if (DType < 0x60) { // Borland segment index break; } @@ -680,7 +689,7 @@ void COMF2ASM::MakeRelocations(int32 Segment, uint32 RecNum, uint32 SOffset, uin uint32 Frame, Target, TargetDisplacement; // Contents of FIXUPP record uint8 byte1, byte2; // First two bytes of subrecord int32 Inline; // Inline address or addend in relocation source - int16 InlineSeg; // Segment address stored in relocation source + //int16 InlineSeg; // Segment address stored in relocation source int32 Addend; // Correction to add to target address int32 SourceSize; // Size of relocation source uint32 RelType; // Relocation type, as defined in disasm.h @@ -784,7 +793,8 @@ void COMF2ASM::MakeRelocations(int32 Segment, uint32 RecNum, uint32 SOffset, uin // Pointer to relocation source inline in raw data: uint8 * inlinep = SData + SOffset + Locat.s.Offset; - Inline = 0; InlineSeg = 0; SourceSize = 0; + Inline = 0; SourceSize = 0; + //InlineSeg = 0; TargetSegment = 0; TargetOffset = 0; TargetSymbol = 0; // Relocation type diff --git a/src/omf2cof.cpp b/src/omf2cof.cpp index 3ea1db2..f429faa 100644 --- a/src/omf2cof.cpp +++ b/src/omf2cof.cpp @@ -1,13 +1,13 @@ /**************************** omf2cof.cpp ********************************* * Author: Agner Fog * Date created: 2007-02-08 -* Last modified: 2009-07-16 +* Last modified: 2018-08-15 * Project: objconv * Module: omf2cof.cpp * Description: * Module for converting OMF file to PE/COFF file * -* Copyright 2007-2009 GNU General Public License http://www.gnu.org/licenses +* Copyright 2007-2018 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ #include "stdafx.h" @@ -15,848 +15,861 @@ static const uint32 OMFAlignTranslate[8] = {0,1,2,16,256,4,0,0}; COMF2COF::COMF2COF() { - // Constructor - memset(this, 0, sizeof(*this)); // Reset everything + // Constructor + memset(this, 0, sizeof(*this)); // Reset everything } void COMF2COF::Convert() { - // Do the conversion - // Allocate variable size buffers - //NewSectIndex.SetNum(this->NSections);// Allocate section translation table - //NewSectIndex.SetZero(); // Initialize - - // Call the subfunctions - ToFile.SetFileType(FILETYPE_COFF); // Set type of to file - MakeFileHeader(); // Make file header - MakeSymbolTable1(); // Make symbol table and string table entries for file and segments - MakeSymbolTable2(); // Make symbol table and string table entries for external symbols - MakeSymbolTable3(); // Make symbol table and string table entries for public symbols - MakeSymbolTable4(); // Make symbol table and string table entries for communal symbols - MakeSymbolTable5(); // Make symbol table and string table entries for local symbols - MakeSections(); // Make sections and relocation tables - CheckUnsupportedRecords(); // Make warnings if file containes unsupported record types - MakeBinaryFile(); // Put sections together - *this << ToFile; // Take over new file buffer + // Do the conversion + // Allocate variable size buffers + //NewSectIndex.SetNum(this->NSections);// Allocate section translation table + //NewSectIndex.SetZero(); // Initialize + + // Call the subfunctions + ToFile.SetFileType(FILETYPE_COFF); // Set type of to file + MakeFileHeader(); // Make file header + MakeSymbolTable1(); // Make symbol table and string table entries for file and segments + MakeSymbolTable2(); // Make symbol table and string table entries for external symbols + MakeSymbolTable3(); // Make symbol table and string table entries for public symbols + MakeSymbolTable4(); // Make symbol table and string table entries for communal symbols + MakeSymbolTable5(); // Make symbol table and string table entries for local symbols + MakeSections(); // Make sections and relocation tables + CheckUnsupportedRecords(); // Make warnings if file containes unsupported record types + MakeBinaryFile(); // Put sections together + *this << ToFile; // Take over new file buffer } void COMF2COF::MakeFileHeader() { - // Convert subfunction: File header - // Make PE file header - NewFileHeader.Machine = PE_MACHINE_I386; - NewFileHeader.TimeDateStamp = (uint32)time(0); - NewFileHeader.SizeOfOptionalHeader = 0; - NewFileHeader.Flags = 0; - - // Values inserted later: - NewFileHeader.NumberOfSections = 0; - NewFileHeader.PSymbolTable = 0; - NewFileHeader.NumberOfSymbols = 0; + // Convert subfunction: File header + // Make PE file header + NewFileHeader.Machine = PE_MACHINE_I386; + NewFileHeader.TimeDateStamp = (uint32)time(0); + NewFileHeader.SizeOfOptionalHeader = 0; + NewFileHeader.Flags = 0; + + // Values inserted later: + NewFileHeader.NumberOfSections = 0; + NewFileHeader.PSymbolTable = 0; + NewFileHeader.NumberOfSymbols = 0; } void COMF2COF::MakeSymbolTable1() { - // Make symbol table string table and section table entries for file and segments - SCOFF_SymTableEntry sym; // Symbol table entry - SCOFF_SectionHeader sec; // Section header entry - char * ClassName; // Old segment class name - - // Initialize new string table. make space for 4-bytes size - NewStringTable.Push(0, 4); - - // Allocate SegmentTranslation buffer - SegmentTranslation.SetNum(SegmentNameOffset.GetNumEntries()); - - // Make symbol table entry for file name - memset(&sym, 0, SIZE_SCOFF_SymTableEntry); - strcpy(sym.s.Name, ".file"); - sym.s.SectionNumber = COFF_SECTION_DEBUG; - sym.s.StorageClass = COFF_CLASS_FILE; - char * ShortFileName = CLibrary::TruncateMemberName(OutputFileName); - sym.s.NumAuxSymbols = 1; // File name is truncated so it will fit into the 18 bytes of SIZE_SCOFF_SymTableEntry - NewSymbolTable.Push(sym); // Store symbol table entry - // Needs auxiliary entry: - memset(&sym, 0, SIZE_SCOFF_SymTableEntry); - if (strlen(ShortFileName) < SIZE_SCOFF_SymTableEntry) { - strcpy(sym.s.Name, ShortFileName); - } - NewSymbolTable.Push(sym); // Store auxiliary symbol table entry - - // Define structure of attributes - OMF_SAttrib Attributes; - // Other segment properties - uint32 Offset, SegLength, NameIndex, ClassIndex; - const char * sname; // Segment/section name - uint32 SegNum = 0; // Segment/section number - uint32 StringI; // New sting table index - uint32 i; // Record number - int32 j, n; // Temporary - - // Loop through segments of old file - for (i = 0; i < NumRecords; i++) { - if (Records[i].Type2 == OMF_SEGDEF) { - // SEGDEF record - Records[i].Index = 3; - // Loop through entries in record. There should be only 1 - while (Records[i].Index < Records[i].End) { - Attributes.b = Records[i].GetByte(); // Read attributes - if (Attributes.u.A == 0) { - // Frame and Offset only included if A = 0 - Records[i].GetWord(); // Frame ignored - Offset = Records[i].GetByte(); + // Make symbol table string table and section table entries for file and segments + SCOFF_SymTableEntry sym; // Symbol table entry + SCOFF_SectionHeader sec; // Section header entry + char * ClassName; // Old segment class name + + // Initialize new string table. make space for 4-bytes size + NewStringTable.Push(0, 4); + + // Allocate SegmentTranslation buffer + SegmentTranslation.SetNum(SegmentNameOffset.GetNumEntries()); + + // Make symbol table entry for file name + memset(&sym, 0, SIZE_SCOFF_SymTableEntry); + strcpy(sym.s.Name, ".file"); + sym.s.SectionNumber = COFF_SECTION_DEBUG; + sym.s.StorageClass = COFF_CLASS_FILE; + char * ShortFileName = CLibrary::ShortenMemberName(OutputFileName); + sym.s.NumAuxSymbols = 1; // File name is truncated so it will fit into the 18 bytes of SIZE_SCOFF_SymTableEntry + NewSymbolTable.Push(sym); // Store symbol table entry + // Needs auxiliary entry: + memset(&sym, 0, SIZE_SCOFF_SymTableEntry); + if (strlen(ShortFileName) < SIZE_SCOFF_SymTableEntry) { + strcpy(sym.s.Name, ShortFileName); + } + NewSymbolTable.Push(sym); // Store auxiliary symbol table entry + + // Define structure of attributes + OMF_SAttrib Attributes; + // Other segment properties + uint32 SegLength, NameIndex, ClassIndex; + //uint32 Offset; + const char * sname; // Segment/section name + uint32 SegNum = 0; // Segment/section number + uint32 StringI; // New sting table index + uint32 i; // Record number + int32 j, n; // Temporary + + // Loop through segments of old file + for (i = 0; i < NumRecords; i++) { + if (Records[i].Type2 == OMF_SEGDEF) { + // SEGDEF record + Records[i].Index = 3; + // Loop through entries in record. There should be only 1 + while (Records[i].Index < Records[i].End) { + Attributes.b = Records[i].GetByte(); // Read attributes + if (Attributes.u.A == 0) { + // Frame and Offset only included if A = 0 + Records[i].GetWord(); // Frame ignored + Records[i].GetByte(); + } + //else Offset = 0; + SegLength = Records[i].GetNumeric(); + NameIndex = Records[i].GetIndex(); + ClassIndex = Records[i].GetIndex(); // Class index + Records[i].GetIndex(); // Overlay index ignored + sname = GetLocalName(NameIndex); // Segment name = new section name + + if (Attributes.u.B) { + // Segment is big + if (Attributes.u.P) { + // 32 bit segment. Big means 2^32 bytes! + err.submit(2306); + } + else { + // 16 bit segment. Big means 2^16 bytes + SegLength = 0x10000; + } + } + + // make symbol table entry + memset(&sym, 0, SIZE_SCOFF_SymTableEntry); + + // Put name into string table + StringI = NewStringTable.PushString(sname); + + // Put name into symbol table + //COFF_PutNameInSymbolTable(sym, sname, NewStringTable); + ((uint32*)(sym.s.Name))[1] = StringI; + + sym.s.SectionNumber = ++SegNum; // Count section number + sym.s.StorageClass = COFF_CLASS_STATIC; + sym.s.NumAuxSymbols = 1; // Needs 1 aux record + + // Remember NewSymbolTable index + SegmentTranslation[SegNum] = NewSymbolTable.GetNumEntries(); + NewSymbolTable.Push(sym); // Store symbol table entry + + // Make auxiliary entry + memset(&sym, 0, SIZE_SCOFF_SymTableEntry); + + // Insert section size + sym.section.Length = SegLength; + + // Remember to insert NumberOfRelocations here later + + // Store auxiliary symbol table entry + NewSymbolTable.Push(sym); + + // Make section header + memset(&sec, 0, sizeof(sec)); // Reset section header + + // Put name into section header + sprintf(sec.Name, "/%i", StringI); + + // Put size into section header + sec.SizeOfRawData = SegLength; + + // Alignment + switch (Attributes.u.A) { + case 0: // Absolute segment + err.submit(2307); break; + case 1: // Byte + sec.Flags |= PE_SCN_ALIGN_1; break; + case 2: // Word + sec.Flags |= PE_SCN_ALIGN_2; break; + case 3: // Paragraph + sec.Flags |= PE_SCN_ALIGN_16; break; + case 4: // Page. May be 256 or 4096, depending on system + // If we use 4096 where the source intended 256, we may get + // size and symbol offsets wrong! + sec.Flags |= PE_SCN_ALIGN_256; break; + case 5: // Dword + sec.Flags |= PE_SCN_ALIGN_4; break; + default: // Unknown alignment + err.submit(2308, Attributes.u.A); + sec.Flags |= PE_SCN_ALIGN_16; break; + } + + // Get further attributes from class name + ClassName = GetLocalName(ClassIndex); + + // Convert class name to upper case + n = (int32)strlen(ClassName); + for (j = 0; j < n; j++) ClassName[j] &= ~0x20; + + // Search for known class names. + // Standard names are CODE, DATA, BSS, CONST, STACK + if (strstr(ClassName, "CODE") || strstr(ClassName, "TEXT")) { + // Code segment + sec.Flags |= PE_SCN_CNT_CODE | PE_SCN_MEM_EXECUTE | PE_SCN_MEM_READ; + } + else if (strstr(ClassName, "DATA")) { + // Data segment + sec.Flags |= PE_SCN_CNT_INIT_DATA | PE_SCN_MEM_READ | PE_SCN_MEM_WRITE; + } + else if (strstr(ClassName, "BSS")) { + // Unitialized data segment + sec.Flags |= PE_SCN_CNT_UNINIT_DATA | PE_SCN_MEM_READ | PE_SCN_MEM_WRITE; + } + else if (strstr(ClassName, "CONST")) { + // Constant data segment + sec.Flags |= PE_SCN_CNT_INIT_DATA | PE_SCN_MEM_READ; + } + else if (strstr(ClassName, "STACK")) { + // Stack segment. Ignore + sec.Flags |= PE_SCN_LNK_REMOVE; + err.submit(1206); // Warning: ignored + } + else { + // Unknown/user defined class. Assume data segment + sec.Flags |= PE_SCN_CNT_INIT_DATA | PE_SCN_MEM_READ | PE_SCN_MEM_WRITE; + } + + // Insert pointers to relocations and raw data later + // Store section header + NewSectionHeaders.Push(sec); } - else Offset = 0; - SegLength = Records[i].GetNumeric(); - NameIndex = Records[i].GetIndex(); - ClassIndex = Records[i].GetIndex(); // Class index - Records[i].GetIndex(); // Overlay index ignored - sname = GetLocalName(NameIndex); // Segment name = new section name - - if (Attributes.u.B) { - // Segment is big - if (Attributes.u.P) { - // 32 bit segment. Big means 2^32 bytes! - err.submit(2306); - } - else { - // 16 bit segment. Big means 2^16 bytes - SegLength = 0x10000; - } - } - - // make symbol table entry - memset(&sym, 0, SIZE_SCOFF_SymTableEntry); - - // Put name into string table - StringI = NewStringTable.PushString(sname); - - // Put name into symbol table - //COFF_PutNameInSymbolTable(sym, sname, NewStringTable); - ((uint32*)(sym.s.Name))[1] = StringI; - - sym.s.SectionNumber = ++SegNum; // Count section number - sym.s.StorageClass = COFF_CLASS_STATIC; - sym.s.NumAuxSymbols = 1; // Needs 1 aux record - - // Remember NewSymbolTable index - SegmentTranslation[SegNum] = NewSymbolTable.GetNumEntries(); - NewSymbolTable.Push(sym); // Store symbol table entry - - // Make auxiliary entry - memset(&sym, 0, SIZE_SCOFF_SymTableEntry); - - // Insert section size - sym.section.Length = SegLength; - - // Remember to insert NumberOfRelocations here later - - // Store auxiliary symbol table entry - NewSymbolTable.Push(sym); - - // Make section header - memset(&sec, 0, sizeof(sec)); // Reset section header - - // Put name into section header - sprintf(sec.Name, "/%i", StringI); - - // Put size into section header - sec.SizeOfRawData = SegLength; - - // Alignment - switch (Attributes.u.A) { - case 0: // Absolute segment - err.submit(2307); break; - case 1: // Byte - sec.Flags |= PE_SCN_ALIGN_1; break; - case 2: // Word - sec.Flags |= PE_SCN_ALIGN_2; break; - case 3: // Paragraph - sec.Flags |= PE_SCN_ALIGN_16; break; - case 4: // Page. May be 256 or 4096, depending on system - // If we use 4096 where the source intended 256, we may get - // size and symbol offsets wrong! - sec.Flags |= PE_SCN_ALIGN_256; break; - case 5: // Dword - sec.Flags |= PE_SCN_ALIGN_4; break; - default: // Unknown alignment - err.submit(2308, Attributes.u.A); - sec.Flags |= PE_SCN_ALIGN_16; break; - } - - // Get further attributes from class name - ClassName = GetLocalName(ClassIndex); - - // Convert class name to upper case - n = (int32)strlen(ClassName); - for (j = 0; j < n; j++) ClassName[j] &= ~0x20; - - // Search for known class names. - // Standard names are CODE, DATA, BSS, CONST, STACK - if (strstr(ClassName, "CODE") || strstr(ClassName, "TEXT")) { - // Code segment - sec.Flags |= PE_SCN_CNT_CODE | PE_SCN_MEM_EXECUTE | PE_SCN_MEM_READ; - } - else if (strstr(ClassName, "DATA")) { - // Data segment - sec.Flags |= PE_SCN_CNT_INIT_DATA | PE_SCN_MEM_READ | PE_SCN_MEM_WRITE; - } - else if (strstr(ClassName, "BSS")) { - // Unitialized data segment - sec.Flags |= PE_SCN_CNT_UNINIT_DATA | PE_SCN_MEM_READ | PE_SCN_MEM_WRITE; - } - else if (strstr(ClassName, "CONST")) { - // Constant data segment - sec.Flags |= PE_SCN_CNT_INIT_DATA | PE_SCN_MEM_READ; - } - else if (strstr(ClassName, "STACK")) { - // Stack segment. Ignore - sec.Flags |= PE_SCN_LNK_REMOVE; - err.submit(1206); // Warning: ignored - } - else { - // Unknown/user defined class. Assume data segment - sec.Flags |= PE_SCN_CNT_INIT_DATA | PE_SCN_MEM_READ | PE_SCN_MEM_WRITE; - } - - // Insert pointers to relocations and raw data later - // Store section header - NewSectionHeaders.Push(sec); - } - if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency - } - if (Records[i].Type2 == OMF_COMDAT || Records[i].Type2 == OMF_COMDEF) { - // Communal sections - err.submit(1055); - } - } + if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency + } + if (Records[i].Type2 == OMF_COMDAT || Records[i].Type2 == OMF_COMDEF) { + // Communal sections + err.submit(1055); + } + } } void COMF2COF::MakeSymbolTable2() { - // Make symbol table and string table entries for external symbols - uint32 i; - SCOFF_SymTableEntry sym; // new symbol table entry - uint32 NumExtSym = SymbolNameOffset.GetNumEntries(); // Number of external symbols - ExtdefTranslation.SetNum(NumExtSym+1); // Allocate space in translation table + // Make symbol table and string table entries for external symbols + uint32 i; + SCOFF_SymTableEntry sym; // new symbol table entry + uint32 NumExtSym = SymbolNameOffset.GetNumEntries(); // Number of external symbols + ExtdefTranslation.SetNum(NumExtSym+1); // Allocate space in translation table - // Loop through external symbol names - for (i = 1; i < NumExtSym; i++) { - // Reset symbol table entry - memset(&sym, 0, SIZE_SCOFF_SymTableEntry); + // Loop through external symbol names + for (i = 1; i < NumExtSym; i++) { + // Reset symbol table entry + memset(&sym, 0, SIZE_SCOFF_SymTableEntry); - // Insert name - COFF_PutNameInSymbolTable(sym, GetSymbolName(i), NewStringTable); + // Insert name + COFF_PutNameInSymbolTable(sym, GetSymbolName(i), NewStringTable); - // Insert storage class - sym.s.StorageClass = COFF_CLASS_EXTERNAL; + // Insert storage class + sym.s.StorageClass = COFF_CLASS_EXTERNAL; - // Store symbol table entry - NewSymbolTable.Push(sym); + // Store symbol table entry + NewSymbolTable.Push(sym); - // Update table for translating old EXTDEF number (1-based) to new symbol table index (0-based) - ExtdefTranslation[i] = NewSymbolTable.GetNumEntries() - 1; - } + // Update table for translating old EXTDEF number (1-based) to new symbol table index (0-based) + ExtdefTranslation[i] = NewSymbolTable.GetNumEntries() - 1; + } } void COMF2COF::MakeSymbolTable3() { - // Make symbol table and string table entries for public symbols - SCOFF_SymTableEntry sym; // new symbol table entry - uint32 i; // Record index - char * string; // Symbol name - uint32 Segment; // Segment - uint32 Offset; // Offset - uint32 Namei; // Index into symbol table - SOMFLocalSymbol localsym; // Entry into LocalSymbols - - // Search for PUBDEF records - for (i = 0; i < NumRecords; i++) { - if (Records[i].Type2 == OMF_PUBDEF) { - // PUBDEF record - - Records[i].Index = 3; - Records[i].GetIndex(); // Group. Ignore - Segment = Records[i].GetIndex(); // Segment - if (Segment == 0) Records[i].GetWord(); // Base frame. Ignore - - // Loop through strings in record - while (Records[i].Index < Records[i].End) { - string = Records[i].GetString(); // Symbol name - Offset = Records[i].GetNumeric(); // Offset to segment - Records[i].GetIndex(); // Type index. Ignore - - // Reset symbol table entry - memset(&sym, 0, SIZE_SCOFF_SymTableEntry); - - // Insert name - Namei = COFF_PutNameInSymbolTable(sym, string, NewStringTable); - - // Insert storage class - sym.s.StorageClass = COFF_CLASS_EXTERNAL; - - // Store offset - sym.s.Value = Offset; - - // Section number = segment number - if (Segment == 0) sym.s.SectionNumber = COFF_SECTION_ABSOLUTE; - else sym.s.SectionNumber = (int16)Segment; - - // Store symbol table entry - NewSymbolTable.Push(sym); - - // Make entry into LocalSymbols to indicate that this symbol has a name - if (Segment > 0) { - // Make index into NewStringTable if we don't allready have one - if (Namei == 0) Namei = NewStringTable.PushString(string); - localsym.Offset = Offset; - localsym.Segment = Segment; - localsym.Name = Namei; - localsym.NewSymtabIndex = NewSymbolTable.GetNumEntries() - 1; // 0-based index into new symbol table - LocalSymbols.PushUnique(localsym); + // Make symbol table and string table entries for public symbols + SCOFF_SymTableEntry sym; // new symbol table entry + uint32 i; // Record index + char * string; // Symbol name + uint32 Segment; // Segment + uint32 Offset; // Offset + uint32 Namei; // Index into symbol table + SOMFLocalSymbol localsym; // Entry into LocalSymbols + + // Search for PUBDEF records + for (i = 0; i < NumRecords; i++) { + if (Records[i].Type2 == OMF_PUBDEF) { + // PUBDEF record + + Records[i].Index = 3; + Records[i].GetIndex(); // Group. Ignore + Segment = Records[i].GetIndex(); // Segment + if (Segment == 0) Records[i].GetWord(); // Base frame. Ignore + + // Loop through strings in record + while (Records[i].Index < Records[i].End) { + string = Records[i].GetString(); // Symbol name + Offset = Records[i].GetNumeric(); // Offset to segment + Records[i].GetIndex(); // Type index. Ignore + + // Reset symbol table entry + memset(&sym, 0, SIZE_SCOFF_SymTableEntry); + + // Insert name + Namei = COFF_PutNameInSymbolTable(sym, string, NewStringTable); + + // Insert storage class + sym.s.StorageClass = COFF_CLASS_EXTERNAL; + + // Store offset + sym.s.Value = Offset; + + // Section number = segment number + if (Segment == 0) sym.s.SectionNumber = COFF_SECTION_ABSOLUTE; + else sym.s.SectionNumber = (int16)Segment; + + // Store symbol table entry + NewSymbolTable.Push(sym); + + // Make entry into LocalSymbols to indicate that this symbol has a name + if (Segment > 0) { + // Make index into NewStringTable if we don't allready have one + if (Namei == 0) Namei = NewStringTable.PushString(string); + localsym.Offset = Offset; + localsym.Segment = Segment; + localsym.Name = Namei; + localsym.NewSymtabIndex = NewSymbolTable.GetNumEntries() - 1; // 0-based index into new symbol table + LocalSymbols.PushUnique(localsym); + } } - } - if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency - } - } + if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency + } + } } void COMF2COF::MakeSymbolTable4() { - // Make symbol table and string table entries for communal symbols - // Warning: Currently not supported! + // Make symbol table and string table entries for communal symbols + // Warning: Currently not supported! } void COMF2COF::MakeSymbolTable5() { - // Make symbol table and string table entries for local symbols. - // There is no table for local symbols in OMF files. We have to search - // through all FIXUPP records for relocation targets and assign arbitrary - // names to them. - - uint32 i; // Loop counter - uint32 Target, TargetDisplacement; // Contents of FIXUPP record - uint8 byte1, byte2; // First two bytes of FIXUPP subrecord - // Bitfields in subrecords - OMF_SLocat Locat; // Structure of first two bytes of FIXUP subrecord swapped = Locat field - OMF_SFixData FixData; // Structure of FixData field in FIXUP subrecord of FIXUPP record - OMF_STrdDat TrdDat; // Structure of Thread Data field in THREAD subrecord of FIXUPP record - int8 * LastDataRecordPointer = 0; // Pointer to data in the data record that relocations refer to - uint32 LastDataRecordSize = 0; // Size of the data record that relocations refer to - SOMFLocalSymbol localsym; // Entry into LocalSymbols - uint32 LocalSymNum = 0; // Number of unnamed local symbols - char NewName[32]; // Buffer for making new name - SCOFF_SymTableEntry sym; // New symbol table entry - - // Search for FIXUPP records and data records - for (i = 0; i < NumRecords; i++) { - - if (Records[i].Type2 == OMF_LEDATA) { - // LEDATA record. Remember pointer to binary data in order to read inline offset - Records[i].Index = 3; // Initialize record reading - Records[i].GetIndex(); // Read segment and offset - Records[i].GetNumeric(); - LastDataRecordSize = Records[i].End - Records[i].Index; // Calculate size of data - LastDataRecordPointer = Records[i].buffer + Records[i].FileOffset + Records[i].Index; - } - - if (Records[i].Type2 == OMF_FIXUPP) { - // FIXUPP record - Records[i].Index = 3; // Initialize record reading - - // Loop through entries in record - while (Records[i].Index < Records[i].End) { - - // Read first byte - byte1 = Records[i].GetByte(); - - if (byte1 & 0x80) { - // This is a FIXUP subrecord - - Target = 0; TargetDisplacement = 0; - // read second byte - byte2 = Records[i].GetByte(); - // swap bytes and put into byte12 bitfield - Locat.bytes[1] = byte1; - Locat.bytes[0] = byte2; - // Read FixData - FixData.b = Records[i].GetByte(); - // Read conditional fields - if (FixData.s.F == 0) { - if (FixData.s.Frame < 4) { - Records[i].GetIndex(); // Frame. Ignore - } - } - if (FixData.s.T == 0) { - // Target specified - Target = Records[i].GetIndex(); - //uint32 TargetMethod = FixData.s.Target + FixData.s.P * 4; - } - if (FixData.s.P == 0) { - TargetDisplacement = Records[i].GetNumeric(); - } - // Get inline addend - if (LastDataRecordPointer && Locat.s.Offset < LastDataRecordSize) { - int8 * inlinep = LastDataRecordPointer + Locat.s.Offset; - if (Locat.s.Location == 9 || Locat.s.Location == 13) { - TargetDisplacement += *(int32*)inlinep; - } - } - if (FixData.s.T == 0 && (FixData.s.Target == 0 || FixData.s.Target == 1)) { - // Target is local symbol - - // Make entry in LocalSymbols - localsym.Offset = TargetDisplacement; // Offset to segment - localsym.Segment = Target; // Target segment - localsym.Name = 0; // Has no name yet - localsym.NewSymtabIndex = 0; // Not in new symbol table yet - // Make entry in LocalSymbols. - // PushUnique will not make an entry if this target address already - // has an entry in LocalSymbols and possibly a public name - LocalSymbols.PushUnique(localsym); - } - } - else { - // This is a THREAD subrecord. Read and ignore - TrdDat.b = byte1; // Put byte into bitfield - if (TrdDat.s.Method < 4) { - Records[i].GetIndex(); // has index field if method < 4 ? - } - } - } // Finished loop through subrecords - if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency - } - } // Finished loop through records + // Make symbol table and string table entries for local symbols. + // There is no table for local symbols in OMF files. We have to search + // through all FIXUPP records for relocation targets and assign arbitrary + // names to them. + + uint32 i; // Loop counter + uint32 Target, TargetDisplacement; // Contents of FIXUPP record + uint8 byte1, byte2; // First two bytes of FIXUPP subrecord + // Bitfields in subrecords + OMF_SLocat Locat; // Structure of first two bytes of FIXUP subrecord swapped = Locat field + OMF_SFixData FixData; // Structure of FixData field in FIXUP subrecord of FIXUPP record + OMF_STrdDat TrdDat; // Structure of Thread Data field in THREAD subrecord of FIXUPP record + int8 * LastDataRecordPointer = 0; // Pointer to data in the data record that relocations refer to + uint32 LastDataRecordSize = 0; // Size of the data record that relocations refer to + SOMFLocalSymbol localsym; // Entry into LocalSymbols + uint32 LocalSymNum = 0; // Number of unnamed local symbols + char NewName[32]; // Buffer for making new name + SCOFF_SymTableEntry sym; // New symbol table entry + + // Search for FIXUPP records and data records + for (i = 0; i < NumRecords; i++) { + + if (Records[i].Type2 == OMF_LEDATA) { + // LEDATA record. Remember pointer to binary data in order to read inline offset + Records[i].Index = 3; // Initialize record reading + Records[i].GetIndex(); // Read segment and offset + Records[i].GetNumeric(); + LastDataRecordSize = Records[i].End - Records[i].Index; // Calculate size of data + LastDataRecordPointer = Records[i].buffer + Records[i].FileOffset + Records[i].Index; + } + + if (Records[i].Type2 == OMF_FIXUPP) { + // FIXUPP record + Records[i].Index = 3; // Initialize record reading + + // Loop through entries in record + while (Records[i].Index < Records[i].End) { + + // Read first byte + byte1 = Records[i].GetByte(); + + if (byte1 & 0x80) { + // This is a FIXUP subrecord + + Target = 0; TargetDisplacement = 0; + // read second byte + byte2 = Records[i].GetByte(); + // swap bytes and put into byte12 bitfield + Locat.bytes[1] = byte1; + Locat.bytes[0] = byte2; + // Read FixData + FixData.b = Records[i].GetByte(); + // Read conditional fields + if (FixData.s.F == 0) { + if (FixData.s.Frame < 4) { + Records[i].GetIndex(); // Frame. Ignore + } + } + if (FixData.s.T == 0) { + // Target specified + Target = Records[i].GetIndex(); + //uint32 TargetMethod = FixData.s.Target + FixData.s.P * 4; + } + if (FixData.s.P == 0) { + TargetDisplacement = Records[i].GetNumeric(); + } + // Get inline addend + if (LastDataRecordPointer && Locat.s.Offset < LastDataRecordSize) { + int8 * inlinep = LastDataRecordPointer + Locat.s.Offset; + if (Locat.s.Location == 9 || Locat.s.Location == 13) { + TargetDisplacement += *(int32*)inlinep; + } + } + if (FixData.s.T == 0 && (FixData.s.Target == 0 || FixData.s.Target == 1)) { + // Target is local symbol + + // Make entry in LocalSymbols + localsym.Offset = TargetDisplacement; // Offset to segment + localsym.Segment = Target; // Target segment + localsym.Name = 0; // Has no name yet + localsym.NewSymtabIndex = 0; // Not in new symbol table yet + // Make entry in LocalSymbols. + // PushUnique will not make an entry if this target address already + // has an entry in LocalSymbols and possibly a public name + LocalSymbols.PushUnique(localsym); + } + } + else { + // This is a THREAD subrecord. Read and ignore + TrdDat.b = byte1; // Put byte into bitfield + if (TrdDat.s.Method < 4) { + Records[i].GetIndex(); // has index field if method < 4 ? + } + } + } // Finished loop through subrecords + if (Records[i].Index != Records[i].End) err.submit(1203); // Check for consistency + } + } // Finished loop through records - // Now check LocalSymbols for unnamed symbols - for (i = 0; i < LocalSymbols.GetNumEntries(); i++) { - if (LocalSymbols[i].Name == 0) { + // Now check LocalSymbols for unnamed symbols + for (i = 0; i < LocalSymbols.GetNumEntries(); i++) { + if (LocalSymbols[i].Name == 0) { - // Unnamed symbol. Give it a name - sprintf(NewName, "?NoName%02i", ++LocalSymNum); + // Unnamed symbol. Give it a name + sprintf(NewName, "?NoName%02i", ++LocalSymNum); - // Make index in new symbol table - // Reset symbol table entry - memset(&sym, 0, SIZE_SCOFF_SymTableEntry); + // Make index in new symbol table + // Reset symbol table entry + memset(&sym, 0, SIZE_SCOFF_SymTableEntry); - // Insert name - LocalSymbols[i].Name = COFF_PutNameInSymbolTable(sym, NewName, NewStringTable); - // if (LocalSymbols[i].Name == 0) LocalSymbols[i].Name = NewStringTable.PushString(NewName); + // Insert name + LocalSymbols[i].Name = COFF_PutNameInSymbolTable(sym, NewName, NewStringTable); + // if (LocalSymbols[i].Name == 0) LocalSymbols[i].Name = NewStringTable.PushString(NewName); - // Store offset - sym.s.Value = LocalSymbols[i].Offset; + // Store offset + sym.s.Value = LocalSymbols[i].Offset; - // Section number = segment number - sym.s.SectionNumber = LocalSymbols[i].Segment; + // Section number = segment number + sym.s.SectionNumber = LocalSymbols[i].Segment; - // Storage class - sym.s.StorageClass = COFF_CLASS_STATIC; + // Storage class + sym.s.StorageClass = COFF_CLASS_STATIC; - // Store symbol table entry - NewSymbolTable.Push(sym); + // Store symbol table entry + NewSymbolTable.Push(sym); - // Store index into new symbol table (0 - based) - LocalSymbols[i].NewSymtabIndex = NewSymbolTable.GetNumEntries() - 1; - } - } + // Store index into new symbol table (0 - based) + LocalSymbols[i].NewSymtabIndex = NewSymbolTable.GetNumEntries() - 1; + } + } } void COMF2COF::MakeSections() { - // Make sections and relocation tables - uint32 SegNum; // Index into NewSectionHeaders = segment - 1 - uint32 DesiredSegment; // Old segment number = new section number - uint32 RecNum; // Old record number - CMemoryBuffer TempBuf; // Temporary buffer for building raw data - CMemoryBuffer RelocationTable; // Temporary buffer for building new relocation table - SCOFF_Relocation rel; // New relocation table record - uint32 LastDataRecord = 0; // Index to the data record that relocations refer to - uint32 LastDataRecordSize = 0; // Size of the data record that relocations refer to - int8 * LastDataRecordPointer = 0; // Pointer to data in the data record that relocations refer to - uint32 Segment; // Segment of last LEDATA, LIDATA or COMDEF record - uint32 Offset; // Offset of LEDATA or LIDATA record to segment - uint32 Size; // Size of data in LEDATA or LIDATA record - uint32 SegmentSize; // Total size of segment - uint32 LastOffset; // Offset after last LEDATA into segment - uint32 FileOffsetData; // File offset of first raw data and relocations in new file - uint32 FileOffset; // File offset of current raw data or relocations - - // File offset of first data = size of file header and section headers - FileOffsetData = sizeof(SCOFF_FileHeader) + NewSectionHeaders.GetNumEntries() * sizeof(SCOFF_SectionHeader); - - // Loop through segments - for (SegNum = 0; SegNum < NewSectionHeaders.GetNumEntries(); SegNum++) { - - DesiredSegment = SegNum + 1; // Search for records referring to this segment - - SegmentSize = NewSectionHeaders[SegNum].SizeOfRawData; - if (SegmentSize == 0) continue; // Empty segment - - // Allocate temporary data buffer and reset it - TempBuf.SetSize(SegmentSize + 16); - int FillByte = 0; // Byte to fill memory with - if (NewSectionHeaders[SegNum].Flags & PE_SCN_CNT_CODE) { - // Code segment. Fill any unused bytes with NOP opcode = 0x90 - FillByte = 0x90; - } - memset(TempBuf.Buf(), FillByte, SegmentSize + 16);// Reset to all 0 or NOP - - // Reset relocation table buffer - RelocationTable.SetSize(0); - - LastOffset = 0; LastDataRecordSize = 0; - - // Search for LEDATA, LIDATA and FIXUPP records for this segment - for (RecNum = 0; RecNum < NumRecords; RecNum++) { - if (Records[RecNum].Type2 == OMF_LEDATA) { - - // LEDATA record - Records[RecNum].Index = 3; // Initialize record reading - Segment = Records[RecNum].GetIndex();// Read segment number - - if (Segment != DesiredSegment) continue; // Does not refer to this segment - - Offset = Records[RecNum].GetNumeric();// Read offset - Size = Records[RecNum].End - Records[RecNum].Index; // Calculate size of data - LastDataRecord = RecNum; // Save for later FIXUPP that refers to this record - - if (Offset < LastOffset + LastDataRecordSize && LastOffset < Offset + Size) { - // Overlapping data records - if (Offset + 8 < LastOffset + LastDataRecordSize || !(NewSectionHeaders[SegNum].Flags & PE_SCN_CNT_CODE)) { - // Overlapping data by more than 7 bytes or not executable code - err.submit(1207); - } - else { - // Possibly backpatched code - err.submit(1208); // Warning - err.ClearError(1208); // Report only once - } - } - - LastDataRecordSize = Size; - LastDataRecordPointer = Records[RecNum].buffer + Records[RecNum].FileOffset + Records[RecNum].Index; - LastOffset = Offset; // Save offset for subsequent FIXUPP records - - // Check if data within segment - if (Offset + Size > SegmentSize) { - err.submit(2309, GetSegmentName(Segment)); - continue; - } - - // Put raw data into temporary buffer - memcpy(TempBuf.Buf() + Offset, LastDataRecordPointer, Size); - - } // Finished with LEDATA record - - if (Records[RecNum].Type2 == OMF_LIDATA) { - // LIDATA record - Records[RecNum].Index = 3; // Initialize record reading - Segment = Records[RecNum].GetIndex(); - - if (Segment != DesiredSegment) continue; // Does not refer to this segment - - LastDataRecord = RecNum; // Save for later FIXUPP that refers to this record - - Offset = Records[RecNum].GetNumeric();// Read offset - - if (Offset > SegmentSize) { - err.submit(2310); continue; // Error: outside bounds + // Make sections and relocation tables + uint32 SegNum; // Index into NewSectionHeaders = segment - 1 + uint32 DesiredSegment; // Old segment number = new section number + uint32 RecNum; // Old record number + CMemoryBuffer TempBuf; // Temporary buffer for building raw data + CMemoryBuffer RelocationTable; // Temporary buffer for building new relocation table + SCOFF_Relocation rel; // New relocation table record + uint32 LastDataRecord = 0; // Index to the data record that relocations refer to + uint32 LastDataRecordSize = 0; // Size of the data record that relocations refer to + int8 * LastDataRecordPointer = 0; // Pointer to data in the data record that relocations refer to + uint32 Segment = 0; // Segment of last LEDATA, LIDATA or COMDEF record + uint32 Offset; // Offset of LEDATA or LIDATA record to segment + uint32 Size; // Size of data in LEDATA or LIDATA record + uint32 SegmentSize; // Total size of segment + uint32 LastOffset; // Offset after last LEDATA into segment + uint32 FileOffsetData; // File offset of first raw data and relocations in new file + uint32 FileOffset; // File offset of current raw data or relocations + + // File offset of first data = size of file header and section headers + FileOffsetData = sizeof(SCOFF_FileHeader) + NewSectionHeaders.GetNumEntries() * sizeof(SCOFF_SectionHeader); + + // Loop through segments + for (SegNum = 0; SegNum < NewSectionHeaders.GetNumEntries(); SegNum++) { + + DesiredSegment = SegNum + 1; // Search for records referring to this segment + + SegmentSize = NewSectionHeaders[SegNum].SizeOfRawData; + if (SegmentSize == 0) continue; // Empty segment + + // Allocate temporary data buffer and reset it + TempBuf.SetSize(SegmentSize + 16); + int FillByte = 0; // Byte to fill memory with + if (NewSectionHeaders[SegNum].Flags & PE_SCN_CNT_CODE) { + // Code segment. Fill any unused bytes with NOP opcode = 0x90 + FillByte = 0x90; + } + memset(TempBuf.Buf(), FillByte, SegmentSize + 16);// Reset to all 0 or NOP + + // Reset relocation table buffer + RelocationTable.SetSize(0); + + LastOffset = 0; LastDataRecordSize = 0; + + // Search for LEDATA, LIDATA and FIXUPP records for this segment + for (RecNum = 0; RecNum < NumRecords; RecNum++) { + if (Records[RecNum].Type2 == OMF_LEDATA) { + + // LEDATA record + Records[RecNum].Index = 3; // Initialize record reading + Segment = Records[RecNum].GetIndex();// Read segment number + + if (Segment != DesiredSegment) continue; // Does not refer to this segment + + Offset = Records[RecNum].GetNumeric();// Read offset + Size = Records[RecNum].End - Records[RecNum].Index; // Calculate size of data + LastDataRecord = RecNum; // Save for later FIXUPP that refers to this record + + // Check if data within segment + if (Offset + Size > SegmentSize) { + err.submit(2309, GetSegmentName(Segment)); + return; + } + + if (Offset < LastOffset + LastDataRecordSize && LastOffset < Offset + Size) { + // Overlapping data records + if (Offset + 8 < LastOffset + LastDataRecordSize || !(NewSectionHeaders[SegNum].Flags & PE_SCN_CNT_CODE)) { + // Overlapping data by more than 7 bytes or not executable code + err.submit(1207); + } + else { + // Possibly backpatched code + err.submit(1208); // Warning + err.ClearError(1208); // Report only once + } + } + + LastDataRecordSize = Size; + LastDataRecordPointer = Records[RecNum].buffer + Records[RecNum].FileOffset + Records[RecNum].Index; + LastOffset = Offset; // Save offset for subsequent FIXUPP records + + /*// Check if data within segment + if (Offset + Size > SegmentSize) { + err.submit(2309, GetSegmentName(Segment)); + continue; + } */ + + // Put raw data into temporary buffer + memcpy(TempBuf.Buf() + Offset, LastDataRecordPointer, Size); + + } // Finished with LEDATA record + + if (Records[RecNum].Type2 == OMF_LIDATA) { + // LIDATA record + Records[RecNum].Index = 3; // Initialize record reading + Segment = Records[RecNum].GetIndex(); + + if (Segment != DesiredSegment) continue; // Does not refer to this segment + + LastDataRecord = RecNum; // Save for later FIXUPP that refers to this record + + Offset = Records[RecNum].GetNumeric();// Read offset + + if (Offset > SegmentSize) { + err.submit(2310); return; // Error: outside bounds + } + + // Unpack LIDATA blocks recursively + Size = Records[RecNum].UnpackLIDATABlock(TempBuf.Buf() + Offset, SegmentSize - Offset); + + if (Offset < LastOffset + LastDataRecordSize && LastOffset < Offset + Size) { + // Overlapping data records + err.submit(1207); // Warning + } + LastDataRecordSize = Size; // Save data size + LastOffset = Offset; // Save offset for subsequent FIXUPP records + + } // Finished with LIDATA record + + if (Records[RecNum].Type2 == OMF_COMDAT) { + // COMDAT record. Currently not supported by objconv + LastDataRecord = RecNum; // Save for later FIXUPP that refers to this record + Segment = 0; // Ignore any relocation referring to this } - // Unpack LIDATA blocks recursively - Size = Records[RecNum].UnpackLIDATABlock(TempBuf.Buf() + Offset, SegmentSize - Offset); - - if (Offset < LastOffset + LastDataRecordSize && LastOffset < Offset + Size) { - // Overlapping data records - err.submit(1207); // Warning - } - LastDataRecordSize = Size; // Save data size - LastOffset = Offset; // Save offset for subsequent FIXUPP records + if (Records[RecNum].Type2 == OMF_FIXUPP) { + // FIXUPP record + + if (Segment != DesiredSegment) continue; // Does not refer to this segment + + uint32 Target, TargetDisplacement; // Contents of FIXUPP record + //uint32 Frame; // Contents of FIXUPP record + uint8 byte1, byte2; // First two bytes of subrecord + + // Bitfields in subrecords + OMF_SLocat Locat; // Structure of first two bytes of FIXUP subrecord swapped = Locat field + OMF_SFixData FixData; // Structure of FixData field in FIXUP subrecord of FIXUPP record + OMF_STrdDat TrdDat; // Structure of Thread Data field in THREAD subrecord of FIXUPP record + + Records[RecNum].Index = 3; + + if (Records[LastDataRecord].Type2 != OMF_LEDATA && Records[RecNum].Index < Records[RecNum].End) { + // Non-empty FIXUPP record does not refer to LEDATA record + if (Records[LastDataRecord].Type2 == OMF_COMDAT) { + // COMDAT currently not supported. Ignore! + } + else if (Records[LastDataRecord].Type2 == OMF_LIDATA) { + err.submit(2311); // Error: Relocation of iterated data not supported + } + else { + err.submit(2312); // Does not refer to data record + } + continue; // Ignore this FIXUPP record + } + + // Loop through entries in record + while (Records[RecNum].Index < Records[RecNum].End) { + + // Read first byte + byte1 = Records[RecNum].GetByte(); + if (byte1 & 0x80) { + + // This is a FIXUP subrecord + //Frame = 0; + Target = 0; TargetDisplacement = 0; + + // read second byte + byte2 = Records[RecNum].GetByte(); + // swap bytes and put into byte12 bitfield + Locat.bytes[1] = byte1; + Locat.bytes[0] = byte2; + // Read FixData + FixData.b = Records[RecNum].GetByte(); + + // Read conditional fields + if (FixData.s.F == 0) { + if (FixData.s.Frame < 4) { + Records[RecNum].GetIndex(); + } + } - } // Finished with LIDATA record + if (FixData.s.T == 0) { + // Target specified + Target = Records[RecNum].GetIndex(); + //uint32 TargetMethod = FixData.s.Target + FixData.s.P * 4; + } + else { + // Target specified in previous thread + // Does anybody still use compression of repeated fixup targets? + // I don't care to support this if it is never used + err.submit(2313); // Error message: not supported + continue; + } - if (Records[RecNum].Type2 == OMF_COMDAT) { - // COMDAT record. Currently not supported by objconv - LastDataRecord = RecNum; // Save for later FIXUPP that refers to this record - Segment = 0; // Ignore any relocation referring to this - } + if (FixData.s.P == 0) { + TargetDisplacement = Records[RecNum].GetNumeric(); + } - if (Records[RecNum].Type2 == OMF_FIXUPP) { - // FIXUPP record + // Get inline addend and check relocation method + if (LastDataRecordPointer && Locat.s.Offset < LastDataRecordSize) { + // Pointer to relocation source inline in raw data: + int8 * inlinep = LastDataRecordPointer + Locat.s.Offset; + + switch (Locat.s.Location) { // Relocation method + + case 9: case 13: // 32 bit + // The OMF format may indicate a relocation target by an + // offset stored inline in the relocation source. + // We prefer to store the target address explicitly in a + // symbol table entry. + + // Add the inline offset to the explicit offset + TargetDisplacement += *(uint32*)inlinep; + + // Remove the inline addend to avoid adding it twice: + // We have to do this in the new buffer TempBuf because + // the data have already been copied to TempBuf + if (*(uint32*)(TempBuf.Buf() + LastOffset + Locat.s.Offset) != *(uint32*)inlinep) { + // Check that the data in Buf() and TempBuf.Buf() are the same + err.submit(9000); + } + // Remove the inline addend to avoid adding it twice + *(uint32*)(TempBuf.Buf() + LastOffset + Locat.s.Offset) = 0; + break; + + case 0: case 4: // 8 bit. Not supported + err.submit(2316, "8 bit"); break; + + case 1: case 2: case 5: // 16 bit. Not supported + err.submit(2316, "16 bit"); break; + + case 3: // 16+16 bit. Not supported + err.submit(2316, "16+16 bit far"); break; + + case 6: case 11: // 16+32 bit. Not supported + err.submit(2316, "16+32 bit far"); break; + } + } - if (Segment != DesiredSegment) continue; // Does not refer to this segment - - uint32 Frame, Target, TargetDisplacement; // Contents of FIXUPP record - uint8 byte1, byte2; // First two bytes of subrecord - - // Bitfields in subrecords - OMF_SLocat Locat; // Structure of first two bytes of FIXUP subrecord swapped = Locat field - OMF_SFixData FixData; // Structure of FixData field in FIXUP subrecord of FIXUPP record - OMF_STrdDat TrdDat; // Structure of Thread Data field in THREAD subrecord of FIXUPP record - - Records[RecNum].Index = 3; - - if (Records[LastDataRecord].Type2 != OMF_LEDATA && Records[RecNum].Index < Records[RecNum].End) { - // Non-empty FIXUPP record does not refer to LEDATA record - if (Records[LastDataRecord].Type2 == OMF_COMDAT) { - // COMDAT currently not supported. Ignore! - } - else if (Records[LastDataRecord].Type2 == OMF_LIDATA) { - err.submit(2311); // Error: Relocation of iterated data not supported - } - else { - err.submit(2312); // Does not refer to data record - } - continue; // Ignore this FIXUPP record - } + // Make relocation record + // Offset of relocation source + rel.VirtualAddress = Locat.s.Offset + LastOffset; + + SOMFLocalSymbol locsym; // Symbol record for search in LocalSymbols table + int32 LocalSymbolsIndex; // Index into LocalSymbols table + + // Relocation type: direct or EIP-relative + // (The displacement between relocation source and EIP for + // self-relative relocations is implicit in both OMF and COFF + // files. No need for correction) + rel.Type = Locat.s.M ? COFF32_RELOC_DIR32 : COFF32_RELOC_REL32; + + switch (FixData.s.Target) { // = Target method modulo 4 + case 0: // T0 and T4: Target = segment + + // Local or public symbol. Search in LocalSymbols table + locsym.Segment = Target; // Target segment + locsym.Offset = TargetDisplacement; // Target offset including inline displacement + // Find in LocalSymbols table + LocalSymbolsIndex = LocalSymbols.Exists(locsym); + if (LocalSymbolsIndex < 0) {err.submit(9000); continue;} // Not found + + // Get index into new symbol table + rel.SymbolTableIndex = LocalSymbols[LocalSymbolsIndex].NewSymtabIndex; + break; + + case 1: // T1 and T5: Target = segment group + // Don't know how to handle group-relative relocation. Make error message + err.submit(2315, GetLocalName(Target)); + continue; + + case 2: // T2 and T6: Target = external symbol + + // Translate old EXTDEF index to new symbol table index + if (Target >= ExtdefTranslation.GetNumEntries()) { + Target = 0; err.submit(2312); + continue; + } + rel.SymbolTableIndex = ExtdefTranslation[Target]; + + // Put addend inline in new file + if (LastOffset + Locat.s.Offset < SegmentSize) { + *(uint32*)(TempBuf.Buf() + LastOffset + Locat.s.Offset) = TargetDisplacement; + } + break; + + default: // Unknown method + err.submit(2314, FixData.s.Target + FixData.s.P * 4); + } - // Loop through entries in record - while (Records[RecNum].Index < Records[RecNum].End) { - - // Read first byte - byte1 = Records[RecNum].GetByte(); - if (byte1 & 0x80) { - - // This is a FIXUP subrecord - Frame = 0; Target = 0; TargetDisplacement = 0; - - // read second byte - byte2 = Records[RecNum].GetByte(); - // swap bytes and put into byte12 bitfield - Locat.bytes[1] = byte1; - Locat.bytes[0] = byte2; - // Read FixData - FixData.b = Records[RecNum].GetByte(); - - // Read conditional fields - if (FixData.s.F == 0) { - if (FixData.s.Frame < 4) { - Frame = Records[RecNum].GetIndex(); - } - } - - if (FixData.s.T == 0) { - // Target specified - Target = Records[RecNum].GetIndex(); - //uint32 TargetMethod = FixData.s.Target + FixData.s.P * 4; - } - else { - // Target specified in previous thread - // Does anybody still use compression of repeated fixup targets? - // I don't care to support this if it is never used - err.submit(2313); // Error message: not supported - continue; - } - - if (FixData.s.P == 0) { - TargetDisplacement = Records[RecNum].GetNumeric(); - } - - // Get inline addend and check relocation method - if (LastDataRecordPointer && Locat.s.Offset < LastDataRecordSize) { - // Pointer to relocation source inline in raw data: - int8 * inlinep = LastDataRecordPointer + Locat.s.Offset; - - switch (Locat.s.Location) { // Relocation method - - case 9: case 13: // 32 bit - // The OMF format may indicate a relocation target by an - // offset stored inline in the relocation source. - // We prefer to store the target address explicitly in a - // symbol table entry. - - // Add the inline offset to the explicit offset - TargetDisplacement += *(uint32*)inlinep; - - // Remove the inline addend to avoid adding it twice: - // We have to do this in the new buffer TempBuf because - // the data have already been copied to TempBuf - if (*(uint32*)(TempBuf.Buf() + LastOffset + Locat.s.Offset) != *(uint32*)inlinep) { - // Check that the data in Buf() and TempBuf.Buf() are the same - err.submit(9000); + // Store in temporary relocation table + RelocationTable.Push(&rel, SIZE_SCOFF_Relocation); + + } + else { + // This is a THREAD subrecord. + // I don't think this feature for compressing fixup data is + // used any more, if it ever was. I am not supporting it here. + // Frame threads can be safely ignored. A target thread cannot + // be ignored if there is any reference to it. The error is + // reported above at the reference to a target thread, not here. + TrdDat.b = byte1; // Put byte into bitfield + if (TrdDat.s.Method < 4) { // Make sure we read this correctly, even if ignored + Records[RecNum].GetIndex(); // has index field if method < 4 ? } - // Remove the inline addend to avoid adding it twice - *(uint32*)(TempBuf.Buf() + LastOffset + Locat.s.Offset) = 0; - break; - - case 0: case 4: // 8 bit. Not supported - err.submit(2316, "8 bit"); break; - - case 1: case 2: case 5: // 16 bit. Not supported - err.submit(2316, "16 bit"); break; - - case 3: // 16+16 bit. Not supported - err.submit(2316, "16+16 bit far"); break; - - case 6: case 11: // 16+32 bit. Not supported - err.submit(2316, "16+32 bit far"); break; - } - } - - // Make relocation record - // Offset of relocation source - rel.VirtualAddress = Locat.s.Offset + LastOffset; - - SOMFLocalSymbol locsym; // Symbol record for search in LocalSymbols table - int32 LocalSymbolsIndex; // Index into LocalSymbols table - - // Relocation type: direct or EIP-relative - // (The displacement between relocation source and EIP for - // self-relative relocations is implicit in both OMF and COFF - // files. No need for correction) - rel.Type = Locat.s.M ? COFF32_RELOC_DIR32 : COFF32_RELOC_REL32; - - switch (FixData.s.Target) { // = Target method modulo 4 - case 0: // T0 and T4: Target = segment - - // Local or public symbol. Search in LocalSymbols table - locsym.Segment = Target; // Target segment - locsym.Offset = TargetDisplacement; // Target offset including inline displacement - // Find in LocalSymbols table - LocalSymbolsIndex = LocalSymbols.Exists(locsym); - if (LocalSymbolsIndex < 0) {err.submit(9000); continue;} // Not found - - // Get index into new symbol table - rel.SymbolTableIndex = LocalSymbols[LocalSymbolsIndex].NewSymtabIndex; - break; - - case 1: // T1 and T5: Target = segment group - // Don't know how to handle group-relative relocation. Make error message - err.submit(2315, GetLocalName(Target)); - continue; - - case 2: // T2 and T6: Target = external symbol - - // Translate old EXTDEF index to new symbol table index - rel.SymbolTableIndex = ExtdefTranslation[Target]; - - // Put addend inline in new file - if (LastOffset + Locat.s.Offset < SegmentSize) { - *(uint32*)(TempBuf.Buf() + LastOffset + Locat.s.Offset) = TargetDisplacement; - } - break; - - default: // Unknown method - err.submit(2314, FixData.s.Target + FixData.s.P * 4); - } - - // Store in temporary relocation table - RelocationTable.Push(&rel, SIZE_SCOFF_Relocation); - - } - else { - // This is a THREAD subrecord. - // I don't think this feature for compressing fixup data is - // used any more, if it ever was. I am not supporting it here. - // Frame threads can be safely ignored. A target thread cannot - // be ignored if there is any reference to it. The error is - // reported above at the reference to a target thread, not here. - TrdDat.b = byte1; // Put byte into bitfield - if (TrdDat.s.Method < 4) { // Make sure we read this correctly, even if ignored - Records[RecNum].GetIndex(); // has index field if method < 4 ? - } - } - } // Finished loop through subrecords + } + } // Finished loop through subrecords - if (Records[RecNum].Index != Records[RecNum].End) err.submit(1203); // Check for consistency - } - } // End of loop to search for LEDATA, LIDATA and FIXUPP records for this segment + if (Records[RecNum].Index != Records[RecNum].End) err.submit(1203); // Check for consistency + } + } // End of loop to search for LEDATA, LIDATA and FIXUPP records for this segment - // Transfer raw data from TempBuf to NewData buffer - FileOffset = NewData.Push(TempBuf.Buf(), SegmentSize); + // Transfer raw data from TempBuf to NewData buffer + FileOffset = NewData.Push(TempBuf.Buf(), SegmentSize); - // Put file offset of raw data into section header - NewSectionHeaders[SegNum].PRawData = FileOffsetData + FileOffset; + // Put file offset of raw data into section header + NewSectionHeaders[SegNum].PRawData = FileOffsetData + FileOffset; - // Align relocation table by 4 - NewData.Align(4); + // Align relocation table by 4 + NewData.Align(4); - // Transfer relocation table from RelocationTable to NewData buffer - FileOffset = NewData.Push(RelocationTable.Buf(), RelocationTable.GetDataSize()); + // Transfer relocation table from RelocationTable to NewData buffer + FileOffset = NewData.Push(RelocationTable.Buf(), RelocationTable.GetDataSize()); - // Put file offset of relocations into section header - NewSectionHeaders[SegNum].PRelocations = FileOffsetData + FileOffset; + // Put file offset of relocations into section header + NewSectionHeaders[SegNum].PRelocations = FileOffsetData + FileOffset; - // Put number of relocations into section header - NewSectionHeaders[SegNum].NRelocations = (uint16)(RelocationTable.GetNumEntries()); + // Put number of relocations into section header + NewSectionHeaders[SegNum].NRelocations = (uint16)(RelocationTable.GetNumEntries()); - // Put number of relocations into symbol table auxiliary entry. - // Search for the symbol table entry for this section: - for (uint32 sym = 0; sym < NewSymbolTable.GetNumEntries(); sym++) { - if (NewSymbolTable[sym].s.SectionNumber == DesiredSegment - && NewSymbolTable[sym].s.StorageClass == COFF_CLASS_STATIC - && NewSymbolTable[sym].s.NumAuxSymbols == 1) { - // Found right symbol table entry. Insert NumberOfRelocations - NewSymbolTable[sym+1].section.NumberOfRelocations = NewSectionHeaders[SegNum].NRelocations; - break; // No need to search further - } - } - } // End of loop through segments + // Put number of relocations into symbol table auxiliary entry. + // Search for the symbol table entry for this section: + for (uint32 sym = 0; sym < NewSymbolTable.GetNumEntries(); sym++) { + if ((uint32)NewSymbolTable[sym].s.SectionNumber == DesiredSegment + && NewSymbolTable[sym].s.StorageClass == COFF_CLASS_STATIC + && NewSymbolTable[sym].s.NumAuxSymbols == 1) { + // Found right symbol table entry. Insert NumberOfRelocations + NewSymbolTable[sym+1].section.NumberOfRelocations = NewSectionHeaders[SegNum].NRelocations; + break; // No need to search further + } + } + } // End of loop through segments } void COMF2COF::CheckUnsupportedRecords() { - // Make warnings if file containes unsupported record types - uint32 RecNum; // Record number - uint32 NumComdat = 0; // Number of COMDAT records - uint32 NumComent = 0; // Number of COMENT records - - // Loop through all records - for (RecNum = 0; RecNum < NumRecords; RecNum++) { - // Check record type - switch (Records[RecNum].Type2) { - case OMF_THEADR: case OMF_MODEND: case OMF_EXTDEF: case OMF_PUBDEF: - case OMF_LNAMES: case OMF_SEGDEF: case OMF_GRPDEF: case OMF_FIXUPP: - case OMF_LEDATA: case OMF_LIDATA: case OMF_COMDEF: case OMF_VERNUM: - // These record types are supported or can safely be ignored - break; - - case OMF_LINNUM: case OMF_LINSYM: - // Debug records - cmd.CountDebugRemoved(); break; - - case OMF_COMDAT: case OMF_LCOMDEF: case OMF_CEXTDEF: - NumComdat++; break; // Count COMDAT records - - case OMF_COMENT: - NumComent++; break; // Count COMENT records - - default: // Warning for unknown record type - err.submit(1212, COMF::GetRecordTypeName(Records[RecNum].Type2)); - } - } - // Report number of unsupported sections found - if (NumComdat) err.submit(2305, NumComdat); - if (NumComent) err.submit(1211, NumComent); + // Make warnings if file containes unsupported record types + uint32 RecNum; // Record number + uint32 NumComdat = 0; // Number of COMDAT records + uint32 NumComent = 0; // Number of COMENT records + + // Loop through all records + for (RecNum = 0; RecNum < NumRecords; RecNum++) { + // Check record type + switch (Records[RecNum].Type2) { + case OMF_THEADR: case OMF_MODEND: case OMF_EXTDEF: case OMF_PUBDEF: + case OMF_LNAMES: case OMF_SEGDEF: case OMF_GRPDEF: case OMF_FIXUPP: + case OMF_LEDATA: case OMF_LIDATA: case OMF_COMDEF: case OMF_VERNUM: + // These record types are supported or can safely be ignored + break; + + case OMF_LINNUM: case OMF_LINSYM: + // Debug records + cmd.CountDebugRemoved(); break; + + case OMF_COMDAT: case OMF_LCOMDEF: case OMF_CEXTDEF: + NumComdat++; break; // Count COMDAT records + + case OMF_COMENT: + NumComent++; break; // Count COMENT records + + default: // Warning for unknown record type + err.submit(1212, COMF::GetRecordTypeName(Records[RecNum].Type2)); + } + } + // Report number of unsupported sections found + if (NumComdat) err.submit(2305, NumComdat); + if (NumComent) err.submit(1211, NumComent); } void COMF2COF::MakeBinaryFile() { - // Putting sections together - uint32 i; + // Putting sections together + uint32 i; - // Get number of symbols and sections into file header - NewFileHeader.NumberOfSymbols = NewSymbolTable.GetNumEntries(); - NewFileHeader.NumberOfSections = NewSectionHeaders.GetNumEntries(); + // Get number of symbols and sections into file header + NewFileHeader.NumberOfSymbols = NewSymbolTable.GetNumEntries(); + NewFileHeader.NumberOfSections = NewSectionHeaders.GetNumEntries(); - // Put file header into new file - ToFile.Push(&NewFileHeader, sizeof(NewFileHeader)); + // Put file header into new file + ToFile.Push(&NewFileHeader, sizeof(NewFileHeader)); - // Put section headers into new file - if (NewSectionHeaders.GetNumEntries()) { - ToFile.Push(&NewSectionHeaders[0], NewSectionHeaders.GetNumEntries() * sizeof(SCOFF_SectionHeader)); - } + // Put section headers into new file + if (NewSectionHeaders.GetNumEntries()) { + ToFile.Push(&NewSectionHeaders[0], NewSectionHeaders.GetNumEntries() * sizeof(SCOFF_SectionHeader)); + } - // Put raw data and relocation tables into new file - ToFile.Push(NewData.Buf(), NewData.GetDataSize()); + // Put raw data and relocation tables into new file + ToFile.Push(NewData.Buf(), NewData.GetDataSize()); - // Get address of symbol table into file header - ToFile.Get(0).PSymbolTable = ToFile.GetDataSize(); + // Get address of symbol table into file header + ToFile.Get(0).PSymbolTable = ToFile.GetDataSize(); - // Put symbol table into new file - for (i = 0; i < NewSymbolTable.GetNumEntries(); i++) { - ToFile.Push(&NewSymbolTable[i], SIZE_SCOFF_SymTableEntry); - } + // Put symbol table into new file + for (i = 0; i < NewSymbolTable.GetNumEntries(); i++) { + ToFile.Push(&NewSymbolTable[i], SIZE_SCOFF_SymTableEntry); + } - // Insert string table size - NewStringTable.Get(0) = NewStringTable.GetDataSize(); + // Insert string table size + NewStringTable.Get(0) = NewStringTable.GetDataSize(); - // Put string table into new file - ToFile.Push(NewStringTable.Buf(), NewStringTable.GetDataSize()); + // Put string table into new file + ToFile.Push(NewStringTable.Buf(), NewStringTable.GetDataSize()); } diff --git a/src/omfhash.cpp b/src/omfhash.cpp index c469a3f..1185164 100644 --- a/src/omfhash.cpp +++ b/src/omfhash.cpp @@ -40,7 +40,7 @@ void COMFHashTable::MakeHash(int8 * name) { uint16 BucketX; // Calculate block hash String = (uint8*)name; // Type cast string to unsigned char * StringLength = (uint32)strlen(name); - if (StringLength > 255) { + if (StringLength > 255 || StringLength == 0) { // String too long err.submit(1204, name); // Warning: truncating StringLength = 255; diff --git a/src/opcodes.cpp b/src/opcodes.cpp index 7eccf43..70a4f10 100644 --- a/src/opcodes.cpp +++ b/src/opcodes.cpp @@ -1,13 +1,13 @@ /**************************** opcodes.cpp ******************************* * Author: Agner Fog * Date created: 2007-02-21 -* Last modified: 2012-08-23 +* Last modified: 2018-10-08 * Project: objconv * Module: opcodes.cpp * Description: * Definition of opcode maps used by disassembler * -* Copyright 2007-2012 GNU General Public License http://www.gnu.org/licenses +* Copyright 2007-2018 GNU General Public License http://www.gnu.org/licenses *****************************************************************************/ @@ -19,21 +19,24 @@ Instset defines which instruction set is required. Prefix defines which prefixes are allowed or required and what they do. Format defines which scheme the instruction code is modeled after. Dest is the type of the destination operand. -Source1-4 defines the types of up to 4 source operands. +Source1-3 defines the types of up to 3 source operands. Link indicates branching into a subpage. Options is used for various types of additional information. +These code tables are organized as a big branching tree. A line can branch into a subpage if more than one instruction or variant begins with the same code bytes. Each subpage can branch further to form a tree structure many levels deep. The first page, OpcodeMap0, is indexed by the first code byte after any prefixes. The subpages can be indexed by several different criteria, such as subsequent bytes, various bit-fields, or by the values of any prefixes that come before the code byte. The -interpretation of an instruction may start at the root, OpcodeMap0, and -follow any branches until the final leaf is found. +branching criteria are indicated in the 'link' column, while the submap +number is indicated in the 'instset' field. -Instructions with VEX prefix can use the VEX.mm bits as shortcuts to the -subpages OpcodeMap1, OpcodeMap2 and OpcodeMap4. +The interpretation of an instruction may start at the root, OpcodeMap0, +and follow any branches until the final leaf is found. +Instructions with VEX, EVEX or MVEX prefix use the VEX.mm bits as +shortcuts to the subpages OpcodeMap1, OpcodeMap2 and OpcodeMap4. The values in the tables do not use names for the constants because each value would need the combination of several names so that the lines would @@ -57,2940 +60,2941 @@ introduced. // Primary opcode map. This is the root of the opcode lookup tree SOpcodeDef OpcodeMap0[256] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"add", 0x0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 00 - {"add", 0x0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 01 - {"add", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 02 - {"add", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 03 - {"add", 0x0 , 0x0 , 0x41 , 0xA1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 04 - {"add", 0x0 , 0x1100 , 0x81 , 0xA9 , 0x28 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 05 - {"push es", 0x8000, 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 06 - {"pop es", 0x8000, 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 07 - {"or", 0x0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 08 - {"or", 0x0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 09 - {"or", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0A - {"or", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0B - {"or", 0x0 , 0x0 , 0x41 , 0xA1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0C - {"or", 0x0 , 0x1100 , 0x81 , 0xA9 , 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 0D - {"push cs", 0x8000, 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0E - {0, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F link to OpcodeMap1 -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"adc", 0x0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 10 - {"adc", 0x0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 11 - {"adc", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 12 - {"adc", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 13 - {"adc", 0x0 , 0x0 , 0x41 , 0xA1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 14 - {"adc", 0x0 , 0x1100 , 0x81 , 0xA9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 15 - {"push ss", 0x8000, 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 16 - {"pop ss", 0x8000, 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 17 - {"sbb", 0x0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 18 - {"sbb", 0x0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 19 - {"sbb", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 1A - {"sbb", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 1B - {"sbb", 0x0 , 0x0 , 0x41 , 0xA1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 1C - {"sbb", 0x0 , 0x1100 , 0x81 , 0xA9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 1D - {"push ds", 0x8000, 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 1E - {"pop ds", 0x8000, 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 1F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"and", 0x0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 20 - {"and", 0x0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 21 - {"and", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 22 - {"and", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 23 - {"and", 0x0 , 0x0 , 0x41 , 0xA1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 24 - {"and", 0x0 , 0x1100 , 0x81 , 0xA9 , 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 25 - {"es:", 0x0 , 0x0 , 0x8001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 26 - {"daa", 0x8000, 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 27 - {"sub", 0x0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 28 - {"sub", 0x0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 29 - {"sub", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 2A - {"sub", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 2B - {"sub", 0x0 , 0x0 , 0x41 , 0xA1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 2C - {"sub", 0x0 , 0x1100 , 0x81 , 0xA9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 2D - {"cs:", 0x0 , 0x0 , 0x8001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 2E - {"das", 0x8000, 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 2F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"xor", 0x0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 30 - {"xor", 0x0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 31 - {"xor", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 32 - {"xor", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 33 - {"xor", 0x0 , 0x0 , 0x41 , 0xA1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 34 - {"xor", 0x0 , 0x1100 , 0x81 , 0xA9 , 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 35 - {"ss:", 0x0 , 0x0 , 0x8001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 36 - {"aaa", 0x8000, 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 37 - {"cmp", 0x0 , 0x0 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 38 - {"cmp", 0x0 , 0x1100 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 39 - {"cmp", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 3A - {"cmp", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 3B - {"cmp", 0x0 , 0x0 , 0x41 , 0xA1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 3C - {"cmp", 0x0 , 0x1100 , 0x81 , 0xA9 , 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x84 }, // 3D - {"ds:", 0x0 , 0x0 , 0x8001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 3E - {"aas", 0x8000, 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 3F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 40 - {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 41 - {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 42 - {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 43 - {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 44 - {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 45 - {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 46 - {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 47 - {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 48 - {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 49 - {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 4A - {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 4B - {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 4C - {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 4D - {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 4E - {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 4F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"push", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 50 - {"push", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 51 - {"push", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 52 - {"push", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 53 - {"push", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 54 - {"push", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 55 - {"push", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 56 - {"push", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 57 - {"pop", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 58 - {"pop", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 59 - {"pop", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 5A - {"pop", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 5B - {"pop", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 5C - {"pop", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 5D - {"pop", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 5E - {"pop", 0x0 , 0x2102 , 0x3 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 5F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pusha", 0x8001, 0x102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 }, // 60 - {"popa", 0x8001, 0x102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 }, // 61 - {"bound", 0x8001, 0x106 , 0x12 , 0x1008, 0x2009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 62 - {0, 0x3B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x7 , 0x0 }, // 63 Link to arpl/movsxd - {"fs:", 0x0 , 0x0 , 0x8001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 64 - {"gs:", 0x0 , 0x0 , 0x8001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 65 - {"operand size:",0x0, 0x0 , 0x8000, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 - {"address size:",0x0, 0x0 , 0x8000, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 67 - {"push", 0x0 , 0x2102 , 0x82 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 68 push imm word - {"imul", 0x1 , 0x1100 , 0x92 , 0x1009, 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x80 }, // 69 imul r,m,iv - {"push", 0x0 , 0x2102 , 0x42 , 0x0 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 6A push imm byte - {"imul", 0x1 , 0x1100 , 0x52 , 0x1009, 0x9 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // 6B imul r,m,ib - {"insb", 0x0 , 0x21 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 6C insb - {"ins", 0x0 , 0x121 , 0x1 , 0x20C2, 0xB2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 6D insw - {"outsb", 0x0 , 0x21 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 6E outsb - {"outs", 0x0 , 0x121 , 0x1 , 0xB2 , 0x20C2, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 6F outs -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"jo", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 70 conditional short jumps - {"jno", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 71 - {"jc", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 72 - {"jnc", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 73 - {"jz", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 74 - {"jnz", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 75 - {"jbe", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 76 - {"ja", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 77 - {"js", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 78 - {"jns", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 79 - {"jpe", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 7A - {"jpo", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 7B - {"jl", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 7C - {"jge", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 7D - {"jle", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 7E - {"jg", 0x0 , 0x88 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 7F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"grp1", 0x1A , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 80 link to immediate grp 1 - {"grp1", 0x1B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 81 link to immediate grp 1 - {"grp1", 0x1C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 82 link to immediate grp 1 - {"grp1", 0x1D , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 83 link to immediate grp 1 - {"test", 0x0 , 0x0 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 84 - {"test", 0x0 , 0x1100 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // 85 - {"xchg", 0x0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x48 }, // 86 - {"xchg", 0x0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x48 }, // 87 - {"mov", 0x0 , 0xC40 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // 88 - {"mov", 0x0 , 0x1D40 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // 89 - {"mov", 0x0 , 0x0 , 0x12 , 0x1001, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // 8A - {"mov", 0x0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // 8B - {"mov", 0x0 , 0x1100 , 0x13 , 0x9 , 0x91 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 8C mov r16,segreg - {"lea", 0x0 , 0x1101 , 0x12 , 0x1009, 0x2009, 0x0 , 0x0 , 0x0 , 0x0 , 0xC0 }, // 8D - {"mov", 0x0 , 0x1100 , 0x12 , 0x91 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 8E mov segreg,r16 - {"pop", 0x28 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 8F Link to group 1A -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"nop", 0x3C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 90 NOP/Pause. Link to map - {"xchg", 0x0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 91 xchg cx,ax - {"xchg", 0x0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 92 xchg dx,ax - {"xchg", 0x0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 93 xchg bx,ax - {"xchg", 0x0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 94 xchg sp,ax - {"xchg", 0x0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 95 xchg bp,ax - {"xchg", 0x0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 96 xchg si,ax - {"xchg", 0x0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 97 xchg di,ax - {"cbw", 0x39 , 0x1100 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 98 Link to map - {"cwd", 0x3A , 0x1100 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 99 Link to map - {"call", 0x8000, 0x182 , 0x200 , 0x85 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x28 }, // 9A call far - {"fwait", 0x100 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 9B - {"pushf", 0x3E , 0x2100 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 9C Link to map: pushf/d/q - {"popf", 0x3F , 0x2100 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 9D Link to map: popf/d/q - {"sahf", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 9E - {"lahf", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 9F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"mov", 0x0 , 0x5 , 0x401 , 0x10A1, 0x2001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // A0 mov al,mem - {"mov", 0x0 , 0x1105 , 0x401 , 0x10A9, 0x2009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // A1 mov ax,mem - {"mov", 0x0 , 0x5 , 0x401 , 0x2001, 0x10A1, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // A2 mov mem,al - {"mov", 0x0 , 0x1105 , 0x401 , 0x2009, 0x10A9, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // A3 mov mem,ax - {"movs", 0x0 , 0x25 , 0x1 , 0x20C2, 0x20C1, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // A4 movsb - {"movs", 0x0 , 0x1125 , 0x1 , 0x20C2, 0x20C1, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // A5 movsw - {"cmps", 0x0 , 0x45 , 0x1 , 0x20C2, 0x20C1, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // A6 cmpsb - {"cmps", 0x0 , 0x1145 , 0x1 , 0x20C2, 0x20C1, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // A7 cmpsw - {"test", 0x0 , 0x0 , 0x41 , 0x10A1, 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // A8 test al,ib - {"test", 0x0 , 0x1100 , 0x81 , 0x10A9, 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // A9 test ax,iw - {"stos", 0x0 , 0x21 , 0x1 , 0x20C2, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // AA stosb - {"stos", 0x0 , 0x1121 , 0x1 , 0x20C2, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // AB stosw - {"lods", 0x0 , 0x25 , 0x1 , 0x0 , 0x20C1, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // AC lodsb - {"lods", 0x0 , 0x1125 , 0x1 , 0x0 , 0x20C1, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // AD lodsw - {"scas", 0x0 , 0x41 , 0x1 , 0x20C2, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // AE scasb - {"scas", 0x0 , 0x1141 , 0x1 , 0x20C2, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // AF scasw -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"mov", 0x0 , 0x0 , 0x43 , 0x1001, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // B0 mov al,ib - {"mov", 0x0 , 0x0 , 0x43 , 0x1001, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // B1 mov cl,ib - {"mov", 0x0 , 0x0 , 0x43 , 0x1001, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // B2 mov dl,ib - {"mov", 0x0 , 0x0 , 0x43 , 0x1001, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // B3 mov bl,ib - {"mov", 0x0 , 0x0 , 0x43 , 0x1001, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // B4 mov ah,ib - {"mov", 0x0 , 0x0 , 0x43 , 0x1001, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // B5 mov ch,ib - {"mov", 0x0 , 0x0 , 0x43 , 0x1001, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // B6 mov dh,ib - {"mov", 0x0 , 0x0 , 0x43 , 0x1001, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // B7 mov bh,ib - {"mov", 0x0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x400 }, // B8 mov ax,iw - {"mov", 0x0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x400 }, // B9 mov cx,iw - {"mov", 0x0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x400 }, // BA mov dx,iw - {"mov", 0x0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x400 }, // BB mov bx,iw - {"mov", 0x0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x400 }, // BC mov sp,iw - {"mov", 0x0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x400 }, // BD mov bp,iw - {"mov", 0x0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x400 }, // BE mov si,iw - {"mov", 0x0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0x0 , 0x0 , 0x0 , 0x0 , 0x400 }, // BF mov di,iw -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"grp2", 0x1E , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // C0 link to grp 2 - {"grp2", 0x1F , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // C1 link to grp 2 - {"ret", 0x0 , 0x2182 , 0x22 , 0x0 , 0x12 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // C2 retn iw - {"ret", 0x0 , 0x2182 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // C3 retn - {"les", 0x8000, 0x100 , 0x812 , 0x1009, 0x200C, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C4 les - {"lds", 0x8000, 0x100 , 0x812 , 0x1009, 0x200C, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C5 lds - {"mov", 0x2F , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // C6 link to grp 11 - {"mov", 0x30 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // C7 link to grp 11 - {"enter", 0x0 , 0x0 , 0x62 , 0x0 , 0x12 , 0x11 , 0x0 , 0x0 , 0x0 , 0x8 }, // C8 - {"leave", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // C9 - {"retf", 0x0 , 0x2182 , 0x22 , 0x0 , 0x12 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // CA retf iw - {"retf", 0x0 , 0x2182 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // CB retf - {"int 3;breakpoint or filler",0,0,2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x48 }, // CC - {"int", 0x0 , 0x0 , 0x42 , 0x0 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // CD - {"into", 0x8000, 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // CE - {0, 0x19 , 0x1100 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // CF link to IRET -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"grp2", 0x20 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // D0 link to grp 2 - {"grp2", 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // D1 link to grp 2 - {"grp2", 0x22 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // D2 link to grp 2 - {"grp2", 0x23 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // D3 link to grp 2 - {"aam", 0x8000, 0x0 , 0x42 , 0x0 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // D4. Don't show immediate operand if = 10 ! - {"aad", 0x8000, 0x0 , 0x42 , 0x0 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // D5. Don't show immediate operand if = 10 ! - {"salc", 0x8000, 0x0 , 0x4002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // D6 salc (undocumented opcode) - {"xlat", 0x92 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 , 0x0 }, // D7. Link to xlat - {"x87 instr", 0x8 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // D8 link to FP grp - {"x87 instr", 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // D9 link to FP grp - {"x87 instr", 0xA , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // DA link to FP grp - {"x87 instr", 0xB , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // DB link to FP grp - {"x87 instr", 0xC , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // DC link to FP grp - {"x87 instr", 0xD , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // DD link to FP grp - {"x87 instr", 0xE , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // DE link to FP grp - {"x87 instr", 0xF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // DF link to FP grp -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"loopne", 0x0 , 0x80 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // E0 - {"loope", 0x0 , 0x80 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // E1 - {"loop", 0x0 , 0x80 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // E2 - {"j(e/r)cxz", 0x3D , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA , 0x0 }, // E3 link to map - {"in", 0x800 , 0x0 , 0x41 , 0xA1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // E4 in al,ib - {"in", 0x800 , 0x100 , 0x41 , 0xA8 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // E5 in ax,ib - {"out", 0x800 , 0x0 , 0x41 , 0x32 , 0xA1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // E6 out ib,al - {"out", 0x800 , 0x100 , 0x41 , 0x32 , 0xA8 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // E7 out ib,ax - {"call", 0x0 , 0x82 , 0x82 , 0x83 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // E8 call near - {"jmp", 0x0 , 0x80 , 0x82 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x90 }, // E9 jmp near - {"jmp", 0x8000, 0x80 , 0x202 , 0x84 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x30 }, // EA jmp far - {"jmp", 0x0 , 0x80 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // EB jmp short - {"in", 0x800 , 0x0 , 0x1 , 0xA1 , 0xB2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // EC in al,dx - {"in", 0x800 , 0x100 , 0x1 , 0xA8 , 0xB2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // ED in ax,dx - {"out", 0x800 , 0x0 , 0x1 , 0xB2 , 0xA1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // EE out dx,al - {"out", 0x800 , 0x100 , 0x1 , 0xB2 , 0xA8 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // EF out dx,ax -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"lock:", 0x0 , 0x0 , 0x8000, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F0 lock prefix - {"icebp", 0x8000, 0x0 , 0x4002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F1 ICE breakpoint, undocumented opcode - {"repne:", 0x0 , 0x0 , 0x8000, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 repne prefix - {"repe:", 0x0 , 0x0 , 0x8000, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F3 repe prefix - {"hlt", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x48 }, // F4 - {"cmc", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F5 - {"grp3", 0x24 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // F6 link to grp 3 - {"grp3", 0x25 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // F7 link to grp 3 - {"clc", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F8 - {"stc", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F9 - {"cli", 0x800 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // FA - {"sti", 0x800 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // FB - {"cld", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // FC - {"std", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // FD - {"grp4", 0x26 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // FE link to grp 4 - {"grp5", 0x27 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 } // FF link to grp 5 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"add", 0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 00 + {"add", 0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 01 + {"add", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 02 + {"add", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 03 + {"add", 0 , 0 , 0x41 , 0xA1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 04 + {"add", 0 , 0x1100 , 0x81 , 0xA9 , 0x28 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 05 + {"push es", 0x8000, 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 06 + {"pop es", 0x8000, 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 07 + {"or", 0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 08 + {"or", 0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 09 + {"or", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0A + {"or", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0B + {"or", 0 , 0 , 0x41 , 0xA1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0C + {"or", 0 , 0x1100 , 0x81 , 0xA9 , 0x39 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 0D + {"push cs", 0x8000, 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0E + {0, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F link to OpcodeMap1 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"adc", 0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 10 + {"adc", 0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 11 + {"adc", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 12 + {"adc", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 13 + {"adc", 0 , 0 , 0x41 , 0xA1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 14 + {"adc", 0 , 0x1100 , 0x81 , 0xA9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 15 + {"push ss", 0x8000, 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 16 + {"pop ss", 0x8000, 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 17 + {"sbb", 0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 18 + {"sbb", 0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 19 + {"sbb", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1A + {"sbb", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1B + {"sbb", 0 , 0 , 0x41 , 0xA1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1C + {"sbb", 0 , 0x1100 , 0x81 , 0xA9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 1D + {"push ds", 0x8000, 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1E + {"pop ds", 0x8000, 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"and", 0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 20 + {"and", 0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 21 + {"and", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 22 + {"and", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 23 + {"and", 0 , 0 , 0x41 , 0xA1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 24 + {"and", 0 , 0x1100 , 0x81 , 0xA9 , 0x39 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 25 + {"es:", 0 , 0 , 0x8001, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 26 + {"daa", 0x8000, 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 27 + {"sub", 0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 28 + {"sub", 0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 29 + {"sub", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 2A + {"sub", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 2B + {"sub", 0 , 0 , 0x41 , 0xA1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 2C + {"sub", 0 , 0x1100 , 0x81 , 0xA9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 2D + {"cs:", 0 , 0 , 0x8001, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 2E + {"das", 0x8000, 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 2F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"xor", 0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 30 + {"xor", 0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 31 + {"xor", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 32 + {"xor", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 33 + {"xor", 0 , 0 , 0x41 , 0xA1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 34 + {"xor", 0 , 0x1100 , 0x81 , 0xA9 , 0x39 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 35 + {"ss:", 0 , 0 , 0x8001, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 36 + {"aaa", 0x8000, 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 37 + {"cmp", 0 , 0 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0x4 }, // 38 + {"cmp", 0 , 0x1100 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0x4 }, // 39 + {"cmp", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 3A + {"cmp", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 3B + {"cmp", 0 , 0 , 0x41 , 0xA1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 3C + {"cmp", 0 , 0x1100 , 0x81 , 0xA9 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0x84 }, // 3D + {"ds:", 0 , 0 , 0x8001, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 3E + {"aas", 0x8000, 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 3F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 40 + {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 41 + {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 42 + {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 43 + {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 44 + {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 45 + {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 46 + {"inc", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 47 + {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 48 + {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 49 + {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 4A + {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 4B + {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 4C + {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 4D + {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 4E + {"dec", 0x8000, 0x100 , 0x3 , 0x1008, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 4F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"push", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 50 + {"push", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 51 + {"push", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 52 + {"push", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 53 + {"push", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 54 + {"push", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 55 + {"push", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 56 + {"push", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // 57 + {"pop", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 58 + {"pop", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 59 + {"pop", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 5A + {"pop", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 5B + {"pop", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 5C + {"pop", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 5D + {"pop", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 5E + {"pop", 0 , 0x2102 , 0x3 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 5F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pusha", 0x8001, 0x102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 }, // 60 + {"popa", 0x8001, 0x102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 }, // 61 + {"bound", 0x8001, 0x106 , 0x12 , 0x1008, 0x2009, 0 , 0 , 0 , 0 , 0 , 0 }, // 62 + {0, 0x3B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x7 , 0 }, // 63 Link to arpl/movsxd + {"fs:", 0 , 0 , 0x8001, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 64 + {"gs:", 0 , 0 , 0x8001, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 65 + {"operand size:",0x0, 0 , 0x8000, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 + {"address size:",0x0, 0 , 0x8000, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 67 + {"push", 0 , 0x2102 , 0x82 , 0 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 68 push imm word + {"imul", 0x1 , 0x1100 , 0x92 , 0x1009, 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0x80 }, // 69 imul r,m,iv + {"push", 0 , 0x2102 , 0x42 , 0 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 6A push imm byte + {"imul", 0x1 , 0x1100 , 0x52 , 0x1009, 0x9 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // 6B imul r,m,ib + {"insb", 0 , 0x21 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 6C insb + {"ins", 0 , 0x121 , 0x1 , 0x20C2, 0xB2 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 6D insw + {"outsb", 0 , 0x21 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 6E outsb + {"outs", 0 , 0x121 , 0x1 , 0xB2 , 0x20C2, 0 , 0 , 0 , 0 , 0 , 0x8 }, // 6F outs +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"jo", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 70 conditional short jumps + {"jno", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 71 + {"jc", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 72 + {"jnc", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 73 + {"jz", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 74 + {"jnz", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 75 + {"jbe", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 76 + {"ja", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 77 + {"js", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 78 + {"jns", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 79 + {"jpe", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 7A + {"jpo", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 7B + {"jl", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 7C + {"jge", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 7D + {"jle", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 7E + {"jg", 0 , 0x88 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 7F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"grp1", 0x1A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 80 link to immediate grp 1 + {"grp1", 0x1B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 81 link to immediate grp 1 + {"grp1", 0x1C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 82 link to immediate grp 1 + {"grp1", 0x1D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 83 link to immediate grp 1 + {"test", 0 , 0 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0x4 }, // 84 + {"test", 0 , 0x1100 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0x4 }, // 85 + {"xchg", 0 , 0xC50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0x48 }, // 86 + {"xchg", 0 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0x48 }, // 87 + {"mov", 0 , 0xC40 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0x40 }, // 88 + {"mov", 0 , 0x1D40 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0x40 }, // 89 + {"mov", 0 , 0 , 0x12 , 0x1001, 0x1 , 0 , 0 , 0 , 0 , 0 , 0x40 }, // 8A + {"mov", 0 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0x40 }, // 8B + {"mov", 0 , 0x1100 , 0x13 , 0x9 , 0x91 , 0 , 0 , 0 , 0 , 0 , 0 }, // 8C mov r16,segreg + {"lea", 0 , 0x1101 , 0x12 , 0x1009, 0x2009, 0 , 0 , 0 , 0 , 0 , 0xC0 }, // 8D + {"mov", 0 , 0x1100 , 0x12 , 0x91 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 8E mov segreg,r16 + {"pop", 0x28 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 8F Link to group 1A +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"nop", 0x3C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 90 NOP/Pause. Link to map + {"xchg", 0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 91 xchg cx,ax + {"xchg", 0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 92 xchg dx,ax + {"xchg", 0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 93 xchg bx,ax + {"xchg", 0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 94 xchg sp,ax + {"xchg", 0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 95 xchg bp,ax + {"xchg", 0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 96 xchg si,ax + {"xchg", 0 , 0x1100 , 0x3 , 0x1009, 0xA9 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 97 xchg di,ax + {"cbw", 0x39 , 0x1100 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 98 Link to map + {"cwd", 0x3A , 0x1100 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 99 Link to map + {"call", 0x8000, 0x182 , 0x200 , 0x85 , 0 , 0 , 0 , 0 , 0 , 0 , 0x28 }, // 9A call far + {"fwait", 0x100 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 9B + {"pushf", 0x3E , 0x2100 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 9C Link to map: pushf/d/q + {"popf", 0x3F , 0x2100 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 9D Link to map: popf/d/q + {"sahf", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 9E + {"lahf", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 9F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"mov", 0 , 0x5 , 0x401 , 0x10A1, 0x2001, 0 , 0 , 0 , 0 , 0 , 0 }, // A0 mov al,mem + {"mov", 0 , 0x1105 , 0x401 , 0x10A9, 0x2009, 0 , 0 , 0 , 0 , 0 , 0 }, // A1 mov ax,mem + {"mov", 0 , 0x5 , 0x401 , 0x2001, 0x10A1, 0 , 0 , 0 , 0 , 0 , 0 }, // A2 mov mem,al + {"mov", 0 , 0x1105 , 0x401 , 0x2009, 0x10A9, 0 , 0 , 0 , 0 , 0 , 0 }, // A3 mov mem,ax + {"movs", 0 , 0x25 , 0x1 , 0x20C2, 0x20C1, 0 , 0 , 0 , 0 , 0 , 0x8 }, // A4 movsb + {"movs", 0 , 0x1125 , 0x1 , 0x20C2, 0x20C1, 0 , 0 , 0 , 0 , 0 , 0x8 }, // A5 movsw + {"cmps", 0 , 0x45 , 0x1 , 0x20C2, 0x20C1, 0 , 0 , 0 , 0 , 0 , 0x8 }, // A6 cmpsb + {"cmps", 0 , 0x1145 , 0x1 , 0x20C2, 0x20C1, 0 , 0 , 0 , 0 , 0 , 0x8 }, // A7 cmpsw + {"test", 0 , 0 , 0x41 , 0x10A1, 0x31 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // A8 test al,ib + {"test", 0 , 0x1100 , 0x81 , 0x10A9, 0x39 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // A9 test ax,iw + {"stos", 0 , 0x21 , 0x1 , 0x20C2, 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // AA stosb + {"stos", 0 , 0x1121 , 0x1 , 0x20C2, 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // AB stosw + {"lods", 0 , 0x25 , 0x1 , 0 , 0x20C1, 0 , 0 , 0 , 0 , 0 , 0x8 }, // AC lodsb + {"lods", 0 , 0x1125 , 0x1 , 0 , 0x20C1, 0 , 0 , 0 , 0 , 0 , 0x8 }, // AD lodsw + {"scas", 0 , 0x41 , 0x1 , 0x20C2, 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // AE scasb + {"scas", 0 , 0x1141 , 0x1 , 0x20C2, 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // AF scasw +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"mov", 0 , 0 , 0x43 , 0x1001, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // B0 mov al,ib + {"mov", 0 , 0 , 0x43 , 0x1001, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // B1 mov cl,ib + {"mov", 0 , 0 , 0x43 , 0x1001, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // B2 mov dl,ib + {"mov", 0 , 0 , 0x43 , 0x1001, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // B3 mov bl,ib + {"mov", 0 , 0 , 0x43 , 0x1001, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // B4 mov ah,ib + {"mov", 0 , 0 , 0x43 , 0x1001, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // B5 mov ch,ib + {"mov", 0 , 0 , 0x43 , 0x1001, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // B6 mov dh,ib + {"mov", 0 , 0 , 0x43 , 0x1001, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // B7 mov bh,ib + {"mov", 0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0 , 0 , 0 , 0 , 0 , 0x400 }, // B8 mov ax,iw + {"mov", 0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0 , 0 , 0 , 0 , 0 , 0x400 }, // B9 mov cx,iw + {"mov", 0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0 , 0 , 0 , 0 , 0 , 0x400 }, // BA mov dx,iw + {"mov", 0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0 , 0 , 0 , 0 , 0 , 0x400 }, // BB mov bx,iw + {"mov", 0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0 , 0 , 0 , 0 , 0 , 0x400 }, // BC mov sp,iw + {"mov", 0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0 , 0 , 0 , 0 , 0 , 0x400 }, // BD mov bp,iw + {"mov", 0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0 , 0 , 0 , 0 , 0 , 0x400 }, // BE mov si,iw + {"mov", 0 , 0x1100 , 0x103 , 0x1009, 0x19 , 0 , 0 , 0 , 0 , 0 , 0x400 }, // BF mov di,iw +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"grp2", 0x1E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // C0 link to grp 2 + {"grp2", 0x1F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // C1 link to grp 2 + {"ret", 0 , 0x21AA , 0x22 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0x30 }, // C2 retn iw + {"ret", 0 , 0x21AA , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x30 }, // C3 retn + {"les", 0x8000, 0x100 , 0x812 , 0x1009, 0x200C, 0 , 0 , 0 , 0 , 0 , 0 }, // C4 les + {"lds", 0x8000, 0x100 , 0x812 , 0x1009, 0x200C, 0 , 0 , 0 , 0 , 0 , 0 }, // C5 lds + {"mov", 0x2F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // C6 link to grp 11 + {"mov", 0x30 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // C7 link to grp 11 + {"enter", 0 , 0 , 0x62 , 0 , 0x12 , 0x11 , 0 , 0 , 0 , 0 , 0x8 }, // C8 + {"leave", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // C9 + {"retf", 0 , 0x2182 , 0x22 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0x10 }, // CA retf iw + {"retf", 0 , 0x2182 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x10 }, // CB retf + {"int 3;breakpoint or filler",0,0,2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x48 }, // CC + {"int", 0 , 0 , 0x42 , 0 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // CD + {"into", 0x8000, 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // CE + {0, 0x19 , 0x1100 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // CF link to IRET +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"grp2", 0x20 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // D0 link to grp 2 + {"grp2", 0x21 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // D1 link to grp 2 + {"grp2", 0x22 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // D2 link to grp 2 + {"grp2", 0x23 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // D3 link to grp 2 + {"aam", 0x8000, 0 , 0x42 , 0 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // D4. Don't show immediate operand if = 10 ! + {"aad", 0x8000, 0 , 0x42 , 0 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // D5. Don't show immediate operand if = 10 ! + {"salc", 0x8000, 0 , 0x4002, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // D6 salc (undocumented opcode) + {"xlat", 0x92 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x10 , 0 }, // D7. Link to xlat + {"x87 instr", 0x8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // D8 link to FP grp + {"x87 instr", 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // D9 link to FP grp + {"x87 instr", 0xA , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // DA link to FP grp + {"x87 instr", 0xB , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // DB link to FP grp + {"x87 instr", 0xC , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // DC link to FP grp + {"x87 instr", 0xD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // DD link to FP grp + {"x87 instr", 0xE , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // DE link to FP grp + {"x87 instr", 0xF , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // DF link to FP grp +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"loopne", 0 , 0x80 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // E0 + {"loope", 0 , 0x80 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // E1 + {"loop", 0 , 0x80 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // E2 + {"j(e/r)cxz", 0x3D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA , 0 }, // E3 link to map + {"in", 0x800 , 0 , 0x41 , 0xA1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // E4 in al,ib + {"in", 0x800 , 0x100 , 0x41 , 0xA8 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // E5 in ax,ib + {"out", 0x800 , 0 , 0x41 , 0x32 , 0xA1 , 0 , 0 , 0 , 0 , 0 , 0 }, // E6 out ib,al + {"out", 0x800 , 0x100 , 0x41 , 0x32 , 0xA8 , 0 , 0 , 0 , 0 , 0 , 0 }, // E7 out ib,ax + {"call", 0 , 0xAA , 0x82 , 0x83 , 0 , 0 , 0 , 0 , 0 , 0 , 0x28 }, // E8 call near + {"jmp", 0 , 0xA8 , 0x82 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xB0 }, // E9 jmp near + {"jmp", 0x8000, 0x80 , 0x202 , 0x84 , 0 , 0 , 0 , 0 , 0 , 0 , 0x30 }, // EA jmp far + {"jmp", 0 , 0xA8 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0x30 }, // EB jmp short + {"in", 0x800 , 0 , 0x1 , 0xA1 , 0xB2 , 0 , 0 , 0 , 0 , 0 , 0 }, // EC in al,dx + {"in", 0x800 , 0x100 , 0x1 , 0xA8 , 0xB2 , 0 , 0 , 0 , 0 , 0 , 0 }, // ED in ax,dx + {"out", 0x800 , 0 , 0x1 , 0xB2 , 0xA1 , 0 , 0 , 0 , 0 , 0 , 0 }, // EE out dx,al + {"out", 0x800 , 0x100 , 0x1 , 0xB2 , 0xA8 , 0 , 0 , 0 , 0 , 0 , 0 }, // EF out dx,ax +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"lock:", 0 , 0 , 0x8000, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F0 lock prefix + {"icebp", 0x8000, 0 , 0x4002, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F1 ICE breakpoint, undocumented opcode + {"repne:", 0 , 0 , 0x8000, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 repne prefix + {"repe:", 0 , 0 , 0x8000, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F3 repe prefix + {"hlt", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x48 }, // F4 + {"cmc", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F5 + {"grp3", 0x24 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // F6 link to grp 3 + {"grp3", 0x25 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // F7 link to grp 3 + {"clc", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F8 + {"stc", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F9 + {"cli", 0x800 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // FA + {"sti", 0x800 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // FB + {"cld", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // FC + {"std", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // FD + {"grp4", 0x26 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // FE link to grp 4 + {"grp5", 0x27 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 } // FF link to grp 5 }; // Secondary opcode map for 2-byte opcode. First byte = 0F // Indexed by second opcode byte SOpcodeDef OpcodeMap1[256] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"grp6", 0x2A , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 0F 00 link to grp 6; sldt etc. - {"grp7", 0x2B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // 0F 01 link to grp 7; sgdt etc. - {0, 0x5E , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 02 link to lar - {0, 0x5F , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 03 link to lsl - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"syscall", 0x5 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 05 - {"clts", 0x805 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 06 - {"sysret", 0x805 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // 0F 07 - {"invd", 0x804 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 08 - {"wbinvd", 0x804 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 09 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"ud2", 0x3 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // 0F 0B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"PREFETCH;AMD only",0x1001,0, 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0D. AMD only. Works as NOP on Intel - {"FEMS", 0x1001, 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F OE. AMD only - {0, 0x6 , 0x0 , 0x52 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x6 , 0x0 }, // 0F 0F. Link to tertiary map for AMD 3DNow instructions -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x40 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // Link to tertiary map: movups, etc. - {0, 0x41 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // Link to tertiary map: movups, etc. - {0, 0x42 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // Link to tertiary map: movlps, etc. - {"movl", 0x11 , 0x10200, 0x13 , 0x2351, 0x124F, 0x0 , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 13 movlps/pd - {"unpckl", 0x11 , 0xD0200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 14 unpcklps/pd - {"unpckh", 0x11 , 0xD0200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 15 unpckhps/pd - {0, 0x44 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // Link to tertiary map: movhps, etc. - {"movh", 0x11 , 0x10200, 0x13 , 0x2351, 0x124F, 0x0 , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 17 movhps/pd - {0, 0x35 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // Link to tertiary map: group 16 - {"hint", 0x6 , 0x0 , 0x2012, 0x0 , 0x6 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 19. Hint instructions reserved for future use - {"hint", 0x6 , 0x0 , 0x2012, 0x0 , 0x6 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 1A. Hint instructions reserved for future use - {"hint", 0x6 , 0x0 , 0x2012, 0x0 , 0x6 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 1B. Hint instructions reserved for future use - {"hint", 0x6 , 0x0 , 0x2012, 0x0 , 0x6 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 1C. Hint instructions reserved for future use - {"hint", 0x6 , 0x0 , 0x2012, 0x0 , 0x6 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 1D. Hint instructions reserved for future use - {"hint", 0x6 , 0x0 , 0x2012, 0x0 , 0x6 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 1E. Hint instructions reserved for future use - {"nop", 0x6 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // 0F 1F. Multi-byte nop -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"mov", 0x803 , 0x0 , 0x13 , 0x100A, 0x92 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 20. mov r32/64,cr - {"mov", 0x803 , 0x1000 , 0x13 , 0x1009, 0x93 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 21. mov r32,dr - {"mov", 0x803 , 0x0 , 0x12 , 0x92 , 0x100A, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 22. mov cr,r32/64 - {"mov", 0x803 , 0x1000 , 0x12 , 0x93 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 23. mov dr,r32 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"grp6", 0x2A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F 00 link to grp 6; sldt etc. + {"grp7", 0x2B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // 0F 01 link to grp 7; sgdt etc. + {0, 0x5E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 02 link to lar + {0, 0x5F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 03 link to lsl + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 04 Illegal + {"syscall", 0x5 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 05 + {"clts", 0x805 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 06 + {"sysret", 0x805 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x10 }, // 0F 07 + {"invd", 0x804 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 08 + {"wbinvd", 0x804 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 09 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0A Illegal + {"ud2", 0x3 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x10 }, // 0F 0B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0C Illegal + {0, 0xD1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F 0D Link to prefetch + {"FEMS", 0x1001, 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F OE. AMD only + {0, 0x6 , 0 , 0x52 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }, // 0F 0F. Link to tertiary map for AMD 3DNow instructions +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x40 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 10 Link to tertiary map: movups, etc. + {0, 0x41 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 11 Link to tertiary map: movups, etc. + {0, 0x42 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 12 Link to tertiary map: movlps, etc. + {"movl", 0x11 ,0x812200, 0x13 , 0x234F, 0x144F, 0 , 0 , 0x1000, 0 , 0 , 0x3 }, // 0F 13 movlps/pd + {"unpckl", 0x11 ,0x8D2200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x31 , 0 , 0 , 0x3 }, // 0F 14 unpcklps/pd + {"unpckh", 0x11 ,0x8D2200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x31 , 0 , 0 , 0x3 }, // 0F 15 unpckhps/pd + {0, 0x44 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 16 Link to tertiary map: movhps, etc. + {"movh", 0x11 ,0x812200, 0x13 , 0x234F, 0x144F, 0 , 0 , 0x1000, 0 , 0 , 0x3 }, // 0F 17 movhps/pd + {0, 0x35 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F 18 Link to tertiary map: group 16 + {"hint", 0x6 , 0 , 0x2012, 0 , 0x6 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 19. Hint instructions reserved for future use + {0, 0x110 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 1A. Link to BNDMK etc + {0, 0x111 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 1B. Link to BNDCL etc + {"hint", 0x6 , 0 , 0x2012, 0 , 0x6 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 1C. Hint instructions reserved for future use + {"hint", 0x6 , 0 , 0x2012, 0 , 0x6 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 1D. Hint instructions reserved for future use + {"hint", 0x135 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // 0F 1E. link to endbr64 etc. + {"nop", 0x6 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x40 }, // 0F 1F. Multi-byte nop +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"mov", 0x803 , 0 , 0x13 , 0x100A, 0x92 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 20. mov r32/64,cr + {"mov", 0x803 , 0x1000 , 0x13 , 0x1009, 0x93 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 21. mov r32,dr + {"mov", 0x803 , 0 , 0x12 , 0x92 , 0x100A, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 22. mov cr,r32/64 + {"mov", 0x803 , 0x1000 , 0x12 , 0x93 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 23. mov dr,r32 #if 0 // Opcode 0F 24 has two meanings: // 1: mov r32,tr (obsolete, 80386 only) - {"mov;80386 only",0x803,0x0 , 0x4013, 0x1003, 0x94 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24. mov r32,tr (80386 only) + {"mov;80386 only",0x803,0x0 , 0x4013, 0x1003, 0x94 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 24. mov r32,tr (80386 only) #else // 2: start of 3-byte opcode for AMD SSE5 instructions with DREX byte - {0, 0x66 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F 24. Link to tertiary map for 3-byte opcodes AMD SSE5 with four operands + {0, 0x68 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F 24. Link to tertiary map for 3-byte opcodes AMD SSE5 with four operands #endif - {0, 0x67 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F 25. Link to tertiary map for 3-byte opcodes AMD SSE5 with three operands + immediate byte - {"mov;80386 only",0x803,0 , 0x4012, 0x94 , 0x1003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 26. mov tr,r32 (80386 only) - {0, 0x803 , 0x0 , 0x4012, 0x1003, 0x1003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 27. illegal - {"mova", 0x11 ,0x452200, 0x12 , 0x124F, 0x24F, 0x0 , 0x0 , 0x1204, 0x0 , 0x103 }, // 0F 28. movaps/pd - {"mova", 0xBC , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0 , 0x9 , 0 }, // 0F 29. Link to movaps/pd - {0, 0x46 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 2A. Link to tertiary map: cvtpi2ps, etc. - {0, 0x6A , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 2B. Link to tertiary map: movntps/pd,AMD: also ss/sd - {0, 0x47 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 2C. Link to tertiary map: cvttps2pi, etc. - {0, 0x48 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 2D. Link to tertiary map: cvtps2pi, etc. - {0, 0x4B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 2E. Link to tertiary map: ucomiss/sd - {0, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 2F. Link to tertiary map: comiss/sd -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"wrmsr", 0x805 , 0x1000 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 30 - {"rdtsc", 0x5 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 31 - {"rdmsr", 0x805 , 0x1000 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 32 - {"rdpmc", 0x5 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 33 - {"sysenter", 0x8 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 34 - {"sysexit;Same name with or without 48h prefix",0x808,0x1000,1,0,0,0,0,0x0 , 0x0 , 0x0 }, // 0F 35 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 36 Illegal - {"getsec", 0x14 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 37 - {0, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F 38. Link to tertiary map for 3-byte opcodes - {0, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F 39. Link to tertiary map for 3-byte opcodes - {0, 0x4 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F 3A. Link to tertiary map for 3-byte opcodes - {0, 0x5 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F 3B. Link to tertiary map for 3-byte opcodes - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3C Illegal - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3D Illegal - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3E Illegal - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3F (VIA/Centaur ALTINST ?) -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cmovo", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 40. cmov - {"cmovno", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 41. cmov - {"cmovc", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 42. cmov - {"cmovnc", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 43. cmov - {"cmove", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 44. cmov - {"cmovne", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 45. cmov - {"cmovbe", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 46. cmov - {"cmova", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 47. cmov - {"cmovs", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 48. cmov - {"cmovns", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 49. cmov - {"cmovpe", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 4A. cmov - {"cmovpo", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 4B. cmov - {"cmovl", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 4C. cmov - {"cmovge", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 4D. cmov - {"cmovle", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 4E cmov - {"cmovg", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 4F. cmov -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movmsk", 0x11 , 0x51200, 0x12 , 0x1009, 0x124F, 0x0 , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 50. movmskps/pd - {"sqrt", 0x76 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 51. Link to sqrtps/pd/ss/sd - {"rsqrt", 0x77 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 52. Link to rsqrtps/ss - {"rcp", 0x78 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 53. Link to rcpps/ss - {"and", 0x11 , 0xD0200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 54. andps/pd - {"andn", 0x11 , 0xD0200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 55. andnps/pd - {"or", 0x11 , 0xD0200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 56. orps/pd - {"xor", 0x11 , 0xD0200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 57. xorps/pd - {"add", 0x11 ,0x692E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x3 }, // 0F 58. addps/pd/ss/sd - {"mul", 0x11 ,0x692E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x3 }, // 0F 59. mulps/pd/ss/sd - {0, 0x49 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 5A. Link to cvtps2pd, etc. - {0, 0x4A , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 5B. Link to cvtdq2ps, etc. - {"sub", 0x11 ,0x692E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x3 }, // 0F 5C. subps/pd/ss/sd - {"min", 0x11 ,0x290E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 5D. minps/pd/ss/sd - {"div", 0x11 ,0x290E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 5E. divps/pd/ss/sd - {"max", 0x11 ,0x290E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x3 }, // 0F 5F. maxps/pd/ss/sd -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"punpcklbw", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 60 - {"punpcklwd", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 61 - {"punpckldq", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 62 - {"packsswb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 63 - {"pcmpgtb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 64 - {"pcmpgtw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 65 - {"pcmpgtd", 0xC8 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0xE , 0 }, // 0F 66. link to pcmpgtd - {"packuswb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 67 - {"punpckhbw", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 68 - {"punpckhwd", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 69 - {"punpckhdq", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 6A - {"packssdw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 6B - {"punpcklqdq",0x12 , 0xD8200, 0x19 , 0x1204, 0x1204, 0x204 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 6C. Not valid without 66 prefix - {"punpckhqdq",0x12 , 0xD8200, 0x19 , 0x1204, 0x1204, 0x204 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 6D. Not valid without 66 prefix - {0, 0x58 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 0F 6E. Link to tertiary map: movd/movq - {0, 0x4D , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 6F. Link to tertiary map: movq/movdqa/movdqu -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x4F , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 70. Link to tertiary map: pshufw, etc. - {0, 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 0F 71. Link to tertiary map for group 12 - {0, 0x32 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 0F 72. Link to tertiary map for group 13 - {0, 0x33 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 0F 73. Link to tertiary map for group 14 - {"pcmpeqb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 74 - {"pcmpeqw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 75 - {"pcmpeqd", 0xC7 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0xE , 0 }, // 0F 76. link to pcmpeqd - {"emms", 0x79 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xB , 0 }, // 0F 77. Link to emms, vzeroupper, vzeroall - {0, 0x6C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 78. Link to map for wmread, insrtq, extrq - {0, 0x6D , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 79. Link to map for wmread, insrtq, extrq - {0, 0x68 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F 7A. Link to map for obsolete 3-byte opcodes AMD SSE5. Note: VEX 0F 7A is in map B1 - {0, 0x69 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 }, // 0F 7B. Link to map for obsolete 3-byte opcodes AMD SSE5 - {0, 0x5C , 0xA00 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 7C. Link to map: hadd - {0, 0x5D , 0xA00 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 7D. Link to map: hsub - {0, 0x59 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 7E. Link to map: movd/movq - {0, 0x4E , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 7F. Link to map: movq/movdqa/movdqu -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"jo", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 80 - {"jno", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 81 - {"jc", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 82 - {"jnc", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 83 - {"je", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 84 - {"jne", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 85 - {"jbe", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 86 - {"ja", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 87 - {"js", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 88 - {"jns", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 89 - {"jpe", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 8A - {"jpo", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 8B - {"jl", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 8C - {"jge", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 8D - {"jle", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 8E - {"jg", 0x3 , 0x8 , 0x80 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xA0 }, // 0F 8F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"seto", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 90 - {"setno", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 91 - {"setb", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 92 - {"setae", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 93 - {"sete", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 94 - {"setne", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 95 - {"setbe", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 96 - {"seta", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 97 - {"sets", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 98 - {"setns", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 99 - {"setpe", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 9A - {"setpo", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 9B - {"setl", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 9C - {"setge", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 9D - {"setle", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 9E - {"setg", 0x3 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 9F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"push fs", 0x3 , 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A0 - {"pop fs", 0x3 , 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A1 - {"cpuid", 0x4 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F A2 - {"bt", 0x3 , 0x1100 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A3 - {"shld", 0x3 , 0x1100 , 0x53 , 0x9 , 0x1009, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A4 - {"shld", 0x3 , 0x1100 , 0x13 , 0x9 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A5 - {0, 0xA6 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // 0F A6. Link to VIA instructions - {0, 0xA7 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // 0F A7. Link to VIA instructions - {"push gs", 0x3 , 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A8 - {"pop gs", 0x3 , 0x2 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A9 - {"rsm", 0x803 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F AA - {"bts", 0x3 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F AB - {"shrd", 0x3 , 0x1100 , 0x53 , 0x9 , 0x1009, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F AC - {"shrd", 0x3 , 0x1100 , 0x13 , 0x9 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F AD - {0, 0x34 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 , 0x0 }, // 0F AE. Link to tertiary map for group 15 - {"imul", 0x1 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F AF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cmpxchg", 0x3 , 0xC50 , 0x13 , 0x2001, 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F B0 - {"cmpxchg", 0x3 , 0x1D50 , 0x13 , 0x2009, 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F B1 - {"lss", 0x0 , 0x1100 , 0x812 , 0x1009, 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F B2 (valid in 64-bit mode) - {"btr", 0x3 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F B3 - {"lfs", 0x0 , 0x1100 , 0x812 , 0x1009, 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F B4 - {"lgs", 0x0 , 0x1100 , 0x812 , 0x1009, 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F B5 - {"movzx", 0x3 , 0x1100 , 0x12 , 0x1009, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F B6 - {"movzx", 0x3 , 0x1100 , 0x12 , 0x1009, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F B7 - {0, 0x60 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F B8. Link to tertiary map for popcnt, jmpe - {0, 0x2E , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 0F B9. Link to tertiary map for group 10: ud1 - {0, 0x2C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 0F BA. Link to tertiary map for group 8: bt - {"btc", 0x3 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F BB - {"bsf", 0xAE , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F BC. Link to bsf etc. - {0, 0x6B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F BD. Link to tertiary map for BSR and LZCNT - {"movsx", 0x3 , 0x1100 , 0x12 , 0x1009, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F BE - {"movsx", 0x3 , 0x1100 , 0x12 , 0x1009, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F BF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"xadd", 0x4 , 0x0C50 , 0x13 , 0x1 , 0x1001, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F C0 - {"xadd", 0x4 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F C1 - {0, 0x38 , 0x0 , 0x52 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x6 , 0x0 }, // 0F C2. Link to tertiary map for cmpps etc. - {"movnti", 0x11 , 0x1000 , 0x13 , 0x2009, 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F C3 - {0, 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F C4. Link to pinsrw - {"pextrw", 0x7 , 0x11200, 0x52 , 0x1009, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F C5 - {"shuf", 0x11 , 0xD0200, 0x59 , 0x124F, 0x124F, 0x24F , 0x11 , 0x0 , 0x0 , 0x3 }, // 0F C6 - {0, 0x50 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 0F C7. Link to tertiary map for group 9 - {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F C8. bswap eax - {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F C9. bswap ecx - {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F CA. bswap edx - {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F CB. bswap ebx - {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F CC. bswap esp - {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F CD. bswap ebp - {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F CE. bswap esi - {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F CF. bswap edi -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x2D , 0xA00 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F D0. Link to addsubps/pd - {"psrlw", 0x99 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F D1. Link to map for psrlw - {"psrld", 0x9A , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F D2. Link to map for psrld - {"psrlq", 0x9B , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F D3. Link to map for psrlq - {"paddq", 0x12 , 0xD0200, 0x19 , 0x1104, 0x1104, 0x104 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D4 - {"pmullw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D5 - {0, 0x53 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F D6. Link to tertiary map for movq2dq etc. - {"pmovmskb", 0x93 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0B , 0x0 }, // 0F D7. Link pmovmskb - {"psubusb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D8 - {"psubusw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D9 - {"pminub", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F DA - {"pand", 0xC2 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0xE , 0 }, // 0F DB. link to pand - {"paddusb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F DC - {"paddusw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F DD - {"pmaxub", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F DE - {"pandn", 0xC3 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0xE , 0 }, // 0F DF. link to pandn -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pavgb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F E0 - {"psraw", 0x9C , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F E1. Link to map for psraw - {"psrad", 0x9D , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F E2. Link to map for psrad - {"pavgw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F E3 - {"pmulhuw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F E4 - {"pmulhw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F E5 - {0, 0x54 , 0xE00 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F E6. Link to tertiary map for cvtpd2dq etc. - {0, 0x55 , 0x200 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F E7. Link to tertiary map for movntq - {"psubsb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F E8 - {"psubsw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F E9 - {"pminsw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F EA - {"por", 0xC4 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0xE , 0 }, // 0F EB. link to por - {"paddsb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F EC - {"paddsw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F ED - {"pmaxsw", 0x7 , 0x90200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F EE - {"pxor", 0xC5 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0xE , 0 }, // 0F EF. link to pxor -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x56 , 0x800 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F F0. Link to tertiary map for lddqu - {"psllw", 0x96 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F F1. Link to map for psllw - {"pslld", 0x97 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F F2. Link to map for pslld - {"psllq", 0x98 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F F3. Link to map for psllq - {"pmuludq", 0x7 , 0xD0200, 0x19 , 0x1104, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F F4 - {"pmaddwd", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F F5 - {"psadbw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F F6 - {0, 0x57 , 0x200 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F F7. Link to tertiary map for maskmovq - {"psubb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F F8 - {"psubw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F F9 - {"psubd", 0x7 ,0x4D0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x1406, 0x0 , 0x2 }, // 0F FA - {"psubq", 0x7 , 0xD0200, 0x19 , 0x1104, 0x1104, 0x104 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F FB - {"paddb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F FC - {"paddw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F FD - {"paddd", 0x7 ,0x4D0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x1406, 0x0 , 0x2 }, // 0F FE - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F FF + {0, 0x69 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F 25. Link to tertiary map for 3-byte opcodes AMD SSE5 with three operands + immediate byte + {"mov;80386 only",0x803,0 , 0x4012, 0x94 , 0x1003, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 26. mov tr,r32 (80386 only) + {0, 0x803 , 0 , 0x4012, 0x1003, 0x1003, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 27. illegal + {"mova", 0x11 ,0xC52200, 0x12 , 0x124F, 0x24F, 0 , 0 , 0x30 , 0x1204, 0 , 0x103 }, // 0F 28. movaps/pd + {"mova", 0xBC , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 29. Link to movaps/pd + {0, 0x46 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 2A. Link to tertiary map: cvtpi2ps, etc. + {0, 0xD2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 2B. Link to tertiary map: movntps/pd,AMD: also ss/sd + {0, 0x47 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 2C. Link to tertiary map: cvttps2pi, etc. + {0, 0x48 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 2D. Link to tertiary map: cvtps2pi, etc. + {0, 0x4B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 2E. Link to tertiary map: ucomiss/sd + {0, 0x4C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 2F. Link to tertiary map: comiss/sd +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"wrmsr", 0x805 , 0x1000 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 30 + {"rdtsc", 0x5 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 31 + {"rdmsr", 0x805 , 0x1000 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 32 + {"rdpmc", 0x5 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 33 + {"sysenter", 0x8 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 34 + {"sysexit;Same name with or without 48h prefix",0x808,0x1000,1,0,0,0,0, 0 ,0x0 , 0 , 0 }, // 0F 35 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 36 Illegal + {"getsec", 0x14 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 37 + {0, 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F 38. Link to tertiary map for 3-byte opcodes + {0, 0x3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F 39. Link to tertiary map for 3-byte opcodes + {0, 0x4 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F 3A. Link to tertiary map for 3-byte opcodes + {0, 0x5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F 3B. Link to tertiary map for 3-byte opcodes + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3C Illegal + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3D Illegal + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3E Illegal + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3F (VIA/Centaur ALTINST ?) +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cmovo", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 40. cmov + {"cmovno", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 41. cmov + {"cmovc", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 42. cmov + {"cmovnc", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 43. cmov + {"cmove", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 44. cmov + {"cmovne", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 45. cmov + {"cmovbe", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 46. cmov + {"cmova", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 47. cmov + {"cmovs", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 48. cmov + {"cmovns", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 49. cmov + {"cmovpe", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 4A. cmov + {"cmovpo", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 4B. cmov + {"cmovl", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 4C. cmov + {"cmovge", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 4D. cmov + {"cmovle", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 4E cmov + {"cmovg", 0x6 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 4F. cmov +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movmskp", 0xCA , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 50. Link to movmskps/pd + {"sqrt", 0x76 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 51. Link to sqrtps/pd/ss/sd + {"rsqrt", 0x77 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 52. Link to rsqrtps/ss + {"rcp", 0x78 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 53. Link to rcpps/ss + {"and", 0x11 ,0x8D2200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x21 , 0 , 0 , 0x3 }, // 0F 54. andps/pd + {"andn", 0x11 ,0x8D2200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x21 , 0 , 0 , 0x3 }, // 0F 55. andnps/pd + {"or", 0x11 ,0x8D2200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x21 , 0 , 0 , 0x3 }, // 0F 56. orps/pd + {"xor", 0x11 ,0x8D2200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x21 , 0 , 0 , 0x3 }, // 0F 57. xorps/pd + {"add", 0x11 ,0xE92E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x3 }, // 0F 58. addps/pd/ss/sd + {"mul", 0x11 ,0xE92E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x3 }, // 0F 59. mulps/pd/ss/sd + {0, 0x49 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 5A. Link to cvtps2pd, etc. + {0, 0x4A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 5B. Link to cvtdq2ps, etc. + {"sub", 0x11 ,0xE92E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x3 }, // 0F 5C. subps/pd/ss/sd + {"min", 0x11 ,0xA92E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x33 , 0 , 0 , 0x3 }, // 0F 5D. minps/pd/ss/sd + {"div", 0x11 ,0xA92E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0 , 0 , 0x3 }, // 0F 5E. divps/pd/ss/sd + {"max", 0x11 ,0xA92E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x33 , 0 , 0 , 0x3 }, // 0F 5F. maxps/pd/ss/sd +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"punpcklbw", 0x7 ,0x8D0200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 60 + {"punpcklwd", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 61 + {"punpckldq", 0x7 ,0x8D0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0x21 , 0 , 0 , 0x2 }, // 0F 62 + {"packsswb", 0x7 ,0x8D2200, 0x19 , 0x1201, 0x1202, 0x202 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 63 + {"pcmpgtb", 0x118 , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 64 + {"pcmpgtw", 0x119 , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 65 + {"pcmpgtd", 0xC8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 66. link to pcmpgtd + {"packuswb", 0x7 ,0x8D0200, 0x19 , 0x1201, 0x1202, 0x202 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 67 + {"punpckhbw", 0x7 ,0x8D2200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 68 + {"punpckhwd", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 69 + {"punpckhdq", 0x7 ,0x8D0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0x31 , 0 , 0 , 0x2 }, // 0F 6A + {"packssdw", 0x7 ,0x8D0200, 0x19 , 0x1202, 0x1203, 0x203 , 0 , 0x21 , 0 , 0 , 0x2 }, // 0F 6B + {"punpcklqdq",0x12 ,0x8DB200, 0x19 , 0x1204, 0x1204, 0x204 , 0 , 0x21 , 0 , 0 , 0x2 }, // 0F 6C + {"punpckhqdq",0x12 ,0x8DB200, 0x19 , 0x1204, 0x1204, 0x204 , 0 , 0x21 , 0 , 0 , 0x2 }, // 0F 6D + {0, 0x58 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 0F 6E. Link to tertiary map: movd/movq + {0, 0x4D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 6F. Link to tertiary map: movq/movdqa/movdqu +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x4F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 70. Link to tertiary map: pshufw, etc. + {0, 0x31 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F 71. Link to tertiary map for group 12 + {0, 0x32 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F 72. Link to tertiary map for group 13 + {0, 0x33 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F 73. Link to tertiary map for group 14 + {"pcmpeqb", 0x116 , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 74 + {"pcmpeqw", 0x117 , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 75 + {"pcmpeqd", 0xC7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 76. link to pcmpeqd + {"emms", 0x79 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xB , 0 }, // 0F 77. Link to emms, vzeroupper, vzeroall + {0, 0x6C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 78. Link to map for wmread, insrtq, extrq + {0, 0x6D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 79 without EVEX. Link to map for wmread, insrtq, extrq + {0, 0x6A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F 7A. Link to map for obsolete 3-byte opcodes AMD SSE5. Note: VEX 0F 7A is in map B1 + {0, 0x6B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 , 0 }, // 0F 7B. Link to map for obsolete 3-byte opcodes AMD SSE5. Note: VEX 0F 7B is in map B1 + {0, 0x5C , 0xA00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 7C. Link to map: hadd + {0, 0x5D , 0xA00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 7D. Link to map: hsub + {0, 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 7E. Link to map: movd/movq + {0, 0x4E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 7F. Link to map: movq/movdqa/movdqu +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"jo", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 80 + {"jno", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 81 + {"jc", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 82 + {"jnc", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 83 + {"je", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 84 + {"jne", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 85 + {"jbe", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 86 + {"ja", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 87 + {"js", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 88 + {"jns", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 89 + {"jpe", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 8A + {"jpo", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 8B + {"jl", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 8C + {"jge", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 8D + {"jle", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 8E + {"jg", 0x3 , 0x8 , 0x80 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0xA0 }, // 0F 8F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"seto", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 90 + {"setno", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 91 + {"setb", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 92 + {"setae", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 93 + {"sete", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 94 + {"setne", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 95 + {"setbe", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 96 + {"seta", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 97 + {"sets", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 98 + {"setns", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 99 + {"setpe", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 9A + {"setpo", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 9B + {"setl", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 9C + {"setge", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 9D + {"setle", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 9E + {"setg", 0x3 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 9F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"push fs", 0x3 , 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A0 + {"pop fs", 0x3 , 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A1 + {"cpuid", 0x4 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F A2 + {"bt", 0x3 , 0x1100 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A3 + {"shld", 0x3 , 0x1100 , 0x53 , 0x9 , 0x1009, 0x11 , 0 , 0 , 0 , 0 , 0 }, // 0F A4 + {"shld", 0x3 , 0x1100 , 0x13 , 0x9 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 }, // 0F A5 + {0, 0xA6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // 0F A6. Link to VIA instructions + {0, 0xA7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // 0F A7. Link to VIA instructions + {"push gs", 0x3 , 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A8 + {"pop gs", 0x3 , 0x2 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A9 + {"rsm", 0x803 , 0 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F AA + {"bts", 0x3 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F AB + {"shrd", 0x3 , 0x1100 , 0x53 , 0x9 , 0x1009, 0x11 , 0 , 0 , 0 , 0 , 0 }, // 0F AC + {"shrd", 0x3 , 0x1100 , 0x13 , 0x9 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 }, // 0F AD + {0, 0x34 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // 0F AE. Link to tertiary map for group 15 + {"imul", 0x1 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F AF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cmpxchg", 0x3 , 0xC50 , 0x13 , 0x2001, 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F B0 + {"cmpxchg", 0x3 , 0x1D50 , 0x13 , 0x2009, 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F B1 + {"lss", 0 , 0x1100 , 0x812 , 0x1009, 0x200D, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F B2 (valid in 64-bit mode) + {"btr", 0x3 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F B3 + {"lfs", 0 , 0x1100 , 0x812 , 0x1009, 0x200D, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F B4 + {"lgs", 0 , 0x1100 , 0x812 , 0x1009, 0x200D, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F B5 + {"movzx", 0x3 , 0x1100 , 0x12 , 0x1009, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F B6 + {"movzx", 0x3 , 0x1100 , 0x12 , 0x1009, 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F B7 + {0, 0x60 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F B8. Link to tertiary map for popcnt, jmpe + {0, 0x2E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F B9. Link to tertiary map for group 10: ud1 + {0, 0x2C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F BA. Link to tertiary map for group 8: bt + {"btc", 0x3 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F BB + {"bsf", 0xAE , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F BC. Link to bsf etc. + {0, 0xD3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F BD. Link to tertiary map for BSR and LZCNT + {"movsx", 0x3 , 0x1100 , 0x12 , 0x1009, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F BE + {"movsx", 0x3 , 0x1100 , 0x12 , 0x1009, 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F BF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"xadd", 0x4 , 0x0C50 , 0x13 , 0x1 , 0x1001, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F C0 + {"xadd", 0x4 , 0x1D50 , 0x13 , 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F C1 + {0, 0xF5 , 0 , 0x52 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F C2. Link to cmpps etc. + {"movnti", 0x11 , 0x1000 , 0x13 , 0x2009, 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F C3 + {0, 0x29 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F C4. Link to pinsrw + {"pextrw", 0x7 ,0x812200, 0x52 , 0x1002, 0x1102, 0x11 , 0 , 0x1000, 0 , 0 , 0x2 }, // 0F C5 + {"shuf", 0x11 ,0x8D2200, 0x59 , 0x124F, 0x124F, 0x24F , 0x11 , 0x31 , 0 , 0 , 0x3 }, // 0F C6 + {0, 0x50 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F C7. Link to tertiary map for group 9 + {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F C8. bswap eax + {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F C9. bswap ecx + {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F CA. bswap edx + {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F CB. bswap ebx + {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F CC. bswap esp + {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F CD. bswap ebp + {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F CE. bswap esi + {"bswap", 0x3 , 0x1000 , 0x3 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F CF. bswap edi +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x2D , 0xA00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F D0. Link to addsubps/pd + {"psrlw", 0x99 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F D1. Link to map for psrlw + {"psrld", 0x9A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F D2. Link to map for psrld + {"psrlq", 0x9B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F D3. Link to map for psrlq + {"paddq", 0x12 ,0x8D3200, 0x19 , 0x1204, 0x1204, 0x204 , 0 , 0x21 , 0 , 0 , 0x2 }, // 0F D4 + {"pmullw", 0x7 ,0x8DA200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D5 + {0, 0x53 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F D6. Link to tertiary map for movq2dq etc. + {"pmovmskb", 0x93 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0B , 0 }, // 0F D7. Link pmovmskb + {"psubusb", 0x7 ,0x8D2200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D8 + {"psubusw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D9 + {"pminub", 0x7 ,0x8D0200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F DA + {"pand", 0xC2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F DB. link to pand + {"paddusb", 0x7 ,0x8D2200, 0x19 , 0x1201, 0x1201, 0x201 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F DC + {"paddusw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x202 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F DD + {"pmaxub", 0x7 ,0x8D2200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F DE + {"pandn", 0xC3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F DF. link to pandn +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pavgb", 0x7 ,0x8D2200, 0x19 , 0x1201, 0x1201, 0x201 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F E0 + {"psraw", 0x9C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F E1. Link to map for psraw + {"psrad", 0x9D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F E2. Link to map for psrad + {"pavgw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x202 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F E3 + {"pmulhuw", 0x7 ,0x8DA200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F E4 + {"pmulhw", 0x7 ,0x8DA200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F E5 + {0, 0x54 , 0xE00 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F E6. Link to tertiary map for cvtpd2dq etc. + {0, 0x55 , 0x200 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F E7. Link to tertiary map for movntq + {"psubsb", 0x7 ,0x8D2200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F E8 + {"psubsw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F E9 + {"pminsw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F EA + {"por", 0xC4 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F EB. link to por + {"paddsb", 0x7 ,0x8D2200, 0x19 , 0x1201, 0x1201, 0x201 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F EC + {"paddsw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x202 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F ED + {"pmaxsw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F EE + {"pxor", 0xC5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F EF. link to pxor +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x56 , 0x800 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F F0. Link to tertiary map for lddqu + {"psllw", 0x96 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F F1. Link to map for psllw + {"pslld", 0x97 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F F2. Link to map for pslld + {"psllq", 0x98 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F F3. Link to map for psllq + {"pmuludq", 0x7 ,0x8D2200, 0x19 , 0x1104, 0x1104, 0x104 , 0 , 0x31 , 0 , 0 , 0x2 }, // 0F F4 (32 bit memory operand is broadcast as 64 bit into every second dword) + {"pmaddwd", 0x7 ,0x8D2200, 0x19 , 0x1103, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F F5 + {"psadbw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F F6 + {0, 0x57 , 0x200 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F F7. Link to tertiary map for maskmovq + {"psubb", 0x7 ,0x8D2200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F F8 + {"psubw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F F9 + {"psubd", 0x7 ,0xCD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0x21 , 0x1406, 0 , 0x2 }, // 0F FA + {"psubq", 0x7 ,0x8D2200, 0x19 , 0x1104, 0x1104, 0x104 , 0 , 0x21 , 0 , 0 , 0x2 }, // 0F FB + {"paddb", 0x7 ,0x8D2200, 0x19 , 0x1201, 0x1201, 0x201 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F FC + {"paddw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x202 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F FD + {"paddd", 0x7 ,0xCD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0x31 , 0x1406, 0 , 0x2 }, // 0F FE + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F FF // Tertiary opcode map for 3-byte opcode. First two bytes = 0F 38 // or VEX encoded with mmmm = 2 // Indexed by third opcode byte SOpcodeDef OpcodeMap2[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pshufb", 0x14 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 00 - {"phaddw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 01 - {"phaddd", 0x14 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 02 - {"phaddsw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 03 - {"pmaddubsw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 04 - {"phsubw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 05 - {"phsubd", 0x14 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 06 - {"phsubsw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 07 - {"psignb", 0x14 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 08 - {"psignw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 09 - {"psignd", 0x14 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 0A - {"pmulhrsw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 0B - {"vpermilps", 0x19 , 0xF8200, 0x19 , 0x124B, 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 0C - {"vpermilpd", 0x19 , 0xF8200, 0x19 , 0x124C, 0x124C, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 0D - {"vtestps", 0x19 , 0x78200, 0x12 , 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 0E - {"vtestpd", 0x19 , 0x78200, 0x12 , 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 0F - -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pblendvb", 0x15 , 0x8200 , 0x12 , 0x1401, 0x401 , 0xAE , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 10 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 11 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 12 - {"vcvtph2ps", 0x10000,0x78200, 0x12 , 0x250 , 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 13 - {"blendvps", 0x15 , 0x8200 , 0x12 , 0x124B, 0x24B , 0xAE , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 14 - {"blendvpd", 0x15 , 0x8200 , 0x12 , 0x124C, 0x24C , 0xAE , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 15 - {"vpermps", 0x1C , 0x1F8200,0x19 , 0x154B, 0x154B, 0x503 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 16 - {"ptest", 0x15 , 0x58200, 0x12 , 0x1250, 0x250 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 17. Also in AMD SSE5 instruction set - {"vbroadcastss",0x19,0x478200, 0x12 , 0x124B, 0x04B , 0x0 , 0x0 , 0x1048, 0x0 , 0x0 }, // 0F 38 18 - {"vbroadcastsd",0x19,0x47A200, 0x12 , 0x124C, 0x04C , 0x0 , 0x0 , 0x1049, 0x0 , 0x0 }, // 0F 38 19 - {0, 0xB2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 1A. Link to broadcast instructions - {"vbroadcastf64x4",0x20,0x429200,0x12, 0x164C, 0x264C, 0x0 , 0x0 , 0x1011, 0x0 , 0x100 }, // 0F 38 1B - {"pabsb", 0x14 , 0x50200, 0x12 , 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 1C - {"pabsw", 0x14 , 0x50200, 0x12 , 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 1D - {"pabsd", 0x14 , 0x50200, 0x12 , 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 1E - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 1F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x7A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 20. Link pmovsxbw - {0, 0x7C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 21. Link pmovsxbd - {0, 0x7E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 22. Link pmovsxbq - {0, 0x80 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 23. Link pmovsxwd - {0, 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 24. Link pmovsxwq - {0, 0x84 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 25. Link pmovsxdq - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 26 - {"vptestmd", 0x20 , 0x4B8200,0x19 , 0x95 , 0x1603, 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 27 - {"pmuldq", 0x15 , 0xD8200, 0x19 , 0x1204, 0x1203, 0x203 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 28 - {"pcmpeqq", 0x16 , 0xD8200, 0x19 , 0x1204, 0x1204, 0x204 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 29 - {"movntdqa", 0x15 , 0x58200, 0x12 , 0x1250, 0x2250, 0x0 , 0x0 , 0x0 , 0x0 , 0x102 }, // 0F 38 2A - {"packusdw", 0x15 , 0xD8200, 0x19 , 0x1202, 0x1203, 0x203 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 2B - {"vmaskmovps",0x19 , 0xF8200, 0x19, 0x124B, 0x124B, 0x224B, 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 2C - {"vmaskmovpd",0x19 , 0xF8200, 0x19, 0x124C, 0x124C, 0x224C, 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 2D - {"vmaskmovps",0x19 , 0xF8200, 0x1A, 0x224B, 0x124B, 0x124B, 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 2E - {"vmaskmovpd",0x19 , 0xF8200, 0x1A, 0x224C, 0x124C, 0x124C, 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 2F - -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x86 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 30. Link pmovzxbv - {0, 0x88 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 31. Link pmovzxbd - {0, 0x8A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 32. Link pmovzxbq - {0, 0x8C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 33. Link pmovzxwd - {0, 0x8E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 34. Link pmovzxwq - {0, 0x90 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 35. Link pmovzxdq - {"vpermd", 0x1C , 0x4F8200,0x19 , 0x1203, 0x1203, 0x203 , 0x0 , 0x1000, 0x0 , 0x0 }, // 0F 38 36 - {"pcmpgtq", 0x16 , 0xD8200, 0x19 , 0x1204, 0x1204, 0x204 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 37 - {"pminsb", 0x15 , 0xD8200, 0x19 , 0x1201, 0x1201, 0x201 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 38 - {"pminsd", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0x0 , 0x1406, 0x0 , 0x2 }, // 0F 38 39 - {"pminuw", 0x15 , 0xD8200, 0x19 , 0x1202, 0x1202, 0x202 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 3A - {"pminud", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0x0 , 0x1406, 0x0 , 0x2 }, // 0F 38 3B - {"pmaxsb", 0x15 , 0xD8200, 0x19 , 0x1201, 0x1201, 0x201 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 3C - {"pmaxsd", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0x0 , 0x1406, 0x0 , 0x2 }, // 0F 38 3D - {"pmaxuw", 0x15 , 0xD8200, 0x19 , 0x1202, 0x1202, 0x202 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 3E - {"pmaxud", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0x0 , 0x1406, 0x0 , 0x2 }, // 0F 38 3F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pmulld", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0x0 , 0x1406, 0x0 , 0x2 }, // 0F 38 40 - {"phminposuw",0x15 , 0x18200, 0x12 , 0x1402, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 41 - {"vgetexpp", 0x20 , 0x429200,0x12 , 0x164F, 0x64F , 0x0 , 0x0 , 0x1204, 0x0 , 0x101 }, // 0F 38 42 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 43 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 44 - {"vpsrlv", 0x1C ,0x4FB200, 0x19 , 0x1209, 0x1209, 0x209 , 0x0 , 0x1406, 0x0 , 0x1 }, // 0F 38 45 - {"vpsravd", 0x1C ,0x4FB200, 0x19 , 0x1203, 0x1203, 0x203 , 0x0 , 0x1406, 0x0 , 0x0 }, // 0F 38 46 - {"vpsllv", 0x1C ,0x4FB200, 0x19 , 0x1209, 0x1209, 0x209 , 0x0 , 0x1406, 0x0 , 0x1 }, // 0F 38 47 - {"(reserved)",0x0 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 48 - {"(reserved)",0x0 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 49 - {"(reserved)",0x0 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 4A - {"(reserved)",0x0 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 4B - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 4C - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 4D - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 4E - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 4F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vaddnp", 0x20 ,0x4A9200, 0x19, 0x164F, 0x164F, 0x64F , 0x0 , 0x1304, 0x0 , 0x101 }, // 0F 38 50 - {"vgmaxabsps",0x20 , 0x428200,0x12 , 0x164F, 0x64F , 0x0 , 0x0 , 0x1204, 0x0 , 0x100 }, // 0F 38 51 - {"vgminp", 0x20 , 0x429200,0x12 , 0x164F, 0x64F , 0x0 , 0x0 , 0x1204, 0x0 , 0x101 }, // 0F 38 52 - {"vgmaxp", 0x20 , 0x429200,0x12 , 0x164F, 0x64F , 0x0 , 0x0 , 0x1204, 0x0 , 0x101 }, // 0F 38 53 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 54 - {"vfixupnanp",0x20 ,0x4A9200, 0x19, 0x164F, 0x164F, 0x603 , 0x0 , 0x1206, 0x0 , 0x101 }, // 0F 38 55 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 56 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 57 - {"vpbroadcastd",0xA0, 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 38 58. Link to vpbroadcastd - {"vpbroadcastq",0xA1, 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 38 59. Link to vpbroadcastq - {0, 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 1A. Link to broadcast instructions - {"vbroadcasti64x4",0x20,0x429200,0x12, 0x1604, 0x2604, 0x0 , 0x0 , 0x1013, 0x0 , 0x100 }, // 0F 38 5B - {"vpadcd", 0x20 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 5C - {"vpaddsetcd",0x20 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 5D - {"vpsbbd", 0x20 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 5E - {"vpsubsetbd",0x20 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 5F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 60 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 61 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 62 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 63 - {"vpblendm", 0x20 ,0x4AB200, 0x19, 0x1609, 0x1609, 0x609 , 0x0 , 0x1406, 0x0 , 0x101 }, // 0F 38 64 - {"vblendmp", 0x20 ,0x4A9200, 0x19, 0x164F, 0x164F, 0x64F , 0x0 , 0x1404, 0x0 , 0x101 }, // 0F 38 65 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 66 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 67 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 68 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 69 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 6A - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 6B - {"vpsubrd", 0x20 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 6C - {"vsubrp", 0x20 ,0x4A9200, 0x19, 0x164F, 0x164F, 0x64F , 0x0 , 0x1304, 0x0 , 0x101 }, // 0F 38 6D - {"vpsbbrd", 0x20 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 6E - {"vpsubrsetbd",0x20 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 6F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 70 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 71 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 72 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 73 - {"vpcmpltd", 0x20 ,0x4B8200, 0x19 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 38 74 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 75 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 76 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 77 - {"vpbroadcastb",0x9E, 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 38 78. Link to vpbroadcastb - {"vpbroadcastw",0x9F, 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 38 79. Link to vpbroadcastw - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 7A - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 7B - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 7C - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 7D - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 7E - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 7F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 80 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 81 - {"invpcid", 0x1C , 0x9200 , 0x12 , 0x1009, 0x2406, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 82 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 83 - {"vscaleps", 0x20 ,0x4B8200, 0x19 , 0x164B, 0x164B, 0x603 , 0x0 , 0x1306, 0x0 , 0x100 }, // 0F 38 84 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 85 - {"vpmulhud", 0x20 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 86 - {"vpmulhd", 0x20 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 87 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 88 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 89 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 8A - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 8B - {"vpmaskmov", 0x1C , 0xFB200, 0x19, 0x1209, 0x1209, 0x2209, 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 8C - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 8D - {"vpmaskmov", 0x1C , 0xFB200, 0x1A, 0x2209, 0x1209, 0x1209, 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 8E - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 8F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vpgatherd", 0xCA , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 90. link to vpgatherd/q - {"vpgatherq", 0x94 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0x0 }, // 0F 38 91. Link to vpgatherqd/q - {"vgatherdp", 0xB6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0x0 }, // 0F 38 92. Link to vpgatherdps/pd - {"vgatherqp", 0x95 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0x0 }, // 0F 38 93. Link to vpgatherqps/pd - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 94 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 95 - {"vfmaddsub132p",0x1A,0xF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 96 - {"vfmsubadd132p",0x1A,0xF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 97 - {"vfmadd132p",0x1A ,0x4F9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 98 - {"vfmadd132s",0x1A , 0xB9200, 0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 99 - {"vfmsub132p",0x1A ,0x4F9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 9A - {"vfmsub132s",0x1A , 0xB9200, 0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 9B - {"vfnmadd132p",0x1A ,0x4F9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 9C - {"vfnmadd132s",0x1A , 0xB9200, 0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 9D - {"vfnmsub132p",0x1A ,0x4F9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 9E - {"vfnmsub132s",0x1A , 0xB9200, 0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 9F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vpscatterd", 0x20 , 0x43B200,0x1E , 0x2609, 0x1609, 0x0 , 0x0 , 0x304E, 0x0 , 0x101 }, // 0F 38 A0 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 A1 - {"vscatterdp",0x20 , 0x439200,0x1E , 0x264B, 0x1603, 0x0 , 0x0 , 0x304C, 0x0 , 0x101 }, // 0F 38 A2 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 A3 - {"vfmadd233ps",0x20 ,0x4F8200, 0x19 , 0x124B, 0x124B, 0x24B , 0x0 , 0x1316, 0x0 , 0x100 }, // 0F 38 A4 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 A5 - {"vfmaddsub213p",0x1A,0xF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 A6 - {"vfmsubadd213p",0x1A,0xF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 A7 - {"vfmadd213p",0x1A ,0x4F9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 A8 - {"vfmadd213s",0x1A , 0xB9200, 0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 A9 - {"vfmsub213p",0x1A ,0x4F9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 AA - {"vfmsub213s",0x1A , 0xB9200, 0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 AB - {"vfnmadd213p",0x1A ,0x4F9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 AC - {"vfnmadd213s",0x1A , 0xB9200, 0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 AD - {"vfnmsub213p",0x1A ,0x4F9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 AE - {"vfnmsub213s",0x1A , 0xB9200, 0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 AF - -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"(reserved)",0x00 ,0x4D2E00, 0x401E, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 B0 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 B1 - {"(reserved)",0x00 ,0x4D2E00, 0x401E, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 B2 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 B3 - {"vpmadd233d",0x20 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 B4 - {"vpmadd231d",0x20 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0x0 , 0x1406, 0x0 , 0x100 }, // 0F 38 B5 - {"vfmaddsub231p",0x1A,0xF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 B6 - {"vfmsubadd231p",0x1A,0xF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 B7 - {"vfmadd231p", 0x1A,0x4F9200,0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 B8 - {"vfmadd231s", 0x1A, 0xB9200,0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 B9 - {"vfmsub231p", 0x1A,0x4F9200,0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 BA - {"vfmsub231s", 0x1A, 0xB9200,0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 BB - {"vfnmadd231p", 0x1A,0x4F9200,0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 BC - {"vfnmadd231s", 0x1A, 0xB9200,0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 BD - {"vfnmsub231p", 0x1A,0x4F9200,0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x1304, 0x0 , 0x1 }, // 0F 38 BE - {"vfnmsub231s", 0x1A, 0xB9200,0x19 , 0x144F, 0x144F, 0x44F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F 38 BF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"(reserved)",0x0 ,0x4D2E00 , 0x401E, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 C0 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 C1 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 C2 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 C3 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 C4 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 C5 - {0, 0xB7 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 0F 38 C6. Link to vgatherpf0dps - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 C7 - {"vexp223ps", 0x20 ,0x428200, 0x12 , 0x164B, 0x603 , 0x0 , 0x0 , 0x1201, 0x0 , 0x100 }, // 0F 38 C8 - {"vlog2ps", 0x20 ,0x428200, 0x12 , 0x164B, 0x603 , 0x0 , 0x0 , 0x1201, 0x0 , 0x100 }, // 0F 38 C9 - {"vrcp23ps", 0x20 ,0x428200, 0x12 , 0x164B, 0x603 , 0x0 , 0x0 , 0x1201, 0x0 , 0x100 }, // 0F 38 CA - {"vrsqrt23ps",0x20 ,0x428200, 0x12 , 0x164B, 0x603 , 0x0 , 0x0 , 0x1201, 0x0 , 0x100 }, // 0F 38 CB - {"vaddsetsps",0x20 ,0x4A8200, 0x19, 0x164B, 0x164B, 0x64B , 0x0 , 0x3304, 0x0 , 0x100 }, // 0F 38 CC - {"vpaddsetsd",0x20 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0x0 , 0x3406, 0x0 , 0x100 }, // 0F 38 CD - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 CE - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 CF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0xBE , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 38 D0. Link to vloadunpackld - {0, 0xBF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 38 D1. Link to vloadunpacklps - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 D2 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 D3 - {0, 0xC0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 38 D4. Link to vloadunpackhd - {0, 0xC1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 38 D5. Link to vloadunpackhps - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 D6 - {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 D7 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 D8 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 D9 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 DA - {"aesimc", 0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 DB - {"aesenc", 0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 DC - {"aesenclast",0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 DD - {"aesdec", 0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 DE - {"aesdeclast",0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 DF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E0 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E1 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E2 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E3 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E4 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E5 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E6 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E7 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E8 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 E9 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 EA - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 EB - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 EC - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 ED - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 EE - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 EF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"crc32", 0x16 ,0x19900 , 0x12 , 0x1009, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F0 - {"crc32", 0x07 ,0x19900 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 0F 38 F1. Link to crc32 16/32/64 bit - {"andn", 0x1C , 0xB1000, 0x19 , 0x1009, 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F2 - {"blsi", 0xA2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0x0 }, // 0F 38 F3. Link to blsi etc. by reg bit - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F4 - {"bzhi", 0xA3 , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 38 F5. Link to bzhi, pdep, pext - {"mulx", 0x1C , 0xB1000, 0x19 , 0x1009, 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F6 - {"bextr", 0xAD , 0 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 38 F7. Link to bextr etc. - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F8 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F9 - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 FA - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 FB - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 FC - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 FD - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 FE - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 FF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pshufb", 0x14 ,0x8D2200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 38 00 + {"phaddw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 01 + {"phaddd", 0x14 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 02 + {"phaddsw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 03 + {"pmaddubsw", 0x14 ,0x8D2200, 0x19 , 0x1102, 0x1101, 0x101 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 38 04 + {"phsubw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 05 + {"phsubd", 0x14 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 06 + {"phsubsw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 07 + {"psignb", 0x14 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 08 + {"psignw", 0x14 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 09 + {"psignd", 0x14 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 0A + + {"pmulhrsw", 0x14 ,0x8DA200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 38 0B + {"vpermilps", 0x19 ,0x8FA200, 0x19 , 0x124B, 0x124B, 0x24B , 0 , 0x31 , 0 , 0 , 0 }, // 0F 38 0C + {"vpermilpd", 0x19 ,0x8FA200, 0x19 , 0x124C, 0x124C, 0x24C , 0 , 0x31 , 0 , 0 , 0 }, // 0F 38 0D + {"vtestps", 0x19 , 0x78200, 0x12 , 0x124B, 0x24B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 0E + {"vtestpd", 0x19 , 0x78200, 0x12 , 0x124B, 0x24B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 0F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0xEA , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 10. Link pblendvb and vpsrlvw + {"vpsravw", 0x1C ,0x8FC200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 38 11 + {"vpsllvw", 0x20 ,0x8FC200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 38 12 + {"vcvtph2ps", 0x19 ,0x878200, 0x12 , 0x250 , 0xF4A , 0 , 0 , 0x2232, 0 , 0 , 0 }, // 0F 38 13 + {0, 0x8D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xB , 0 }, // 0F 38 14. Link to vprorvd blendvps and vpmovqw + {0, 0x8E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xB , 0 }, // 0F 38 15. Link to vprolvd blendvpd and vpmovqd + {"vpermp", 0x1C ,0x9F9200 ,0x19 , 0x124F, 0x1203, 0x24F , 0 , 0x31 , 0 , 0 , 0x1 }, // 0F 38 16 + {"ptest", 0x15 , 0x58200, 0x12 , 0x1250, 0x250 , 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 17. Also in AMD SSE5 instruction set + {"vbroadcastss",0x19,0xC78200, 0x12 , 0x124B, 0x04B , 0 , 0 , 0x20 , 0x1048, 0 , 0 }, // 0F 38 18 + {0, 0x12A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0E , 0 }, // 0F 38 19. Link to vbroadcastsd + {0, 0xE5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0C , 0 }, // 0F 38 1A. Link to broadcast instructions + {0, 0x38 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0C , 0 }, // 0F 38 1B. Link to vbroadcastf64x4 + {"pabsb", 0x14 ,0x85A200, 0x12 , 0x1201, 0x201 , 0 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 38 1C + {"pabsw", 0x14 ,0x85A200, 0x12 , 0x1202, 0x202 , 0 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 38 1D + {"pabsd", 0x14 ,0x85B200, 0x12 , 0x1203, 0x203 , 0 , 0 , 0x31 , 0 , 0 , 0x2 }, // 0F 38 1E + {"vpabsq", 0x20 ,0x85B200, 0x12 , 0x1203, 0x203 , 0 , 0 , 0x31 , 0 , 0 , 0x0 }, // 0F 38 1F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x7A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 20. Link pmovsxbw + {0, 0x7B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 21. Link pmovsxbd and vpmovdb + {0, 0x7D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 22. Link pmovsxbq and vpmovqb + {0, 0x7F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 23. Link pmovsxwd and vpmovdw + {0, 0x80 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 24. Link pmovsxwq and vpmovqw + {0, 0x82 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 25. Link pmovsxdq and vpmovqd + {"vptestm", 0x20 ,0x8BC200, 0x19 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 1 }, // 0F 38 27 + {"vptestm", 0x20 ,0xCBB200, 0x19 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 1 }, // 0F 38 27 + {"pmuldq", 0x15 ,0x8DA200, 0x19 , 0x1204, 0x1204, 0x204 , 0 , 0x31 , 0 , 0 , 0x2 }, // 0F 38 28 (32 bit memory operand is broadcast as 64 bit into every second dword) + {0, 0xE3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 29. Link to pcmpeqq + {0, 0x91 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 2A. Link to movntdqa and vpbroadcastmb2q + {"packusdw", 0x15 ,0x8D8200, 0x19 , 0x1202, 0x1203, 0x203 , 0 , 0x21 , 0 , 0 , 0x2 }, // 0F 38 2B + {0, 0xFD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 2C. Link to vmaskmovps and vscalefps + {0, 0xFE , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 2D. Link to vmaskmovss and vscalefss + {"vmaskmovps",0x19 , 0xF8200, 0x1A, 0x224B, 0x124B, 0x124B, 0 , 0 , 0 , 0 , 0 }, // 0F 38 2E + {"vmaskmovpd",0x19 , 0xF8200, 0x1A, 0x224C, 0x124C, 0x124C, 0 , 0 , 0 , 0 , 0 }, // 0F 38 2F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x83 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 30. Link pmovzxbv + {0, 0x85 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 31. Link pmovzxbd and vpmovdb + {0, 0x87 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 32. Link pmovzxbq and vpmovqb + {0, 0x89 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 33. Link pmovzxwd and vpmovdw + {0, 0x8A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 34. Link pmovzxwq and vpmovqw + {0, 0x8C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 35. Link pmovzxdq and vpmovqd + {"vperm", 0x1C , 0xCFB200,0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1000, 0 , 0x1 }, // 0F 38 36 + {0, 0xE4 , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 37 + {0, 0x12C , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 38. Link to pminsb etc. + {0, 0xE6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 39. Link pminsd + {0, 0xFF , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 3A + {0 , 0xE7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0x2 }, // 0F 38 3B. Link pminud + {"pmaxsb", 0x15 ,0x8DA200, 0x19 , 0x1201, 0x1201, 0x201 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 38 3C + {0, 0xE8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 3D. Link pmaxsd + {"pmaxuw", 0x15 ,0x8DA200, 0x19 , 0x1202, 0x1202, 0x202 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F 38 3E + {0, 0xE9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 3F. Link pmaxud +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pmull", 0x15 ,0xCDB200, 0x19 , 0x1203, 0x1203, 0x203 , 0 , 0x31 , 0x1406, 0 , 0x3 }, // 0F 38 40 + {"phminposuw",0x15 ,0x18200, 0x12 , 0x1402, 0x402 , 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 41 + {"vgetexpp", 0x20 ,0xC29200, 0x12 , 0x124F, 0x24F , 0 , 0 , 0x33 , 0x1204, 0 , 0x101 }, // 0F 38 42 + {"vgetexps", 0x20 ,0xCA9200, 0x19 , 0x144F, 0x24F , 0x04F , 0 , 0x32 , 0x1204, 0 , 0x101 }, // 0F 38 43 + {"vplzcnt", 0x21 ,0x80B200, 0x12 , 0x1209, 0x0209, 0 , 0 , 0x31 , 0 , 0 , 0x1 }, // 0F 38 44 + {"vpsrlv", 0x1C ,0xCFB200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }, // 0F 38 45 + {"vpsrav", 0x1C ,0xCFB200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }, // 0F 38 46 + {"vpsllv", 0x1C ,0xCFB200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }, // 0F 38 47 + {"(reserved)",0x0 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 48 + {"(reserved)",0x0 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 49 + {"(reserved)",0x0 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 4A + {"(reserved)",0x0 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 4B + {"vrcp14p" ,0x20 ,0x8D9200, 0x12 , 0x124F, 0x024F, 0 , 0 , 0x31 , 0 , 0 , 0x1 }, // 0F 38 4C + {"vrcp14s" ,0x20 ,0x8D9200, 0x19 , 0x144F, 0x144F, 0x004F, 0 , 0x30 , 0 , 0 , 0x1 }, // 0F 38 4D + {"vrsqrt14p", 0x20 ,0x8D9200, 0x12 , 0x124F, 0x024F, 0 , 0 , 0x31 , 0 , 0 , 0x1 }, // 0F 38 4E + {"vrsqrt14s", 0x20 ,0x8D9200, 0x19 , 0x144F, 0x144F, 0x004F, 0 , 0x30 , 0 , 0 , 0x1 }, // 0F 38 4F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vaddnp", 0x80 ,0x4A9200, 0x19, 0x164F, 0x164F, 0x64F , 0 , 0 , 0x1304, 0 , 0x101 }, // 0F 38 50 + {"vgmaxabsps",0x80 ,0x428200, 0x12 , 0x164F, 0x64F , 0 , 0 , 0 , 0x1204, 0 , 0x100 }, // 0F 38 51 + {"vgminp", 0x80 ,0x429200, 0x12 , 0x164F, 0x64F , 0 , 0 , 0 , 0x1204, 0 , 0x101 }, // 0F 38 52 + {"vgmaxp", 0x80 ,0x429200, 0x12 , 0x164F, 0x64F , 0 , 0 , 0 , 0x1204, 0 , 0x101 }, // 0F 38 53 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 54 + {"vfixupnanp",0x80 ,0x4A9200, 0x19, 0x164F, 0x164F, 0x603 , 0 , 0 , 0x1206, 0 , 0x101 }, // 0F 38 55 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 56 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 57 + {"vpbroadcastd",0xA0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 58. Link to vpbroadcastd + {"vpbroadcastq",0xA1, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 59. Link to vpbroadcastq + {0, 0x84 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 5A. Link to broadcast instructions + {"vbroadcasti64x4",0x80,0xC29200,0x12, 0x1604, 0x2504, 0 , 0 , 0x20 , 0x1013, 0 , 0x100 }, // 0F 38 5B + {"vpadcd", 0x80 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 5C + {"vpaddsetcd",0x80 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 5D + {"vpsbbd", 0x80 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 5E + {"vpsubsetbd",0x80 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 5F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 60 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 61 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 62 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 63 + {"vpblendm", 0x20 ,0xCAB200, 0x19, 0x1209, 0x1209, 0x209 , 0 , 0x21 , 0x1406, 0 , 0x001 }, // 0F 38 64 (alignment required only in Knights Corner) + {"vblendmp", 0x80 ,0xCA9200, 0x19, 0x124F, 0x124F, 0x24F , 0 , 0x21 , 0x1404, 0 , 0x101 }, // 0F 38 65 + {"vpblendm", 0x20 ,0x8AC200, 0x19, 0x1209, 0x1209, 0x209 , 0 , 0x21 , 0x1406, 0 , 0x001 }, // 0F 38 66 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 67 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 68 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 69 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 6A + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 6B + {"vpsubrd", 0x80 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 6C + {"vsubrp", 0x80 ,0x4A9200, 0x19, 0x164F, 0x164F, 0x64F , 0 , 0 , 0x1304, 0 , 0x101 }, // 0F 38 6D + {"vpsbbrd", 0x80 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 6E + {"vpsubrsetbd",0x80 , 0x4A8200,0x19 , 0x1603, 0x95 , 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 6F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 70 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 71 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 72 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 73 + {"vpcmpltd", 0x80 ,0x4B8200, 0x19 , 0x95 , 0x1603, 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 74 + {"vpermi2" , 0x23 ,0x8EC200, 0x19, 0x1209, 0x1209, 0x209 , 0 , 0x20 , 0 , 0 , 1 }, // 0F 38 75 (instruction set avx512vbmi for byte version) + {"vpermi2", 0x20 ,0x8AB200, 0x19, 0x1609, 0x1609, 0x0609, 0 , 0x31 , 0 , 0 , 0x1 }, // 0F 38 76 + {"vpermi2p", 0x20 ,0x8A9200, 0x19, 0x164F, 0x164F, 0x064F, 0 , 0x31 , 0 , 0 , 0x1 }, // 0F 38 77 + {"vpbroadcastb",0x9E, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 78. Link to vpbroadcastb + {"vpbroadcastw",0x9F, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 38 79. Link to vpbroadcastw + {"vpbroadcastb",0x20,0x828200, 0x12, 0x1201, 0x1001, 0 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 38 7A + {"vpbroadcastw",0x20,0x828200, 0x12, 0x1202, 0x1002, 0 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 38 7B + {"vpbroadcast",0x20 ,0x82B200, 0x12, 0x1209, 0x1009, 0 , 0 , 0x20 , 0 , 0 , 0x1 }, // 0F 38 7C + {"vpermt2" , 0x20 ,0x8EC200, 0x19, 0x1209, 0x1209, 0x209 , 0 , 0x20 , 0 , 0 , 1 }, // 0F 38 7D (instruction set avx512vbmi for byte version) + {"vpermt2", 0x20 ,0x8AB200, 0x19, 0x1209, 0x1209, 0x209 , 0 , 0x21 , 0 , 0 , 0x1 }, // 0F 38 7E + {"vpermt2p", 0x20 ,0x8A9200, 0x19, 0x164F, 0x164F, 0x064F, 0 , 0x21 , 0 , 0 , 0x1 }, // 0F 38 7F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 80 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 81 + {"invpcid", 0x81D , 0x9200 , 0x12 , 0x1009, 0x2406, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 82 + {"vpmultishiftqb",0x23,0x8E9200,0x19 , 0x1204, 0x1204, 0x204 , 0 , 0x21 , 0 , 0 , 0 }, // 0F 38 83 + {"vscaleps", 0x80 ,0x4B8200, 0x19 , 0x164B, 0x164B, 0x603 , 0 , 0 , 0x1306, 0 , 0x100 }, // 0F 38 84 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 85 + {"vpmulhud", 0x80 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 86 + {"vpmulhd", 0x80 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }, // 0F 38 87 + {"vexpandp", 0x20 ,0x801200, 0x12 , 0x164F, 0x064F, 0 , 0 , 0x1030, 0 , 0 , 1 }, // 0F 38 88 + {"vpexpand", 0x20 ,0x83B200, 0x12 , 0x1209, 0x0209, 0 , 0 , 0x30 , 0 , 0 , 1 }, // 0F 38 89 + {"vcompressp",0x20 ,0x809200, 0x13, 0x024F, 0x124F, 0 , 0 , 0x1030, 0 , 0 , 1 }, // 0F 38 8A + {"vpcompress",0x20 ,0x80B200, 0x13, 0x0209, 0x1209, 0 , 0 , 0x1030, 0 , 0 , 1 }, // 0F 38 8B + {"vpmaskmov", 0x1C , 0xFB200, 0x19, 0x1209, 0x1209, 0x2209, 0 , 0 , 0 , 0 , 1 }, // 0F 38 8C + {"vperm" , 0x23 ,0x8EC200, 0x19, 0x1209, 0x1209, 0x209 , 0 , 0x20 , 0 , 0 , 1 }, // 0F 38 8D + {"vpmaskmov", 0x1C , 0xFB200, 0x1A, 0x2209, 0x1209, 0x1209, 0 , 0 , 0 , 0 , 1 }, // 0F 38 8E + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 8F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x102 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 90. link to vpgatherd/q + {0, 0x94 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 91. Link to vpgatherqd/q + {0, 0xB6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 92. Link to vpgatherdps/pd + {0, 0xE0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 38 93. Link to vpgatherqps/pd + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 94 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 95 + {"vfmaddsub132p",0x1A,0x8F9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0 , 0 , 0x1 }, // 0F 38 96 + {"vfmsubadd132p",0x1A,0x8F9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0 , 0 , 0x1 }, // 0F 38 97 + {"vfmadd132p",0x1A ,0xCF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 98 + {"vfmadd132s",0x1A ,0x8B9200, 0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 99 + {"vfmsub132p",0x1A ,0xCF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 9A + {"vfmsub132s",0x1A ,0x8B9200, 0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 9B + {"vfnmadd132p",0x1A ,0xCF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 9C + {"vfnmadd132s",0x1A ,0x8B9200, 0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 9D + {"vfnmsub132p",0x1A ,0xCF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 9E + {"vfnmsub132s",0x1A ,0x8B9200, 0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 9F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0xD7 , 0 ,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 38 A0. Link to vpscatterdd + {0, 0xD8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 38 A1. Link to vpscatterqd + {0, 0x100 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 38 A2. Link to vpscatterdps + {0, 0x101 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 38 A3. Link to vpscatterqps + {"vfmadd233ps",0x80 ,0x4F8200, 0x19 , 0x124B, 0x124B, 0x24B , 0 , 0 , 0x1316, 0 , 0x100 }, // 0F 38 A4 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 A5 + {"vfmaddsub213p",0x1A,0x8F9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0 , 0 , 0x1 }, // 0F 38 A6 + {"vfmsubadd213p",0x1A,0x8F9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0 , 0 , 0x1 }, // 0F 38 A7 + {"vfmadd213p",0x1A ,0xCF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 A8 + {"vfmadd213s",0x1A ,0x8B9200, 0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 A9 + {"vfmsub213p",0x1A ,0xCF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 AA + {"vfmsub213s",0x1A ,0x8B9200, 0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 AB + {"vfnmadd213p",0x1A ,0xCF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 AC + {"vfnmadd213s",0x1A ,0x8B9200, 0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 AD + {"vfnmsub213p",0x1A ,0xCF9200, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 AE + {"vfnmsub213s",0x1A ,0x8B9200, 0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 AF + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"(reserved)",0x00 ,0x4D2E00, 0x401E, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 B0 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 B1 + {"(reserved)",0x00 ,0x4D2E00, 0x401E, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 B2 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 B3 + {0, 0x128 , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 B4. Link to vpmadd52luq + {0, 0x129 , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 B5. Link to vpmadd52huq + {"vfmaddsub231p",0x1A,0x8F9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0 , 0 , 0x1 }, // 0F 38 B6 + {"vfmsubadd231p",0x1A,0x8F9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0 , 0 , 0x1 }, // 0F 38 B7 + {"vfmadd231p", 0x1A,0xCF9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 B8 + {"vfmadd231s", 0x1A,0x8B9200,0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 B9 + {"vfmsub231p", 0x1A,0xCF9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 BA + {"vfmsub231s", 0x1A,0x8B9200,0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 BB + {"vfnmadd231p", 0x1A,0xCF9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 BC + {"vfnmadd231s", 0x1A,0x8B9200,0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 BD + {"vfnmsub231p", 0x1A,0xCF9200,0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x37 , 0x1304, 0 , 0x1 }, // 0F 38 BE + {"vfnmsub231s", 0x1A,0x8B9200,0x19 , 0x144F, 0x144F, 0x04F , 0 , 0x36 , 0 , 0 , 0x1 }, // 0F 38 BF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"(reserved)",0x0 ,0x4D2E00 , 0x401E, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 C0 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 C1 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 C2 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 C3 + {"vpconflict",0x21 ,0x80B200, 0x12 , 0x1209, 0x0209, 0 , 0 , 0x31 , 0 , 0 , 0x1 }, // 0F 38 C4 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 C5 + {0, 0xB7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 38 C6. Link to vgatherpf0dps + {0, 0x10F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F 38 C7. Link to vgatherpf0qps + {0, 0x107 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 C8 + {0, 0x108 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 C9 + {0, 0x109 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 CA + {0, 0x10A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 CB + {0, 0x10B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 CC + {0, 0x10C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x11 , 0 }, // 0F 38 CD + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 CE + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 CF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0xBE , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 D0. Link to vloadunpackld + {0, 0xBF , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 D1. Link to vloadunpacklps + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 D2 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 D3 + {0, 0xC0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 D4. Link to vloadunpackhd + {0, 0xC1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 D5. Link to vloadunpackhps + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 D6 + {"(reserved)",0x00 ,0x4D2E00, 0x4012, 0x609 , 0x609 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 D7 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 D8 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 D9 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 DA + {"aesimc", 0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 DB + {"aesenc", 0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 DC + {"aesenclast",0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 DD + {"aesdec", 0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 DE + {"aesdeclast",0x17 ,0x98200 , 0x19, 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 DF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E0 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E1 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E2 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E3 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E4 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E5 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E6 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E7 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E8 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 E9 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 EA + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 EB + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 EC + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 ED + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 EE + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 EF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"crc32", 0x16 ,0x19900 , 0x12 , 0x1009, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F0 + {"crc32", 0x07 ,0x19900 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 0F 38 F1. Link to crc32 16/32/64 bit + {"andn", 0x1D ,0xB1000 , 0x19 , 0x1009, 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F2 + {"blsi", 0xA2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 0F 38 F3. Link to blsi etc. by reg bit + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F4 + {"bzhi", 0xA3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 F5. Link to bzhi, pdep, pext + {"mulx", 0xD0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 F6. Link to mulx, adcx, adox + {"bextr", 0xAD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 38 F7. Link to bextr etc. + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F8 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F9 + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 FA + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 FB + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 FC + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 FD + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 FE + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 38 FF // Tertiary opcode map for 3-byte opcode. First two bytes = 0F 39 -// Not used but reserved by Intel for future extensions +// Reserved by Intel for future extensions, but never used SOpcodeDef OpcodeMap3[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2012, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 39 00 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2012, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 39 00 // Tertiary opcode map for 3-byte opcode. First two bytes = 0F 3A // or VEX encoded with mmmm = 3 // Indexed by third opcode byte SOpcodeDef OpcodeMap4[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vpermq", 0x1C , 0x17B200,0x52 , 0x1504, 0x504 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 00 - {"vpermd", 0x1C , 0x17B200,0x52 , 0x1503, 0x503 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 01 - {"vpblendd", 0x1C , 0xF8200, 0x59, 0x1203, 0x1203, 0x203 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 3A 02 - {"valignd", 0x20 ,0x4A8200, 0x59, 0x1603, 0x1603, 0x603 , 0x31 , 0x1000, 0x0 , 0x100 }, // 0F 3A 03 - {"vpermilps", 0x19 , 0x78200, 0x52, 0x124B, 0x24B , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 04 - {"vpermilpd", 0x19 , 0x78200, 0x52, 0x124C, 0x24C , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 05 - {"vperm2f128",0x19 ,0x1F8200, 0x59, 0x1550, 0x1550, 0x550 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 06 - {"vpermf32x4",0x20 ,0x438200, 0x52, 0x124B, 0x24B , 0x31 , 0x0 , 0x1000, 0x0 , 0x100 }, // 0F 3A 07 - {"roundps", 0x15 , 0x58200, 0x52 , 0x124B, 0x24B , 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 3A 08. Also in AMD instruction set - {"roundpd", 0x15 , 0x58200, 0x52 , 0x124C, 0x24C , 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 3A 09. Also in AMD instruction set - {"roundss", 0x15 , 0x98200, 0x59 , 0x104B, 0x104B, 0x4B , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 0A. Also in AMD instruction set - {"roundsd", 0x15 , 0x98200, 0x59 , 0x104C, 0x104C, 0x4C , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 0B. Also in AMD instruction set - {"blendps", 0x15 , 0xD8200, 0x59 , 0x124B, 0x124B, 0x24B , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 0C - {"blendpd", 0x15 , 0xD8200, 0x59 , 0x124C, 0x124C, 0x24C , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 0D - {"pblendw", 0x15 , 0xD8200, 0x59 , 0x1202, 0x1202, 0x202 , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 0E - {"palignr", 0x14 , 0xD0200, 0x59 , 0x1150, 0x1150, 0x150 , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 0F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 10 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 11 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 12 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 13 - {0, 0x61 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 3A 14. Link to pextrb - {0, 0x62 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 3A 15. Link to pextrw - {0, 0x63 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 0F 3A 16. Link to pextrd, pextrq - {"extractps", 0x15 , 0x19200, 0x53 , 0x9 , 0x124B, 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 3A 17 - {"vinsertf128",0x19, 0x1F8200, 0x59 , 0x1550, 0x1550, 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 3A 18 - {"vextractf128",0x19,0x178200, 0x53, 0x450 , 0x1550, 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 19 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 1A - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 1B - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 1C -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vcvtps2ph", 0x10000,0x78200, 0x52, 0x450 , 0x150 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 1D - {"vpcmpud", 0xC9 , 0x0 , 0x59 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x6 , 0x0 }, // 0F 3A 1E. link to vpcmpud - {"vpcmpd", 0xC6 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }, // 0F 3A 1F. link to vpcmpd -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0xA5 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 0F 3A 20. Link to pinsrb - {"insertps", 0x15 , 0x98200, 0x59 , 0x144B, 0x144B, 0x4B , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 21 - {"pinsrd/q", 0x75 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 0F 3A 22. Link to pinsrd/q - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 23 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 24 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 25 - {"vgetmantp", 0x20 , 0x429200,0x52 , 0x164F, 0x64F , 0x0 , 0x0 , 0x1204, 0x0 , 0x101 }, // 0F 3A 26 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 27 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 28 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 29 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 2A - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 2B - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 2C - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 2D - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 2E - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 2F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 30 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 31 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 32 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 33 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 34 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 35 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 36 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 37 - {"vinserti128",0x1C , 0x1F8200,0x59 , 0x1506, 0x1506, 0x406 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 3A 38 - {"vextracti128",0x1C, 0x178200,0x53 , 0x406 , 0x1506, 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 39 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 3A - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 3B - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 3C - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 3D - {"kextract", 0x20 , 0x38200, 0x52 , 0x1095, 0x1004, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 3E - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 3F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"dpps", 0x15 , 0xD8200, 0x59 , 0x124B, 0x124B, 0x24B , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 40 - {"dppd", 0x15 , 0x98200, 0x59 , 0x144C, 0x144C, 0x44C , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 41 (No ymm version) - {"mpsadbw", 0x15 , 0xD8200, 0x59 , 0x1202, 0x1202, 0x201 , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 42 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 43 - {"pclmulqdq", 0x18 , 0x98200, 0x59, 0x1404, 0x1404, 0x404 , 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 44 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 45 - {"vperm2i128",0x1C , 0x1FB200,0x59 , 0x1506, 0x1506, 0x506 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 3A 46 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 47 - {"vpermil2ps",0x19 , 0xFD200, 0x5C, 0x124B, 0x124B, 0x24B , 0x24B , 0x31 , 0x0 , 0x0 }, // 0F 3A 48 - {"vpermil2pd",0x19 , 0xFD200, 0x5C, 0x124C, 0x124C, 0x24C , 0x24C , 0x31 , 0x0 , 0x0 }, // 0F 3A 49 - {"vblendvps", 0x19 , 0xFD200, 0x5C , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 3A 4A - {"vblendvpd", 0x19 , 0xFD200, 0x5C , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 3A 4B - {"vpblendvb", 0x19 , 0xFD200, 0x5C , 0x1201, 0x1201, 0x201 , 0x201 , 0x0 , 0x0 , 0x0 }, // 0F 3A 4C - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 4D - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 4E - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 4F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 50 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 51 - {"vrndfxpntp",0x20 , 0x4B9200,0x52 , 0x124F, 0x24F , 0x11 , 0x0 , 0x1204, 0x0 , 0x101 }, // 0F 3A 52 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 53 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 54 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 55 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 56 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 57 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 58 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 59 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 5A - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 5B - {"vfmaddsubps",0x1006,0xFD200,0x5D , 0x24B , 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 3A 5C - {"vfmaddsubpd",0x1006,0xFD200,0x5D , 0x24C , 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 3A 5D - {"vfmsubaddps",0x1006,0xFD200,0x5D , 0x24B , 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 3A 5E - {"vfmsubaddpd",0x1006,0xFD200,0x5D , 0x24C , 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 3A 5F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pcmpestrm", 0x16 , 0x18200, 0x52 , 0x1401, 0x451 , 0x31 , 0x0 , 0x0 , 0x0 , 0x202 }, // 0F 3A 60 - {"pcmpestri", 0x16 , 0x18200, 0x52 , 0x1401, 0x451 , 0x31 , 0x0 , 0x0 , 0x0 , 0x202 }, // 0F 3A 61 - {"pcmpistrm", 0x16 , 0x18200, 0x52 , 0x1401, 0x451 , 0x31 , 0x0 , 0x0 , 0x0 , 0x202 }, // 0F 3A 62 - {"pcmpistri", 0x16 , 0x18200, 0x52 , 0x1401, 0x451 , 0x31 , 0x0 , 0x0 , 0x0 , 0x202 }, // 0F 3A 63 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 64 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 65 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 66 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 67 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vpermq", 0x1C ,0x97B200, 0x52 , 0x1204, 0x204 , 0x31 , 0 , 0x31 , 0 , 0 , 0 }, // 0F 3A 00 + {"vpermpd", 0x1C ,0x97B200, 0x52 , 0x124C, 0x24C , 0x31 , 0 , 0x31 , 0 , 0 , 0 }, // 0F 3A 01 + {"vpblendd", 0x1C , 0xF8200, 0x59, 0x1203, 0x1203, 0x203 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 3A 02 + {"valign", 0x20 ,0xCAB200, 0x59, 0x1209, 0x1209, 0x209 , 0x31 , 0x21 , 0x1000, 0 , 0x101 }, // 0F 3A 03 + {"vpermilps", 0x19 ,0x8F8200, 0x52, 0x124B, 0x24B , 0x31 , 0 , 0x31 , 0 , 0 , 0 }, // 0F 3A 04 + {"vpermilpd", 0x19 ,0x8FA200, 0x52, 0x124C, 0x24C , 0x31 , 0 , 0x31 , 0 , 0 , 0 }, // 0F 3A 05 + {"vperm2f128",0x19 ,0x1F8200, 0x59, 0x1550, 0x1550, 0x550 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 3A 06 + {"vpermf32x4",0x80 ,0x438200, 0x52, 0x124B, 0x24B , 0x31 , 0 , 0 , 0x1000, 0 , 0x100 }, // 0F 3A 07 + {0, 0xF9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 08. Also in AMD instruction set + {0, 0xFA , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 09. Also in AMD instruction set + {0, 0xFB , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 0A. Also in AMD instruction set + {0, 0xFC , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 0B. Also in AMD instruction set + {"blendps", 0x15 , 0xD8200, 0x59 , 0x124B, 0x124B, 0x24B , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 0C + {"blendpd", 0x15 , 0xD8200, 0x59 , 0x124C, 0x124C, 0x24C , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 0D + {"pblendw", 0x15 , 0xD8200, 0x59 , 0x1202, 0x1202, 0x202 , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 0E + {"palignr", 0x14 ,0x8D2200, 0x59 , 0x1201, 0x1201, 0x201 , 0x31 , 0x20 , 0 , 0 , 0x2 }, // 0F 3A 0F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 10 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 11 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 12 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 13 + {0, 0x61 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 3A 14. Link to pextrb + {0, 0x62 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 3A 15. Link to pextrw + {0, 0x63 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 0F 3A 16. Link to pextrd, pextrq + {"extractps" ,0x15 ,0x819200, 0x53 , 0x3 , 0x144B, 0x31 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 3A 17 + {0 ,0x122 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 18 + {0 ,0x11E , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 19. Link to vextractf128 + {0 ,0x124 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 3A 1A. Link to vinsertf64x4 + {0, 0xDE , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 3A 1B. Link to vextractf64x4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 1C +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vcvtps2ph", 0x1D ,0x878200, 0x53, 0xF4A , 0x250 , 0x31 , 0 , 0x22 , 0 , 0 , 0 }, // 0F 3A 1D + {0, 0x114 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }, // 0F 3A 1E. link to vpcmpud + {0, 0x115 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }, // 0F 3A 1F. link to vpcmpd +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0xA5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 0F 3A 20. Link to pinsrb + {"insertps", 0x15 ,0x898200, 0x59 , 0x144B, 0x144B, 0x4B , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 21 + {"pinsrd/q", 0x75 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 0F 3A 22. Link to pinsrd/q + {0, 0x8F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 3A 23. Link to vshuff32x4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 24 + {"vpternlog", 0x20 ,0x88B200, 0x59 , 0x1209, 0x1209, 0x0209, 0x31 , 0x31 , 0 , 0 , 0x1 }, // 0F 3A 25 + {"vgetmantp", 0x20 , 0xC29200,0x52 , 0x124F, 0x24F , 0x31 , 0 , 0x33 , 0x1204, 0 , 0x001 }, // 0F 3A 26 + {"vgetmants", 0x20 , 0xCA9200,0x59 , 0x144F, 0x24F , 0x04F , 0x31 , 0x32 , 0x1204, 0 , 0x001 }, // 0F 3A 27 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 28 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 29 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 2A + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 2B + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 2C + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 2D + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 2E + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 2F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"kshiftr", 0x20 , 0x3C200, 0x52 , 0x1095, 0x1095, 0x11 , 0 , 0 , 0 , 0 , 1 }, // 0F 3A 30 + {"kshiftr", 0x20 , 0x3B200, 0x52 , 0x1095, 0x1095, 0x11 , 0 , 0 , 0 , 0 , 1 }, // 0F 3A 30 + {"kshiftl", 0x20 , 0x3C200, 0x52 , 0x1095, 0x1095, 0x11 , 0 , 0 , 0 , 0 , 1 }, // 0F 3A 32 + {"kshiftl", 0x20 , 0x3B200, 0x52 , 0x1095, 0x1095, 0x11 , 0 , 0 , 0 , 0 , 1 }, // 0F 3A 33 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 34 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 35 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 36 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 37 + {0, 0x125 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 38. Link to vinserti128 + {0, 0x120 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 39. Link to vextracti128 + {0, 0x127 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 3A 3A. Link to vinserti64x4 + {0, 0xDF , 0 , 0x53 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 3A 3B. Link to vextracti64x4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 3C + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 3D + {0, 0xC6 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 0F 3A 3E. Link to kextract and vpcmp + {0, 0x113 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }, // 0F 3A 3F. Link to vpcmp + // name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"dpps", 0x15 , 0xD8200, 0x59 , 0x124B, 0x124B, 0x24B , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 40 + {"dppd", 0x15 , 0x98200, 0x59 , 0x144C, 0x144C, 0x44C , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 41 (No ymm version) + {0, 0x11D , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0x2 }, // 0F 3A 42. Link to mpsadbw + {0, 0x90 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 3A 43. Link to vshufi32x4 + {"pclmulqdq", 0x18 , 0x98200, 0x59, 0x1404, 0x1404, 0x404 , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 44 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 45 + {"vperm2i128",0x1C , 0x1FB200,0x59 , 0x1506, 0x1506, 0x506 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 3A 46 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 47 + {"vpermil2ps",0x1005, 0xFF200, 0x5C, 0x124B, 0x124B, 0x24B , 0x24B , 0 , 0x31 , 0 , 0 }, // 0F 3A 48 AMD XOP + {"vpermil2pd",0x1005, 0xFF200, 0x5C, 0x124C, 0x124C, 0x24C , 0x24C , 0 , 0x31 , 0 , 0 }, // 0F 3A 49 AMD XOP + {"vblendvps", 0x19 , 0xF8200, 0x5C , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 3A 4A + {"vblendvpd", 0x19 , 0xF8200, 0x5C , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 3A 4B + {"vpblendvb", 0x19 , 0xF8200, 0x5C , 0x1201, 0x1201, 0x201 , 0x201 , 0 , 0 , 0 , 0 }, // 0F 3A 4C + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 4D + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 4E + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 4F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vrangep", 0x20 ,0x8EB200, 0x59, 0x124F, 0x124F, 0x24F , 0x31 , 0x23 , 0 , 0 , 1 }, // 0F 3A 50 + {"vranges", 0x20 ,0x8EB200, 0x59, 0x144F, 0x144F, 0x44F , 0x31 , 0x33 , 0 , 0 , 1 }, // 0F 3A 50 + {"vrndfxpntp",0x80 , 0x4B9200,0x52 , 0x124F, 0x24F , 0x11 , 0 , 0 , 0x1204, 0 , 0x101 }, // 0F 3A 52 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 53 + {"vfixupimmp",0x20 ,0x881200, 0x59 , 0x124F, 0x124F, 0x024F, 0x31 , 0x33 , 0 , 0 , 1 }, // 0F 3A 54 + {"vfixupimms",0x20 ,0x8C1200, 0x59 , 0x104F, 0x104F, 0x004F, 0x31 , 0x32 , 0 , 0 , 1 }, // 0F 3A 55 + {"vreducep", 0x20 ,0x86B200, 0x52 , 0x124F, 0x24f , 0 , 0x31 , 0x23 , 0 , 0 , 1 }, // 0F 3A 56 + {"vreduces", 0x20 ,0x8EB200, 0x52 , 0x144F, 0x44f , 0 , 0x31 , 0x22 , 0 , 0 , 1 }, // 0F 3A 57 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 58 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 59 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 5A + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 5B + {"vfmaddsubps",0x1006,0xFF200,0x5C , 0x24B , 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 3A 5C + {"vfmaddsubpd",0x1006,0xFF200,0x5C , 0x24C , 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 3A 5D + {"vfmsubaddps",0x1006,0xFF200,0x5C , 0x24B , 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 3A 5E + {"vfmsubaddpd",0x1006,0xFF200,0x5C , 0x24C , 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 3A 5F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pcmpestrm", 0x16 , 0x18200, 0x52 , 0x1401, 0x451 , 0x31 , 0 , 0 , 0 , 0 , 0x202 }, // 0F 3A 60 + {"pcmpestri", 0x16 , 0x18200, 0x52 , 0x1401, 0x451 , 0x31 , 0 , 0 , 0 , 0 , 0x202 }, // 0F 3A 61 + {"pcmpistrm", 0x16 , 0x18200, 0x52 , 0x1401, 0x451 , 0x31 , 0 , 0 , 0 , 0 , 0x202 }, // 0F 3A 62 + {"pcmpistri", 0x16 , 0x18200, 0x52 , 0x1401, 0x451 , 0x31 , 0 , 0 , 0 , 0 , 0x202 }, // 0F 3A 63 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 64 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 65 + {"vfpclassp", 0x20 ,0x82B200, 0x52 , 0x95 , 0x24F , 0x31 , 0 , 0x10 , 0 , 0 , 1 }, // 0F 3A 66 + {"vfpclasss", 0x20 ,0x82B200, 0x52 , 0x95 , 0x44F , 0x31 , 0 , 0x10 , 0 , 0 , 1 }, // 0F 3A 67 // 4-operand FMA instructions. First specified by Intel, then Intel changed their plans, now supported by AMD - {"vfmaddps", 0x1006,0xFD200 , 0x5D , 0x24B , 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 3A 68 - {"vfmaddpd", 0x1006,0xFD200 , 0x5D , 0x24C , 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 3A 69 - {"vfmaddss", 0x1006,0xBD200 , 0x5D , 0x44B , 0x44B , 0x44B , 0x44B , 0x0 , 0x0 , 0x0 }, // 0F 3A 6A - {"vfmaddsd", 0x1006,0xBD200 , 0x5D , 0x44C , 0x44C , 0x44C , 0x44C , 0x0 , 0x0 , 0x0 }, // 0F 3A 6B - {"vfmsubps", 0x1006,0xFD200 , 0x5D , 0x24B , 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 3A 6C - {"vfmsubpd", 0x1006,0xFD200 , 0x5D , 0x24C , 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 3A 6D - {"vfmsubss", 0x1006,0xBD200 , 0x5D , 0x44B , 0x44B , 0x44B , 0x44B , 0x0 , 0x0 , 0x0 }, // 0F 3A 6E - {"vfmsubsd", 0x1006,0xBD200 , 0x5D , 0x44C , 0x44C , 0x44C , 0x44C , 0x0 , 0x0 , 0x0 }, // 0F 3A 6F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 70 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 71 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 72 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 73 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 74 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 75 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 76 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 77 - {"vfnmaddps", 0x1006,0xFD200 , 0x5D , 0x24B , 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 3A 78 - {"vfnmaddpd", 0x1006,0xFD200 , 0x5D , 0x24C , 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 3A 79 - {"vfnmaddss", 0x1006,0xBD200 , 0x5D , 0x44B , 0x44B , 0x44B , 0x44B , 0x0 , 0x0 , 0x0 }, // 0F 3A 7A - {"vfnmaddsd", 0x1006,0xBD200 , 0x5D , 0x44C , 0x44C , 0x44C , 0x44C , 0x0 , 0x0 , 0x0 }, // 0F 3A 7B - {"vfnmsubps", 0x1006,0xFD200 , 0x5D , 0x24B , 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 3A 7C - {"vfnmsubpd", 0x1006,0xFD200 , 0x5D , 0x24C , 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 3A 7D - {"vfnmsubss", 0x1006,0xBD200 , 0x5D , 0x44B , 0x44B , 0x44B , 0x44B , 0x0 , 0x0 , 0x0 }, // 0F 3A 7E - {"vfnmsubsd", 0x1006,0xBD200 , 0x5D , 0x44C , 0x44C , 0x44C , 0x44C , 0x0 , 0x0 , 0x0 }, // 0F 3A 7F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 80 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 81 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 82 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 83 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 84 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 85 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 86 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 87 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 88 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 89 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 8A - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 8B - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 8C - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 8D - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 8E - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 8F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 90 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 91 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 92 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 93 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 94 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 95 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 96 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 97 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 98 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 99 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 9A - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 9B - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 9C - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 9D - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 9E - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A 9F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A0 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A1 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A2 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A3 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A4 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A5 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A6 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A7 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A8 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A A9 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A AA - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A AB - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A AC - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A AD - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A AE - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A AF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B0 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B1 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B2 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B3 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B4 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B5 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B6 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B7 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B8 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A B9 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A BA - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A BB - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A BC - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A BD - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A BE - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A BF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C0 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C1 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C2 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C3 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C4 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C5 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C6 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C7 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C8 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A C9 - {0, 0xB4 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 3A CA. Link to vcvtfxpntpd2udq etc - {0, 0xB5 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 3A CB. Link to vcvtfxpntdq2ps etc - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A CC - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A CD - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A CE - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A CF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"(reserved)",0x00 ,0x4D2E00, 0x4052, 0x609 , 0x609 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 D0 - {"(reserved)",0x00 ,0x4D2E00, 0x4052, 0x609 , 0x609 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 D1 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A D2 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A D3 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A D4 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A D5 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A D6 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A D7 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A D8 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A D9 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A DA - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A DB - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A DC - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A DD - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A DE -{"aeskeygenassist",0x17,0x18200 , 0x52, 0x1101, 0x101 , 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 3A DF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E0 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E1 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E2 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E3 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E4 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E5 -{"vcvtfxpntpd2dq",0x20 ,0x42B800, 0x52, 0x1603, 0x64C , 0x31 , 0x0 , 0x1205, 0x0 , 0x100 }, // 0F 3A E6 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E7 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E8 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A E9 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A EA - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A EB - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A EC - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A ED - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A EE - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A EF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0xA4 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F 3A F0. Link to rorx - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F1 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F2 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F3 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F4 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F5 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F6 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F7 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F8 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F9 - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A FA - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A FB - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A FC - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A FD - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A FE - {0, 0x0 , 0x0 , 0x2052, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 3A FF + {"vfmaddps", 0x1006,0xFF200 , 0x5C , 0x24B , 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 3A 68 + {"vfmaddpd", 0x1006,0xFF200 , 0x5C , 0x24C , 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 3A 69 + {"vfmaddss", 0x1006,0xBF200 , 0x5C , 0x44B , 0x44B , 0x44B , 0x44B , 0 , 0 , 0 , 0 }, // 0F 3A 6A + {"vfmaddsd", 0x1006,0xBF200 , 0x5C , 0x44C , 0x44C , 0x44C , 0x44C , 0 , 0 , 0 , 0 }, // 0F 3A 6B + {"vfmsubps", 0x1006,0xFF200 , 0x5C , 0x24B , 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 3A 6C + {"vfmsubpd", 0x1006,0xFF200 , 0x5C , 0x24C , 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 3A 6D + {"vfmsubss", 0x1006,0xBF200 , 0x5C , 0x44B , 0x44B , 0x44B , 0x44B , 0 , 0 , 0 , 0 }, // 0F 3A 6E + {"vfmsubsd", 0x1006,0xBF200 , 0x5C , 0x44C , 0x44C , 0x44C , 0x44C , 0 , 0 , 0 , 0 }, // 0F 3A 6F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 70 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 71 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 72 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 73 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 74 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 75 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 76 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 77 + {"vfnmaddps", 0x1006,0xFF200 , 0x5C , 0x24B , 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 3A 78 + {"vfnmaddpd", 0x1006,0xFF200 , 0x5C , 0x24C , 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 3A 79 + {"vfnmaddss", 0x1006,0xBF200 , 0x5C , 0x44B , 0x44B , 0x44B , 0x44B , 0 , 0 , 0 , 0 }, // 0F 3A 7A + {"vfnmaddsd", 0x1006,0xBF200 , 0x5C , 0x44C , 0x44C , 0x44C , 0x44C , 0 , 0 , 0 , 0 }, // 0F 3A 7B + {"vfnmsubps", 0x1006,0xFF200 , 0x5C , 0x24B , 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 3A 7C + {"vfnmsubpd", 0x1006,0xFF200 , 0x5C , 0x24C , 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 3A 7D + {"vfnmsubss", 0x1006,0xBF200 , 0x5C , 0x44B , 0x44B , 0x44B , 0x44B , 0 , 0 , 0 , 0 }, // 0F 3A 7E + {"vfnmsubsd", 0x1006,0xBF200 , 0x5C , 0x44C , 0x44C , 0x44C , 0x44C , 0 , 0 , 0 , 0 }, // 0F 3A 7F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 80 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 81 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 82 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 83 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 84 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 85 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 86 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 87 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 88 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 89 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 8A + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 8B + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 8C + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 8D + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 8E + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 8F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 90 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 91 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 92 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 93 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 94 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 95 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 96 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 97 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 98 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 99 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 9A + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 9B + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 9C + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 9D + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 9E + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 9F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A0 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A1 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A2 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A3 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A5 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A6 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A7 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A8 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A A9 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A AA + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A AB + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A AC + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A AD + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A AE + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A AF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B0 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B1 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B2 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B3 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B5 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B6 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B7 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B8 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A B9 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A BA + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A BB + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A BC + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A BD + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A BE + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A BF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C0 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C1 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C2 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C3 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C5 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C6 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C7 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C8 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A C9 + {0, 0xB4 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 3A CA. Link to vcvtfxpntpd2udq etc + {0, 0xB5 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 3A CB. Link to vcvtfxpntdq2ps etc + {"sha1rnds4", 0x22 , 0 , 0x52 , 0x1403, 0x0403, 0x31 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A CC + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A CD + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A CE + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A CF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"(reserved)",0x00 ,0x4D2E00, 0x4052, 0x609 , 0x609 , 0x31 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 D0 + {"(reserved)",0x00 ,0x4D2E00, 0x4052, 0x609 , 0x609 , 0x31 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 D1 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A D2 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A D3 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A D4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A D5 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A D6 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A D7 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A D8 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A D9 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A DA + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A DB + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A DC + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A DD + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A DE +{"aeskeygenassist",0x17,0x18200 , 0x52, 0x1101, 0x101 , 0x31 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 3A DF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E0 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E1 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E2 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E3 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E5 +{"vcvtfxpntpd2dq",0x80 ,0x42B800, 0x52, 0x1603, 0x64C , 0x31 , 0 , 0 , 0x1205, 0 , 0x100 }, // 0F 3A E6 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E7 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E8 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A E9 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A EA + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A EB + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A EC + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A ED + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A EE + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A EF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0xA4 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F 3A F0. Link to rorx + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F1 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F2 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F3 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F4 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F5 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F6 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F7 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F8 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F9 + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A FA + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A FB + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A FC + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A FD + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A FE + {0, 0 , 0 , 0x2052, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 3A FF // Tertiary opcode map for 3-byte opcode. First two bytes = 0F 3B -// Unused but reserved by Intel for future extensions +// Reserved by Intel for future extensions, but never used SOpcodeDef OpcodeMap5[1] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2000, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 3B 00 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2000, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 3B 00 // Tertiary opcode map for AMD 3DNow instructions (obsolete). First two bytes = 0F 0F // Indexed by immediate byte following operands SOpcodeDef OpcodeMap6[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 00 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 01 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 02 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 03 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 04 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 05 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 06 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 07 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 08 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 09 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 0A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 0B - {"PFI2FW", 0x1001, 0x0 , 0x52 , 0x134B, 0x302 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 0C - {"PI2FD", 0x1001, 0x0 , 0x52 , 0x134B, 0x303 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 0D - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 0E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 0F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 10 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 11 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 12 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 13 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 14 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 15 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 16 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 17 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 18 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 19 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 1A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 1B - {"PF2IW", 0x1002, 0x0 , 0x52 , 0x1302, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 1C - {"PF2ID", 0x1001, 0x0 , 0x52 , 0x1303, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 1D - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 1E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 1F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 20 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 21 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 22 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 23 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 24 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 25 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 26 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 27 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 28 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 29 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 2A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 2B - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 2C - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 2D - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 2E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 2F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 30 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 31 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 32 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 33 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 34 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 35 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 36 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 37 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 38 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 39 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 3A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 3B - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 3C - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 3D - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 3E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 3F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 40 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 41 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 42 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 43 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 44 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 45 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 46 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 47 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 48 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 49 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 4A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 4B - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 4C - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 4D - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 4E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 4F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 50 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 51 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 52 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 53 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 54 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 55 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 56 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 57 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 58 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 59 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 5A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 5B - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 5C - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 5D - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 5E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 5F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 60 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 61 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 62 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 63 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 64 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 65 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 66 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 67 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 68 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 69 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 6A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 6B - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 6C - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 6D - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 6E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 6F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 70 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 71 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 72 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 73 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 74 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 75 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 76 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 77 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 78 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 79 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 7A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 7B - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 7C - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 7D - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 7E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 7F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 80 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 81 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 82 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 83 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 84 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 85 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 86 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 87 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 88 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 89 - {"PFNACC", 0x1002, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 8A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 8B - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 8C - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 8D - {"PFPNACC", 0x1002, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 8E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 8F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"PFCMPGE", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 90 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 91 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 92 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 93 - {"PFMIN", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 94 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 95 - {"PFRCP", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 96 - {"PFRSQRT", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 97 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 98 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 99 - {"PFSUB", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 9A - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 9B - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 9C - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 9D - {"PFADD", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 9E - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op 9F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"PFCMPGT", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A0 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A1 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A2 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A3 - {"PFMAX", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A4 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A5 - {"PFRCPIT1", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A6 - {"PFRSQIT1", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A7 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A8 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op A9 - {"PFSUBR", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op AA - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op AB - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op AC - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op AD - {"PFACC", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op AE - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op AF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"PFCMPEQ", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B0 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B1 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B2 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B3 - {"PFMUL", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B4 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B5 - {"PFRCPIT2", 0x1001, 0x0 , 0x52 , 0x134B, 0x34B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B6 - {"PMULHRW", 0x1001, 0x0 , 0x52 , 0x1302, 0x302 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B7 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B8 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op B9 - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op BA - {"PSWAPD", 0x1002, 0x0 , 0x52 , 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op BB - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op BC - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op BD - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op BE - {"PAVGUSB", 0x1001, 0x0 , 0x52 , 0x1301, 0x301 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 0F op BF -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x1001, 0x0 , 0x2052, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 0F op C0 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 00 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 01 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 02 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 03 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 04 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 05 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 06 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 07 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 08 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 09 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 0A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 0B + {"PFI2FW", 0x1001, 0 , 0x52 , 0x134B, 0x302 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 0C + {"PI2FD", 0x1001, 0 , 0x52 , 0x134B, 0x303 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 0D + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 0E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 0F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 10 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 11 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 12 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 13 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 14 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 15 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 16 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 17 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 18 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 19 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 1A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 1B + {"PF2IW", 0x1002, 0 , 0x52 , 0x1302, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 1C + {"PF2ID", 0x1001, 0 , 0x52 , 0x1303, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 1D + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 1E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 1F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 20 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 21 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 22 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 23 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 24 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 25 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 26 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 27 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 28 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 29 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 2A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 2B + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 2C + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 2D + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 2E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 2F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 30 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 31 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 32 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 33 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 34 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 35 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 36 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 37 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 38 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 39 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 3A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 3B + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 3C + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 3D + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 3E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 3F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 40 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 41 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 42 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 43 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 44 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 45 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 46 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 47 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 48 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 49 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 4A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 4B + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 4C + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 4D + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 4E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 4F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 50 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 51 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 52 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 53 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 54 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 55 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 56 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 57 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 58 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 59 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 5A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 5B + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 5C + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 5D + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 5E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 5F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 60 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 61 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 62 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 63 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 64 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 65 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 66 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 67 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 68 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 69 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 6A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 6B + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 6C + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 6D + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 6E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 6F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 70 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 71 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 72 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 73 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 74 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 75 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 76 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 77 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 78 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 79 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 7A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 7B + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 7C + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 7D + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 7E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 7F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 80 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 81 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 82 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 83 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 84 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 85 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 86 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 87 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 88 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 89 + {"PFNACC", 0x1002, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 8A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 8B + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 8C + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 8D + {"PFPNACC", 0x1002, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 8E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 8F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"PFCMPGE", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 90 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 91 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 92 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 93 + {"PFMIN", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 94 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 95 + {"PFRCP", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 96 + {"PFRSQRT", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 97 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 98 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 99 + {"PFSUB", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 9A + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 9B + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 9C + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 9D + {"PFADD", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 9E + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op 9F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"PFCMPGT", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A0 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A1 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A2 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A3 + {"PFMAX", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A4 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A5 + {"PFRCPIT1", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A6 + {"PFRSQIT1", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A7 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A8 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op A9 + {"PFSUBR", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op AA + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op AB + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op AC + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op AD + {"PFACC", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op AE + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op AF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"PFCMPEQ", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B0 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B1 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B2 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B3 + {"PFMUL", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B4 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B5 + {"PFRCPIT2", 0x1001, 0 , 0x52 , 0x134B, 0x34B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B6 + {"PMULHRW", 0x1001, 0 , 0x52 , 0x1302, 0x302 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B7 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B8 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op B9 + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op BA + {"PSWAPD", 0x1002, 0 , 0x52 , 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op BB + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op BC + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op BD + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op BE + {"PAVGUSB", 0x1001, 0 , 0x52 , 0x1301, 0x301 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0F op BF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x1001, 0 , 0x2052, 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 0F op C0 // Opcode map for crc32. Opcode byte = 0F 38 F1 // Indexed by operand size (16, 32, 64) SOpcodeDef OpcodeMap7[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"crc32", 0x16 ,0x19900 , 0x12 , 0x1003, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F1 - {"crc32", 0x16 ,0x19900 , 0x12 , 0x1003, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F1 - {"crc32", 0x16 ,0x19900 , 0x12 , 0x1004, 0x4 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 F1 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"crc32", 0x16 ,0x19900 , 0x12 , 0x1003, 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F1 + {"crc32", 0x16 ,0x19900 , 0x12 , 0x1003, 0x3 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F1 + {"crc32", 0x16 ,0x19900 , 0x12 , 0x1004, 0x4 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 38 F1 // Secondary opcode map for x87 f.p. instructions. Opcode D8 // Indexed by reg bits and mod == 3 SOpcodeDef OpcodeMap8[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fadd", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fadd m32 - {"fmul", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fmul m32 - {"fcom", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fcom m32 - {"fcomp", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fcomp m32 - {"fsub", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsub m32 - {"fsubr", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsubr m32 - {"fdiv", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fdiv m32 - {"fdivr", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fdivr m32 - {"fadd", 0x100 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fadd st,st(i) - {"fmul", 0x100 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fmul st,st(i) - {"fcom", 0x100 , 0x0 , 0x11 , 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fcom st,st(i) - {"fcomp", 0x100 , 0x0 , 0x11 , 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fcomp st,st(i) - {"fsub", 0x100 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsub st,st(i) - {"fsubr", 0x100 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsubr st,st(i) - {"fdiv", 0x100 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fdiv st,st(i) - {"fdivr", 0x100 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // fdivr st,st(i) +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fadd", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 }, // fadd m32 + {"fmul", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 }, // fmul m32 + {"fcom", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fcom m32 + {"fcomp", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fcomp m32 + {"fsub", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 }, // fsub m32 + {"fsubr", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 }, // fsubr m32 + {"fdiv", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 }, // fdiv m32 + {"fdivr", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 }, // fdivr m32 + {"fadd", 0x100 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fadd st,st(i) + {"fmul", 0x100 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fmul st,st(i) + {"fcom", 0x100 , 0 , 0x11 , 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fcom st,st(i) + {"fcomp", 0x100 , 0 , 0x11 , 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fcomp st,st(i) + {"fsub", 0x100 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fsub st,st(i) + {"fsubr", 0x100 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fsubr st,st(i) + {"fdiv", 0x100 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fdiv st,st(i) + {"fdivr", 0x100 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }}; // fdivr st,st(i) // Secondary opcode map for x87 f.p. instructions. Opcode D9 // Indexed by reg bits and mod == 3 SOpcodeDef OpcodeMap9[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fld", 0x100 , 0x0 , 0x11 , 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fld m32 - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fst", 0x100 , 0x0 , 0x11 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fst m32 - {"fstp", 0x100 , 0x0 , 0x11 , 0x2043, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fstp m32 - {"fldenv", 0x100 , 0x0 , 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fldenv m - {"fldcw", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fldcw m16 - {"fnstenv", 0x100 , 0x0 , 0x11 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fnstenv m - {"fnstcw", 0x100 , 0x0 , 0x11 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fnstcw m16 - {"fld", 0x100 , 0x0 , 0x11 , 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fld st(i) - {"fxch", 0x100 , 0x0 , 0x11 , 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fxch st(i) - {"fnop", 0x10 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // Link to tertiary map 0x10 fnop - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // Link to tertiary map 0x11 fchs etc. - {0, 0x12 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // Link to tertiary map 0x12 fld1 etc. - {0, 0x13 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // Link to tertiary map 0x13 f2xm1 etc. - {0, 0x14 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }}; // Link to tertiary map 0x14 fprem etc. +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fld", 0x100 , 0 , 0x11 , 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 }, // fld m32 + {0, 0 , 0 , 0x4011, 0 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fst", 0x100 , 0 , 0x11 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fst m32 + {"fstp", 0x100 , 0 , 0x11 , 0x2043, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fstp m32 + {"fldenv", 0x100 , 0 , 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // fldenv m + {"fldcw", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fldcw m16 + {"fnstenv", 0x100 , 0 , 0x11 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fnstenv m + {"fnstcw", 0x100 , 0 , 0x11 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fnstcw m16 + {"fld", 0x100 , 0 , 0x11 , 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fld st(i) + {"fxch", 0x100 , 0 , 0x11 , 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fxch st(i) + {"fnop", 0x10 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }, // Link to tertiary map 0x10 fnop + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0x11 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }, // Link to tertiary map 0x11 fchs etc. + {0, 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }, // Link to tertiary map 0x12 fld1 etc. + {0, 0x13 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }, // Link to tertiary map 0x13 f2xm1 etc. + {0, 0x14 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }}; // Link to tertiary map 0x14 fprem etc. // Secondary opcode map for x87 f.p. instructions. Opcode DA // Indexed by reg bits and mod == 3 SOpcodeDef OpcodeMapA[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fiadd", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fiadd m32 - {"fimul", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fimul m32 - {"ficom", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // ficom m32 - {"ficomp", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // ficomp m32 - {"fisub", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fisub m32 - {"fisubr", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fisubr m32 - {"fidiv", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fidiv m32 - {"fidivr", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fidivr m32 - {"fcmovb", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fcmovb st,st(i) - {"fcmove", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fcmovb st,st(i) - {"fcmovbe", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fcmovbe st,st(i) - {"fcmovu", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fcmovbe st,st(i) - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x15 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // Link to tertiary map 0x15 fucompp - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // Illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fiadd", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // fiadd m32 + {"fimul", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // fimul m32 + {"ficom", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0x4 }, // ficom m32 + {"ficomp", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0x4 }, // ficomp m32 + {"fisub", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // fisub m32 + {"fisubr", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // fisubr m32 + {"fidiv", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // fidiv m32 + {"fidivr", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // fidivr m32 + {"fcmovb", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fcmovb st,st(i) + {"fcmove", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fcmovb st,st(i) + {"fcmovbe", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fcmovbe st,st(i) + {"fcmovu", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fcmovbe st,st(i) + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0x15 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }, // Link to tertiary map 0x15 fucompp + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }}; // Illegal // Secondary opcode map for x87 f.p. instructions. Opcode DB // Indexed by reg bits and mod == 3 SOpcodeDef OpcodeMapB[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fild", 0x100 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fild m32 - {"fisttp", 0x13 , 0x0 , 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fisttp m32 - {"fist", 0x100 , 0x0 , 0x11 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fist m32 - {"fistp", 0x100 , 0x0 , 0x11 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fistp m32 - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fld", 0x100 , 0x0 , 0x11 , 0x0 , 0x2045, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fld m80 - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fstp", 0x100 , 0x0 , 0x11 , 0x2045, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fst m80 - {"fcmovnb", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fcmovnb st,st(i) - {"fcmovne", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fcmovne st,st(i) - {"fcmovnbe", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fcmovnbe st,st(i) - {"fcmovnu", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fcmovnu st,st(i) - {0, 0x16 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // Link to tertiary map 0x16 fclex etc. - {"fucomi", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fucomi st,st(i) - {"fcomi", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fcomi st,st(i) - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fild", 0x100 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // fild m32 + {"fisttp", 0x13 , 0 , 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // fisttp m32 + {"fist", 0x100 , 0 , 0x11 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fist m32 + {"fistp", 0x100 , 0 , 0x11 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fistp m32 + {0, 0 , 0 , 0x4011, 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fld", 0x100 , 0 , 0x11 , 0 , 0x2045, 0 , 0 , 0 , 0 , 0 , 0 }, // fld m80 + {0, 0 , 0 , 0x4011, 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fstp", 0x100 , 0 , 0x11 , 0x2045, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fst m80 + {"fcmovnb", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fcmovnb st,st(i) + {"fcmovne", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fcmovne st,st(i) + {"fcmovnbe", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fcmovnbe st,st(i) + {"fcmovnu", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fcmovnu st,st(i) + {0, 0x16 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }, // Link to tertiary map 0x16 fclex etc. + {"fucomi", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fucomi st,st(i) + {"fcomi", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fcomi st,st(i) + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Secondary opcode map for x87 f.p. instructions. Opcode DC // Indexed by reg bits and mod == 3 SOpcodeDef OpcodeMapC[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fadd", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fadd m64 - {"fmul", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fmul m64 - {"fcom", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fcom m64 - {"fcomp", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fcomp m64 - {"fsub", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsub m64 - {"fsubr", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsubr m64 - {"fdiv", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fdiv m64 - {"fdivr", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fdivr m64 - {"fadd", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fadd st(i),st - {"fmul", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fmul st(i),st - {0, 0x0 , 0x0 , 0x4011, 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4011, 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fsubr", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsubr st(i),st - {"fsub", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsub st(i),st - {"fdivr", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fdivr st(i),st - {"fdiv", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // fdiv st(i),st +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fadd", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 }, // fadd m64 + {"fmul", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 }, // fmul m64 + {"fcom", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fcom m64 + {"fcomp", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fcomp m64 + {"fsub", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 }, // fsub m64 + {"fsubr", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 }, // fsubr m64 + {"fdiv", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 }, // fdiv m64 + {"fdivr", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 }, // fdivr m64 + {"fadd", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fadd st(i),st + {"fmul", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fmul st(i),st + {0, 0 , 0 , 0x4011, 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4011, 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fsubr", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fsubr st(i),st + {"fsub", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fsub st(i),st + {"fdivr", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fdivr st(i),st + {"fdiv", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }}; // fdiv st(i),st // Secondary opcode map for x87 f.p. instructions. Opcode DD // Indexed by reg bits and mod == 3 SOpcodeDef OpcodeMapD[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fld", 0x100 , 0x0 , 0x11 , 0x0 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fld m64 - {"fisttp", 0x13 , 0x0 , 0x11 , 0x2004, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fisttp m64 - {"fst", 0x100 , 0x0 , 0x11 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fst m64 - {"fstp", 0x100 , 0x0 , 0x11 , 0x2044, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fstp m64 - {"frstor", 0x100 , 0x0 , 0x11 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // frstor 108 bytes - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fnsave", 0x100 , 0x0 , 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fnsave 108 bytes - {"fnstsw", 0x100 , 0x0 , 0x11 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fstsw m16 - {"ffree", 0x100 , 0x0 , 0x11 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // ffree st(i) - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fst", 0x100 , 0x0 , 0x11 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fst st(i) - {"fstp", 0x100 , 0x0 , 0x11 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fstp st(i) - {"fucom", 0x101 , 0x0 , 0x11 , 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fucom st(i) - {"fucomp", 0x101 , 0x0 , 0x11 , 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fucomp st(i) - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fld", 0x100 , 0 , 0x11 , 0 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 }, // fld m64 + {"fisttp", 0x13 , 0 , 0x11 , 0x2004, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fisttp m64 + {"fst", 0x100 , 0 , 0x11 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fst m64 + {"fstp", 0x100 , 0 , 0x11 , 0x2044, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fstp m64 + {"frstor", 0x100 , 0 , 0x11 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // frstor 108 bytes + {0, 0 , 0 , 0x4011, 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fnsave", 0x100 , 0 , 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // fnsave 108 bytes + {"fnstsw", 0x100 , 0 , 0x11 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fstsw m16 + {"ffree", 0x100 , 0 , 0x11 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // ffree st(i) + {0, 0 , 0 , 0x4011, 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fst", 0x100 , 0 , 0x11 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fst st(i) + {"fstp", 0x100 , 0 , 0x11 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fstp st(i) + {"fucom", 0x101 , 0 , 0x11 , 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fucom st(i) + {"fucomp", 0x101 , 0 , 0x11 , 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // fucomp st(i) + {0, 0 , 0 , 0x4011, 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4011, 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Secondary opcode map for x87 f.p. instructions. Opcode DE // Indexed by reg bits and mod == 3 SOpcodeDef OpcodeMapE[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fiadd", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fiadd m16 - {"fimul", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fimul m16 - {"ficom", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // ficom m16 - {"ficomp", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // ficomp m16 - {"fisub", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fisub m16 - {"fisubr", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fisubr m16 - {"fidiv", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fidiv m16 - {"fidivr", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fidivr m16 - {"faddp", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // faddp st(i),st - {"fmulp", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fmulp st(i),st - {0, 0x0 , 0x0 , 0x4011, 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x17 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // Link to tertiary map 0x17 fcompp - {"fsubrp", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsubrp st(i),st (Yes, the order is illogical here) - {"fsubp", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fsubp st(i),st - {"fdivrp", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fdivrp st(i),st - {"fdivp", 0x100 , 0x0 , 0x11 , 0x1040, 0xAF , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // fdivp st(i),st +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fiadd", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fiadd m16 + {"fimul", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fimul m16 + {"ficom", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0x4 }, // ficom m16 + {"ficomp", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0x4 }, // ficomp m16 + {"fisub", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fisub m16 + {"fisubr", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fisubr m16 + {"fidiv", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fidiv m16 + {"fidivr", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fidivr m16 + {"faddp", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // faddp st(i),st + {"fmulp", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fmulp st(i),st + {0, 0 , 0 , 0x4011, 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0x17 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }, // Link to tertiary map 0x17 fcompp + {"fsubrp", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fsubrp st(i),st (Yes, the order is illogical here) + {"fsubp", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fsubp st(i),st + {"fdivrp", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }, // fdivrp st(i),st + {"fdivp", 0x100 , 0 , 0x11 , 0x1040, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 }}; // fdivp st(i),st // Secondary opcode map for x87 f.p. instructions. Opcode DF // Indexed by reg bits and mod == 3 SOpcodeDef OpcodeMapF[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fild", 0x100 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fild m16 - {"fisttp", 0x13 , 0x0 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fisttp m16 - {"fist", 0x100 , 0x0 , 0x11 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fist m16 - {"fistp", 0x100 , 0x0 , 0x11 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fistp m16 - {"fbld", 0x100 , 0x0 , 0x11 , 0x0 , 0x2005, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fbld m80 - {"fild", 0x100 , 0x0 , 0x11 , 0x0 , 0x2004, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fild m64 - {"fbstp", 0x100 , 0x0 , 0x11 , 0x2005, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fbstp m80 - {"fistp", 0x100 , 0x0 , 0x11 , 0x2004, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fistp m64 - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x18 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // Link to tertiary map 0x18 fnstsw ax - {"fucomip", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fucomp st,st(i) - {"fcomip", 0x6 , 0x0 , 0x11 , 0xAF , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // fcomp st,st(i) - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x1040, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fild", 0x100 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fild m16 + {"fisttp", 0x13 , 0 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // fisttp m16 + {"fist", 0x100 , 0 , 0x11 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fist m16 + {"fistp", 0x100 , 0 , 0x11 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fistp m16 + {"fbld", 0x100 , 0 , 0x11 , 0 , 0x2005, 0 , 0 , 0 , 0 , 0 , 0 }, // fbld m80 + {"fild", 0x100 , 0 , 0x11 , 0 , 0x2004, 0 , 0 , 0 , 0 , 0 , 0 }, // fild m64 + {"fbstp", 0x100 , 0 , 0x11 , 0x2005, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fbstp m80 + {"fistp", 0x100 , 0 , 0x11 , 0x2004, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fistp m64 + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0x18 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x5 , 0 }, // Link to tertiary map 0x18 fnstsw ax + {"fucomip", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fucomp st,st(i) + {"fcomip", 0x6 , 0 , 0x11 , 0xAF , 0x1040, 0 , 0 , 0 , 0 , 0 , 0x4 }, // fcomp st,st(i) + {0, 0 , 0 , 0x4011, 0 , 0x1040, 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Tertiary opcode map for f.p. D9 / reg = 010 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap10[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fnop", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // fnop - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // the rest is illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fnop", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x40 }, // fnop + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // the rest is illegal // Tertiary opcode map for f.p. D9 / reg = 100 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap11[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fchs", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fchs - {"fabs", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fabs - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"ftst", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // ftst - {"fxam", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fxam - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fchs", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fchs + {"fabs", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fabs + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"ftst", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // ftst + {"fxam", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fxam + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Tertiary opcode map for f.p. D9 / reg = 101 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap12[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fld1", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // fld1 - {"fldl2t", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fldl2e", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fldpi", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fldlg2", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fldln2", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fldz", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fld1", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // fld1 + {"fldl2t", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fldl2e", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fldpi", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fldlg2", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fldln2", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fldz", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Tertiary opcode map for f.p. D9 / reg = 110 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap13[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"f2xm1", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // f2xm1 - {"fyl2x", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fptan", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fpatan", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fxtract", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fprem1", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fdecstp", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fincstp", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"f2xm1", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // f2xm1 + {"fyl2x", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fptan", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fpatan", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fxtract", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fprem1", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fdecstp", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fincstp", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // // Tertiary opcode map for f.p. D9 / reg = 111 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap14[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fprem", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fyl2xp1", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fsqrt", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fsincos", 0x101 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"frndint", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fscale", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fsin", 0x101 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fcos", 0x101 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fprem", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fyl2xp1", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fsqrt", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fsincos", 0x101 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"frndint", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fscale", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fsin", 0x101 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fcos", 0x101 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // // Tertiary opcode map for f.p. DA / reg = 101 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap15[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fucompp", 0x101 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fucompp", 0x101 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Tertiary opcode map for f.p. DB / reg = 100 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap16[5] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fnclex", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"fninit", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fnclex", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"fninit", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Tertiary opcode map for f.p. DE / reg = 011 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap17[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"fcompp", 0x100 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"fcompp", 0x100 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Tertiary opcode map for f.p. DF / reg = 100 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap18[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fnstsw", 0x100 , 0x0 , 0x10 , 0xA2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fnstsw", 0x100 , 0 , 0x10 , 0xA2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Secondary opcode map for IRET. Opcode byte = 0xCF // Indexed by operand size SOpcodeDef OpcodeMap19[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"iret", 0x0 , 0x102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // CF - {"iretd", 0x0 , 0x102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }, // CF - {"iretq", 0x0 , 0x1102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x10 }}; // CF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"iret", 0 , 0x102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x10 }, // CF + {"iretd", 0 , 0x102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x10 }, // CF + {"iretq", 0 , 0x1102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x10 }}; // CF // Secondary opcode map for immediate group 1. Opcode byte = 0x80 // Indexed by reg bits = 0 - 7 SOpcodeDef OpcodeMap1A[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"add", 0x0 , 0x10 , 0x51 , 0x1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 80 /0 - {"or", 0x0 , 0x10 , 0x51 , 0x1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 80 /1 - {"adc", 0x0 , 0x10 , 0x51 , 0x1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 80 /2 - {"sbb", 0x0 , 0x10 , 0x51 , 0x1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 80 /3 - {"and", 0x0 , 0x10 , 0x51 , 0x1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 80 /4 - {"sub", 0x0 , 0x10 , 0x51 , 0x1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 80 /5 - {"xor", 0x0 , 0x10 , 0x51 , 0x1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 80 /6 - {"cmp", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }}; // 80 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"add", 0 , 0x10 , 0x51 , 0x1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 80 /0 + {"or", 0 , 0x10 , 0x51 , 0x1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 80 /1 + {"adc", 0 , 0x10 , 0x51 , 0x1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 80 /2 + {"sbb", 0 , 0x10 , 0x51 , 0x1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 80 /3 + {"and", 0 , 0x10 , 0x51 , 0x1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 80 /4 + {"sub", 0 , 0x10 , 0x51 , 0x1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 80 /5 + {"xor", 0 , 0x10 , 0x51 , 0x1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 80 /6 + {"cmp", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0x4 }}; // 80 /7 // Secondary opcode map for immediate group 1. Opcode byte = 0x81 // Indexed by reg bits = 0 - 7 SOpcodeDef OpcodeMap1B[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"add", 0x0 , 0x1110 , 0x91 , 0x9 , 0x28 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 81 /0 - {"or", 0x0 , 0x1110 , 0x91 , 0x9 , 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 81 /1 - {"adc", 0x0 , 0x1110 , 0x91 , 0x9 , 0x28 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 81 /2 - {"sbb", 0x0 , 0x1110 , 0x91 , 0x9 , 0x28 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 81 /3 - {"and", 0x0 , 0x1110 , 0x91 , 0x9 , 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 81 /4 - {"sub", 0x0 , 0x1110 , 0x91 , 0x9 , 0x28 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 81 /5 - {"xor", 0x0 , 0x1110 , 0x91 , 0x9 , 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // 81 /6 - {"cmp", 0x0 , 0x1100 , 0x91 , 0x9 , 0x28 , 0x0 , 0x0 , 0x0 , 0x0 , 0x84 }}; // 81 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"add", 0 , 0x1110 , 0x91 , 0x9 , 0x28 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 81 /0 + {"or", 0 , 0x1110 , 0x91 , 0x9 , 0x39 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 81 /1 + {"adc", 0 , 0x1110 , 0x91 , 0x9 , 0x28 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 81 /2 + {"sbb", 0 , 0x1110 , 0x91 , 0x9 , 0x28 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 81 /3 + {"and", 0 , 0x1110 , 0x91 , 0x9 , 0x39 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 81 /4 + {"sub", 0 , 0x1110 , 0x91 , 0x9 , 0x28 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 81 /5 + {"xor", 0 , 0x1110 , 0x91 , 0x9 , 0x39 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // 81 /6 + {"cmp", 0 , 0x1100 , 0x91 , 0x9 , 0x28 , 0 , 0 , 0 , 0 , 0 , 0x84 }}; // 81 /7 // Secondary opcode map for immediate group 1. Opcode byte = 0x82. // Undocumented opcode. Signed byte instructions do the same as unsigned byte instructions at 0x80 SOpcodeDef OpcodeMap1C[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"add", 0x8000, 0x10 , 0x4051, 0x1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 82 /0 - {"or", 0x8000, 0x10 , 0x4051, 0x1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 82 /1 - {"adc", 0x8000, 0x10 , 0x4051, 0x1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 82 /2 - {"sbb", 0x8000, 0x10 , 0x4051, 0x1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 82 /3 - {"and", 0x8000, 0x10 , 0x4051, 0x1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 82 /4 - {"sub", 0x8000, 0x10 , 0x4051, 0x1 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 82 /5 - {"xor", 0x8000, 0x10 , 0x4051, 0x1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 82 /6 - {"cmp", 0x8000, 0x0 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }}; // 82 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"add", 0x8000, 0x10 , 0x4051, 0x1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 82 /0 + {"or", 0x8000, 0x10 , 0x4051, 0x1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 82 /1 + {"adc", 0x8000, 0x10 , 0x4051, 0x1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 82 /2 + {"sbb", 0x8000, 0x10 , 0x4051, 0x1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 82 /3 + {"and", 0x8000, 0x10 , 0x4051, 0x1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 82 /4 + {"sub", 0x8000, 0x10 , 0x4051, 0x1 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 82 /5 + {"xor", 0x8000, 0x10 , 0x4051, 0x1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 82 /6 + {"cmp", 0x8000, 0 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0x4 }}; // 82 /7 // Secondary opcode map for immediate group 1. Opcode byte = 0x83 // Indexed by reg bits = 0 - 7 SOpcodeDef OpcodeMap1D[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"add", 0x0 , 0x1110 , 0x51 , 0x9 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 83 /0 - {"or", 0x0 , 0x1110 , 0x51 , 0x9 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 83 /1 - {"adc", 0x0 , 0x1110 , 0x51 , 0x9 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 83 /2 - {"sbb", 0x0 , 0x1110 , 0x51 , 0x9 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 83 /3 - {"and", 0x0 , 0x1110 , 0x51 , 0x9 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 83 /4 - {"sub", 0x0 , 0x1110 , 0x51 , 0x9 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 83 /5 - {"xor", 0x0 , 0x1110 , 0x51 , 0x9 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 83 /6 - {"cmp", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }}; // 83 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"add", 0 , 0x1110 , 0x51 , 0x9 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 83 /0 + {"or", 0 , 0x1110 , 0x51 , 0x9 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 83 /1 + {"adc", 0 , 0x1110 , 0x51 , 0x9 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 83 /2 + {"sbb", 0 , 0x1110 , 0x51 , 0x9 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 83 /3 + {"and", 0 , 0x1110 , 0x51 , 0x9 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 83 /4 + {"sub", 0 , 0x1110 , 0x51 , 0x9 , 0x21 , 0 , 0 , 0 , 0 , 0 , 0 }, // 83 /5 + {"xor", 0 , 0x1110 , 0x51 , 0x9 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }, // 83 /6 + {"cmp", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0x4 }}; // 83 /7 // Secondary opcode map for shift group 2. Opcode byte = 0xC0 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap1E[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"rol", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C0 /0 rol byte ptr r/m,ib - {"ror", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C0 /1 - {"rcl", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C0 /2 - {"rcr", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C0 /3 - {"shl", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C0 /4 - {"shr", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C0 /5 - {"sal", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C0 /6 - {"sar", 0x0 , 0x0 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // C0 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"rol", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C0 /0 rol byte ptr r/m,ib + {"ror", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C0 /1 + {"rcl", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C0 /2 + {"rcr", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C0 /3 + {"shl", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C0 /4 + {"shr", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C0 /5 + {"sal", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C0 /6 + {"sar", 0 , 0 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }}; // C0 /7 // Secondary opcode map for shift group 2. Opcode byte = 0xC1 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap1F[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"rol", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C1 /0 rol word ptr r/m,ib - {"ror", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C1 /1 - {"rcl", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C1 /2 - {"rcr", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C1 /3 - {"shl", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C1 /4 - {"shr", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C1 /5 - {"sal", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C1 /6 - {"sar", 0x0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // C1 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"rol", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C1 /0 rol word ptr r/m,ib + {"ror", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C1 /1 + {"rcl", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C1 /2 + {"rcr", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C1 /3 + {"shl", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C1 /4 + {"shr", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C1 /5 + {"sal", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C1 /6 + {"sar", 0 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }}; // C1 /7 // Secondary opcode map for shift group 2. Opcode byte = 0xD0 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap20[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"rol", 0x0 , 0x0 , 0x11 , 0x1 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /0 rol byte ptr r/m,1 - {"ror", 0x0 , 0x0 , 0x11 , 0x1 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /1 - {"rcl", 0x0 , 0x0 , 0x11 , 0x1 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /2 - {"rcr", 0x0 , 0x0 , 0x11 , 0x1 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /3 - {"shl", 0x0 , 0x0 , 0x11 , 0x1 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /4 - {"shr", 0x0 , 0x0 , 0x11 , 0x1 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /5 - {"sal", 0x0 , 0x0 , 0x11 , 0x1 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /6 - {"sar", 0x0 , 0x0 , 0x11 , 0x1 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // C2 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"rol", 0 , 0 , 0x11 , 0x1 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /0 rol byte ptr r/m,1 + {"ror", 0 , 0 , 0x11 , 0x1 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /1 + {"rcl", 0 , 0 , 0x11 , 0x1 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /2 + {"rcr", 0 , 0 , 0x11 , 0x1 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /3 + {"shl", 0 , 0 , 0x11 , 0x1 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /4 + {"shr", 0 , 0 , 0x11 , 0x1 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /5 + {"sal", 0 , 0 , 0x11 , 0x1 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /6 + {"sar", 0 , 0 , 0x11 , 0x1 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }}; // C2 /7 // Secondary opcode map for shift group 2. Opcode byte = 0xD1 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap21[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"rol", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /0 rol word ptr r/m,1 - {"ror", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /1 - {"rcl", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /2 - {"rcr", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /3 - {"shl", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /4 - {"shr", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /5 - {"sal", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /6 - {"sar", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // C3 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"rol", 0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /0 rol word ptr r/m,1 + {"ror", 0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /1 + {"rcl", 0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /2 + {"rcr", 0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /3 + {"shl", 0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /4 + {"shr", 0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /5 + {"sal", 0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /6 + {"sar", 0 , 0x1100 , 0x11 , 0x9 , 0xB1 , 0 , 0 , 0 , 0 , 0 , 0 }}; // C3 /7 // Secondary opcode map for shift group 2. Opcode byte = 0xD2 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap22[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"rol", 0x0 , 0x0 , 0x11 , 0x1 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /0 rol byte ptr r/m,cl - {"ror", 0x0 , 0x0 , 0x11 , 0x1 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /1 - {"rcl", 0x0 , 0x0 , 0x11 , 0x1 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /2 - {"rcr", 0x0 , 0x0 , 0x11 , 0x1 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /3 - {"shl", 0x0 , 0x0 , 0x11 , 0x1 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /4 - {"shr", 0x0 , 0x0 , 0x11 , 0x1 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /5 - {"sal", 0x0 , 0x0 , 0x11 , 0x1 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C2 /6 - {"sar", 0x0 , 0x0 , 0x11 , 0x1 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // C2 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"rol", 0 , 0 , 0x11 , 0x1 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /0 rol byte ptr r/m,cl + {"ror", 0 , 0 , 0x11 , 0x1 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /1 + {"rcl", 0 , 0 , 0x11 , 0x1 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /2 + {"rcr", 0 , 0 , 0x11 , 0x1 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /3 + {"shl", 0 , 0 , 0x11 , 0x1 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /4 + {"shr", 0 , 0 , 0x11 , 0x1 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /5 + {"sal", 0 , 0 , 0x11 , 0x1 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C2 /6 + {"sar", 0 , 0 , 0x11 , 0x1 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }}; // C2 /7 // Secondary opcode map for shift group 2. Opcode byte = 0xD3 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap23[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"rol", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /0 rol word ptr r/m,cl - {"ror", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /1 - {"rcl", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /2 - {"rcr", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /3 - {"shl", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /4 - {"shr", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /5 - {"sal", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C3 /6 - {"sar", 0x0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // C3 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"rol", 0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /0 rol word ptr r/m,cl + {"ror", 0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /1 + {"rcl", 0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /2 + {"rcr", 0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /3 + {"shl", 0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /4 + {"shr", 0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /5 + {"sal", 0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }, // C3 /6 + {"sar", 0 , 0x1100 , 0x11 , 0x9 , 0xB3 , 0 , 0 , 0 , 0 , 0 , 0 }}; // C3 /7 // Secondary opcode map for group 3. Opcode byte = 0xF6 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap24[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"test", 0x0 , 0x0 , 0x51 , 0x1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // test rm8,ib - {"test", 0x0 , 0x0 , 0x4051, 0x1 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // test rm8,ib. undocumented - {"not", 0x0 , 0x1C50 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // not rm8 - {"neg", 0x0 , 0x1C50 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // neg rm8 - {"mul", 0x0 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // mul rm8 - {"imul", 0x0 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // imul rm8 - {"div", 0x0 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // div rm8 - {"idiv", 0x0 , 0x0 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }}; // idiv rm8 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"test", 0 , 0 , 0x51 , 0x1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // test rm8,ib + {"test", 0 , 0 , 0x4051, 0x1 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // test rm8,ib. undocumented + {"not", 0 , 0x1C50 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // not rm8 + {"neg", 0 , 0x1C50 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // neg rm8 + {"mul", 0 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // mul rm8 + {"imul", 0 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // imul rm8 + {"div", 0 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // div rm8 + {"idiv", 0 , 0 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }}; // idiv rm8 // Secondary opcode map for group 3. Opcode byte = 0xF7 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap25[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"test", 0x0 , 0x1100 , 0x91 , 0x9 , 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // test rm,i - {"test", 0x0 , 0x1100 , 0x4091, 0x9 , 0x39 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // test rm,i. undocumented - {"not", 0x0 , 0x1D50 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // not rm - {"neg", 0x0 , 0x1D50 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // neg rm - {"mul", 0x0 , 0x1100 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // mul rm - {"imul", 0x0 , 0x1100 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // imul rm - {"div", 0x0 , 0x1100 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // div rm - {"idiv", 0x0 , 0x1100 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }}; // idiv rm +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"test", 0 , 0x1100 , 0x91 , 0x9 , 0x39 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // test rm,i + {"test", 0 , 0x1100 , 0x4091, 0x9 , 0x39 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // test rm,i. undocumented + {"not", 0 , 0x1D50 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // not rm + {"neg", 0 , 0x1D50 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // neg rm + {"mul", 0 , 0x1100 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // mul rm + {"imul", 0 , 0x1100 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // imul rm + {"div", 0 , 0x1100 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // div rm + {"idiv", 0 , 0x1100 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }}; // idiv rm // Secondary opcode map for group 4. Opcode byte = 0xFE // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap26[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"inc", 0x0 , 0xC50 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // inc rm8 - {"dec", 0x0 , 0xC50 , 0x11 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // dec rm8 - {0, 0x0 , 0x0 , 0x4011, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal opcode +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"inc", 0 , 0xC50 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // inc rm8 + {"dec", 0 , 0xC50 , 0x11 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // dec rm8 + {0, 0 , 0 , 0x4011, 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal opcode // Secondary opcode map for group 5. Opcode byte = 0xFF // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap27[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"inc", 0x0 , 0x1D50 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // inc rm - {"dec", 0x0 , 0x1D50 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // dec rm - {"call", 0x0 , 0x2182 , 0x11 , 0xC , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // call indirect rm - {"call", 0x0 , 0x1102 , 0x811 , 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x28 }, // call indirect far - {"jmp", 0x0 , 0x2180 , 0x11 , 0xB , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x14 }, // jmp indirect rm - {"jmp", 0x0 , 0x1100 , 0x811 , 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x30 }, // jmp indirect far - {"push", 0x0 , 0x2102 , 0x11 , 0xA , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x4 }, // push rm - {0, 0x0 , 0x0 , 0x4011, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal opcode +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"inc", 0 , 0x1D50 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // inc rm + {"dec", 0 , 0x1D50 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // dec rm + {"call", 0 , 0x2182 , 0x11 , 0xC , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // call indirect rm + {"call", 0 , 0x1102 , 0x811 , 0x200D, 0 , 0 , 0 , 0 , 0 , 0 , 0x28 }, // call indirect far + {"jmp", 0 , 0x2180 , 0x11 , 0xB , 0 , 0 , 0 , 0 , 0 , 0 , 0x14 }, // jmp indirect rm + {"jmp", 0 , 0x1100 , 0x811 , 0x200D, 0 , 0 , 0 , 0 , 0 , 0 , 0x30 }, // jmp indirect far + {"push", 0 , 0x2102 , 0x11 , 0xA , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 }, // push rm + {0, 0 , 0 , 0x4011, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal opcode // Secondary opcode map for immediate group 1A. Opcode byte = 0x8F // Indexed by reg bits = 0 - 7. Values != 0 are discouraged SOpcodeDef OpcodeMap28[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pop", 0x0 , 0x2102 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 8F - {"pop", 0x0 , 0x2102 , 0x4011, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 8F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pop", 0 , 0x2102 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 8F + {"pop", 0 , 0x2102 , 0x4011, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 8F // Tertiary opcode map for pinsrw. Opcode byte = 0F C4 // Indexed by mod bits 0 register vs. memory operand SOpcodeDef OpcodeMap29[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pinsrw", 0x7 , 0x91200, 0x59 , 0x1102, 0x1102, 0x2002, 0x11 , 0x0 , 0x0 , 0x2 }, // 0F C4 mem16 - {"pinsrw", 0x7 , 0x91200, 0x59 , 0x1102, 0x1102, 0x1009, 0x11 , 0x0 , 0x0 , 0x2 }}; // 0F C4 register +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pinsrw", 0x7 ,0x892200, 0x59 , 0x1102, 0x1102, 0x2002, 0x11 , 0x1000, 0 , 0 , 0x2 }, // 0F C4 mem16 + {"pinsrw", 0x7 ,0x892200, 0x59 , 0x1102, 0x1102, 0x1009, 0x11 , 0 , 0 , 0 , 0x2 }}; // 0F C4 register // Tertiary opcode map for group 6. Opcode byte = 0F 00 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap2A[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"sldt", 0x2 , 0x1100 , 0x11 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"str", 0x802 , 0x100 , 0x11 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"lldt", 0x802 , 0x2000 , 0x11 , 0x0 , 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"ltr", 0x802 , 0x0 , 0x11 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"verr", 0x802 , 0x0 , 0x11 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"verw", 0x802 , 0x0 , 0x11 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"sldt", 0x2 , 0x1100 , 0x11 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"str", 0x802 , 0x100 , 0x11 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"lldt", 0x802 , 0x2000 , 0x11 , 0 , 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // + {"ltr", 0x802 , 0 , 0x11 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"verr", 0x802 , 0 , 0x11 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"verw", 0x802 , 0 , 0x11 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0x4011, 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {0, 0 , 0 , 0x4011, 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Tertiary opcode map for group 7. Opcode byte = 0F 01 // Indexed by reg bits = 0 - 7 and mod = 11b. SOpcodeDef OpcodeMap2B[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"sgdt", 0x802 , 0x1100 , 0x11 , 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // mod<3, reg=0 - {"sidt", 0x802 , 0x1100 , 0x11 , 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"lgdt", 0x802 , 0x1100 , 0x11 , 0x0 , 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"lidt", 0x802 , 0x1100 , 0x11 , 0x0 , 0x200D, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"smsw", 0x2 , 0x0 , 0x11 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"lmsw", 0x802 , 0x0 , 0x11 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"invlpg", 0x4 , 0x0 , 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // mod<3, reg=7 - - {0, 0x36 , 0x0 , 0x4011, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // link to quarternary map, vmcall etc. - {0, 0x37 , 0x0 , 0x4011, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // link to quarternary map, monitor, mwait - {0, 0xA9 , 0x0 , 0x4011, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // link to quarternary map, xgetbv, xsetbv - {0, 0xAA , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }, // link AMD virtualization - {"smsw", 0x2 , 0x1100 , 0x11 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0x0 , 0x0 , 0x4011, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"lmsw", 0x802 , 0x0 , 0x11 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0xAB , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x5 , 0x0 }}; // link SWAPGS and RDTSCP +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"sgdt", 0x802 , 0x1100 , 0x11 , 0x200D, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // mod<3, reg=0 + {"sidt", 0x802 , 0x1100 , 0x11 , 0x200D, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"lgdt", 0x802 , 0x1100 , 0x11 , 0 , 0x200D, 0 , 0 , 0 , 0 , 0 , 0 }, // + {"lidt", 0x802 , 0x1100 , 0x11 , 0 , 0x200D, 0 , 0 , 0 , 0 , 0 , 0 }, // + {"smsw", 0x2 , 0 , 0x11 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0x133 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // link to rstorssp + {"lmsw", 0x802 , 0 , 0x11 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"invlpg", 0x4 , 0 , 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // mod<3, reg=7 + + {0, 0x36 , 0 , 0x4011, 0 , 0 , 0 , 0 , 0 , 0 , 5 , 0 }, // link to quarternary map, vmcall etc. + {0, 0x37 , 0 , 0x4011, 0 , 0 , 0 , 0 , 0 , 0 , 5 , 0 }, // link to quarternary map, monitor, mwait + {0, 0xA9 , 0 , 0x4011, 0 , 0 , 0 , 0 , 0 , 0 , 5 , 0 }, // link to quarternary map, xgetbv, xsetbv + {0, 0xAA , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 0 }, // link AMD virtualization + {"smsw", 0x2 , 0x1100 , 0x11 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0x130 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 0 }, // link to incssp etc. + {"lmsw", 0x802 , 0 , 0x11 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0xAB , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 0 }}; // link SWAPGS and RDTSCP // Secondary opcode map for group 8. Opcode byte = 0F BA: bt // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap2C[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x51 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x0 , 0x51 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x0 , 0x51 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x0 , 0x51 , 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"bt", 0x3 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"bts", 0x3 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"btr", 0x3 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"btc", 0x3 , 0x1100 , 0x51 , 0x9 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x51 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0 , 0 , 0x51 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0 , 0 , 0x51 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0 , 0 , 0x51 , 0x9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {"bt", 0x3 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"bts", 0x3 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"btr", 0x3 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"btc", 0x3 , 0x1100 , 0x51 , 0x9 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }}; // // Secondary opcode map for addsub. Opcode byte = 0F D0 // Indexed by prefix = none, 66, F2, F3 SOpcodeDef OpcodeMap2D[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"addsub", 0x13 , 0xD0000, 0x4019, 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D0. undefined - {"addsubpd", 0x13 , 0xD0200, 0x19 , 0x124C, 0x124C, 0x24C , 0x0 , 0x0 , 0x0 , 0x2 }, // 66 0F D0. addsubpd - {"addsubps", 0x13 , 0xD0800, 0x19 , 0x124B, 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F D0. addsubps - {"addsub", 0x13 , 0xD0400, 0x4019, 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F D0. undefined +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"addsub", 0x13 , 0xD0000, 0x4019, 0x124F, 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0x2 }, // 0F D0. undefined + {"addsubpd", 0x13 , 0xD0200, 0x19 , 0x124C, 0x124C, 0x24C , 0 , 0 , 0 , 0 , 0x2 }, // 66 0F D0. addsubpd + {"addsubps", 0x13 , 0xD0800, 0x19 , 0x124B, 0x124B, 0x24B , 0 , 0 , 0 , 0 , 0x2 }, // F2 0F D0. addsubps + {"addsub", 0x13 , 0xD0400, 0x4019, 0x124F, 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0x2 }}; // F3 0F D0. undefined // Secondary opcode map for group 10. Opcode byte = 0F B9 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap2E[1] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"ud1", 0x0 , 0x0 , 0x4012, 0x1009, 0x6 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // Invalid opcode, possibly used for emulation +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"ud1", 0 , 0 , 0x4012, 0x1009, 0x6 , 0 , 0 , 0 , 0 , 0 , 0 }}; // Invalid opcode, possibly used for emulation // Secondary opcode map for mov group 11. Opcode byte = 0xC6 // Indexed by reg bits and mod. SOpcodeDef OpcodeMap2F[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"mov", 0x0 , 0xC45 , 0x51 , 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 m /0 mov m,ib - {"mov", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 m /1 - {"mov", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 m /2 - {"mov", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 m /3 - {"mov", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 m /4 - {"mov", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 m /5 - {"mov", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 m /6 - {"mov", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 m /7 - {"", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 r /0 - {"", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 r /1 - {"", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 r /2 - {"", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 r /3 - {"", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 r /4 - {"", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 r /5 - {"", 0x0 , 0x5 , 0x4051, 0x1 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C6 r /6 - {"xabort", 0x1D , 0x0 , 0x50 , 0x0 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // C6 r /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"mov", 0 , 0xC45 , 0x51 , 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 m /0 mov m,ib + {"mov", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 m /1 + {"mov", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 m /2 + {"mov", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 m /3 + {"mov", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 m /4 + {"mov", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 m /5 + {"mov", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 m /6 + {"mov", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 m /7 + {"", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 r /0 + {"", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 r /1 + {"", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 r /2 + {"", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 r /3 + {"", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 r /4 + {"", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 r /5 + {"", 0 , 0x5 , 0x4051, 0x1 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 }, // C6 r /6 + {"xabort", 0x1D , 0 , 0x50 , 0 , 0x31 , 0 , 0 , 0 , 0 , 0 , 0 }}; // C6 r /7 // Secondary opcode map for mov group 11. Opcode byte = 0xC7 // Indexed by reg bits and mod. SOpcodeDef OpcodeMap30[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"mov", 0x0 , 0x1D45 , 0x91 , 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 m /0 mov m,iw - {"mov", 0x0 , 0x5 , 0x4091, 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 m /1 - {"mov", 0x0 , 0x5 , 0x4091, 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 m /2 - {"mov", 0x0 , 0x5 , 0x4091, 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 m /3 - {"mov", 0x0 , 0x5 , 0x4091, 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 m /4 - {"mov", 0x0 , 0x5 , 0x4091, 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 m /5 - {"mov", 0x0 , 0x5 , 0x4091, 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 m /6 - {"mov", 0x0 , 0x5 , 0x4091, 0x9 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 m /7 - {"", 0x0 , 0x0 , 0x91 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 r /0 - {"", 0x0 , 0x0 , 0x91 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 r /1 - {"", 0x0 , 0x0 , 0x91 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 r /2 - {"", 0x0 , 0x0 , 0x91 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 r /3 - {"", 0x0 , 0x0 , 0x91 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 r /4 - {"", 0x0 , 0x0 , 0x91 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 r /5 - {"", 0x0 , 0x0 , 0x91 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // C7 r /6 - {"xbegin", 0x1D , 0x100 , 0x90 , 0x0 , 0x29 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // C7 r /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"mov", 0 , 0x1D45 , 0x91 , 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 m /0 mov m,iw + {"mov", 0 , 0x5 , 0x4091, 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 m /1 + {"mov", 0 , 0x5 , 0x4091, 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 m /2 + {"mov", 0 , 0x5 , 0x4091, 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 m /3 + {"mov", 0 , 0x5 , 0x4091, 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 m /4 + {"mov", 0 , 0x5 , 0x4091, 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 m /5 + {"mov", 0 , 0x5 , 0x4091, 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 m /6 + {"mov", 0 , 0x5 , 0x4091, 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 m /7 + {"mov", 0 , 0x1105 , 0x91 , 0x9 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 r /0 mov r,iw + {"", 0 , 0 , 0x91 , 0 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 r /1 + {"", 0 , 0 , 0x91 , 0 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 r /2 + {"", 0 , 0 , 0x91 , 0 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 r /3 + {"", 0 , 0 , 0x91 , 0 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 r /4 + {"", 0 , 0 , 0x91 , 0 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 r /5 + {"", 0 , 0 , 0x91 , 0 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }, // C7 r /6 + {"xbegin", 0x1D , 0x100 , 0x90 , 0 , 0x29 , 0 , 0 , 0 , 0 , 0 , 0 }}; // C7 r /7 // Secondary opcode map for group 12. Opcode byte = 0F 71 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap31[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Illegal - {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Illegal - {"psrlw", 0x7 , 0xD2200, 0x58 , 0x1102, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // - {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Illegal - {"psraw", 0x7 , 0xD2200, 0x58 , 0x1102, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // - {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Illegal - {"psllw", 0x7 , 0xD2200, 0x58 , 0x1102, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // - {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }}; // Illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0 , 0 , 0 , 0 , 0x2 }, // Illegal + {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0 , 0 , 0 , 0 , 0x2 }, // Illegal + {"psrlw", 0x7 ,0x8D2200, 0x58 , 0x1102, 0x1102, 0x11 , 0 , 0x20 , 0 , 0 , 0x2 }, // 2 + {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0 , 0 , 0 , 0 , 0x2 }, // Illegal + {"psraw", 0x7 ,0x8D2200, 0x58 , 0x1102, 0x1102, 0x11 , 0 , 0x20 , 0 , 0 , 0x2 }, // 4 + {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0 , 0 , 0 , 0 , 0x2 }, // Illegal + {"psllw", 0x7 ,0x8D2200, 0x58 , 0x1102, 0x1102, 0x11 , 0 , 0x20 , 0 , 0 , 0x2 }, // 6 + {0, 0x7 , 0x90200, 0x58 , 0x1102, 0x1102, 0x11 , 0 , 0 , 0 , 0 , 0x2 }}; // Illegal // Secondary opcode map for group 13. Opcode byte = 0F 72 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap32[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x12 , 0x90200, 0x58 , 0x1103, 0x103 , 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Illegal - {0, 0x12 , 0x90200, 0x58 , 0x1103, 0x103 , 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Illegal - {"psrld", 0x12 ,0x490200, 0x58 , 0x1103, 0x103 , 0x11 , 0x0 , 0x1406, 0x0 , 0x2 }, // /2 - {0, 0x12 , 0x90200, 0x58 , 0x1103, 0x103 , 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Illegal - {"psrad", 0x12 ,0x490200, 0x58 , 0x1103, 0x103 , 0x11 , 0x0 , 0x1406, 0x0 , 0x2 }, // /4 - {0, 0x12 , 0x90200, 0x58 , 0x1103, 0x103 , 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Illegal - {"pslld", 0x12 ,0x490200, 0x58 , 0x1103, 0x103 , 0x11 , 0x0 , 0x1406, 0x0 , 0x2 }, // /6 - {0, 0x12 , 0x90200, 0x58 , 0x1103, 0x103 , 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }}; // Illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vpror", 0x20 ,0x893200, 0x58 , 0x1209, 0x209 , 0x11 , 0 , 0x21 , 0 , 0 , 0x1 }, // /0 + {"vprol", 0x20 ,0x893200, 0x58 , 0x1209, 0x209 , 0x11 , 0 , 0x21 , 0 , 0 , 0x1 }, // /1 + {"psrld", 0x12 ,0xCD3200, 0x58 , 0x1103, 0x103 , 0x11 , 0 , 0x21 , 0x1406, 0 , 0x2 }, // /2 + {0, 0x12 , 0x90200, 0x58 , 0x1103, 0x103 , 0x11 , 0 , 0 , 0 , 0 , 0x2 }, // Illegal + {"psra", 0x12 ,0xCD3200, 0x58 , 0x1109, 0x109 , 0x11 , 0 , 0x31 , 0x1406, 0 , 0x3 }, // /4. W bit controls operand size only if EVEX + {0, 0x12 , 0x90200, 0x58 , 0x1103, 0x103 , 0x11 , 0 , 0 , 0 , 0 , 0x2 }, // Illegal + {"pslld", 0x12 ,0xCD3200, 0x58 , 0x1103, 0x103 , 0x11 , 0 , 0x21 , 0x1406, 0 , 0x2 }, // /6 + {0, 0x12 , 0x90200, 0x58 , 0x1103, 0x103 , 0x11 , 0 , 0 , 0 , 0 , 0x2 }}; // Illegal // Secondary opcode map for group 14. Opcode byte = 0F 73 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap33[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x12 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x12 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"psrlq", 0x12 , 0xD0200, 0x58 , 0x1103, 0x1103, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // - {"psrldq", 0x12 , 0xD8200, 0x58 , 0x1204, 0x1204, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // Not valid without 66 prefix - {0, 0x12 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x12 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"psllq", 0x12 , 0xD0200, 0x58 , 0x1103, 0x1103, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }, // - {"pslldq", 0x12 , 0xD8200, 0x58 , 0x1204, 0x1204, 0x11 , 0x0 , 0x0 , 0x0 , 0x2 }}; // Not valid without 66 prefix +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x12 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // /0 Illegal + {0, 0x12 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // /1 Illegal + {"psrlq", 0x12 ,0x8D3200, 0x58 , 0x1104, 0x104 , 0x11 , 0 , 0x21 , 0 , 0 , 0x2 }, // /2 + {"psrldq", 0x12 , 0xDA200, 0x58 , 0x1204, 0x204 , 0x11 , 0 , 0 , 0 , 0 , 0x2 }, // /3 Not valid without 66 prefix + {0, 0x12 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // /4 Illegal + {0, 0x12 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // /5 Illegal + {"psllq", 0x12 ,0x8D3200, 0x58 , 0x1104, 0x104 , 0x11 , 0 , 0x21 , 0 , 0 , 0x2 }, // /6 + {"pslldq", 0x12 ,0x8DA200, 0x58 , 0x1204, 0x204 , 0x11 , 0 , 0 , 0 , 0 , 0x2 }}; // /7 Not valid without 66 prefix // Secondary opcode map for group 15. Opcode byte = 0F AE // Indexed by reg bits = 0 - 7 and mod = 3 // These codes are without VEX prefix. Same codes with VEX or MVEX prefix are in OpcodeMapCD SOpcodeDef OpcodeMap34[16] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fxsave", 0x11 , 0x0 , 0x11 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F AE /0 - {"fxrstor", 0x11 , 0x0 , 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F AE /1 - {"ldmxcsr", 0x11 , 0x10000, 0x11 , 0x0 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F AE /2 - {"stmxcsr", 0x11 , 0x10000, 0x11 , 0x2003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F AE /3 - {0, 0x0 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"xsaveopt", 0x19 , 0x2000 , 0x11 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F AE /6 - {"clflush", 0x12 , 0x0 , 0x11 , 0x2006, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F AE /7 - {"rdfsbase", 0x10000,0x1400 , 0x11 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F3 0F AE m-0 - {"rdgsbase", 0x10000,0x1400 , 0x11 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F3 0F AE m-1 - {"wrfsbase", 0x10000,0x1400 , 0x11 , 0 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F3 0F AE m-2 - {"wrgsbase", 0x10000,0x1400 , 0x11 , 0 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F3 0F AE m-3 - {0, 0x0 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"lfence", 0x12 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // m-5 - {"mfence", 0x12 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // m-6 - {"sfence", 0x12 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // m-7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fxsave", 0x11 , 0 , 0x11 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F AE /0 + {"fxrstor", 0x11 , 0 , 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F AE /1 + {"ldmxcsr", 0x11 , 0x10000, 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F AE /2 + {"stmxcsr", 0x11 , 0x10000, 0x11 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F AE /3 + {0, 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0x134 , 0 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // 0F AE /5. Link setssbsy + {0, 0xF3 , 0 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // 0F AE /6. Link xsaveopt + {0, 0xF2 , 0 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // 0F AE /7. Link clflush + {"rdfsbase", 0x10000,0x1400 , 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F3 0F AE m-0 + {"rdgsbase", 0x10000,0x1400 , 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F3 0F AE m-1 + {"wrfsbase", 0x10000,0x1400 , 0x11 , 0 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // F3 0F AE m-2 + {"wrgsbase", 0x10000,0x1400 , 0x11 , 0 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // F3 0F AE m-3 + {0, 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {"lfence", 0x12 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // m-5 + {"mfence", 0x12 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // m-6 + {0, 0xF4 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }}; // m-7. Link sfence, pcommit // Secondary opcode map for group 16. Opcode byte = 0F 18 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap35[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"prefetchnta",0x13 ,0x410000, 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x2 , 0x0 , 0x2 }, // 0F 18 /0 - {"prefetcht0",0x13 ,0x410000, 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x2 , 0x0 , 0x2 }, // 0F 18 /1 - {"prefetcht1",0x13 ,0x410000, 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x2 , 0x0 , 0x2 }, // 0F 18 /2 - {"prefetcht2",0x13 ,0x410000, 0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x2 , 0x0 , 0x2 }, // 0F 18 /3 - {"vprefetchenta",0x13,0x430000,0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x2 , 0x0 , 0x0 }, // 0F 18 /4 - {"vprefetche0",0x13 ,0x430000,0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x2 , 0x0 , 0x0 }, // 0F 18 /5 - {"vprefetche1",0x13 ,0x430000,0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x2 , 0x0 , 0x0 }, // 0F 18 /6 - {"vprefetche2",0x13 ,0x430000,0x11 , 0x0 , 0x2006, 0x0 , 0x0 , 0x2 , 0x0 , 0x0 }}; // 0F 18 /7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"prefetchnta",0x13 ,0x410000, 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0x2 , 0 , 0x2 }, // 0F 18 /0 + {"prefetcht0",0x13 ,0x410000, 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0x2 , 0 , 0x2 }, // 0F 18 /1 + {"prefetcht1",0x13 ,0x410000, 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0x2 , 0 , 0x2 }, // 0F 18 /2 + {"prefetcht2",0x13 ,0x410000, 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0x2 , 0 , 0x2 }, // 0F 18 /3 + {"vprefetchenta",0x13,0x430000,0x11 , 0 , 0x2006, 0 , 0 , 0 , 0x2 , 0 , 0 }, // 0F 18 /4 + {"vprefetche0",0x13 ,0x430000,0x11 , 0 , 0x2006, 0 , 0 , 0 , 0x2 , 0 , 0 }, // 0F 18 /5 + {"vprefetche1",0x13 ,0x430000,0x11 , 0 , 0x2006, 0 , 0 , 0 , 0x2 , 0 , 0 }, // 0F 18 /6 + {"vprefetche2",0x13 ,0x430000,0x11 , 0 , 0x2006, 0 , 0 , 0 , 0x2 , 0 , 0 }}; // 0F 18 /7 // Quarternary opcode map for group 7. 0F 01 reg = 0 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap36[6] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // illegal - {"vmcall", 0x813 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // Intel processor only? - {"vmlaunch", 0x813 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // Intel processor only? - {"vmresume", 0x813 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Intel processor only? - {"vmxoff", 0x813 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Intel processor only? - {0, 0x0 , 0x0 , 0x4010, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // illegal + {"vmcall", 0x813 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // Intel processor only? + {"vmlaunch", 0x813 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // Intel processor only? + {"vmresume", 0x813 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Intel processor only? + {"vmxoff", 0x813 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Intel processor only? + {0, 0 , 0 , 0x4010, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal // Quarternary opcode map for group 7. 0F 01 reg = 1 // Indexed by rm bits of mod/reg/rm byte SOpcodeDef OpcodeMap37[5] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"monitor", 0x813 , 0x4 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"mwait", 0x813 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0x0 , 0x0 , 0x10 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // illegal - -// Tertiary opcode map for floating point cmpps/pd instructions. First two bytes = 0F C2 -// Indexed by immediate byte following operands = 0 - 7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"monitor", 0x813 , 0x4 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1 - 0 + {"mwait", 0x813 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1 - 1 + {"clac", 0x81D , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1 - 2 + {"stac", 0x81D , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 1 - 3 + {0, 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // illegal + +// EVEX 0F 38 1B, indexed by W bit SOpcodeDef OpcodeMap38[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cmpeq", 0x12 ,0x4D2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x1204, 0x0 , 0x3 }, // 0F C2 op 00: cmpeqps/pd - {"cmplt", 0x12 ,0x4D2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x1204, 0x0 , 0x3 }, // 0F C2 op 01: - {"cmple", 0x12 ,0x4D2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x1204, 0x0 , 0x3 }, // 0F C2 op 02: - {"cmpunord", 0x12 ,0x4D2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x1204, 0x0 , 0x3 }, // 0F C2 op 03: - {"cmpneq", 0x12 ,0x4D2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x1204, 0x0 , 0x3 }, // 0F C2 op 04: - {"cmpnlt", 0x12 ,0x4D2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x1204, 0x0 , 0x3 }, // 0F C2 op 05: - {"cmpnle", 0x12 ,0x4D2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x1204, 0x0 , 0x3 }, // 0F C2 op 06: - {"cmpord", 0x12 ,0x4D2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x1204, 0x0 , 0x3 }, // 0F C2 op 07: -// imm > 7 only with VEX prefix, not with MVEX - {"vcmpeq_uq", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 08: - {"vcmpnge_us",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 09: - {"vcmpngt_us",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 0A: - {"vcmpfalse_oq",0x19,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 0B: - {"vcmpneq_oq",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 0C: - {"vcmpge_os", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 0D: - {"vcmpgt_os", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 0E: - {"vcmptrue_uq",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 0F: - {"vcmpeq_os", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 10: - {"vcmplt_oq", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 11: - {"vcmple_oq", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 12: - {"vcmpunord_s",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 13: - {"vcmpneq_us",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 14: - {"vcmpnlt_uq",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 15: - {"vcmpnle_uq",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 16: - {"vcmpord_s", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 17: - {"vcmpeq_us", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 18: - {"vcmpnge_uq",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 19: - {"vcmpngt_uq",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 1A: - {"vcmpfalse_os",0x19,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 1B: - {"vcmpneq_os",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 1C: - {"vcmpge_oq", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 1D: - {"vcmpgt_oq", 0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 1E: - {"vcmptrue_us",0x19 ,0xE0E00 , 0x59 , 0x124F, 0x24F , 0x24F , 0x0 , 0x0 , 0x0 , 0x1 }, // 0F C2 op 1F: - {"vcmp", 0x19 ,0xE0200 , 0x4059, 0x124F, 0x24F , 0x24F , 0x11 , 0x0 , 0x0 , 0x3 }}; // 0F C2 op > 1F: cmpps/pd, imm +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vbroadcastf32x8",0x20,0xC69200,0x12, 0x164B, 0x254B, 0 , 0 , 0x20 , 0x1011, 0 , 0x100 }, // EVEX W0 0F 38 1B + {"vbroadcastf64x4",0x20,0xC69200,0x12, 0x164C, 0x254C, 0 , 0 , 0x20 , 0x1011, 0 , 0x100 }}; // EVEX W1 0F 38 1B // Secondary opcode map for cbw/cwde/cdqe. Opcode byte = 0x98 // Indexed by operand size = 16, 32, 64 SOpcodeDef OpcodeMap39[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cbw", 0x0 , 0x100 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 98 - {"cwde", 0x0 , 0x100 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 98 - {"cdqe", 0x4000, 0x1000 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }}; // 98 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cbw", 0 , 0x100 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 98 + {"cwde", 0 , 0x100 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 98 + {"cdqe", 0x4000, 0x1000 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }}; // 98 // Secondary opcode map for cwd/cdq/cqo. Opcode byte = 0x99 // Indexed by operand size = 16, 32, 64 SOpcodeDef OpcodeMap3A[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cwd", 0x0 , 0x100 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 99 - {"cdq", 0x0 , 0x100 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 99 - {"cqo", 0x4000, 0x1000 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }}; // 99 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cwd", 0 , 0x100 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 99 + {"cdq", 0 , 0x100 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 99 + {"cqo", 0x4000, 0x1000 , 0x1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }}; // 99 // Secondary opcode map for arpl/movsxd. Opcode byte = 0x63 // Indexed by mode = 16, 32, 64 SOpcodeDef OpcodeMap3B[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"arpl", 0x8802, 0x0 , 0x13 , 0x2 , 0x1002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 63 - {"arpl", 0x8802, 0x0 , 0x13 , 0x2 , 0x1002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 63 - {"movsxd", 0x4000, 0x1000 , 0x12 , 0x1009, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 63 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"arpl", 0x8802, 0 , 0x13 , 0x2 , 0x1002, 0 , 0 , 0 , 0 , 0 , 0 }, // 63 + {"arpl", 0x8802, 0 , 0x13 , 0x2 , 0x1002, 0 , 0 , 0 , 0 , 0 , 0 }, // 63 + {"movsxd", 0x4000, 0x1000 , 0x12 , 0x1009, 0x3 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 63 // Secondary opcode map for nop/pause. Opcode byte = 0x90 // Indexed by prefix = none, 66, F2, F3 SOpcodeDef OpcodeMap3C[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"nop", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // 90 - {"nop", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // 66 90 - {"nop", 0x0 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x40 }, // F2 90 - {"pause", 0x0 , 0x400 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 90. (No instset indicated because backwards compatible) +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"nop", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x40 }, // 90 + {"nop", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x40 }, // 66 90 + {"nop", 0 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x40 }, // F2 90 + {"pause", 0 , 0x400 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 90. (No instset indicated because backwards compatible) // Secondary opcode map for jcxz. Opcode byte = 0xE3 // Indexed by address size SOpcodeDef OpcodeMap3D[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"jcxz", 0x0 , 0x81 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // E3 - {"jecxz", 0x0 , 0x81 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, - {"jrcxz", 0x4000, 0x81 , 0x42 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"jcxz", 0 , 0x81 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // E3 + {"jecxz", 0 , 0x81 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {"jrcxz", 0x4000, 0x81 , 0x42 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // Secondary opcode map for pushf/d/q. Opcode byte = 0x9C // Indexed by operand size SOpcodeDef OpcodeMap3E[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pushf", 0x0 , 0x102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 9C pushf - {"pushf", 0x0 , 0x2102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 }, // 9C pushf/d/q - {"pushf", 0x0 , 0x2102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 }}; // 9C pushf/d/q +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pushf", 0 , 0x102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 9C pushf + {"pushf", 0 , 0x2102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 }, // 9C pushf/d/q + {"pushf", 0 , 0x2102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 }}; // 9C pushf/d/q // Secondary opcode map for poof/d/q. Opcode byte = 0x9D // Indexed by operand size SOpcodeDef OpcodeMap3F[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"popf", 0x0 , 0x102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 9D popf - {"popf", 0x0 , 0x2102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 }, // 9D popf/d/q - {"popf", 0x0 , 0x2102 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x1 }}; // 9D popf/d/q +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"popf", 0 , 0x102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 9D popf + {"popf", 0 , 0x2102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 }, // 9D popf/d/q + {"popf", 0 , 0x2102 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x1 }}; // 9D popf/d/q // Tertiary opcode map for movups etc. Opcode byte = 0F 10 // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap40[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movups", 0x11 , 0x50000, 0x12 , 0x124B, 0x251 , 0x0 , 0x0 , 0x0 , 0x0 , 0x202 }, // 0F 10 - {"movupd", 0x12 , 0x50200, 0x12 , 0x124C, 0x251 , 0x0 , 0x0 , 0x0 , 0x0 , 0x202 }, // 66 0F 10 - {"movsd", 0x71 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 }, // F2 0F 10 Link for memory/register - {"movss", 0x72 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 }}; // F3 0F 10 Link for memory/register +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movups", 0x11 ,0x850000, 0x12 , 0x124B, 0x251 , 0 , 0 , 0x30 , 0 , 0 , 0x202 }, // 0F 10 + {"movupd", 0x12 ,0x852200, 0x12 , 0x124C, 0x251 , 0 , 0 , 0x30 , 0 , 0 , 0x202 }, // 66 0F 10 + {"movsd", 0x71 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 }, // F2 0F 10 Link for memory/register + {"movss", 0x72 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 }}; // F3 0F 10 Link for memory/register // Tertiary opcode map for movups etc. Opcode byte = 0F 11 // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap41[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movups", 0x11 , 0x50000, 0x13 , 0x251 , 0x124B, 0x0 , 0x0 , 0x0 , 0x0 , 0x202 }, // 0F 11 - {"movupd", 0x12 , 0x50200, 0x13 , 0x251 , 0x124C, 0x0 , 0x0 , 0x0 , 0x0 , 0x202 }, // 66 0F 11 - {"movsd", 0x73 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 }, // F2 0F 11 Link for memory/register - {"movss", 0x74 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 }}; // F3 0F 11 Link for memory/register +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movups", 0x11 ,0x850000, 0x13 , 0x251 , 0x124B, 0 , 0 , 0x30 , 0 , 0 , 0x202 }, // 0F 11 + {"movupd", 0x12 ,0x852200, 0x13 , 0x251 , 0x124C, 0 , 0 , 0x30 , 0 , 0 , 0x202 }, // 66 0F 11 + {"movsd", 0x73 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 }, // F2 0F 11 Link for memory/register + {"movss", 0x74 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 0 }}; // F3 0F 11 Link for memory/register // Tertiary opcode map for movlps etc. Opcode byte = 0F 12 // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap42[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x43 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // Link to quarternary map - {"movlpd", 0x12 , 0x90200, 0x19 , 0x124C, 0x124C, 0x2351, 0x0 , 0x0 , 0x0 , 0x2 }, // 66 0F 12 - {"movddup", 0x70 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xB , 0 }, // F2 0F 12 - {"movsldup", 0x13 , 0x50400, 0x12 , 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 12 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x43 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // Link to quarternary map + {"movlpd", 0x12 ,0x892200, 0x19 , 0x144C, 0x144C, 0x204C, 0 , 0 , 0 , 0 , 0x2 }, // 66 0F 12 + {"movddup", 0x70 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xB , 0 }, // F2 0F 12 + {"movsldup", 0x13 ,0x852400, 0x12 , 0x124B, 0x24B , 0 , 0 , 0x30 , 0 , 0 , 0x2 }}; // F3 0F 12 // Quarternary opcode map for movlps and movhlps. Opcode byte = 0F 12 // Indexed by mod bits SOpcodeDef OpcodeMap43[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movlps", 0x11 , 0x90000, 0x19 , 0x144B, 0x144B, 0x2351, 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 12 (mem) - {"movhlps", 0x11 , 0x90000, 0x19 , 0x144B, 0x144B, 0x144B, 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 12 (reg) +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movlps", 0x11 ,0x892000, 0x19 , 0x144B, 0x144B, 0x234B, 0 , 0x1000, 0 , 0 , 0x2 }, // 0F 12 (mem) + {"movhlps", 0x11 ,0x892000, 0x19 , 0x144B, 0x144B, 0x144B, 0 , 0x00 , 0 , 0 , 0x2 }}; // 0F 12 (reg) // Tertiary opcode map for movlps etc. Opcode byte = 0F 16 // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap44[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x45 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // Link to quarternary map - {"movhpd", 0x12 , 0x90200, 0x19 , 0x124C, 0x124C, 0x204C, 0x0 , 0x0 , 0x0 , 0x2 }, // 66 0F 16 - {0, 0x13 , 0x800 , 0x4012, 0x124C, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 16 - {"movshdup", 0x13 , 0x50400, 0x12 , 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 16 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x45 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // Link to quarternary map + {"movhpd", 0x12 ,0x892200, 0x19 , 0x144C, 0x144C, 0x204C, 0 , 0x00 , 0 , 0 , 0x2 }, // 66 0F 16 + {0, 0x13 , 0x800 , 0x4012, 0x124C, 0x4C , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 16 + {"movshdup", 0x13 ,0x852400, 0x12 , 0x124B, 0x24B , 0 , 0 , 0x30 , 0 , 0 , 0x2 }}; // F3 0F 16 // Quarternary opcode map for movhps and movlhps. Opcode byte = 0F 16 // Indexed by mod bits SOpcodeDef OpcodeMap45[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movhps", 0x11 , 0x90000, 0x19 , 0x124B, 0x124B, 0x2351, 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 12 (mem) - {"movlhps", 0x11 , 0x90000, 0x19 , 0x124B, 0x124B, 0x124B, 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 12 (reg) +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movhps", 0x11 ,0x890000, 0x19 , 0x144B, 0x144B, 0x234B, 0 , 0x1000, 0 , 0 , 0x2 }, // 0F 12 (mem) + {"movlhps", 0x11 ,0x890000, 0x19 , 0x144B, 0x144B, 0x144B, 0 , 0x0 , 0 , 0 , 0x2 }}; // 0F 12 (reg) // Tertiary opcode map for cvtpi2ps etc. Opcode byte = 0F 2A // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap46[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cvtpi2ps", 0x11 , 0x0 , 0x12 , 0x124B, 0x303 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 2A - {"cvtpi2pd", 0x12 , 0x200 , 0x12 , 0x124C, 0x303 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F 2A - {"cvtsi2sd", 0x12 , 0x91800, 0x19 , 0x104C, 0x104C, 0x9 , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 2A - {"cvtsi2ss", 0x12 , 0x91400, 0x19 , 0x104B, 0x104B, 0x9 , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 2A +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cvtpi2ps", 0x11 , 0 , 0x12 , 0x124B, 0x303 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 2A + {"cvtpi2pd", 0x12 , 0x200 , 0x12 , 0x124C, 0x303 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 2A + {"cvtsi2sd", 0x12 ,0x891800, 0x19 , 0x104C, 0x104C, 0x9 , 0 , 0x6 , 0 , 0 , 0x2 }, // F2 0F 2A + {"cvtsi2ss", 0x12 ,0x891400, 0x19 , 0x104B, 0x104B, 0x9 , 0 , 0x6 , 0 , 0 , 0x2 }}; // F3 0F 2A // Tertiary opcode map for cvttps2pi etc. Opcode byte = 0F 2C // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap47[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cvttps2pi", 0x11 , 0x0 , 0x12 , 0x1303, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 2C - {"cvttpd2pi", 0x12 , 0x200 , 0x12 , 0x1303, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F 2C - {"cvttsd2si", 0x12 , 0x11800, 0x12 , 0x1009, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 2C - {"cvttss2si", 0x12 , 0x11400, 0x12 , 0x1009, 0x4B , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 2C +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cvttps2pi", 0x11 , 0 , 0x12 , 0x1303, 0x24B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 2C + {"cvttpd2pi", 0x12 , 0x200 , 0x12 , 0x1303, 0x24C , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 2C + {"cvttsd2si", 0x12 ,0x811800, 0x12 , 0x1009, 0x4C , 0 , 0 , 0x2 , 0 , 0 , 0x2 }, // F2 0F 2C + {"cvttss2si", 0x12 ,0x811400, 0x12 , 0x1009, 0x4B , 0 , 0 , 0x2 , 0 , 0 , 0x2 }}; // F3 0F 2C // Tertiary opcode map for cvtps2pi etc. Opcode byte = 0F 2D // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap48[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cvtps2pi", 0x11 , 0x0 , 0x12 , 0x1303, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 2D - {"cvtpd2pi", 0x12 , 0x200 , 0x12 , 0x1303, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F 2D - {"cvtsd2si", 0x12 , 0x11800, 0x12 , 0x1009, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 2D - {"cvtss2si", 0x12 , 0x11400, 0x12 , 0x1009, 0x4B , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 2D +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cvtps2pi", 0x11 ,0x000000, 0x12 , 0x1303, 0x24B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 2D + {"cvtpd2pi", 0x12 ,0x000200, 0x12 , 0x1303, 0x24C , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 2D + {"cvtsd2si", 0x12 ,0x811800, 0x12 , 0x1009, 0x4C , 0 , 0 , 0x6 , 0 , 0 , 0x2 }, // F2 0F 2D + {"cvtss2si", 0x12 ,0x811400, 0x12 , 0x1009, 0x4B , 0 , 0 , 0x6 , 0 , 0 , 0x2 }}; // F3 0F 2D // Tertiary opcode map for cvtps2pd etc. Opcode byte = 0F 5A // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap49[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cvtps2pd", 0x12 ,0x450000, 0x12 , 0x124C, 0x44B , 0x0 , 0x0 , 0x1215, 0x0 , 0x2 }, // 0F 5A - {"cvtpd2ps", 0x12 ,0x452200, 0x12 , 0x144B, 0x24C , 0x0 , 0x0 , 0x1305, 0x0 , 0x2 }, // 66 0F 5A - {"cvtsd2ss", 0x12 , 0x90800, 0x19 , 0x104B, 0x4C , 0x4C , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 5A - {"cvtss2sd", 0x12 , 0x90400, 0x19 , 0x104C, 0x104C, 0x4B , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 5A +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cvtps2pd", 0x12 ,0xC50000, 0x12 , 0x124C, 0xF4B , 0 , 0 , 0x33 , 0x1215, 0 , 0x2 }, // 0F 5A + {"cvtpd2ps", 0x12 ,0xC52200, 0x12 , 0x1F4B, 0x24C , 0 , 0 , 0x37, 0x1305, 0 , 0x2 }, // 66 0F 5A + {"cvtsd2ss", 0x12 ,0x892800, 0x19 , 0x104B, 0x4C , 0x4C , 0 , 0x36 , 0 , 0 , 0x2 }, // F2 0F 5A + {"cvtss2sd", 0x12 ,0x892400, 0x19 , 0x104C, 0x104C, 0x4B , 0 , 0x32 , 0 , 0 , 0x2 }}; // F3 0F 5A // Tertiary opcode map for cvtdq2ps etc. Opcode byte = 0F 5B // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap4A[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cvtdq2ps", 0x12 , 0x50000, 0x12 , 0x124B, 0x203 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 5B - {"cvtps2dq", 0x12 , 0x50200, 0x12 , 0x1203, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 66 0F 5B - {0, 0x12 , 0x800 , 0x4012, 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 5B. Illegal - {"cvttps2dq", 0x12 , 0x50400, 0x12 , 0x1203, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 5B +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cvtdq2ps", 0x12 ,0x850000, 0x12 , 0x124B, 0x203 , 0 , 0 , 0x37 , 0 , 0 , 0x2 }, // 0F 5B + {"cvtps2dq", 0x12 ,0x850200, 0x12 , 0x1203, 0x24B , 0 , 0 , 0x37 , 0 , 0 , 0x2 }, // 66 0F 5B + {0, 0x12 ,0x800 , 0x4012, 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 5B. Illegal + {"cvttps2dq", 0x12 ,0x852400, 0x12 , 0x1203, 0x24B , 0 , 0 , 0x37 , 0 , 0 , 0x2 }}; // F3 0F 5B // Tertiary opcode map for ucomiss/sd etc. Opcode byte = 0F 2E // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap4B[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"ucomiss", 0x11 , 0x10200, 0x12 , 0x124B, 0x4B , 0x0 , 0x0 , 0x0 , 0x0 , 0x6 }, // 0F 2E. ucomiss - {"ucomisd", 0x11 , 0x10200, 0x12 , 0x124C, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x6 }, // 66 0F 2E. ucomisd - {0, 0x0 , 0x0 , 0x12 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // Illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"ucomiss", 0x11 ,0x810200, 0x12 , 0x124B, 0x4B , 0 , 0 , 0x2 , 0 , 0 , 0x6 }, // 0F 2E. ucomiss + {"ucomisd", 0x11 ,0x812200, 0x12 , 0x124C, 0x4C , 0 , 0 , 0x2 , 0 , 0 , 0x6 }, // 66 0F 2E. ucomisd + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // Illegal // Tertiary opcode map for comiss/sd etc. Opcode byte = 0F 2F // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap4C[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"comiss", 0x11 , 0x10200, 0x12 , 0x124B, 0x4B , 0x0 , 0x0 , 0x0 , 0x0 , 0x6 }, // 0F 2F. comiss - {"comisd", 0x11 , 0x10200, 0x12 , 0x124C, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x6 }, // 66 0F 2F. comisd - {0, 0x0 , 0x0 , 0x12 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // Illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"comiss", 0x11 ,0x812200, 0x12 , 0x124B, 0x4B , 0 , 0 , 0x2 , 0 , 0 , 0x6 }, // 0F 2F. comiss + {"comisd", 0x11 ,0x812200, 0x12 , 0x124C, 0x4C , 0 , 0 , 0x2 , 0 , 0 , 0x6 }, // 66 0F 2F. comisd + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // Illegal // Tertiary opcode map for movq/movdqa/movdqu. Opcode byte = 0F 6F // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap4D[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movq", 0x7 , 0x0 , 0x12 , 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 6F - {"movdqa", 0xB8 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xE , 0x0 }, // 66 0F 6F. Link to movdqa and vmovdqa32 - {0, 0x7 , 0x800 , 0x4012, 0x1351, 0x351 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 6F. Illegal - {"movdqu", 0x12 , 0x50400, 0x12 , 0x1250, 0x251 , 0x0 , 0x0 , 0x0 , 0x0 , 0x202 }}; // F3 0F 6F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movq", 0x7 , 0 , 0x12 , 0x1351, 0x351 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 6F + {"movdqa", 0xB8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 66 0F 6F. Link to movdqa and vmovdqa32 + {"vmovdqu", 0x19 ,0x864800, 0x12 , 0x1209, 0x209 , 0 , 0 , 0x20 , 0 , 0 , 0x1200}, // F2 0F 6F + {"movdqu", 0xB9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }}; // F3 0F 6F. Link to movdqu and vmovdqu32 // Tertiary opcode map for movq/movdqa/movdqu. Opcode byte = 0F 7F // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap4E[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movq", 0x7 , 0x0 , 0x13 , 0x351 , 0x1351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7F - {"movdqa", 0xBA , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xE , 0x0 }, // 66 0F 7F. Link to movdqa and vmovdqa32 - {0, 0x7 , 0x800 , 0x4013, 0x351 , 0x1351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 7F. Illegal - {"movdqu", 0x12 , 0x50400, 0x13 , 0x251 , 0x1250, 0x0 , 0x0 , 0x0 , 0x0 , 0x202 }}; // F3 0F 7F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movq", 0x7 , 0 , 0x13 , 0x351 , 0x1351, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7F + {"movdqa", 0xBA , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // 66 0F 7F. Link to movdqa and vmovdqa32 + {"vmovdqu", 0x19 ,0x864800, 0x13 , 0x209 , 0x1209, 0 , 0 , 0x20 , 0 , 0 ,0x1200 }, // E/MVEX F3 0F 7F + {"movdqu", 0xBB , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }}; // F3 0F 7F. Link to movdqu and vmovdqu32 // Tertiary opcode map for pshufw etc. Opcode byte = 0F 70 // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap4F[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pshufw", 0x7 , 0x0 , 0x52 , 0x1302, 0x302 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 70 - {"pshufd", 0x12 ,0x452100, 0x52 , 0x1203, 0x203 , 0x31 , 0x0 , 0x1000, 0x0 , 0x2 }, // 66 0F 70 - {"pshuflw", 0x12 , 0x50800, 0x52 , 0x1202, 0x202 , 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 70 - {"pshufhw", 0x12 , 0x50400, 0x52 , 0x1202, 0x202 , 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 70 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pshufw", 0x7 , 0 , 0x52 , 0x1302, 0x302 , 0x31 , 0 , 0 , 0 , 0 , 0 }, // 0F 70 + {"pshufd", 0x12 ,0xC52100, 0x52 , 0x1203, 0x203 , 0x31 , 0 , 0x21 , 0x1000, 0 , 0x2 }, // 66 0F 70 + {"pshuflw", 0x12 ,0x852800, 0x52 , 0x1202, 0x202 , 0x31 , 0 , 0x20 , 0 , 0 , 0x2 }, // F2 0F 70 + {"pshufhw", 0x12 ,0x852400, 0x52 , 0x1202, 0x202 , 0x31 , 0 , 0x20 , 0 , 0 , 0x2 }}; // F3 0F 70 // Tertiary opcode map for group 9. Opcode byte = 0F C7 // Indexed by reg bits = 0 - 7. SOpcodeDef OpcodeMap50[8] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0. Illegal - {0, 0x51 , 0x1010 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 1. Link to quarternary map: cmpxchg8b - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0xAC , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }, // 6. Link to quarternary map: vmptrld etc - {"vmptrst", 0x813 , 0x0 , 0x11 , 0x2351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0. Illegal + {0, 0x51 , 0x1010 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 1. Link to map: cmpxchg8b + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0xAC , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 6. Link to map: vmptrld etc + {0, 0xAF , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }}; // 7. Link to map: vmptrst, rdseed // Quarternary opcode map for cmpxchg8b. Opcode byte = 0F C7 /1 // Indexed by operand size: 16, 32, 64 SOpcodeDef OpcodeMap51[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cmpxchg8b", 0x5 , 0x1C50 , 0x11 , 0x2351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"cmpxchg8b", 0x5 , 0x1C50 , 0x11 , 0x2351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"cmpxchg16b",0x5 , 0x1C50 , 0x11 , 0x2450, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cmpxchg8b", 0x5 , 0x1C50 , 0x11 , 0x2351, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"cmpxchg8b", 0x5 , 0x1C50 , 0x11 , 0x2351, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {"cmpxchg16b",0x5 , 0x1C50 , 0x11 , 0x2450, 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // Quarternary opcode map for vmptrld etc. Opcode byte = 0F C7 /6 mem // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMap52[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vmptrld", 0x813 , 0x0 , 0x11 , 0x2351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F C7 /6 mem - {"vmclear", 0x813 , 0x200 , 0x11 , 0x2351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {0, 0x813 , 0x800 , 0x11 , 0x2351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"vmxon", 0x813 , 0x400 , 0x11 , 0x2351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vmptrld", 0x813 , 0 , 0x11 , 0x2351, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F C7 /6 mem + {"vmclear", 0x813 , 0x200 , 0x11 , 0x2351, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0x813 , 0x800 , 0x11 , 0x2351, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {"vmxon", 0x813 , 0x400 , 0x11 , 0x2351, 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // Quarternary opcode map for movdq2q etc. Opcode byte = 0F D6 // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMap53[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"movq", 0x6F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 66: Link to movq m64,xmm / movq xmm,xmm - {"movdq2q", 0x12 , 0x800 , 0x12 , 0x1351, 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 - {"movq2dq", 0x12 , 0x400 , 0x12 , 0x1450, 0x1351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {"movq", 0x6F , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }, // 66: Link to movq m64,xmm / movq xmm,xmm + {"movdq2q", 0x12 , 0x800 , 0x12 , 0x1351, 0x1450, 0 , 0 , 0 , 0 , 0 , 0 }, // F2 + {"movq2dq", 0x12 , 0x400 , 0x12 , 0x1450, 0x1351, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 // Quarternary opcode map for cvtpd2dq etc. Opcode byte = 0F E6 // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMap54[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {"cvttpd2dq", 0x12 , 0x50200, 0x12 , 0x1403, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 66 - {"cvtpd2dq", 0x12 , 0x50800, 0x12 , 0x1403, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 - {"cvtdq2pd", 0x12 ,0x450400, 0x12 , 0x124C, 0x203 , 0x0 , 0x0 , 0x1214, 0x0 , 0x2 }}; // F3 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {"cvttpd2dq", 0x12 ,0x852200, 0x12 , 0x1F03, 0x24C , 0 , 0 , 0x33 , 0 , 0 , 0x2 }, // 66 + {"cvtpd2dq", 0x12 ,0x852800, 0x12 , 0x1F03, 0x24C , 0 , 0 , 0x37 , 0 , 0 , 0x2 }, // F2 + {"cvtdq2pd", 0x12 ,0xC50400, 0x12 , 0x124C, 0xF03 , 0 , 0 , 0x31 , 0x1214, 0 , 0x2 }}; // F3 // Quarternary opcode map for movntq etc. Opcode byte = 0F E7 // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMap55[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movntq", 0x11 , 0x0 , 0x13 , 0x2351, 0x1351, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"movntdq", 0x12 , 0x50200, 0x13 , 0x2250, 0x1250, 0x0 , 0x0 , 0x0 , 0x0 , 0x102 }, // - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // Illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movntq", 0x11 , 0 , 0x13 , 0x2351, 0x1351, 0 , 0 , 0 , 0 , 0 , 0 }, // + {"movntdq", 0x12 ,0x850200, 0x13 , 0x2250, 0x1250, 0 , 0 , 0x00 , 0 , 0 , 0x102 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // Illegal // Quarternary opcode map for lddqu. Opcode byte = 0F F0 // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMap56[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // Illegal - {0, 0x0 , 0x200 , 0x12 , 0x1450, 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // - {"lddqu", 0x13 , 0x58800, 0x12 , 0x1250, 0x251, 0x0 , 0x0 , 0x0 , 0x0 , 0x202 }, // - {0, 0x0 , 0x400 , 0x12 , 0x1450, 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // Illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x12 , 0x1450, 0x1450, 0 , 0 , 0 , 0 , 0 , 0 }, // Illegal + {0, 0 , 0x200 , 0x12 , 0x1450, 0x1450, 0 , 0 , 0 , 0 , 0 , 0 }, // + {"lddqu", 0x13 , 0x58800, 0x12 , 0x1250, 0x251, 0 , 0 , 0 , 0 , 0 , 0x202 }, // + {0, 0 , 0x400 , 0x12 , 0x1450, 0x1450, 0 , 0 , 0 , 0 , 0 , 0 }}; // Illegal // Quarternary opcode map for maskmovq. Opcode byte = 0F F7 // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMap57[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"maskmovq", 0x7 , 0x5 , 0x12 , 0x1351, 0x1351, 0x0 , 0x0 , 0x0 , 0x0 , 0x20 }, // - {"maskmovdqu",0x12 , 0x18205, 0x12 , 0x1450, 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x22 }, // - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x2450, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // Illegal +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"maskmovq", 0x7 , 0x5 , 0x12 , 0x1351, 0x1351, 0 , 0 , 0 , 0 , 0 , 0x20 }, // + {"maskmovdqu",0x12 , 0x18205, 0x12 , 0x1450, 0x1450, 0 , 0 , 0 , 0 , 0 , 0x22 }, // + {0, 0 , 0 , 0x12 , 0x1450, 0x2450, 0 , 0 , 0 , 0 , 0 , 0 }}; // Illegal // Tertiary opcode map for movd/movq. Opcode byte = 0F 6E // Indexed by operand size 16/32/64 // First two lines are identical because operand size is determined only by REX.W prefix, // while 66 prefix determines mmx or xmm register +// Note: VEX/EVEX version is in map B1 SOpcodeDef OpcodeMap58[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movd", 0x7 , 0x11200, 0x12 , 0x1103, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 6E - {"movd", 0x7 , 0x11200, 0x12 , 0x1103, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 6E - {"movq;Name varies: movd",0x4000,0x11200,0x12,0x1104,0x4,0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 6E. Name varies: movd or movq, though the operand is 64 bits +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movd", 0x7 , 0x11200, 0x12 , 0x1103, 0x3 , 0 , 0 , 0x00 , 0 , 0 , 0x2 }, // 0F 6E + {"movd", 0x7 , 0x11200, 0x12 , 0x1103, 0x3 , 0 , 0 , 0x00 , 0 , 0 , 0x2 }, // 0F 6E + {"movq", 0x4000, 0x11200, 0x12 , 0x1104, 0x4 , 0 , 0 , 0x00 , 0 , 0 , 0x2 }}; // 0F 6E. Name varies: movd or movq, though the operand is 64 bits // Tertiary opcode map for movd/movq. Opcode byte = 0F 7E // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMap59[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x5A , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 0F 7E. Link to map 5A. Name depends on REX.W prefix - {0, 0x5A , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 , 0x0 }, // 66 0F 7E. Link to map 5A. Name depends on REX.W prefix - {0, 0x7 , 0x0 , 0x4013, 0x3 , 0x1103, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 7E. Doesn't exist - {0, 0x5B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x0 }}; // F3 0F 7E. Link to map 5B. movq xmm,xmm/m64 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x5A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 0F 7E. Link to map 5A. Name depends on REX.W prefix + {0, 0x5A , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 , 0 }, // 66 0F 7E. Link to map 5A. Name depends on REX.W prefix + {0, 0x7 , 0 , 0x4013, 0x3 , 0x1103, 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 7E. Doesn't exist + {0, 0x5B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }}; // F3 0F 7E. Link to map 5B. movq xmm,xmm/m64 // Quarternary opcode map for movd/movq. Opcode byte = 66 0F 7E // Indexed by operand size 16/32/64 // First two lines are identical because operand size is determined only by REX.W prefix, // while 66 prefix determines mmx or xmm register SOpcodeDef OpcodeMap5A[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movd", 0x7 , 0x11200, 0x13 , 0x3 , 0x1103, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 7E - {"movd", 0x7 , 0x11200, 0x13 , 0x3 , 0x1103, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 7E - {"movq;Name varies: movd",0x4000,0x11200,0x13,0x4,0x1104,0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 7E. Name varies: movd or movq, though the operand is 64 bits +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movd", 0x7 , 0x11200, 0x13 , 0x3 , 0x1103, 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 7E + {"movd", 0x7 , 0x11200, 0x13 , 0x3 , 0x1103, 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 7E + {"movq", 0x4000, 0x11200, 0x13 , 0x4 , 0x1104, 0x0 , 0 , 0 , 0 , 0 , 0x2 }}; // 0F 7E. Name varies: movd or movq, though the operand is 64 bits // Quarternary opcode map for movq xmm,xmm/m64. Opcode byte = F3 0F 7E // Indexed by memory vs. register operand +// Link to here from both map 59 (without VEX) and map E2 (with VEX) SOpcodeDef OpcodeMap5B[2] = { - {"movq", 0x12 , 0x10400, 0x12 , 0x1404, 0x4 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // F3 0F 7E. movq xmm,m64 - {"movq", 0x12 , 0x10400, 0x12 , 0x1404, 0x404 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 7E. movq xmm,xmm + {"movq", 0x12 ,0x812400, 0x12 , 0x1404, 0x4 , 0 , 0 , 0 , 0 , 0 , 0x2 }, // F3 0F 7E. movq xmm,m64 + {"movq", 0x12 ,0x812400, 0x12 , 0x1404, 0x404 , 0 , 0 , 0 , 0 , 0 , 0x2 }}; // F3 0F 7E. movq xmm,xmm // Tertiary opcode map for haddps/pd etc. Opcode byte = 0F 7C // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap5C[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x4012, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7C - {"haddpd", 0x13 , 0xD0A00, 0x19 , 0x124C, 0x124C, 0x24C , 0x0 , 0x0 , 0x0 , 0x2 }, // 66 0F 7C - {"haddps", 0x13 , 0xD0A00, 0x19 , 0x124B, 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 7C - {0, 0x0 , 0x0 , 0x4012, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 7C +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x4012, 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7C + {"haddpd", 0x13 , 0xD0A00, 0x19 , 0x124C, 0x124C, 0x24C , 0 , 0 , 0 , 0 , 0x2 }, // 66 0F 7C + {"haddps", 0x13 , 0xD0A00, 0x19 , 0x124B, 0x124B, 0x24B , 0 , 0 , 0 , 0 , 0x2 }, // F2 0F 7C + {0, 0 , 0 , 0x4012, 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 7C // Tertiary opcode map for hsubps/pd etc. Opcode byte = 0F 7D // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap5D[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x4012, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7D - {"hsubpd", 0x13 , 0xD0A00, 0x19 , 0x124C, 0x124C, 0x24C , 0x0 , 0x0 , 0x0 , 0x2 }, // 66 0F 7D - {"hsubps", 0x13 , 0xD0A00, 0x19 , 0x124B, 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 7D - {0, 0x0 , 0x0 , 0x4012, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 7D +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x4012, 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7D + {"hsubpd", 0x13 , 0xD0A00, 0x19 , 0x124C, 0x124C, 0x24C , 0 , 0 , 0 , 0 , 0x2 }, // 66 0F 7D + {"hsubps", 0x13 , 0xD0A00, 0x19 , 0x124B, 0x124B, 0x24B , 0 , 0 , 0 , 0 , 0x2 }, // F2 0F 7D + {0, 0 , 0 , 0x4012, 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 7D // Tertiary opcode map for lar. Opcode byte = 0F 02 // Indexed by memory vs. register operand SOpcodeDef OpcodeMap5E[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"lar", 0x802 , 0x1100 , 0x12 , 0x1009, 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 02 memory - {"lar", 0x802 , 0x1100 , 0x12 , 0x1009, 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 02 register +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"lar", 0x802 , 0x1100 , 0x12 , 0x1009, 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 02 memory + {"lar", 0x802 , 0x1100 , 0x12 , 0x1009, 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 02 register // Tertiary opcode map for lsl. Opcode byte = 0F 03 // Indexed by memory vs. register operand SOpcodeDef OpcodeMap5F[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"lsl", 0x802 , 0x1100 , 0x12 , 0x1009, 0x2002, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 03 memory - {"lsl", 0x802 , 0x1100 , 0x12 , 0x1009, 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 03 register +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"lsl", 0x802 , 0x1100 , 0x12 , 0x1009, 0x2002, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 03 memory + {"lsl", 0x802 , 0x1100 , 0x12 , 0x1009, 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 03 register // Tertiary opcode map for popcnt. Opcode byte = 0F B8 // Indexed by prefixes (none, 66, F2, F3) SOpcodeDef OpcodeMap60[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"jmpe;Itanium only",0,0 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F B8 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F B8 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F B8 - {"popcnt", 0x16 ,0x11500 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F B8 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"jmpe;Itanium only",0,0 , 0x11 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F B8 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F B8 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F B8 + {"popcnt", 0x16 ,0x11500 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F B8 // Quarternary opcode map for pextrb. Opcode byte = 0F 3A 14 // Indexed by memory vs. register operand SOpcodeDef OpcodeMap61[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pextrb", 0x15 , 0x18200, 0x53 , 0x2001, 0x1401, 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 3A 14 memory - {"pextrb", 0x15 , 0x19200, 0x53 , 0x1009, 0x1401, 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 3A 14 register +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pextrb", 0x15 ,0x81A200, 0x53 , 0x2001, 0x1401, 0x31 , 0 , 0x1000, 0 , 0 , 0x2 }, // 0F 3A 14 memory + {"pextrb", 0x15 ,0x81A200, 0x53 , 0x1009, 0x1401, 0x31 , 0 , 0 , 0 , 0 , 0x2 }}; // 0F 3A 14 register // Quarternary opcode map for pextrw. Opcode byte = 0F 3A 15 // Indexed by memory vs. register operand SOpcodeDef OpcodeMap62[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pextrw", 0x15 , 0x19200, 0x53 , 0x2001, 0x1402, 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 3A 15 memory - {"pextrw", 0x15 , 0x19200, 0x53 , 0x1009, 0x1402, 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 3A 15 register +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pextrw", 0x15 ,0x81A200, 0x53 , 0x2002, 0x1402, 0x31 , 0 , 0x1000, 0 , 0 , 0x2 }, // 0F 3A 15 memory + {"pextrw", 0x15 ,0x81A200, 0x53 , 0x1002, 0x1402, 0x31 , 0 , 0 , 0 , 0 , 0x2 }}; // 0F 3A 15 register // Quarternary opcode map for pextrd/q. Opcode byte = 0F 3A 16 // Indexed by operand size (16, 32, 64) SOpcodeDef OpcodeMap63[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pextrd", 0x15 , 0x18200, 0x53 , 0x3 , 0x1403, 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 3A 16 pextrd - {"pextrd", 0x15 , 0x18200, 0x53 , 0x3 , 0x1403, 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 3A 16 pextrd - {"pextrq", 0x15 , 0x19200, 0x53 , 0x4 , 0x1404, 0x31 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 3A 16 pextrq - +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pextr", 0x15 ,0x81B200, 0x53 , 0x3 , 0x1403, 0x31 , 0 , 0x1000, 0 , 0 , 3 }, // 0F 3A 16 pextrd + {"pextr", 0x15 ,0x81B200, 0x53 , 0x3 , 0x1403, 0x31 , 0 , 0x1000, 0 , 0 , 3 }, // 0F 3A 16 pextrd + {"pextr", 0x15 ,0x81B200, 0x53 , 0x4 , 0x1404, 0x31 , 0 , 0x1000, 0 , 0 , 3 }}; // 0F 3A 16 pextrq // Opcode map for AMD instructions with XOP prefix and mmmmm = 01000 // Indexed by first opcode byte after XOP prefix. Has one byte immediate data SOpcodeDef OpcodeMap64[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 00 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 01 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 02 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 03 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 04 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 05 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 06 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 07 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 08 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 09 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 0A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 0B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 0C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 0D - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 0E - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 0F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 10 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 11 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 12 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 13 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 14 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 15 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 16 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 17 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 18 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 19 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 1A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 1B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 1C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 1D - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 1E - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 1F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 20 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 21 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 22 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 23 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 24 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 25 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 26 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 27 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 28 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 29 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 2A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 2B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 2C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 2D - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 2E - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 2F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 30 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 31 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 32 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 33 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 34 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 35 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 36 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 37 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 38 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 39 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 3A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 3B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 3C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 3D - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 3E - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 3F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 40 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 41 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 42 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 43 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 44 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 45 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 46 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 47 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 48 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 49 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 4A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 4B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 4C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 4D - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 4E - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 4F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 50 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 51 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 52 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 53 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 54 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 55 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 56 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 57 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 58 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 59 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 5A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 5B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 5C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 5D - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 5E - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 5F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 60 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 61 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 62 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 63 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 64 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 65 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 66 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 67 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 68 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 69 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 6A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 6B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 6C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 6D - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 6E - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 6F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 70 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 71 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 72 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 73 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 74 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 75 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 76 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 77 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 78 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 79 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 7A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 7B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 7C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 7D - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 7E - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 7F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 80 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 81 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 82 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 83 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 84 - {"vpmacssww", 0x1005, 0xB0000, 0x5C, 0x1202, 0x1202, 0x202 , 0x1202, 0x0 , 0x0 , 0x0 }, // XOP(8) 85 - {"vpmacsswd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1202, 0x202 , 0x1203, 0x0 , 0x0 , 0x0 }, // XOP(8) 86 - {"vpmacssdql",0x1005, 0xB0000, 0x5C, 0x1204, 0x1203, 0x203 , 0x1204, 0x0 , 0x0 , 0x0 }, // XOP(8) 87 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 88 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 89 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 8A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 8B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 8C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 8D - {"vpmacssdd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1203, 0x203 , 0x1203, 0x0 , 0x0 , 0x0 }, // XOP(8) 8E - {"vpmacssdqh",0x1005, 0xB0000, 0x5C, 0x1204, 0x1203, 0x203 , 0x1204, 0x0 , 0x0 , 0x0 }, // XOP(8) 8F - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 90 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 91 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 92 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 93 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 94 - {"vpmacsww", 0x1005, 0xB0000, 0x5C, 0x1202, 0x1202, 0x202 , 0x1202, 0x0 , 0x0 , 0x0 }, // XOP(8) 95 - {"vpmacswd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1202, 0x202 , 0x1203, 0x0 , 0x0 , 0x0 }, // XOP(8) 96 - {"vpmacsdql", 0x1005, 0xB0000, 0x5C, 0x1204, 0x1203, 0x203 , 0x1204, 0x0 , 0x0 , 0x0 }, // XOP(8) 97 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 98 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 99 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 9A - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 9B - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 9C - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) 9D - {"vpmacsdd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1203, 0x203 , 0x1203, 0x0 , 0x0 , 0x0 }, // XOP(8) 9E - {"vpmacsdqh", 0x1005, 0xB0000, 0x5C, 0x1204, 0x1203, 0x203 , 0x1204, 0x0 , 0x0 , 0x0 }, // XOP(8) 9F - -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"cvtph2ps", 0x1007, 0x70000, 0x52 , 0x124B, 0x402 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) A0 - {"cvtps2ph", 0x1007, 0x70000, 0x53 , 0x402, 0x124B, 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) A1 - {"vpcmov", 0x1005, 0xF5000, 0x5C, 0x1201, 0x1201, 0x201 , 0x201 , 0x0 , 0x0 , 0x0 }, // XOP(8) A2 - {"vpperm", 0x1005, 0xB5000, 0x5C, 0x1201, 0x1201, 0x201 , 0x201 , 0x0 , 0x0 , 0x0 }, // XOP(8) A3 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) A4 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) A5 - {"vpmadcsswd",0x1005, 0xB0000, 0x5C, 0x1203, 0x1202, 0x202 , 0x1203, 0x0 , 0x0 , 0x0 }, // XOP(8) A6 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) A7 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) A8 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) A9 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) AA - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) AB - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) AC - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) AD - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) AE - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) AF - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B0 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B1 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B2 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B3 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B4 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B5 - {"vpmadcswd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1202, 0x202 , 0x1203, 0x0 , 0x0 , 0x0 }, // XOP(8) B6 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B7 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B8 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) B9 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) BA - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) BB - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) BC - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) BD - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) BE - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) BF - - {"vprotb", 0x1005, 0x30000, 0x52 , 0x1401, 0x401 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C0 - {"vprotw", 0x1005, 0x30000, 0x52 , 0x1402, 0x402 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C1 - {"vprotd", 0x1005, 0x30000, 0x52 , 0x1403, 0x403 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C2 - {"vprotq", 0x1005, 0x30000, 0x52 , 0x1404, 0x404 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C3 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C4 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C5 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C6 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C7 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C8 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) C9 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) CA - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) CB - {"vpcomb", 0x1005, 0xB0000, 0x59 , 0x1401, 0x1401, 0x401 , 0x31 , 0x0 , 0x0 , 0x0 }, // XOP(8) CC - {"vpcomw", 0x1005, 0xB0000, 0x59 , 0x1402, 0x1402, 0x402 , 0x31 , 0x0 , 0x0 , 0x0 }, // XOP(8) CD - {"vpcomd", 0x1005, 0xB0000, 0x59 , 0x1403, 0x1403, 0x403 , 0x31 , 0x0 , 0x0 , 0x0 }, // XOP(8) CE - {"vpcomq", 0x1005, 0xB0000, 0x59 , 0x1404, 0x1404, 0x404 , 0x31 , 0x0 , 0x0 , 0x0 }, // XOP(8) CF - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D0 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D1 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D2 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D3 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D4 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D5 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D6 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D7 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D8 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) D9 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) DA - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) DB - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) DC - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) DD - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) DE - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) DF - - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E0 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E1 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E2 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E3 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E4 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E5 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E6 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E7 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E8 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) E9 - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) EA - {0, 0x0 , 0x0 , 0x2059, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(8) EB - {"vpcomub", 0x1005, 0xB0000, 0x59 , 0x1401, 0x1401, 0x401 , 0x31 , 0x0 , 0x0 , 0x0 }, // XOP(8) EC - {"vpcomuw", 0x1005, 0xB0000, 0x59 , 0x1402, 0x1402, 0x402 , 0x31 , 0x0 , 0x0 , 0x0 }, // XOP(8) ED - {"vpcomud", 0x1005, 0xB0000, 0x59 , 0x1403, 0x1403, 0x403 , 0x31 , 0x0 , 0x0 , 0x0 }, // XOP(8) EE - {"vpcomuq", 0x1005, 0xB0000, 0x59 , 0x1404, 0x1404, 0x404 , 0x31 , 0x0 , 0x0 , 0x0 }}; // XOP(8) EF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 00 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 01 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 02 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 03 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 04 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 05 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 06 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 07 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 08 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 09 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 0A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 0B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 0C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 0D + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 0E + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 0F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 10 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 11 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 12 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 13 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 14 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 15 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 16 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 17 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 18 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 19 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 1A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 1B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 1C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 1D + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 1E + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 1F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 20 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 21 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 22 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 23 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 24 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 25 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 26 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 27 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 28 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 29 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 2A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 2B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 2C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 2D + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 2E + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 2F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 30 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 31 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 32 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 33 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 34 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 35 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 36 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 37 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 38 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 39 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 3A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 3B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 3C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 3D + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 3E + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 3F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 40 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 41 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 42 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 43 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 44 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 45 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 46 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 47 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 48 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 49 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 4A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 4B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 4C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 4D + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 4E + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 4F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 50 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 51 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 52 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 53 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 54 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 55 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 56 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 57 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 58 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 59 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 5A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 5B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 5C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 5D + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 5E + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 5F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 60 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 61 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 62 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 63 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 64 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 65 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 66 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 67 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 68 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 69 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 6A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 6B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 6C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 6D + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 6E + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 6F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 70 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 71 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 72 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 73 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 74 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 75 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 76 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 77 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 78 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 79 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 7A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 7B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 7C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 7D + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 7E + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 7F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 80 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 81 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 82 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 83 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 84 + {"vpmacssww", 0x1005, 0xB0000, 0x5C, 0x1202, 0x1202, 0x202 , 0x1202, 0 , 0 , 0 , 0 }, // XOP(8) 85 + {"vpmacsswd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1202, 0x202 , 0x1203, 0 , 0 , 0 , 0 }, // XOP(8) 86 + {"vpmacssdql",0x1005, 0xB0000, 0x5C, 0x1204, 0x1203, 0x203 , 0x1204, 0 , 0 , 0 , 0 }, // XOP(8) 87 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 88 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 89 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 8A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 8B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 8C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 8D + {"vpmacssdd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1203, 0x203 , 0x1203, 0 , 0 , 0 , 0 }, // XOP(8) 8E + {"vpmacssdqh",0x1005, 0xB0000, 0x5C, 0x1204, 0x1203, 0x203 , 0x1204, 0 , 0 , 0 , 0 }, // XOP(8) 8F + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 90 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 91 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 92 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 93 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 94 + {"vpmacsww", 0x1005, 0xB0000, 0x5C, 0x1202, 0x1202, 0x202 , 0x1202, 0 , 0 , 0 , 0 }, // XOP(8) 95 + {"vpmacswd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1202, 0x202 , 0x1203, 0 , 0 , 0 , 0 }, // XOP(8) 96 + {"vpmacsdql", 0x1005, 0xB0000, 0x5C, 0x1204, 0x1203, 0x203 , 0x1204, 0 , 0 , 0 , 0 }, // XOP(8) 97 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 98 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 99 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 9A + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 9B + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 9C + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) 9D + {"vpmacsdd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1203, 0x203 , 0x1203, 0 , 0 , 0 , 0 }, // XOP(8) 9E + {"vpmacsdqh", 0x1005, 0xB0000, 0x5C, 0x1204, 0x1203, 0x203 , 0x1204, 0 , 0 , 0 , 0 }, // XOP(8) 9F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cvtph2ps", 0x1D , 0x70000, 0x52 , 0x124B, 0x402 , 0x31 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) A0 + {"cvtps2ph", 0x1D , 0x70000, 0x53 , 0x402, 0x124B, 0x31 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) A1 + {"vpcmov", 0x1005, 0xF7000, 0x5C, 0x1201, 0x1201, 0x201 , 0x201 , 0 , 0 , 0 , 0 }, // XOP(8) A2 + {"vpperm", 0x1005, 0xB7000, 0x5C, 0x1201, 0x1201, 0x201 , 0x201 , 0 , 0 , 0 , 0 }, // XOP(8) A3 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) A4 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) A5 + {"vpmadcsswd",0x1005, 0xB0000, 0x5C, 0x1203, 0x1202, 0x202 , 0x1203, 0 , 0 , 0 , 0 }, // XOP(8) A6 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) A7 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) A8 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) A9 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) AA + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) AB + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) AC + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) AD + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) AE + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) AF + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B0 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B1 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B2 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B3 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B4 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B5 + {"vpmadcswd", 0x1005, 0xB0000, 0x5C, 0x1203, 0x1202, 0x202 , 0x1203, 0 , 0 , 0 , 0 }, // XOP(8) B6 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B7 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B8 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) B9 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) BA + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) BB + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) BC + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) BD + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) BE + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) BF + + {"vprotb", 0x1005, 0x30000, 0x52 , 0x1401, 0x401 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C0 + {"vprotw", 0x1005, 0x30000, 0x52 , 0x1402, 0x402 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C1 + {"vprotd", 0x1005, 0x30000, 0x52 , 0x1403, 0x403 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C2 + {"vprotq", 0x1005, 0x30000, 0x52 , 0x1404, 0x404 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C3 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C4 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C5 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C6 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C7 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C8 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) C9 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) CA + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) CB + {"vpcomb", 0x1005, 0xB0000, 0x59 , 0x1401, 0x1401, 0x401 , 0x31 , 0 , 0 , 0 , 0 }, // XOP(8) CC + {"vpcomw", 0x1005, 0xB0000, 0x59 , 0x1402, 0x1402, 0x402 , 0x31 , 0 , 0 , 0 , 0 }, // XOP(8) CD + {"vpcomd", 0x1005, 0xB0000, 0x59 , 0x1403, 0x1403, 0x403 , 0x31 , 0 , 0 , 0 , 0 }, // XOP(8) CE + {"vpcomq", 0x1005, 0xB0000, 0x59 , 0x1404, 0x1404, 0x404 , 0x31 , 0 , 0 , 0 , 0 }, // XOP(8) CF + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D0 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D1 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D2 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D3 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D4 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D5 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D6 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D7 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D8 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) D9 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) DA + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) DB + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) DC + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) DD + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) DE + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) DF + + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E0 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E1 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E2 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E3 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E4 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E5 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E6 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E7 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E8 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) E9 + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) EA + {0, 0 , 0 , 0x2059, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(8) EB + {"vpcomub", 0x1005, 0xB0000, 0x59 , 0x1401, 0x1401, 0x401 , 0x31 , 0 , 0 , 0 , 0 }, // XOP(8) EC + {"vpcomuw", 0x1005, 0xB0000, 0x59 , 0x1402, 0x1402, 0x402 , 0x31 , 0 , 0 , 0 , 0 }, // XOP(8) ED + {"vpcomud", 0x1005, 0xB0000, 0x59 , 0x1403, 0x1403, 0x403 , 0x31 , 0 , 0 , 0 , 0 }, // XOP(8) EE + {"vpcomuq", 0x1005, 0xB0000, 0x59 , 0x1404, 0x1404, 0x404 , 0x31 , 0 , 0 , 0 , 0 }}; // XOP(8) EF // Opcode map for AMD instructions with XOP prefix and mmmmm = 01001 // Indexed by first opcode byte after XOP prefix. Has no immediate data SOpcodeDef OpcodeMap65[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 00 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 01 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 02 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 03 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 04 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 05 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 06 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 07 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 08 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 09 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 0A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 0B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 0C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 0D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 0E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 0F - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 10 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 11 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 12 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 13 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 14 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 15 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 16 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 17 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 18 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 19 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 1A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 1B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 1C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 1D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 1E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 1F - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 20 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 21 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 22 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 23 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 24 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 25 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 26 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 27 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 28 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 29 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 2A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 2B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 2C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 2D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 2E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 2F - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 30 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 31 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 32 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 33 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 34 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 35 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 36 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 37 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 38 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 39 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 3A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 3B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 3C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 3D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 3E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 3F - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 40 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 41 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 42 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 43 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 44 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 45 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 46 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 47 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 48 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 49 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 4A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 4B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 4C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 4D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 4E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 4F - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 50 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 51 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 52 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 53 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 54 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 55 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 56 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 57 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 58 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 59 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 5A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 5B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 5C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 5D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 5E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 5F - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 60 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 61 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 62 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 63 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 64 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 65 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 66 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 67 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 68 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 69 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 6A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 6B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 6C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 6D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 6E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 6F - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 70 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 71 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 72 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 73 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 74 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 75 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 76 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 77 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 78 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 79 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 7A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 7B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 7C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 7D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 7E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 7F - -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"frczps", 0x11005,0x70000, 0x12 , 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 80 - {"frczpd", 0x11005,0x70000, 0x12 , 0x124C, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 81 - {"frczss", 0x11005,0x70000, 0x12 , 0x124B, 0x4B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 82 - {"frczsd", 0x11005,0x70000, 0x12 , 0x124C, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 83 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 84 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 85 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 86 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 87 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 88 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 89 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 8A - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 8B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 8C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 8D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 8E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 8F - -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vprotb", 0x1005, 0xB5000, 0x19 , 0x1401, 0x401 , 0x401 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 90 - {"vprotw", 0x1005, 0xB5000, 0x19 , 0x1402, 0x402 , 0x402 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 91 - {"vprotd", 0x1005, 0xB5000, 0x19 , 0x1403, 0x403 , 0x403 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 92 - {"vprotq", 0x1005, 0xB5000, 0x19 , 0x1404, 0x404 , 0x404 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 93 - {"vpshlb", 0x1005, 0xB5000, 0x19 , 0x1401, 0x401 , 0x401 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 94 - {"vpshlw", 0x1005, 0xB5000, 0x19 , 0x1402, 0x402 , 0x402 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 95 - {"vpshld", 0x1005, 0xB5000, 0x19 , 0x1403, 0x403 , 0x403 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 96 - {"vpshlq", 0x1005, 0xB5000, 0x19 , 0x1404, 0x404 , 0x404 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 97 - {"vpshab", 0x1005, 0xB5000, 0x19 , 0x1401, 0x401 , 0x401 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 98 - {"vpshaw", 0x1005, 0xB5000, 0x19 , 0x1402, 0x402 , 0x402 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 99 - {"vpshad", 0x1005, 0xB5000, 0x19 , 0x1403, 0x403 , 0x403 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 9A - {"vpshaq", 0x1005, 0xB5000, 0x19 , 0x1404, 0x404 , 0x404 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 9B - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 9C - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 9D - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 9E - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) 9F - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A0 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A1 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A2 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A3 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A4 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A5 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A6 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A7 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A8 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) A9 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) AA - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) AB - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) AC - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) AD - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) AE - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) AF - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B0 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B1 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B2 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B3 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B4 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B5 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B6 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B7 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B8 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) B9 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) BA - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) BB - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) BC - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) BD - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) BE - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) BF - -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C0 - {"vphaddbw", 0x1005, 0x30000, 0x12 , 0x1402, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C1 - {"vphaddbd", 0x1005, 0x30000, 0x12 , 0x1403, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C2 - {"vphaddbq", 0x1005, 0x30000, 0x12 , 0x1404, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C3 - {0, 0x0 , 0x0 , 0x2019, 0x0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C4 - {0, 0x0 , 0x0 , 0x2019, 0x0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C5 - {"vphaddwd", 0x1005, 0x30000, 0x12 , 0x1403, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C6 - {"vphaddwq", 0x1005, 0x30000, 0x12 , 0x1404, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C7 - {0, 0x0 , 0x0 , 0x2019, 0x0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C8 - {0, 0x0 , 0x0 , 0x2019, 0x0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) C9 - {0, 0x0 , 0x0 , 0x2019, 0x0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) CA - {"vphadddq", 0x1005, 0x30000, 0x12 , 0x1404, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) CB - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) CC - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) CD - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) CE - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) CF - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D0 - {"vphaddubw", 0x1005, 0x30000, 0x12 , 0x1402, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D1 - {"vphaddubd", 0x1005, 0x30000, 0x12 , 0x1403, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D2 - {"vphaddubq", 0x1005, 0x30000, 0x12 , 0x1404, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D3 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D3 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D4 - {"vphadduwd", 0x1005, 0x30000, 0x12 , 0x1403, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D6 - {"vphadduwq", 0x1005, 0x30000, 0x12 , 0x1404, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D7 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D7 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D8 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) D9 - {"vphaddudq", 0x1005, 0x30000, 0x12 , 0x1404, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) DB - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) DC - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) DD - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) DE - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) DF - - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E0 - {"vphsubbw", 0x1005, 0x30000, 0x12 , 0x1402, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E1 - {"vphsubwd", 0x1005, 0x30000, 0x12 , 0x1403, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E2 - {"vphsubdq", 0x1005, 0x30000, 0x12 , 0x1404, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E3 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E4 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E5 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E6 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E7 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E8 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) E9 - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) EA - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) EB - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) EC - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) ED - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // XOP(9) EE - {0, 0x0 , 0x0 , 0x2019, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // XOP(9) EF +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 00 + {0, 0xD4 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // XOP(9) 01. Link blcfill etc. + {0, 0xD5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // XOP(9) 02. Link blcmsk etc. + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 03 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 04 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 05 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 06 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 07 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 08 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 09 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 0A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 0B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 0C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 0D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 0E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 0F + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 10 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 11 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 12 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 13 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 14 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 15 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 16 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 17 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 18 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 19 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 1A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 1B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 1C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 1D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 1E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 1F + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 20 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 21 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 22 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 23 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 24 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 25 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 26 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 27 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 28 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 29 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 2A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 2B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 2C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 2D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 2E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 2F + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 30 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 31 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 32 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 33 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 34 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 35 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 36 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 37 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 38 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 39 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 3A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 3B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 3C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 3D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 3E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 3F + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 40 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 41 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 42 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 43 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 44 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 45 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 46 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 47 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 48 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 49 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 4A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 4B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 4C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 4D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 4E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 4F + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 50 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 51 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 52 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 53 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 54 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 55 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 56 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 57 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 58 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 59 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 5A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 5B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 5C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 5D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 5E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 5F + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 60 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 61 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 62 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 63 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 64 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 65 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 66 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 67 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 68 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 69 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 6A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 6B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 6C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 6D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 6E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 6F + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 70 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 71 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 72 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 73 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 74 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 75 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 76 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 77 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 78 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 79 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 7A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 7B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 7C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 7D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 7E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 7F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"frczps", 0x11005,0x70000, 0x12 , 0x124B, 0x24B , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 80 + {"frczpd", 0x11005,0x70000, 0x12 , 0x124C, 0x24C , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 81 + {"frczss", 0x11005,0x70000, 0x12 , 0x124B, 0x4B , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 82 + {"frczsd", 0x11005,0x70000, 0x12 , 0x124C, 0x4C , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 83 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 84 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 85 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 86 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 87 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 88 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 89 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 8A + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 8B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 8C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 8D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 8E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 8F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vprotb", 0x1005, 0xB7000, 0x19 , 0x1401, 0x401 , 0x401 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 90 + {"vprotw", 0x1005, 0xB7000, 0x19 , 0x1402, 0x402 , 0x402 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 91 + {"vprotd", 0x1005, 0xB7000, 0x19 , 0x1403, 0x403 , 0x403 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 92 + {"vprotq", 0x1005, 0xB7000, 0x19 , 0x1404, 0x404 , 0x404 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 93 + {"vpshlb", 0x1005, 0xB7000, 0x19 , 0x1401, 0x401 , 0x401 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 94 + {"vpshlw", 0x1005, 0xB7000, 0x19 , 0x1402, 0x402 , 0x402 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 95 + {"vpshld", 0x1005, 0xB7000, 0x19 , 0x1403, 0x403 , 0x403 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 96 + {"vpshlq", 0x1005, 0xB7000, 0x19 , 0x1404, 0x404 , 0x404 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 97 + {"vpshab", 0x1005, 0xB7000, 0x19 , 0x1401, 0x401 , 0x401 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 98 + {"vpshaw", 0x1005, 0xB7000, 0x19 , 0x1402, 0x402 , 0x402 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 99 + {"vpshad", 0x1005, 0xB7000, 0x19 , 0x1403, 0x403 , 0x403 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 9A + {"vpshaq", 0x1005, 0xB7000, 0x19 , 0x1404, 0x404 , 0x404 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 9B + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 9C + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 9D + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 9E + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 9F + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A0 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A1 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A2 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A3 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A4 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A5 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A6 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A7 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A8 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) A9 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) AA + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) AB + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) AC + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) AD + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) AE + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) AF + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B0 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B1 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B2 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B3 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B4 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B5 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B6 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B7 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B8 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) B9 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) BA + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) BB + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) BC + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) BD + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) BE + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) BF + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C0 + {"vphaddbw", 0x1005, 0x30000, 0x12 , 0x1402, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C1 + {"vphaddbd", 0x1005, 0x30000, 0x12 , 0x1403, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C2 + {"vphaddbq", 0x1005, 0x30000, 0x12 , 0x1404, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C3 + {0, 0 , 0 , 0x2019, 0x0, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C4 + {0, 0 , 0 , 0x2019, 0x0, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C5 + {"vphaddwd", 0x1005, 0x30000, 0x12 , 0x1403, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C6 + {"vphaddwq", 0x1005, 0x30000, 0x12 , 0x1404, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C7 + {0, 0 , 0 , 0x2019, 0x0, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C8 + {0, 0 , 0 , 0x2019, 0x0, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) C9 + {0, 0 , 0 , 0x2019, 0x0, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) CA + {"vphadddq", 0x1005, 0x30000, 0x12 , 0x1404, 0x403 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) CB + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) CC + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) CD + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) CE + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) CF + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D0 + {"vphaddubw", 0x1005, 0x30000, 0x12 , 0x1402, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D1 + {"vphaddubd", 0x1005, 0x30000, 0x12 , 0x1403, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D2 + {"vphaddubq", 0x1005, 0x30000, 0x12 , 0x1404, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D3 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D3 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D4 + {"vphadduwd", 0x1005, 0x30000, 0x12 , 0x1403, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D6 + {"vphadduwq", 0x1005, 0x30000, 0x12 , 0x1404, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D7 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D7 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D8 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) D9 + {"vphaddudq", 0x1005, 0x30000, 0x12 , 0x1404, 0x403 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) DB + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) DC + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) DD + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) DE + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) DF + + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E0 + {"vphsubbw", 0x1005, 0x30000, 0x12 , 0x1402, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E1 + {"vphsubwd", 0x1005, 0x30000, 0x12 , 0x1403, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E2 + {"vphsubdq", 0x1005, 0x30000, 0x12 , 0x1404, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E3 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E4 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E5 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E6 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E7 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E8 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) E9 + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) EA + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) EB + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) EC + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) ED + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) EE + {0, 0 , 0 , 0x2019, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // XOP(9) EF + +// Opcode map for AMD instructions with XOP prefix and mmmmm = 01010 +// Indexed by first opcode byte after XOP prefix. Has 4 bytes immediate data +SOpcodeDef OpcodeMap66[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 00 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 01 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 02 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 03 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 04 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 05 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 06 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 07 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 08 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 09 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 0A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 0B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 0C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 0D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 0E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 0F + + {"bextr", 0x1007, 0x11000, 0x92 , 0x1009, 0x9 , 0x33 , 0 , 0 , 0 , 0 , 0 }, // XOP(0xA) 10 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // XOP(0xA) 11 + + +// Opcode map for AMD instructions with XOP prefix and mmmmm = 01011 or whatever (vacant) +// Indexed by first opcode byte after XOP prefix. +SOpcodeDef OpcodeMap67[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // XOP(0xB) 00 // Tertiary opcode map for 3-byte opcode. First two bytes = 0F 24 @@ -3001,1581 +3005,2760 @@ SOpcodeDef OpcodeMap65[] = { // These proposed codes have never been implemented. // Specifications have been changed for the sake of compatibility with Intel AVX coding scheme // ***************************************************** -SOpcodeDef OpcodeMap66[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"fmaddps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 00 - {"fmaddpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 01 - {"fmaddss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0x0 , 0x0 , 0x0 }, // 0F 24 02 - {"fmaddsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0x0 , 0x0 , 0x0 }, // 0F 24 03 - {"fmaddps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 04 - {"fmaddpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 05 - {"fmaddss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0x0 , 0x0 , 0x0 }, // 0F 24 06 - {"fmaddsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0x0 , 0x0 , 0x0 }, // 0F 24 07 - {"fmsubps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 08 - {"fmsubpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 09 - {"fmsubss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0x0 , 0x0 , 0x0 }, // 0F 24 0A - {"fmsubsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0x0 , 0x0 , 0x0 }, // 0F 24 0B - {"fmsubps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 0C - {"fmsubpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 0D - {"fmsubss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0x0 , 0x0 , 0x0 }, // 0F 24 0E - {"fmsubsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0x0 , 0x0 , 0x0 }, // 0F 24 0F - - {"fnmaddps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 10 - {"fnmaddpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 11 - {"fnmaddss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0x0 , 0x0 , 0x0 }, // 0F 24 12 - {"fnmaddsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0x0 , 0x0 , 0x0 }, // 0F 24 13 - {"fnmaddps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 14 - {"fnmaddpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 15 - {"fnmaddss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0x0 , 0x0 , 0x0 }, // 0F 24 16 - {"fnmaddsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0x0 , 0x0 , 0x0 }, // 0F 24 17 - {"fnmsubps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 18 - {"fnmsubpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 19 - {"fnmsubss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0x0 , 0x0 , 0x0 }, // 0F 24 1A - {"fnmsubsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0x0 , 0x0 , 0x0 }, // 0F 24 1B - {"fnmsubps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 1C - {"fnmsubpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 1D - {"fnmsubss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0x0 , 0x0 , 0x0 }, // 0F 24 1E - {"fnmsubsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0x0 , 0x0 , 0x0 }, // 0F 24 1F - - {"permps", 0x21005,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 20 - {"permpd", 0x21005,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 21 - {"pcmov", 0x21005,0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 22 - {"pperm", 0x21005,0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 23 - {"permps", 0x21005,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0x0 , 0x0 , 0x0 }, // 0F 24 24 - {"permpd", 0x21005,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0x0 , 0x0 , 0x0 }, // 0F 24 25 - {"pcmov", 0x21005,0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 26 - {"pperm", 0x21005,0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 27 - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 28 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 29 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 2A - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 2B - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 2C - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 2D - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 2E - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 2F - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 30 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 31 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 32 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 33 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 34 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 35 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 36 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 37 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 38 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 39 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 3A - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 3B - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 3C - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 3D - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 3E - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 3F - - {"protb", 0x21005,0x0 , 0x14 , 0x1401, 0x401 , 0x401 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 40 - {"protw", 0x21005,0x0 , 0x14 , 0x1402, 0x402 , 0x402 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 41 - {"protd", 0x21005,0x0 , 0x14 , 0x1403, 0x403 , 0x403 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 42 - {"protq", 0x21005,0x0 , 0x14 , 0x1404, 0x404 , 0x404 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 43 - {"pshlb", 0x21005,0x0 , 0x14 , 0x1401, 0x401 , 0x401 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 44 - {"pshlw", 0x21005,0x0 , 0x14 , 0x1402, 0x402 , 0x402 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 45 - {"pshld", 0x21005,0x0 , 0x14 , 0x1403, 0x403 , 0x403 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 46 - {"pshlq", 0x21005,0x0 , 0x14 , 0x1404, 0x404 , 0x404 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 47 - {"pshab", 0x21005,0x0 , 0x14 , 0x1401, 0x401 , 0x401 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 48 - {"pshaw", 0x21005,0x0 , 0x14 , 0x1402, 0x402 , 0x402 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 49 - {"pshad", 0x21005,0x0 , 0x14 , 0x1403, 0x403 , 0x403 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 4A - {"pshaq", 0x21005,0x0 , 0x14 , 0x1404, 0x404 , 0x404 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 24 4B - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 4C - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 4D - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 4E - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 4F - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 50 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 51 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 52 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 53 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 54 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 55 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 56 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 57 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 58 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 59 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 5A - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 5B - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 5C - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 5D - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 5E - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 5F - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 60 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 61 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 62 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 63 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 64 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 65 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 66 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 67 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 68 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 69 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 6A - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 6B - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 6C - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 6D - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 6E - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 6F - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 70 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 71 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 72 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 73 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 74 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 75 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 76 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 77 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 78 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 79 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 7A - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 7B - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 7C - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 7D - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 7E - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 7F - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 80 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 81 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 82 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 83 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 84 - {"pmacssww", 0x21005,0x0 , 0x15 , 0x1402, 0x402 , 0x402 , 0x402 , 0x0 , 0x0 , 0x0 }, // 0F 24 85 - {"pmacsswd", 0x21005,0x0 , 0x15 , 0x1403, 0x402 , 0x402 , 0x402 , 0x0 , 0x0 , 0x0 }, // 0F 24 86 - {"pmacssdql", 0x21005,0x0 , 0x15 , 0x1404, 0x403 , 0x403 , 0x403 , 0x0 , 0x0 , 0x0 }, // 0F 24 87 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 88 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 89 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 8A - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 8B - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 8C - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 8D - {"pmacssdd", 0x21005,0x0 , 0x15 , 0x1403, 0x403 , 0x403 , 0x403 , 0x0 , 0x0 , 0x0 }, // 0F 24 8E - {"pmacssdqh", 0x21005,0x0 , 0x15 , 0x1404, 0x403 , 0x403 , 0x403 , 0x0 , 0x0 , 0x0 }, // 0F 24 8F - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 90 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 91 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 92 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 93 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 94 - {"pmacsww", 0x21005,0x0 , 0x15 , 0x1402, 0x402 , 0x402 , 0x402 , 0x0 , 0x0 , 0x0 }, // 0F 24 95 - {"pmacswd", 0x21005,0x0 , 0x15 , 0x1403, 0x402 , 0x402 , 0x402 , 0x0 , 0x0 , 0x0 }, // 0F 24 96 - {"pmacsdql", 0x21005,0x0 , 0x15 , 0x1404, 0x403 , 0x403 , 0x403 , 0x0 , 0x0 , 0x0 }, // 0F 24 97 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 98 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 99 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 9A - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 9B - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 9C - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 9D - {"pmacsdd", 0x21005,0x0 , 0x15 , 0x1403, 0x403 , 0x403 , 0x403 , 0x0 , 0x0 , 0x0 }, // 0F 24 9E - {"pmacsdqh", 0x21005,0x0 , 0x15 , 0x1404, 0x403 , 0x403 , 0x403 , 0x0 , 0x0 , 0x0 }, // 0F 24 9F - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A0 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A1 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A2 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A3 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A4 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A5 - {"pmadcsswd", 0x21005,0x0 , 0x15 , 0x1403, 0x402 , 0x402 , 0x402 , 0x0 , 0x0 , 0x0 }, // 0F 24 A6 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A7 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A8 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 A9 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 AA - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 AB - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 AC - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 AD - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 AE - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 AF - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B0 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B1 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B2 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B3 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B4 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B5 - {"pmadcswd", 0x21005,0x0 , 0x15 , 0x1403, 0x402 , 0x402 , 0x402 , 0x0 , 0x0 , 0x0 }, // 0F 24 B6 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B7 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B8 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 B9 - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 BA - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 BB - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 BC - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 BD - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 BE - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }, // 0F 24 BF - - {0, 0x0 , 0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0x0 , 0x0 , 0x0 }}; // 0F 24 C0+. Reserved for future opcodes +SOpcodeDef OpcodeMap68[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"fmaddps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 00 + {"fmaddpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 01 + {"fmaddss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0 , 0 , 0 , 0 }, // 0F 24 02 + {"fmaddsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0 , 0 , 0 , 0 }, // 0F 24 03 + {"fmaddps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 04 + {"fmaddpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 05 + {"fmaddss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0 , 0 , 0 , 0 }, // 0F 24 06 + {"fmaddsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0 , 0 , 0 , 0 }, // 0F 24 07 + {"fmsubps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 08 + {"fmsubpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 09 + {"fmsubss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0 , 0 , 0 , 0 }, // 0F 24 0A + {"fmsubsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0 , 0 , 0 , 0 }, // 0F 24 0B + {"fmsubps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 0C + {"fmsubpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 0D + {"fmsubss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0 , 0 , 0 , 0 }, // 0F 24 0E + {"fmsubsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0 , 0 , 0 , 0 }, // 0F 24 0F + + {"fnmaddps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 10 + {"fnmaddpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 11 + {"fnmaddss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0 , 0 , 0 , 0 }, // 0F 24 12 + {"fnmaddsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0 , 0 , 0 , 0 }, // 0F 24 13 + {"fnmaddps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 14 + {"fnmaddpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 15 + {"fnmaddss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0 , 0 , 0 , 0 }, // 0F 24 16 + {"fnmaddsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0 , 0 , 0 , 0 }, // 0F 24 17 + {"fnmsubps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 18 + {"fnmsubpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 19 + {"fnmsubss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0 , 0 , 0 , 0 }, // 0F 24 1A + {"fnmsubsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0 , 0 , 0 , 0 }, // 0F 24 1B + {"fnmsubps", 0x21006,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 1C + {"fnmsubpd", 0x21006,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 1D + {"fnmsubss", 0x21006,0x0 , 0x15 , 0x104B, 0x4B , 0x4B , 0x4B , 0 , 0 , 0 , 0 }, // 0F 24 1E + {"fnmsubsd", 0x21006,0x0 , 0x15 , 0x104C, 0x4C , 0x4C , 0x4C , 0 , 0 , 0 , 0 }, // 0F 24 1F + + {"permps", 0x21005,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 20 + {"permpd", 0x21005,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 21 + {"pcmov", 0x21005,0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 22 + {"pperm", 0x21005,0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 23 + {"permps", 0x21005,0x0 , 0x15 , 0x124B, 0x24B , 0x24B , 0x24B , 0 , 0 , 0 , 0 }, // 0F 24 24 + {"permpd", 0x21005,0x0 , 0x15 , 0x124C, 0x24C , 0x24C , 0x24C , 0 , 0 , 0 , 0 }, // 0F 24 25 + {"pcmov", 0x21005,0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 26 + {"pperm", 0x21005,0x0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 27 + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 28 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 29 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 2A + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 2B + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 2C + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 2D + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 2E + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 2F + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 30 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 31 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 32 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 33 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 34 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 35 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 36 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 37 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 38 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 39 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 3A + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 3B + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 3C + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 3D + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 3E + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 3F + + {"protb", 0x21005,0x0 , 0x14 , 0x1401, 0x401 , 0x401 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 40 + {"protw", 0x21005,0x0 , 0x14 , 0x1402, 0x402 , 0x402 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 41 + {"protd", 0x21005,0x0 , 0x14 , 0x1403, 0x403 , 0x403 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 42 + {"protq", 0x21005,0x0 , 0x14 , 0x1404, 0x404 , 0x404 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 43 + {"pshlb", 0x21005,0x0 , 0x14 , 0x1401, 0x401 , 0x401 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 44 + {"pshlw", 0x21005,0x0 , 0x14 , 0x1402, 0x402 , 0x402 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 45 + {"pshld", 0x21005,0x0 , 0x14 , 0x1403, 0x403 , 0x403 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 46 + {"pshlq", 0x21005,0x0 , 0x14 , 0x1404, 0x404 , 0x404 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 47 + {"pshab", 0x21005,0x0 , 0x14 , 0x1401, 0x401 , 0x401 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 48 + {"pshaw", 0x21005,0x0 , 0x14 , 0x1402, 0x402 , 0x402 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 49 + {"pshad", 0x21005,0x0 , 0x14 , 0x1403, 0x403 , 0x403 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 4A + {"pshaq", 0x21005,0x0 , 0x14 , 0x1404, 0x404 , 0x404 , 0 , 0 , 0 , 0 , 0 }, // 0F 24 4B + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 4C + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 4D + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 4E + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 4F + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 50 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 51 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 52 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 53 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 54 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 55 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 56 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 57 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 58 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 59 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 5A + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 5B + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 5C + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 5D + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 5E + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 5F + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 60 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 61 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 62 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 63 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 64 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 65 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 66 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 67 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 68 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 69 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 6A + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 6B + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 6C + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 6D + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 6E + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 6F + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 70 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 71 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 72 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 73 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 74 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 75 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 76 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 77 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 78 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 79 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 7A + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 7B + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 7C + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 7D + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 7E + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 7F + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 80 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 81 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 82 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 83 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 84 + {"pmacssww", 0x21005,0x0 , 0x15 , 0x1402, 0x402 , 0x402 , 0x402 , 0 , 0 , 0 , 0 }, // 0F 24 85 + {"pmacsswd", 0x21005,0x0 , 0x15 , 0x1403, 0x402 , 0x402 , 0x402 , 0 , 0 , 0 , 0 }, // 0F 24 86 + {"pmacssdql", 0x21005,0x0 , 0x15 , 0x1404, 0x403 , 0x403 , 0x403 , 0 , 0 , 0 , 0 }, // 0F 24 87 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 88 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 89 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 8A + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 8B + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 8C + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 8D + {"pmacssdd", 0x21005,0x0 , 0x15 , 0x1403, 0x403 , 0x403 , 0x403 , 0 , 0 , 0 , 0 }, // 0F 24 8E + {"pmacssdqh", 0x21005,0x0 , 0x15 , 0x1404, 0x403 , 0x403 , 0x403 , 0 , 0 , 0 , 0 }, // 0F 24 8F + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 90 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 91 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 92 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 93 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 94 + {"pmacsww", 0x21005,0x0 , 0x15 , 0x1402, 0x402 , 0x402 , 0x402 , 0 , 0 , 0 , 0 }, // 0F 24 95 + {"pmacswd", 0x21005,0x0 , 0x15 , 0x1403, 0x402 , 0x402 , 0x402 , 0 , 0 , 0 , 0 }, // 0F 24 96 + {"pmacsdql", 0x21005,0x0 , 0x15 , 0x1404, 0x403 , 0x403 , 0x403 , 0 , 0 , 0 , 0 }, // 0F 24 97 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 98 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 99 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 9A + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 9B + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 9C + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 9D + {"pmacsdd", 0x21005,0x0 , 0x15 , 0x1403, 0x403 , 0x403 , 0x403 , 0 , 0 , 0 , 0 }, // 0F 24 9E + {"pmacsdqh", 0x21005,0x0 , 0x15 , 0x1404, 0x403 , 0x403 , 0x403 , 0 , 0 , 0 , 0 }, // 0F 24 9F + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A0 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A1 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A2 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A3 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A4 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A5 + {"pmadcsswd", 0x21005,0x0 , 0x15 , 0x1403, 0x402 , 0x402 , 0x402 , 0 , 0 , 0 , 0 }, // 0F 24 A6 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A7 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A8 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 A9 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 AA + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 AB + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 AC + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 AD + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 AE + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 AF + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B0 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B1 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B2 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B3 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B4 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B5 + {"pmadcswd", 0x21005,0x0 , 0x15 , 0x1403, 0x402 , 0x402 , 0x402 , 0 , 0 , 0 , 0 }, // 0F 24 B6 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B7 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B8 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 B9 + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 BA + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 BB + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 BC + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 BD + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 BE + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }, // 0F 24 BF + + {0, 0 , 0 , 0x15 , 0x1450, 0x450 , 0x450 , 0x450 , 0 , 0 , 0 , 0 }}; // 0F 24 C0+. Reserved for future opcodes // Tertiary opcode map for 3-byte opcode. First two bytes = 0F 25 // Indexed by third opcode byte // AMD SSE5 instructions with three operands + immediate byte -SOpcodeDef OpcodeMap67[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 00 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 01 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 02 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 03 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 04 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 05 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 06 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 07 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 08 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 09 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 0A - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 0B - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 0C - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 0D - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 0E - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 0F - - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 10 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 11 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 12 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 13 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 14 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 15 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 16 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 17 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 18 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 19 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 1A - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 1B - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 1C - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 1D - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 1E - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 1F - - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 20 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 21 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 22 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 23 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 24 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 25 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 26 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 27 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 28 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 29 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 2A - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 2B - {"comps", 0x21005,0x0 , 0x54 , 0x124B, 0x24B , 0x24B , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 2C - {"compd", 0x21005,0x0 , 0x54 , 0x124C, 0x24C , 0x24C , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 2D - {"comss", 0x21005,0x0 , 0x54 , 0x104B, 0x4B , 0x4B , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 2E - {"comsd", 0x21005,0x0 , 0x54 , 0x104C, 0x4C , 0x4C , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 2F - - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 30 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 31 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 32 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 33 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 34 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 35 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 36 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 37 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 38 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 39 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 3A - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 3B - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 3C - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 3D - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 3E - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 3F - - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 40 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 41 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 42 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 43 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 44 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 45 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 46 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 47 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 48 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 49 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 4A - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 4B - {"pcomb", 0x21005,0x0 , 0x54 , 0x1401, 0x401 , 0x401 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 4C - {"pcomw", 0x21005,0x0 , 0x54 , 0x1402, 0x402 , 0x402 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 4D - {"pcomd", 0x21005,0x0 , 0x54 , 0x1403, 0x403 , 0x403 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 4E - {"pcomq", 0x21005,0x0 , 0x54 , 0x1404, 0x404 , 0x404 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 4F - - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 50 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 51 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 52 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 53 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 54 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 55 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 56 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 57 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 58 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 59 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 5A - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 5B - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 5C - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 5D - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 5E - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 5F - - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 60 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 61 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 62 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 63 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 64 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 65 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 66 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 67 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 68 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 69 - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 6A - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 6B - {"pcomub", 0x21005,0x0 , 0x54 , 0x1401, 0x401 , 0x401 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 6C - {"pcomuw", 0x21005,0x0 , 0x54 , 0x1402, 0x402 , 0x402 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 6D - {"pcomud", 0x21005,0x0 , 0x54 , 0x1403, 0x403 , 0x403 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 6E - {"pcomuq", 0x21005,0x0 , 0x54 , 0x1404, 0x404 , 0x404 , 0x31 , 0x0 , 0x0 , 0x0 }, // 0F 25 6F - - {0, 0x0 , 0x0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0x0 , 0x0 , 0x0 }}; // 0F 25 70+. Reserved for future opcodes +// Note: These proposed codes have never been implemented. +SOpcodeDef OpcodeMap69[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 00 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 01 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 02 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 03 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 04 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 05 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 06 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 07 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 08 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 09 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 0A + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 0B + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 0C + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 0D + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 0E + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 0F + + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 10 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 11 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 12 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 13 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 14 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 15 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 16 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 17 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 18 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 19 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 1A + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 1B + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 1C + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 1D + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 1E + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 1F + + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 20 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 21 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 22 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 23 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 24 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 25 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 26 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 27 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 28 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 29 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 2A + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 2B + {"comps", 0x21005,0x0 , 0x54 , 0x124B, 0x24B , 0x24B , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 2C + {"compd", 0x21005,0x0 , 0x54 , 0x124C, 0x24C , 0x24C , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 2D + {"comss", 0x21005,0x0 , 0x54 , 0x104B, 0x4B , 0x4B , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 2E + {"comsd", 0x21005,0x0 , 0x54 , 0x104C, 0x4C , 0x4C , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 2F + + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 30 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 31 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 32 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 33 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 34 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 35 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 36 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 37 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 38 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 39 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 3A + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 3B + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 3C + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 3D + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 3E + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 3F + + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 40 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 41 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 42 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 43 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 44 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 45 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 46 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 47 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 48 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 49 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 4A + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 4B + {"pcomb", 0x21005,0x0 , 0x54 , 0x1401, 0x401 , 0x401 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 4C + {"pcomw", 0x21005,0x0 , 0x54 , 0x1402, 0x402 , 0x402 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 4D + {"pcomd", 0x21005,0x0 , 0x54 , 0x1403, 0x403 , 0x403 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 4E + {"pcomq", 0x21005,0x0 , 0x54 , 0x1404, 0x404 , 0x404 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 4F + + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 50 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 51 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 52 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 53 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 54 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 55 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 56 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 57 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 58 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 59 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 5A + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 5B + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 5C + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 5D + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 5E + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 5F + + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 60 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 61 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 62 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 63 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 64 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 65 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 66 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 67 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 68 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 69 + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 6A + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 6B + {"pcomub", 0x21005,0x0 , 0x54 , 0x1401, 0x401 , 0x401 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 6C + {"pcomuw", 0x21005,0x0 , 0x54 , 0x1402, 0x402 , 0x402 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 6D + {"pcomud", 0x21005,0x0 , 0x54 , 0x1403, 0x403 , 0x403 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 6E + {"pcomuq", 0x21005,0x0 , 0x54 , 0x1404, 0x404 , 0x404 , 0x31 , 0 , 0 , 0 , 0 }, // 0F 25 6F + + {0, 0 , 0 , 0x54 , 0x1450, 0x450 , 0x450 , 0x31 , 0 , 0 , 0 , 0 }}; // 0F 25 70+. Reserved for future opcodes // Tertiary opcode map for 3-byte opcode. First two bytes = 0F 7A // Indexed by third opcode byte // AMD SSE5 instructions with two operands -SOpcodeDef OpcodeMap68[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 00 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 01 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 02 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 03 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 04 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 05 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 06 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 07 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 08 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 09 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 0A - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 0B - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 0C - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 0D - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 0E - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 0F - - {"frczps", 0x21005,0x0 , 0x12 , 0x124B, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 10 - {"frczpd", 0x21005,0x0 , 0x12 , 0x124C, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 11 - {"frczss", 0x21005,0x0 , 0x12 , 0x104B, 0x4B , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 12 - {"frczsd", 0x21005,0x0 , 0x12 , 0x104C, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 13 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 14 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 15 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 16 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 17 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 18 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 19 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 1A - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 1B - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 1C - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 1D - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 1E - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 1F - - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 20 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 21 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 22 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 23 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 24 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 25 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 26 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 27 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 28 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 29 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 2A - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 2B - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 2C - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 2D - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 2E - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 2F - - {"cvtph2ps", 0x21007,0x0 , 0x12 , 0x124B, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 30 - {"cvtps2ph", 0x21007,0x0 , 0x13 , 0x402, 0x124B, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 31 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 32 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 33 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 34 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 35 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 36 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 37 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 38 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 39 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 3A - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 3B - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 3C - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 3D - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 3E - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 3F - - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 40 - {"phaddbw", 0x21005,0x0 , 0x12 , 0x1402, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 41 - {"phaddbd", 0x21005,0x0 , 0x12 , 0x1403, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 42 - {"phaddbq", 0x21005,0x0 , 0x12 , 0x1404, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 43 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 44 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 45 - {"phaddwd", 0x21005,0x0 , 0x12 , 0x1403, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 46 - {"phaddwq", 0x21005,0x0 , 0x12 , 0x1404, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 47 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 48 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 49 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 4A - {"phadddq", 0x21005,0x0 , 0x12 , 0x1404, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 4B - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 4C - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 4D - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 4E - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 4F - - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 50 - {"phaddubw", 0x21005,0x0 , 0x12 , 0x1402, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 51 - {"phaddubd", 0x21005,0x0 , 0x12 , 0x1403, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 52 - {"phaddubq", 0x21005,0x0 , 0x12 , 0x1404, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 53 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 54 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 55 - {"phadduwd", 0x21005,0x0 , 0x12 , 0x1403, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 56 - {"phadduwq", 0x21005,0x0 , 0x12 , 0x1404, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 57 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 58 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 59 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 5A - {"phaddudq", 0x21005,0x0 , 0x12 , 0x1404, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 5B - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 5C - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 5D - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 5E - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 5F - - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 60 - {"phsubbw", 0x21005,0x0 , 0x12 , 0x1402, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 61 - {"phsubwd", 0x21005,0x0 , 0x12 , 0x1403, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 62 - {"phsubdq", 0x21005,0x0 , 0x12 , 0x1404, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 63 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 64 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 65 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 66 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 67 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 68 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 69 - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 6A - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 6B - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 6C - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 6D - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7A 6E - {0, 0x0 , 0x0 , 0x12 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 7A 6F +// Note: These proposed codes have never been implemented. +SOpcodeDef OpcodeMap6A[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 00 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 01 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 02 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 03 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 04 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 05 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 06 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 07 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 08 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 09 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 0A + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 0B + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 0C + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 0D + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 0E + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 0F + + {"frczps", 0x21005,0x0 , 0x12 , 0x124B, 0x24B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 10 + {"frczpd", 0x21005,0x0 , 0x12 , 0x124C, 0x24C , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 11 + {"frczss", 0x21005,0x0 , 0x12 , 0x104B, 0x4B , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 12 + {"frczsd", 0x21005,0x0 , 0x12 , 0x104C, 0x4C , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 13 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 14 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 15 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 16 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 17 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 18 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 19 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 1A + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 1B + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 1C + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 1D + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 1E + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 1F + + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 20 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 21 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 22 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 23 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 24 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 25 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 26 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 27 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 28 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 29 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 2A + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 2B + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 2C + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 2D + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 2E + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 2F + + {"cvtph2ps", 0x21007,0x0 , 0x12 , 0x124B, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 30 + {"cvtps2ph", 0x21007,0x0 , 0x13 , 0x402, 0x124B, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 31 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 32 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 33 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 34 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 35 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 36 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 37 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 38 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 39 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 3A + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 3B + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 3C + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 3D + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 3E + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 3F + + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 40 + {"phaddbw", 0x21005,0x0 , 0x12 , 0x1402, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 41 + {"phaddbd", 0x21005,0x0 , 0x12 , 0x1403, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 42 + {"phaddbq", 0x21005,0x0 , 0x12 , 0x1404, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 43 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 44 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 45 + {"phaddwd", 0x21005,0x0 , 0x12 , 0x1403, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 46 + {"phaddwq", 0x21005,0x0 , 0x12 , 0x1404, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 47 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 48 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 49 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 4A + {"phadddq", 0x21005,0x0 , 0x12 , 0x1404, 0x403 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 4B + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 4C + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 4D + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 4E + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 4F + + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 50 + {"phaddubw", 0x21005,0x0 , 0x12 , 0x1402, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 51 + {"phaddubd", 0x21005,0x0 , 0x12 , 0x1403, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 52 + {"phaddubq", 0x21005,0x0 , 0x12 , 0x1404, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 53 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 54 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 55 + {"phadduwd", 0x21005,0x0 , 0x12 , 0x1403, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 56 + {"phadduwq", 0x21005,0x0 , 0x12 , 0x1404, 0x402 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 57 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 58 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 59 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 5A + {"phaddudq", 0x21005,0x0 , 0x12 , 0x1404, 0x403 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 5B + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 5C + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 5D + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 5E + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 5F + + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 60 + {"phsubbw", 0x21005,0x0 , 0x12 , 0x1402, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 61 + {"phsubwd", 0x21005,0x0 , 0x12 , 0x1403, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 62 + {"phsubdq", 0x21005,0x0 , 0x12 , 0x1404, 0x401 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 63 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 64 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 65 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 66 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 67 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 68 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 69 + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 6A + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 6B + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 6C + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 6D + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7A 6E + {0, 0 , 0 , 0x12 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 7A 6F // Tertiary opcode map for 3-byte opcode. First two bytes = 0F 7B // Indexed by third opcode byte // AMD SSE5 instructions with two operands and an immediate byte operand -SOpcodeDef OpcodeMap69[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 00 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 01 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 02 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 03 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 04 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 05 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 06 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 07 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 08 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 09 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 0A - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 0B - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 0C - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 0D - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 0E - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 0F - - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 10 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 11 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 12 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 13 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 14 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 15 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 16 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 17 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 18 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 19 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 1A - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 1B - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 1C - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 1D - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 1E - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 1F - - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 20 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 21 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 22 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 23 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 24 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 25 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 26 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 27 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 28 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 29 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 2A - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 2B - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 2C - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 2D - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 2E - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 2F - - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 30 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 31 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 32 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 33 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 34 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 35 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 36 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 37 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 38 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 39 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 3A - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 3B - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 3C - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 3D - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 3E - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 3F - - {"protb" , 0x21005,0x0 , 0x52 , 0x1401, 0x401 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 40 - {"protw" , 0x21005,0x0 , 0x52 , 0x1402, 0x402 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 41 - {"protd" , 0x21005,0x0 , 0x52 , 0x1403, 0x403 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 42 - {"protq" , 0x21005,0x0 , 0x52 , 0x1404, 0x404 , 0x21 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 43 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 44 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 45 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 46 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 47 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 48 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 49 - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 4A - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 4B - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 4C - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 4D - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 4E - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 7B 4F - - {0, 0x0 , 0x0 , 0x52 , 0x1450, 0x450 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 7B 50+ +// Note: These proposed codes have never been implemented. +SOpcodeDef OpcodeMap6B[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 00 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 01 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 02 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 03 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 04 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 05 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 06 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 07 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 08 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 09 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 0A + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 0B + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 0C + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 0D + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 0E + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 0F + + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 10 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 11 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 12 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 13 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 14 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 15 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 16 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 17 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 18 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 19 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 1A + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 1B + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 1C + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 1D + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 1E + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 1F + + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 20 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 21 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 22 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 23 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 24 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 25 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 26 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 27 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 28 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 29 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 2A + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 2B + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 2C + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 2D + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 2E + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 2F + + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 30 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 31 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 32 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 33 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 34 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 35 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 36 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 37 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 38 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 39 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 3A + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 3B + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 3C + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 3D + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 3E + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 3F + + {"protb" , 0x21005,0x0 , 0x52 , 0x1401, 0x401 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 40 + {"protw" , 0x21005,0x0 , 0x52 , 0x1402, 0x402 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 41 + {"protd" , 0x21005,0x0 , 0x52 , 0x1403, 0x403 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 42 + {"protq" , 0x21005,0x0 , 0x52 , 0x1404, 0x404 , 0x21 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 43 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 44 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 45 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 46 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 47 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 48 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 49 + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 4A + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 4B + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 4C + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 4D + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 4E + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 7B 4F + + {0, 0 , 0 , 0x52 , 0x1450, 0x450 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 7B 50+ -// Tertiary opcode map for movnt. Opcode byte = 0F 2B -// Indexed by prefix = none, 66, F2, F3 -SOpcodeDef OpcodeMap6A[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movntps", 0x11 , 0x50000, 0x13 , 0x224B, 0x124B, 0x0 , 0x0 , 0x0 , 0x0 , 0x102 }, // 0F 2B. movntps - {"movntpd", 0x12 , 0x50200, 0x13 , 0x224C, 0x124C, 0x0 , 0x0 , 0x0 , 0x0 , 0x102 }, // 66 0F 2B. movntpd - {"movntsd", 0x1004, 0x800 , 0x13 , 0x204C, 0x104C, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 2B. movntsd (AMD only) - {"movntss", 0x1004, 0x400 , 0x13 , 0x204B, 0x104B, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 2B. movntss (AMD only) - -// Tertiary opcode map for bsr and lzcnt. Opcode byte = 0F BD -// Indexed by prefix = none, 66, F2, F3 -SOpcodeDef OpcodeMap6B[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"bsr", 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F BD. bsr - {"bsr", 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F BD. not allowed - {"bsr", 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F BD. not allowed - {"lzcnt", 0x1C ,0x11500 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F BD. AMD SSE4a, Intel AVX2 - // Tertiary opcode map for vmread, insrtw, extrq. Opcode byte = 0F 78 // Indexed by prefix = none, 66, F2, F3 SOpcodeDef OpcodeMap6C[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vmread", 0x813 , 0x1000 , 0x13 , 0x4 , 0x1004, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 78. vmread - {0, 0x6E , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // 66 0F 78. link to map 6E: extrq xmm,xmm (AMD SSE4a) - {"insrtq", 0x1004, 0x800 , 0x32 , 0x1450, 0x1450, 0x11 , 0x11 , 0x0 , 0x0 , 0x0 }, // F2 0F 78. insrtq xmm,xmm,i,i (AMD SSE4a) - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 78. +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vmread", 0x813 , 0x1000 , 0x13 , 0x4 , 0x1004, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 78. vmread + {0, 0x6E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // 66 0F 78. link to map 6E: extrq xmm,xmm (AMD SSE4a) + {"insrtq", 0x1004, 0x800 , 0x32 , 0x1450, 0x1450, 0x11 , 0x11 , 0 , 0 , 0 , 0 }, // F2 0F 78. insrtq xmm,xmm,i,i (AMD SSE4a) + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 78. -// Tertiary opcode map for vmwrite, insrtw, extrq. Opcode byte = 0F 79 +// Tertiary opcode map for vmwrite, insrtw, extrq. Opcode byte = 0F 79 without VEX prefix // Indexed by prefix = none, 66, F2, F3 SOpcodeDef OpcodeMap6D[4] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vmwrite", 0x813 , 0x1000 , 0x12 , 0x1004, 0x4 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 79. vmwrite - {"extrq", 0x1004, 0x200 , 0x12 , 0x1450, 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F 79. link to map 6E: extrq xmm,xmm (AMD SSE4a) - {"insrtq", 0x1004, 0x800 , 0x12 , 0x1450, 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 79. insrtq xmm,xmm (AMD SSE4a) - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 79. +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vmwrite", 0x813 , 0x1000 , 0x12 , 0x1004, 0x4 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 79. vmwrite + {"extrq", 0x1004, 0x200 , 0x12 , 0x1450, 0x1450, 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 79. link to map 6E: extrq xmm,xmm (AMD SSE4a) + {"insrtq", 0x1004, 0x800 , 0x12 , 0x1450, 0x1450, 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 79. insrtq xmm,xmm (AMD SSE4a) + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 79. // Quarternary opcode map for extrq. Opcode byte = 66 0F 78 // Indexed by reg bits = 0 - 7 SOpcodeDef OpcodeMap6E[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"extrq", 0x1004, 0x200 , 0x31 , 0x1450, 0x11 , 0x11 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F 78. extrq xmm,i,i (AMD SSE4a) - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // reg bits must be 0 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"extrq", 0x1004, 0x200 , 0x31 , 0x1450, 0x11 , 0x11 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 78. extrq xmm,i,i (AMD SSE4a) + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // reg bits must be 0 // Submap for movq xmm/m64,xmm. Opcode byte = 66 0F D6 // Indexed by memory vs. register operand SOpcodeDef OpcodeMap6F[2] = { - {"movq", 0x12 , 0x10200, 0x13 , 0x4 , 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // movq m64,xmm - {"movq", 0x12 , 0x10200, 0x13 , 0x450 , 0x1450, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // movq xmm,xmm + {"movq", 0x12 ,0x812200, 0x13 , 0x4 , 0x1450, 0 , 0 , 0 , 0 , 0 , 0x2 }, // movq m64,xmm + {"movq", 0x12 ,0x812200, 0x13 , 0x450 , 0x1450, 0 , 0 , 0 , 0 , 0 , 0x2 }}; // movq xmm,xmm -// Submap for movddup. Opcode byte = 66 0F D6 +// Submap for movddup. Opcode byte = F2 0F 12 // Indexed by VEX.L -SOpcodeDef OpcodeMap70[3] = { - {"movddup", 0x13 , 0x00800, 0x12 , 0x124C, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // no VEX prefix - {"vmovddup", 0x19 , 0x50800, 0x12 , 0x124C, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX.L = 0 - {"vmovddup", 0x19 , 0x50800, 0x12 , 0x124C, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // VEX.L = 1 +SOpcodeDef OpcodeMap70[4] = { + {"movddup", 0x13 , 0x00800, 0x12 , 0x124C, 0x4C , 0 , 0 , 0 , 0 , 0 , 0 }, // no VEX prefix + {"vmovddup", 0x19 ,0x852800, 0x12 , 0x124C, 0x4C , 0 , 0 , 0x20 , 0 , 0 , 0 }, // VEX.L = 0 + {"vmovddup", 0x19 ,0x852800, 0x12 , 0x124C, 0x24C , 0 , 0 , 0x20 , 0 , 0 , 0 }, // VEX.L = 1 + {"vmovddup", 0x19 ,0x852800, 0x12 , 0x124C, 0x24C , 0 , 0 , 0x20 , 0 , 0 , 0 }}; // EVEX.LL = 2 // Submap for movsd. Opcode byte = F2 0F 10 // Indexed by memory/register operand SOpcodeDef OpcodeMap71[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"movsd", 0x12 , 0x10800, 0x12 , 0x104C, 0x4C , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 10 mem - {"movsd", 0x12 , 0x90800, 0x19 , 0x104C, 0x104C, 0x104C, 0x0 , 0x0 , 0x0 , 0x2 }}; // F2 0F 10 reg +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movsd", 0x12 ,0x812800, 0x12 , 0x104C, 0x4C , 0 , 0 , 0x30 , 0 , 0 , 0x2 }, // F2 0F 10 mem + {"movsd", 0x12 ,0x892800, 0x19 , 0x104C, 0x104C, 0x104C, 0 , 0x30 , 0 , 0 , 0x2 }}; // F2 0F 10 reg // Submap for movss. Opcode byte = F3 0F 10 // Indexed by memory/register operand SOpcodeDef OpcodeMap72[2] = { - {"movss", 0x12 , 0x10400, 0x12 , 0x104B, 0x4B , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // F3 0F 10 mem - {"movss", 0x12 , 0x90400, 0x19 , 0x104B, 0x104B, 0x104B, 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 10 reg + {"movss", 0x12 ,0x812400, 0x12 , 0x104B, 0x4B , 0 , 0 , 0x30 , 0 , 0 , 0x2 }, // F3 0F 10 mem + {"movss", 0x12 ,0x892400, 0x19 , 0x104B, 0x104B, 0x104B, 0 , 0x30 , 0 , 0 , 0x2 }}; // F3 0F 10 reg // Submap for movsd. Opcode byte = F2 0F 11 // Indexed by memory/register operand SOpcodeDef OpcodeMap73[2] = { - {"movsd", 0x12 , 0x10800, 0x13 , 0x4C , 0x104C, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 11 mem - {"movsd", 0x12 , 0x90800, 0x19 , 0x104C, 0x104C, 0x104C, 0x0 , 0x0 , 0x0 , 0x2 }}; // F2 0F 11 reg + {"movsd", 0x12 ,0x812800, 0x13 , 0x4C , 0x104C, 0 , 0 , 0x30 , 0 , 0 , 0x2 }, // F2 0F 11 mem + {"movsd", 0x12 ,0x892800, 0x19 , 0x104C, 0x104C, 0x104C, 0 , 0x10 , 0 , 0 , 0x2 }}; // F2 0F 11 reg // Submap for movss. Opcode byte = F3 0F 11 // Indexed by memory/register operand SOpcodeDef OpcodeMap74[2] = { - {"movss", 0x12 , 0x10400, 0x13 , 0x4B , 0x104B, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // F3 0F 11 mem - {"movss", 0x12 , 0x90400, 0x19 , 0x104B, 0x104B, 0x104B, 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 11 reg + {"movss", 0x12 ,0x812400, 0x13 , 0x4B , 0x104B, 0 , 0 , 0x10 , 0 , 0 , 0x2 }, // F3 0F 11 mem + {"movss", 0x12 ,0x892400, 0x19 , 0x104B, 0x104B, 0x104B, 0 , 0x30 , 0 , 0 , 0x2 }}; // F3 0F 11 reg // Submap for pinsrd/pinsrq. Opcode byte = 0F 3A 22 // Indexed by operand size SOpcodeDef OpcodeMap75[3] = { - {"pinsrd", 0x15 , 0x99200, 0x59 , 0x1403, 0x1403, 0x3 , 0x11 , 0x0 , 0x0 , 0x2 }, // (16 bit). 66 prefix actually is 32 bits - {"pinsrd", 0x15 , 0x99200, 0x59 , 0x1403, 0x1403, 0x3 , 0x11 , 0x0 , 0x0 , 0x2 }, // 32 bit - {"pinsrq", 0x15 , 0x99200, 0x59 , 0x1404, 0x1404, 0x4 , 0x11 , 0x0 , 0x0 , 0x2 }}; // 64 bit. REX.W prefix + {"pinsrd", 0x15 ,0x89B200, 0x59 , 0x1403, 0x1403, 0x3 , 0x11 , 0x1000, 0 , 0 , 0x2 }, // (16 bit). 66 prefix actually is 32 bits + {"pinsrd", 0x15 ,0x89B200, 0x59 , 0x1403, 0x1403, 0x3 , 0x11 , 0x1000, 0 , 0 , 0x2 }, // 32 bit + {"pinsrq", 0x15 ,0x89B200, 0x59 , 0x1404, 0x1404, 0x4 , 0x11 , 0x1000, 0 , 0 , 0x2 }}; // 64 bit. REX.W prefix // Submap for sqrtps/pd/sd/ss. Opcode byte = 0F 51 // Indexed by prefix = none, 66, F2, F3 SOpcodeDef OpcodeMap76[4] = { - {"sqrtps", 0x11 , 0x50E00, 0x12 , 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 51. sqrtps - {"sqrtpd", 0x11 , 0x50E00, 0x12 , 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 66 0F 51. sqrtpd - {"sqrtsd", 0x11 , 0x90E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x2 }, // F2 0F 51. sqrtsd - {"sqrtss", 0x11 , 0x90E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 51. sqrtss +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"sqrtps", 0x11 ,0x852E00, 0x12 , 0x124F, 0x24F , 0 , 0 , 0x37 , 0 , 0 , 0x2 }, // 0F 51. sqrtps + {"sqrtpd", 0x11 ,0x852E00, 0x12 , 0x124F, 0x24F , 0 , 0 , 0x37 , 0 , 0 , 0x2 }, // 66 0F 51. sqrtpd + {"sqrtsd", 0x11 ,0x892E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x36 , 0 , 0 , 0x2 }, // F2 0F 51. sqrtsd + {"sqrtss", 0x11 ,0x892E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0x36 , 0 , 0 , 0x2 }}; // F3 0F 51. sqrtss // Submap for rsqrtps/ss. Opcode byte = 0F 52 // Indexed by prefix = none, 66, F2, F3 SOpcodeDef OpcodeMap77[4] = { - {"rsqrtps", 0x11 , 0x50E00, 0x12 , 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 52. rsqrtps - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // illegal - {"rsqrtss", 0x11 , 0x90E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 52. rsqrtss + {"rsqrtps", 0x11 , 0x50E00, 0x12 , 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 52. rsqrtps + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // illegal + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // illegal + {"rsqrtss", 0x11 , 0x90E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0x2 }}; // F3 0F 52. rsqrtss // Submap for rcpps/ss. Opcode byte = 0F 53 // Indexed by prefix = none, 66, F2, F3 SOpcodeDef OpcodeMap78[4] = { - {"rcpps", 0x11 , 0x50E00, 0x12 , 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 53. rcpps - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // illegal - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // illegal - {"rcpss", 0x11 , 0x90E00, 0x19 , 0x124F, 0x124F, 0x24F , 0x0 , 0x0 , 0x0 , 0x2 }}; // F3 0F 53. rcpss + {"rcpps", 0x11 , 0x50E00, 0x12 , 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 53. rcpps + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // illegal + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // illegal + {"rcpss", 0x11 , 0x90E00, 0x19 , 0x124F, 0x124F, 0x24F , 0 , 0 , 0 , 0 , 0x2 }}; // F3 0F 53. rcpss // Submap for emms/vzeroupper/vzeroall. Opcode byte = 0F 77 // Indexed by VEX prefix and VEX.L SOpcodeDef OpcodeMap79[3] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"emms", 0x7 , 0x0 , 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 77 - {"vzeroupper",0x19 , 0x10000, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 77, L=0 - {"vzeroall", 0x19 , 0x50000, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // VEX 0F 77, L=1 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"emms", 0x7 , 0 , 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 77 + {"vzeroupper",0x19 , 0x10000, 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 77, L=0 + {"vzeroall", 0x19 , 0x50000, 0x2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // VEX 0F 77, L=1 // Submap for pmovsxbw. Opcode byte = 0F 38 20. Indexed by memory/register operand SOpcodeDef OpcodeMap7A[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pmovsxbw", 0x7B , 0x0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 20 mem, link by VEX.L - {"pmovsxbw", 0x15 , 0x58200, 0x12 , 0x1202, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 20 reg - -// Submap for pmovsxbw. Opcode byte = 0F 38 20, mem Indexed by VEX.L -SOpcodeDef OpcodeMap7B[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pmovsxbw", 0x15 , 0x58200, 0x12 , 0x1202, 0x301 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 20 L0 - {"pmovsxbw", 0x15 , 0x58200, 0x12 , 0x1202, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 20 L1 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pmovsxbw", 0x15 ,0x85A200, 0x12 , 0x1202, 0xF01 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }, // 0F 38 20 mem, link by VEX.L + {"pmovsxbw", 0x15 ,0x85A200, 0x12 , 0x1202, 0xF01 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }}; // 0F 38 20 reg // Submap for pmovsxbd. Opcode byte = 0F 38 21. Indexed by memory/register operand -SOpcodeDef OpcodeMap7C[2] = { - {"pmovsxbd", 0x7D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 21 mem, link by VEX.L - {"pmovsxbd", 0x15 , 0x58200, 0x12 , 0x1203, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 21 reg +SOpcodeDef OpcodeMap7B[2] = { + {0, 0x7C , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 21 mem, link by VEX.L + {"pmovsxbd", 0x15 ,0x85A200, 0x12 , 0x1203, 0x401 , 0 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F 38 21 reg // Submap for pmovsxbd. Opcode byte = 0F 38 21 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap7D[2] = { - {"pmovsxbd", 0x15 , 0x58200, 0x12 , 0x1203, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 21 L0 - {"pmovsxbd", 0x15 , 0x58200, 0x12 , 0x1203, 0x301 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 21 L1 +SOpcodeDef OpcodeMap7C[] = { + {"pmovsxbd", 0x15 ,0x85A200, 0x12 , 0x1203, 0x3 , 0 , 0 , 0x2420 , 0 , 0 , 0x2 }, // 0F 38 21 L0 + {"pmovsxbd", 0x15 ,0x85A200, 0x12 , 0x1203, 0x301 , 0 , 0 , 0x2420 , 0 , 0 , 0x2 }, // 0F 38 21 L1 + {"pmovsxbd", 0x15 ,0x85A200, 0x12 , 0x1203, 0x401 , 0 , 0 , 0x2420 , 0 , 0 , 0x2 }}; // 0F 38 21 L2 // Submap for pmovsxbq. Opcode byte = 0F 38 22. Indexed by memory/register operand -SOpcodeDef OpcodeMap7E[2] = { - {"pmovsxbq", 0x7F , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 22 mem, link by VEX.L - {"pmovsxbq", 0x15 , 0x58200, 0x12 , 0x1204, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 22 reg +SOpcodeDef OpcodeMap7D[2] = { + {"pmovsxbq", 0x7E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 22 mem, link by VEX.L + {"pmovsxbq", 0x15 ,0x858200, 0x12 , 0x1204, 0x401 , 0 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F 38 22 reg // Submap for pmovsxbq. Opcode byte = 0F 38 22 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap7F[2] = { - {"pmovsxbq", 0x15 , 0x58200, 0x12 , 0x1204, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 22 L0 - {"pmovsxbq", 0x15 , 0x58200, 0x12 , 0x1204, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 22 L1 +SOpcodeDef OpcodeMap7E[] = { + {"pmovsxbq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x2 , 0 , 0 , 0x2620, 0 , 0 , 0x2 }, // 0F 38 22 L0 + {"pmovsxbq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x3 , 0 , 0 , 0x2620, 0 , 0 , 0x2 }, // 0F 38 22 L1 + {"pmovsxbq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x4 , 0 , 0 , 0x2620, 0 , 0 , 0x2 }}; // 0F 38 22 L2 // Submap for pmovsxwd. Opcode byte = 0F 38 23. Indexed by memory/register operand -SOpcodeDef OpcodeMap80[2] = { - {"pmovsxwd", 0x81 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 23 mem, link by VEX.L - {"pmovsxwd", 0x15 , 0x58200, 0x12 , 0x1203, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 23 reg - -// Submap for pmovsxwd. Opcode byte = 0F 38 23 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap81[2] = { - {"pmovsxwd", 0x15 , 0x58200, 0x12 , 0x1203, 0x302 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 23 L0 - {"pmovsxwd", 0x15 , 0x58200, 0x12 , 0x1203, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 23 L1 +SOpcodeDef OpcodeMap7F[2] = { + {"pmovsxwd", 0x15 ,0x85A200, 0x12 , 0x1203, 0xF02 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }, // 0F 38 23 mem, link by VEX.L + {"pmovsxwd", 0x15 ,0x85A200, 0x12 , 0x1203, 0xF02 , 0 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F 38 23 reg // Submap for pmovsxwq. Opcode byte = 0F 38 24. Indexed by memory/register operand -SOpcodeDef OpcodeMap82[2] = { - {"pmovsxwq", 0x83 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 24 mem, link by VEX.L - {"pmovsxwq", 0x15 , 0x58200, 0x12 , 0x1204, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 24 reg +SOpcodeDef OpcodeMap80[2] = { + {"pmovsxwq", 0x81 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 24 mem, link by VEX.L + {"pmovsxwq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x402 , 0 , 0 , 0x30 , 0 , 0 , 0x2 }}; // 0F 38 24 reg // Submap for pmovsxwq. Opcode byte = 0F 38 24 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap83[2] = { - {"pmovsxwq", 0x15 , 0x58200, 0x12 , 0x1204, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 24 L0 - {"pmovsxwq", 0x15 , 0x58200, 0x12 , 0x1204, 0x302 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 24 L1 +SOpcodeDef OpcodeMap81[] = { + {"pmovsxwq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x3 , 0 , 0 , 0x2420, 0 , 0 , 0x2 }, // 0F 38 24 L0 + {"pmovsxwq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x302 , 0 , 0 , 0x2420, 0 , 0 , 0x2 }, // 0F 38 24 L1 + {"pmovsxwq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x402 , 0 , 0 , 0x2420, 0 , 0 , 0x2 }}; // 0F 38 24 L1 // Submap for pmovsxdq. Opcode byte = 0F 38 25. Indexed by memory/register operand -SOpcodeDef OpcodeMap84[2] = { - {"pmovsxdq", 0x85 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 25 mem, link by VEX.L - {"pmovsxdq", 0x15 , 0x58200, 0x12 , 0x1204, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 25 reg - -// Submap for pmovsxdq. Opcode byte = 0F 38 25 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap85[2] = { - {"pmovsxdq", 0x15 , 0x58200, 0x12 , 0x1204, 0x303 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 25 L0 - {"pmovsxdq", 0x15 , 0x58200, 0x12 , 0x1204, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 25 L1 +SOpcodeDef OpcodeMap82[2] = { + {"pmovsxdq", 0x15 ,0x85A200, 0x12 , 0x1204, 0xF03 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }, // 0F 38 25 mem, link by VEX.L + {"pmovsxdq", 0x15 ,0x85A200, 0x12 , 0x1204, 0xF03 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }}; // 0F 38 25 reg // Submap for pmovzxbw. Opcode byte = 0F 38 30. Indexed by memory/register operand -SOpcodeDef OpcodeMap86[2] = { - {"pmovzxbw", 0x87 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 30 mem, link by VEX.L - {"pmovzxbw", 0x15 , 0x58200, 0x12 , 0x1202, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 30 reg +SOpcodeDef OpcodeMap83[2] = { + {"pmovzxbw", 0x15 ,0x85A200, 0x12 , 0x1202, 0xF01 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }, // 0F 38 30 L0 + {"pmovzxbw", 0x15 ,0x85A200, 0x12 , 0x1202, 0xF01 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }}; // 0F 38 30 reg -// Submap for pmovzxbw. Opcode byte = 0F 38 30 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap87[2] = { - {"pmovzxbw", 0x15 , 0x58200, 0x12 , 0x1202, 0x301 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 30 L0 - {"pmovzxbw", 0x15 , 0x58200, 0x12 , 0x1202, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 30 L1 +// Submap for 0F 38 5A, indexed by L bit and MVEX for vector size +SOpcodeDef OpcodeMap84[] = { + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 5A, 128 bits + {"vbroadcasti128",0x1C,0x978200,0x12 , 0x1550, 0x2451, 0 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 38 5A, 256 bits + {"vbroadcasti32x4",0x80,0xC28200,0x12, 0x1603, 0x2403, 0 , 0 , 0x20 , 0x1012, 0 , 0x100 }, // 0F 38 5A, 512 bits + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // Submap for pmovzxbd. Opcode byte = 0F 38 31. Indexed by memory/register operand -SOpcodeDef OpcodeMap88[2] = { - {"pmovzxbd", 0x89 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 31 mem, link by VEX.L - {"pmovzxbd", 0x15 , 0x58200, 0x12 , 0x1203, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 31 reg +SOpcodeDef OpcodeMap85[2] = { + {"pmovzxbd", 0x86 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 31 mem, link by VEX.L + {"pmovzxbd", 0x15 ,0x85A200, 0x12 , 0x1203, 0x401 , 0 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F 38 31 reg // Submap for pmovzxbd. Opcode byte = 0F 38 31 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap89[2] = { - {"pmovzxbd", 0x15 , 0x58200, 0x12 , 0x1203, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 31 L0 - {"pmovzxbd", 0x15 , 0x58200, 0x12 , 0x1203, 0x301 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 31 L1 +SOpcodeDef OpcodeMap86[] = { + {"pmovzxbd", 0x15 ,0x85A200, 0x12 , 0x1403, 0x3 , 0 , 0 , 0x2420 , 0 , 0 , 0x2 }, // 0F 38 31 L0 + {"pmovzxbd", 0x15 ,0x85A200, 0x12 , 0x1503, 0x301 , 0 , 0 , 0x2420 , 0 , 0 , 0x2 }, // 0F 38 31 L1 + {"pmovzxbd", 0x15 ,0x85A200, 0x12 , 0x1603, 0x401 , 0 , 0 , 0x2420 , 0 , 0 , 0x2 }}; // 0F 38 31 L2 // Submap for pmovzxbq. Opcode byte = 0F 38 32. Indexed by memory/register operand -SOpcodeDef OpcodeMap8A[2] = { - {"pmovzxbq", 0x8B , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 32 mem, link by VEX.L - {"pmovzxbq", 0x15 , 0x58200, 0x12 , 0x1204, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 32 reg +SOpcodeDef OpcodeMap87[2] = { + {"pmovzxbq", 0x88 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 32 mem, link by VEX.L + {"pmovzxbq", 0x15 ,0x858200, 0x12 , 0x1204, 0x401 , 0 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F 38 32 reg // Submap for pmovzxbq. Opcode byte = 0F 38 32 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap8B[2] = { - {"pmovzxbq", 0x15 , 0x58200, 0x12 , 0x1204, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 32 L0 - {"pmovzxbq", 0x15 , 0x58200, 0x12 , 0x1204, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 32 L1 +SOpcodeDef OpcodeMap88[] = { + {"pmovzxbq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x2 , 0 , 0 , 0x2620, 0 , 0 , 0x2 }, // 0F 38 32 L0 + {"pmovzxbq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x3 , 0 , 0 , 0x2620, 0 , 0 , 0x2 }, // 0F 38 32 L1 + {"pmovzxbq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x4 , 0 , 0 , 0x2620, 0 , 0 , 0x2 }}; // 0F 38 32 L2 // Submap for pmovzxwd. Opcode byte = 0F 38 33. Indexed by memory/register operand -SOpcodeDef OpcodeMap8C[2] = { - {"pmovzxwd", 0x8D , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 33 mem, link by VEX.L - {"pmovzxwd", 0x15 , 0x58200, 0x12 , 0x1203, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 33 reg - -// Submap for pmovzxwd. Opcode byte = 0F 38 33 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap8D[2] = { - {"pmovzxwd", 0x15 , 0x58200, 0x12 , 0x1203, 0x302 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 33 L0 - {"pmovzxwd", 0x15 , 0x58200, 0x12 , 0x1203, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 33 L1 +SOpcodeDef OpcodeMap89[2] = { + {"pmovzxwd", 0x15 ,0x85A200, 0x12 , 0x1203, 0xF02 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }, // 0F 38 33 mem, link by VEX.L + {"pmovzxwd", 0x15 ,0x85A200, 0x12 , 0x1203, 0xF02 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }}; // 0F 38 33 reg // Submap for pmovzxwq. Opcode byte = 0F 38 34. Indexed by memory/register operand -SOpcodeDef OpcodeMap8E[2] = { - {"pmovzxwq", 0x8F , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 34 mem, link by VEX.L - {"pmovzxwq", 0x15 , 0x58200, 0x12 , 0x1204, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 34 reg +SOpcodeDef OpcodeMap8A[2] = { + {"pmovzxwq", 0x8B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x0D , 0 }, // 0F 38 34 mem, link by VEX.L + {"pmovzxwq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x402 , 0 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F 38 34 reg // Submap for pmovzxwq. Opcode byte = 0F 38 34 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap8F[2] = { - {"pmovzxwq", 0x15 , 0x58200, 0x12 , 0x1204, 0x3 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 34 L0 - {"pmovzxwq", 0x15 , 0x58200, 0x12 , 0x1204, 0x302 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 34 L1 +SOpcodeDef OpcodeMap8B[] = { + {"pmovzxwq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x3 , 0 , 0 , 0x2420, 0 , 0 , 0x2 }, // 0F 38 34 L0 + {"pmovzxwq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x302 , 0 , 0 , 0x2420, 0 , 0 , 0x2 }, // 0F 38 34 L1 + {"pmovzxwq", 0x15 ,0x85A200, 0x12 , 0x1204, 0x402 , 0 , 0 , 0x2420, 0 , 0 , 0x2 }}; // 0F 38 34 L1 // Submap for pmovzxwq. Opcode byte = 0F 38 35. Indexed by memory/register operand -SOpcodeDef OpcodeMap90[2] = { - {"pmovzxdq", 0x91 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0D , 0 }, // 0F 38 35 mem, link by VEX.L - {"pmovzxdq", 0x15 , 0x58200, 0x12 , 0x1204, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 35 reg - -// Submap for pmovzxwq. Opcode byte = 0F 38 35 mem. Indexed by VEX.L -SOpcodeDef OpcodeMap91[2] = { - {"pmovzxdq", 0x15 , 0x58200, 0x12 , 0x1204, 0x303 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 38 35 L0 - {"pmovzxdq", 0x15 , 0x58200, 0x12 , 0x1204, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F 38 35 L1 - - -// name instset prefix format dest. source1 source2 source3 Swizzle link options +SOpcodeDef OpcodeMap8C[2] = { + {"pmovzxdq", 0x15 ,0x85A200, 0x12 , 0x1204, 0xF03 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }, // 0F 38 35 mem + {"pmovzxdq", 0x15 ,0x85A200, 0x12 , 0x1204, 0xF03 , 0 , 0 , 0x2220, 0 , 0 , 0x2 }}; // 0F 38 35 reg + +// submap for 0F 38 14. Indexed by VEX prefix +SOpcodeDef OpcodeMap8D[] = { + {"blendvps", 0x15 , 0x8200 , 0x12 , 0x124B, 0x24B , 0xAE , 0 , 0 , 0 , 0 , 0 }, // 0F 38 14 + {"vprorv", 0x20 ,0x883200, 0x19 , 0x1209, 0x1209, 0x0209, 0 , 0x31 , 0 , 0 , 0x1 }}; // VEX 0F 38 14 + +// submap for 0F 38 15. Indexed by VEX prefix +SOpcodeDef OpcodeMap8E[] = { + {"blendvpd", 0x15 , 0x8200 , 0x12 , 0x124C, 0x24C , 0xAE , 0 , 0 , 0 , 0 , 0 }, // 0F 38 15 + {"vprolv", 0x20 ,0x883200, 0x19 , 0x1209, 0x1209, 0x0209, 0 , 0x31 , 0 , 0 , 0x1 }}; // VEX 0F 38 15 + +// submap for 0F 3A 23. Index by W bit +SOpcodeDef OpcodeMap8F[] = { + {"vshuff32x4",0x20 ,0x88B200, 0x59 , 0x124F, 0x124F, 0x024F, 0x31 , 0x31 , 0 , 0 , 0 }, // 0F 3A 23. W0 + {"vshuff64x2",0x20 ,0x88B200, 0x59 , 0x124F, 0x124F, 0x024F, 0x31 , 0x31 , 0 , 0 , 0 }}; // 0F 3A 23. W1 + +// submap for 0F 3A 43. Index by W bit +SOpcodeDef OpcodeMap90[] = { + {"vshufi32x4",0x20 ,0x88B200, 0x59 , 0x1209, 0x1209, 0x0209, 0x31 , 0x31 , 0 , 0 , 0 }, // 0F 3A 43. W0 + {"vshufi64x2",0x20 ,0x88B200, 0x59 , 0x1209, 0x1209, 0x0209, 0x31 , 0x31 , 0 , 0 , 0 }}; // 0F 3A 43. W1 + +// submap for 0F 38 2A. Index by 66 F2 F3 prefix +SOpcodeDef OpcodeMap91[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 2A + {"movntdqa", 0x15 ,0x85A200, 0x12 , 0x1250, 0x2250, 0 , 0 , 0x00 , 0 , 0 , 0x102 }, // 66 0F 38 2A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 38 2A + {"vpbroadcastmb2q",0x20,0x823400,0x12, 0x1204, 0x1095, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 38 2A. W1 + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options // Submap for xlat. Opcode byte = D7. Indexed by assembly syntax: 0=MASM, 1=NASM/YASM, 2=GAS SOpcodeDef OpcodeMap92[3] = { - {"xlat", 0x0 , 0x5 , 0x1 , 0x0 , 0x20C0, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // D7 - {"xlatb", 0x0 , 0x5 , 0x1 , 0x0 , 0x20C0, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // D7 - {"xlat", 0x0 , 0x5 , 0x1 , 0x0 , 0x20C0, 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }}; // D7 + {"xlat", 0 , 0x5 , 0x1 , 0 , 0x20C0, 0 , 0 , 0 , 0 , 0 , 0x8 }, // D7 + {"xlatb", 0 , 0x5 , 0x1 , 0 , 0x20C0, 0 , 0 , 0 , 0 , 0 , 0x8 }, // D7 + {"xlat", 0 , 0x5 , 0x1 , 0 , 0x20C0, 0 , 0 , 0 , 0 , 0 , 0x8 }}; // D7 // Submap for pmovmskb, Opcode 0F D7, Indexed by VEX prefix and VEX.L bit SOpcodeDef OpcodeMap93[3] = { - {"pmovmskb", 0x7 , 0x51200, 0x12 , 0x1009, 0x1150, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D7 - {"pmovmskb", 0x7 , 0x51200, 0x12 , 0x100A, 0x1150, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D7, VEX (32/64 bit dest. depending on mode) - {"pmovmskb", 0x7 , 0x51200, 0x12 , 0x100A, 0x1150, 0x0 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F D7, VEX.L (32/64 bit dest. depending on mode) + {"pmovmskb", 0x7 , 0x51200, 0x12 , 0x1009, 0x1150, 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F D7 + {"pmovmskb", 0x7 , 0x51200, 0x12 , 0x100A, 0x1150, 0 , 0 , 0 , 0 , 0 , 0x2 }, // 0F D7, VEX (32/64 bit dest. depending on mode) + {"pmovmskb", 0x7 , 0x51200, 0x12 , 0x100A, 0x1150, 0 , 0 , 0 , 0 , 0 , 0x2 }}; // 0F D7, VEX.L (32/64 bit dest. depending on mode) -// name instset prefix format dest. source1 source2 source3 Swizzle link options -// Submap for vpgatherq, Opcode 0F 38 91, Indexed by VEX.W bit +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +// Submap for vpgatherq, Opcode 0F 38 91, Indexed by VEX/EVEX SOpcodeDef OpcodeMap94[2] = { - {"vpgatherqd",0x1C , 0xEB200, 0x1E, 0x403 , 0x2203, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 91, W0 - {"vpgatherqq",0x1C , 0xEB200, 0x1E, 0x204 , 0x2204, 0x204 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 91, W1 + {0, 0x105 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // + {0, 0x106 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // // Submap for vgatherqps/pd, Opcode 0F 38 93, Indexed by VEX.W bit SOpcodeDef OpcodeMap95[2] = { - {"vgatherqps",0x1C , 0xE9200, 0x1E, 0x44B , 0x224B, 0x44B , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 93, W0 - {"vgatherqpd",0x1C , 0xE9200, 0x1E, 0x24C , 0x224C, 0x24C , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 93, W1 + {"vgatherqps",0x1C , 0xE9200, 0x1E, 0xF4B , 0x224B, 0xF4B , 0 , 0 , 0 , 0 , 0 }, // 0F 38 93, W0 + {"vgatherqpd",0x1C , 0xE9200, 0x1E, 0x24C , 0x224C, 0x24C , 0 , 0 , 0 , 0 , 0 }}; // 0F 38 93, W1 -// name instset prefix format dest. source1 source2 source3 Swizzle link options +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options // Submap for psllw, Opcode 0F F1, Indexed by VEX.L bit -SOpcodeDef OpcodeMap96[2] = { - {"psllw", 0x7 , 0xD2200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F F1 - {"psllw", 0x7 , 0xD2200, 0x19 , 0x1102, 0x1102, 0x402 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F F1, L1 +SOpcodeDef OpcodeMap96[] = { + {"psllw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F F1 + {"psllw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x402 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F F1, L1 + {"psllw", 0x20 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x402 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F F1, L2 // Submap for pslld, Opcode 0F F2, Indexed by VEX.L bit -SOpcodeDef OpcodeMap97[2] = { - {"pslld", 0x7 , 0xD2200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F F2 - {"pslld", 0x7 , 0xD2200, 0x19 , 0x1103, 0x1103, 0x403 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F F2, L1 +SOpcodeDef OpcodeMap97[] = { + {"pslld", 0x7 ,0x8D2200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F F2 + {"pslld", 0x7 ,0x8D2200, 0x19 , 0x1203, 0x1203, 0x403 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F F2, L1 + {"pslld", 0x20 ,0x8D2200, 0x19 , 0x1203, 0x1203, 0x403 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F F2, L1 // Submap for psllq, Opcode 0F F3, Indexed by VEX.L bit -SOpcodeDef OpcodeMap98[2] = { - {"psllq", 0x7 , 0xD2200, 0x19 , 0x1104, 0x1104, 0x104 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F F3 - {"psllq", 0x7 , 0xD2200, 0x19 , 0x1104, 0x1104, 0x404 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F F3, L1 +SOpcodeDef OpcodeMap98[] = { + {"psllq", 0x7 ,0x8D2200, 0x19 , 0x1104, 0x1104, 0x104 , 0 , 0x30 , 0 , 0 , 0x2 }, // 0F F3 + {"psllq", 0x7 ,0x8D2200, 0x19 , 0x1204, 0x1204, 0x404 , 0 , 0x30 , 0 , 0 , 0x2 }, // 0F F3, L1 + {"psllq", 0x20 ,0x8D2200, 0x19 , 0x1204, 0x1204, 0x404 , 0 , 0x30 , 0 , 0 , 0x2 }}; // 0F F3, L1 // Submap for psrlw, Opcode 0F D1, Indexed by VEX.L bit -SOpcodeDef OpcodeMap99[2] = { - {"psrlw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D1 - {"psrlw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x402 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F D1 +SOpcodeDef OpcodeMap99[] = { + {"psrlw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D1 + {"psrlw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x402 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D1 + {"psrlw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x402 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F D1 // Submap for psrld, Opcode 0F D2, Indexed by VEX.L bit -SOpcodeDef OpcodeMap9A[2] = { - {"psrld", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D2 - {"psrld", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x403 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F D2 +SOpcodeDef OpcodeMap9A[] = { + {"psrld", 0x7 ,0x8D2200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D2 + {"psrld", 0x7 ,0x8D2200, 0x19 , 0x1203, 0x1203, 0x403 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D2 + {"psrld", 0x7 ,0x8D2200, 0x19 , 0x1203, 0x1203, 0x403 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F D2 // Submap for psrlq, Opcode 0F D3, Indexed by VEX.L bit -SOpcodeDef OpcodeMap9B[2] = { - {"psrlq", 0x7 , 0xD0200, 0x19 , 0x1104, 0x1104, 0x104 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D3 - {"psrlq", 0x7 , 0xD0200, 0x19 , 0x1104, 0x1104, 0x404 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F D3 +SOpcodeDef OpcodeMap9B[] = { + {"psrlq", 0x7 ,0x8D2200, 0x19 , 0x1104, 0x1104, 0x104 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D3 + {"psrlq", 0x7 ,0x8D2200, 0x19 , 0x1204, 0x1204, 0x404 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F D3 + {"psrlq", 0x7 ,0x8D2200, 0x19 , 0x1204, 0x1204, 0x404 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F D3 // Submap for psraw, Opcode 0F E1, Indexed by VEX.L bit -SOpcodeDef OpcodeMap9C[2] = { - {"psraw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D1 - {"psraw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x402 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F D1 +SOpcodeDef OpcodeMap9C[] = { + {"psraw", 0x7 ,0x8D2200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F E1 + {"psraw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x402 , 0 , 0x20 , 0 , 0 , 0x2 }, // 0F E1 + {"psraw", 0x7 ,0x8D2200, 0x19 , 0x1202, 0x1202, 0x402 , 0 , 0x20 , 0 , 0 , 0x2 }}; // 0F E1 // Submap for psrad, Opcode 0F E2, Indexed by VEX.L bit -SOpcodeDef OpcodeMap9D[2] = { - {"psrad", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F D2 - {"psrad", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x403 , 0x0 , 0x0 , 0x0 , 0x2 }}; // 0F D2 +SOpcodeDef OpcodeMap9D[] = { + {"psra", 0x7 ,0x8D3200, 0x19 , 0x1109, 0x1109, 0x109 , 0 , 0x21 , 0 , 0 , 0x3 }, // 0F E2 + {"psra", 0x7 ,0x8D3200, 0x19 , 0x1109, 0x1109, 0x409 , 0 , 0x21 , 0 , 0 , 0x3 }, // 0F E2. w bit specifies operand size only if EVEX + {"psra", 0x7 ,0x8D3200, 0x19 , 0x1109, 0x1109, 0x409 , 0 , 0x21 , 0 , 0 , 0x3 }}; // 0F E2. w bit specifies operand size only if EVEX -// name instset prefix format dest. source1 source2 source3 Swizzle link options +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options // Submap for vpbroadcastb, Opcode 0F 38 78, Indexed by memory/register SOpcodeDef OpcodeMap9E[2] = { - {"vpbroadcastb",0x1C, 0x78200, 0x12, 0x1201, 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 78 mem - {"vpbroadcastb",0x1C, 0x78200, 0x12, 0x1201, 0x401 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 78 reg + {"vpbroadcastb",0x1C,0x878200, 0x12, 0x1201, 0x1 , 0 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 38 78 mem + {"vpbroadcastb",0x1C,0x878200, 0x12, 0x1201, 0x401 , 0 , 0 , 0x20 , 0 , 0 , 0 }}; // 0F 38 78 reg // Submap for vpbroadcastw, Opcode 0F 38 79, Indexed by memory/register SOpcodeDef OpcodeMap9F[2] = { - {"vpbroadcastw",0x1C, 0x78200, 0x12, 0x1201, 0x2 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 79 mem - {"vpbroadcastw",0x1C, 0x78200, 0x12, 0x1201, 0x402 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 79 reg + {"vpbroadcastw",0x1C,0x878200, 0x12, 0x1201, 0x2 , 0 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 38 79 mem + {"vpbroadcastw",0x1C,0x878200, 0x12, 0x1201, 0x402 , 0 , 0 , 0x20 , 0 , 0 , 0 }}; // 0F 38 79 reg // Submap for vpbroadcastd, Opcode 0F 38 58, Indexed by memory/register SOpcodeDef OpcodeMapA0[2] = { - {"vpbroadcastd",0x1C,0x478200, 0x12, 0x1201, 0x3 , 0x0 , 0x0 , 0x100A, 0x0 , 0x0 }, // 0F 38 58 mem - {"vpbroadcastd",0x1C, 0x78200, 0x12, 0x1201, 0x403 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 58 reg + {"vpbroadcastd",0x1C,0xC78200, 0x12, 0x1201, 0x3 , 0 , 0 , 0x20 , 0x100A, 0 , 0 }, // 0F 38 58 mem + {"vpbroadcastd",0x1C,0x878200, 0x12, 0x1201, 0x403 , 0 , 0 , 0x20 , 0 , 0 , 0 }}; // 0F 38 58 reg // Submap for vpbroadcastq, Opcode 0F 38 59, Indexed by memory/register SOpcodeDef OpcodeMapA1[2] = { - {"vpbroadcastq",0x1C,0x47A200, 0x12, 0x1201, 0x4 , 0x0 , 0x0 , 0x100B, 0x0 , 0x0 }, // 0F 38 59 mem. (manuals disagree on W bit?) - {"vpbroadcastq",0x1C, 0x78200, 0x12, 0x1201, 0x404 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 59 reg + {"vpbroadcastq",0x1C,0xC7B200, 0x12, 0x1201, 0x4 , 0 , 0 , 0x20 , 0x100B, 0 , 0 }, // 0F 38 59 mem. (manuals disagree on W bit?) + {"vpbroadcastq",0x1C,0x879200, 0x12, 0x1201, 0x404 , 0 , 0 , 0x20 , 0 , 0 , 0 }}; // 0F 38 59 reg // Submap for 0F 38 F3. Indexed by reg bit -// name instset prefix format dest. source1 source2 source3 Swizzle link options +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options SOpcodeDef OpcodeMapA2[8] = { - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F3 /0 - {"blsr" , 0x1C , 0xB1000, 0x18 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F3 /3 - {"blsmsk", 0x1C , 0xB1000, 0x18 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F3 /3 - {"blsi" , 0x1C , 0xB1000, 0x18 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F3 /3 - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F3 /4 - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F3 /5 - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F3 /6 - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 F3 /7 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F3 /0 + {"blsr" , 0x1D , 0xB1000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F3 /3 + {"blsmsk", 0x1D , 0xB1000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F3 /3 + {"blsi" , 0x1D , 0xB1000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F3 /3 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F3 /4 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F3 /5 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F3 /6 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 38 F3 /7 // Submap for 0F 38 F5. Indexed by prefixes SOpcodeDef OpcodeMapA3[4] = { - {"bzhi" , 0x1C , 0xB1000, 0x1B , 0x1009, 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F5 - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F 38 F5 - {"pdep" , 0x1C , 0xB1000, 0x19 , 0x1009, 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 38 F5 - {"pext" , 0x1C , 0xB1000, 0x19 , 0x1009, 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 38 F5 + {"bzhi" , 0x1D , 0xB1000, 0x1B , 0x1009, 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 }, // 0F 38 F5 + {"wruss" , 0 , 0x1200 , 0x13 , 0x2009, 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 38 F5 + {"pdep" , 0x1D , 0xB1000, 0x19 , 0x1009, 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 38 F5 + {"pext" , 0x1D , 0xB1000, 0x19 , 0x1009, 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 38 F5 // Submap for 0F 3A F0. Indexed by prefixes SOpcodeDef OpcodeMapA4[4] = { - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 3A F0 - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F 3A F0 - {"rorx" , 0x1C , 0x31000, 0x52 , 0x1009, 0x9 , 0x31 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 3A F0 - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 3A F0 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A F0 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 3A F0 + {"rorx" , 0x1D , 0x31000, 0x52 , 0x1009, 0x9 , 0x31 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 3A F0 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 3A F0 // Quarternary opcode map for pinsrb. Opcode byte = 0F 3A 20 // Indexed by memory vs. register operand SOpcodeDef OpcodeMapA5[2] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pinsrb", 0x15 , 0x98200, 0x59 , 0x1401, 0x1401, 0x2001, 0x31 , 0x0 , 0x0 , 0x2 }, // 0F 3A 20 memory 8 - {"pinsrb", 0x15 , 0x98200, 0x59 , 0x1401, 0x1401, 0x1003, 0x31 , 0x0 , 0x0 , 0x2 }}; // 0F 3A 20 register 32 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pinsrb", 0x15 ,0x89A200, 0x59 , 0x1401, 0x1401, 0x2001, 0x31 , 0x1000, 0 , 0 , 0x2 }, // 0F 3A 20 memory 8 + {"pinsrb", 0x15 ,0x89A200, 0x59 , 0x1401, 0x1401, 0x1003, 0x31 , 0 , 0 , 0 , 0x2 }}; // 0F 3A 20 register 32 // Opcode map for VIA instructions. Opcode byte = 0F A6 .. // Indexed by mod and reg fields of mod/reg/rm byte SOpcodeDef OpcodeMapA6[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A6, mod<3, reg=0 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A6, mod<3, reg=1 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A6, mod<3, reg=2 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A6, mod<3, reg=3 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A6, mod<3, reg=4 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A6, mod<3, reg=5 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A6, mod<3, reg=6 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A6, mod<3, reg=7 - {"rep montmul;VIA",0x2001,0x8021,0x10, 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // F3 0F A6 /0 - {"rep xsha1;VIA",0x2001,0x8021,0x10 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // F3 0F A6 /1 - {"rep xsha256;VIA",0x2001,0x8021,0x10, 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // F3 0F A6 /2 - {0, 0x0 , 0 , 0x10 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F A6, mod=3, reg=3 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A6, mod<3, reg=0 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A6, mod<3, reg=1 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A6, mod<3, reg=2 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A6, mod<3, reg=3 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A6, mod<3, reg=4 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A6, mod<3, reg=5 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A6, mod<3, reg=6 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A6, mod<3, reg=7 + {"rep montmul;VIA",0x2001,0x8021,0x10, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // F3 0F A6 /0 + {"rep xsha1;VIA",0x2001,0x8021,0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // F3 0F A6 /1 + {"rep xsha256;VIA",0x2001,0x8021,0x10, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // F3 0F A6 /2 + {0, 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F A6, mod=3, reg=3 // Opcode map for VIA instructions. Opcode byte = 0F A7 .. // Indexed by mod and reg fields of mod/reg/rm byte SOpcodeDef OpcodeMapA7[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7, mod<3, reg=0 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7, mod<3, reg=1 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7, mod<3, reg=2 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7, mod<3, reg=3 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7, mod<3, reg=4 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7, mod<3, reg=5 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7, mod<3, reg=6 - {0, 0x0 , 0 , 0x12 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7, mod<3, reg=7 - {0, 0xA8 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F A7, mod=3, reg=0. Link to XSTORE - {"rep xcryptecb;VIA",0x2001,0x8021,0x10,0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // F3 0F A7 /1 - {"rep xcryptcbc;VIA",0x2001,0x8021,0x10,0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // F3 0F A7 /2 - {"rep xcryptctr;VIA",0x2001,0x8021,0x10,0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // F3 0F A7 /3 - {"rep xcryptcfb;VIA",0x2001,0x8021,0x10,0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // F3 0F A7 /4 - {"rep xcryptofb;VIA",0x2001,0x8021,0x10,0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // F3 0F A7 /5 - {0, 0x0 , 0 , 0x10 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F A7, mod=3, reg=6 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7, mod<3, reg=0 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7, mod<3, reg=1 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7, mod<3, reg=2 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7, mod<3, reg=3 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7, mod<3, reg=4 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7, mod<3, reg=5 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7, mod<3, reg=6 + {0, 0 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7, mod<3, reg=7 + {0, 0xA8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F A7, mod=3, reg=0. Link to XSTORE + {"rep xcryptecb;VIA",0x2001,0x8021,0x10,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // F3 0F A7 /1 + {"rep xcryptcbc;VIA",0x2001,0x8021,0x10,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // F3 0F A7 /2 + {"rep xcryptctr;VIA",0x2001,0x8021,0x10,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // F3 0F A7 /3 + {"rep xcryptcfb;VIA",0x2001,0x8021,0x10,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // F3 0F A7 /4 + {"rep xcryptofb;VIA",0x2001,0x8021,0x10,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // F3 0F A7 /5 + {0, 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F A7, mod=3, reg=6 // Opcode map for VIA XSTORE instruction. Opcode byte = 0F A7 /0 // Indexed by prefixes SOpcodeDef OpcodeMapA8[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"xstore;VIA",0x2001, 1 , 0x10 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F A7 /0 - {0, 0x0 , 0 , 0x10 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F A7 /0 - {0, 0x0 , 0 , 0x10 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F A7 /0 - {"rep xstore;VIA",0x2001,0x21, 0x10 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }}; // F3 0F A7 /0 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"xstore;VIA",0x2001, 1 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F A7 /0 + {0, 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F A7 /0 + {0, 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F A7 /0 + {"rep xstore;VIA",0x2001,0x21, 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }}; // F3 0F A7 /0 // Opcode map for XGETBV, XSETBV instruction. Opcode byte = 0F 01 /2 // Indexed by rm bits SOpcodeDef OpcodeMapA9[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"xgetbv", 0x16 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 D0 - {"xsetbv", 0x16 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 D1 - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 D2 - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 D3 - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 D4 - {"xend" , 0x1D , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 D5 - {"xtest" , 0x1D , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 D6 - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 01 D7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"xgetbv", 0x16 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 D0 + {"xsetbv", 0x16 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 D1 + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 D2 + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 D3 + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 D4 + {"xend" , 0x1D , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 D5 + {"xtest" , 0x1D , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 D6 + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 01 D7 // Opcode map for AMD virtualization instructions 0F 1F 11/011/xxx // Indexed by rm bits SOpcodeDef OpcodeMapAA[] = { - {"vmrun" , 0x1804 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 D8 - {"vmmcall", 0x1804 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 D9 - {"vmload", 0x1804 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 DA - {"vmsave", 0x1804 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 DB - {"stgi" , 0x1804 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 DC - {"clgi" , 0x1804 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 DD - {"skinit", 0x1804 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 DE - {0 , 0x1804 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }}; // 0F 01 DF + {"vmrun" , 0x1804 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 D8 + {"vmmcall", 0x1804 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 D9 + {"vmload", 0x1804 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 DA + {"vmsave", 0x1804 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 DB + {"stgi" , 0x1804 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 DC + {"clgi" , 0x1804 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 DD + {"skinit", 0x1804 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 DE + {0 , 0x1804 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }}; // 0F 01 DF // Opcode map for swapgs and RDTSCP instructions 0F 1F 11/111/xxx // Indexed by rm bits SOpcodeDef OpcodeMapAB[] = { - {"swapgs", 0x800 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 F8. instruction set unknown - {"rdtscp", 0x19 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x8 }, // 0F 01 F9. AMD SSE4.A and Intel AVX? - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 FA - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 FB - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 FC - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 FD - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 01 FE - {0 , 0 , 0x0 , 0x10 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 01 FF - -// Opcode map for fxsave and rdfsbase instructions 0F C7 /6 + {"swapgs", 0x800 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 F8. instruction set unknown + {"rdtscp", 0x19 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x8 }, // 0F 01 F9. AMD SSE4.A and Intel AVX? + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 FA + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 FB + {"clzero", 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 FC. AMD + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 FD + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 01 FE + {0 , 0 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F 01 FF + +// Opcode map for 0F C7 /6 // Indexed by mem/reg SOpcodeDef OpcodeMapAC[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x52 , 0x0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x9 , 0x0 }, // 0F C7 /6 mem link to vmptrld etc - {"rdrand", 0x10000,0x1100 , 0x11 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F C7 /6 reg +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0x52 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // 0F C7 /6 mem link to vmptrld etc + {"rdrand", 0x1D , 0x1100 , 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 0F C7 /6 reg // Submap for 0F 38 F7, indexed by prefixes -// name instset prefix format dest. source1 source2 source3 Swizzle link options +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options SOpcodeDef OpcodeMapAD[] = { - {"bextr", 0x1C , 0xB1000, 0x1B , 0x1009, 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 F7 - {"shlx", 0x1C , 0xB1000, 0x1B , 0x1009, 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F 38 F7 - {"shrx", 0x1C , 0xB1000, 0x1B , 0x1009, 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 38 F7 - {"sarx", 0x1C , 0xB1000, 0x1B , 0x1009, 0x9 , 0x1009, 0x0 , 0x0 , 0x0 , 0x0 }}; // f3 0F 38 F7 + {"bextr", 0x1D , 0xB3000, 0x1B , 0x1009, 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 }, // 0F 38 F7 + {"shlx", 0x1D , 0xB3200, 0x1B , 0x1009, 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 }, // 66 0F 38 F7 + {"shrx", 0x1D , 0xB3800, 0x1B , 0x1009, 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 }, // F2 0F 38 F7 + {"sarx", 0x1D , 0xB3400, 0x1B , 0x1009, 0x9 , 0x1009, 0 , 0 , 0 , 0 , 0 }}; // F3 0F 38 F7 // Submap for 0F BC, indexed by prefixes SOpcodeDef OpcodeMapAE[4] = { - {"bsf" , 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F BC - {"bsf" , 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 66 0F BC - {"tzcnti", 0x20 ,0x31800 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F BC - {"tzcnt" , 0x1C ,0x11500 , 0x12 , 0x1009, 0x9 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F BC, or 66 F3 0F BC. Does not work for F3 66 0F BC! + {"bsf" , 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F BC + {"bsf" , 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F BC + {"tzcnti", 0x20 ,0x31800 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F BC + {"tzcnt" , 0x1D ,0x11500 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F BC, or 66 F3 0F BC. Does not work for F3 66 0F BC! -// unused +// Submap for 0F C7 /7, Indexed by mem/reg SOpcodeDef OpcodeMapAF[] = { - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; + {"vmptrst", 0x813 , 0 , 0x11 , 0x2351, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F C7 /7 mem + {0 , 0x138 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }}; // 0F C7 /7 reg. link to rdseed, rdpid -// Opcode map for VEX prefix and mmmm = 0000 + +// Shortcut opcode map for VEX prefix and mmmm = 0000 // Indexed by first opcode byte after VEX prefix. With or without mod/reg/rm byte, and any number of immediate bytes SOpcodeDef OpcodeMapB0[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 00 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 01 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 02 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 03 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 04 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 05 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 06 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 07 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 08 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 09 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 10 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 11 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 12 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 13 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 14 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 15 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 16 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 17 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 18 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 19 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 1A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 1B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 1C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 1D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 1E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 1F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 20 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 21 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 22 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 23 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 24 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 25 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 26 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 27 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 28 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 29 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 2A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 2B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 2C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 2D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 2E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 2F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 30 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 31 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 32 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 33 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 34 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 35 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 36 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 37 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 38 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 39 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 3A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 3B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 3C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 3D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 3E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 3F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 40 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 41 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 42 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 43 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 44 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 45 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 46 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 47 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 48 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 49 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 4A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 4B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 4C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 4D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 4E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 4F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 50 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 51 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 52 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 53 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 54 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 55 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 56 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 57 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 58 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 59 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 5A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 5B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 5C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 5D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 5E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 5F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 60 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 61 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 62 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 63 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 64 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 65 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 66 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 67 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 68 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 69 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 6A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 6B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 6C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 6D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 6E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 6F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 70 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 71 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 72 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 73 - {"jkzd", 0x20 , 0xB0080, 0x44 , 0x95 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // VEX 74 - {"jknzd", 0x20 , 0xB0080, 0x44 , 0x95 , 0x81 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // VEX 75 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 76 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 77 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 78 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 79 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 7A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 7B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 7C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 7D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 7E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // VEX 7F - -// Opcode map for VEX prefix and mmmm = 0001 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 00 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 01 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 02 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 03 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 04 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 05 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 06 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 07 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 08 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 09 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 10 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 11 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 12 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 13 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 14 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 15 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 16 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 17 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 18 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 19 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 1A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 1B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 1C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 1D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 1E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 1F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 20 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 21 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 22 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 23 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 24 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 25 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 26 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 27 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 28 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 29 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 2A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 2B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 2C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 2D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 2E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 2F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 30 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 31 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 32 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 33 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 34 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 35 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 36 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 37 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 38 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 39 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 3A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 3B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 3C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 3D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 3E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 3F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 40 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 41 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 42 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 43 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 44 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 45 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 46 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 47 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 48 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 49 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 4A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 4B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 4C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 4D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 4E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 4F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 50 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 51 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 52 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 53 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 54 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 55 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 56 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 57 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 58 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 59 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 5A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 5B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 5C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 5D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 5E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 5F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 60 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 61 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 62 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 63 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 64 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 65 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 67 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 68 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 69 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 6A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 6B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 6C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 6D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 6E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 6F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 70 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 71 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 72 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 73 + {"jkzd", 0x20 , 0xB0080, 0x44 , 0x95 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // VEX 74 + {"jknzd", 0x20 , 0xB0080, 0x44 , 0x95 , 0x81 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // VEX 75 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 76 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 77 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 78 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 79 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 7A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 7B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 7C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 7D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 7E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // VEX 7F + +// Shortcut opcode map for VEX or EVEX prefix and mmmm = 0001 // Important: if VEX prefix is optional then use OpcodeMap1 instead. Don't put the same code in both maps! // Indexed by first opcode byte after VEX prefix. With or without mod/reg/rm byte, and any number of immediate bytes SOpcodeDef OpcodeMapB1[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 00 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 01 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 02 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 03 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 04 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 05 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 06 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 07 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 08 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 09 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 0A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 0B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 0C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 0D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 0E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 0F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 10 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 11 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 12 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 13 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 14 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 15 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 16 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 17 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 18 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 19 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 1A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 1B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 1C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 1D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 1E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 1F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 20 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 21 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 22 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 23 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 24 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 25 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 26 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 27 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 28 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 29 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 2A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 2B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 2C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 2D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 2E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 2F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 30 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 31 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 32 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 33 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 34 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 35 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 36 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 37 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 38 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 39 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 3A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 3B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 3C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 3D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 3E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 3F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 40 - {"kand", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 41 - {"kandn", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 42 - {"kandnr", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 43 - {"knot", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 44 - {"kor", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 45 - {"kxnor", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 46 - {"kxor", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 47 - {"kmerge2l1h",0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 48 - {"kmerge2l1l",0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 49 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 4A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 4B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 4C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 4D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 4E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 4F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 50 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 51 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 52 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 53 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 54 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 55 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 56 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 57 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 58 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 59 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 5A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 5B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 5C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 5D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 5E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 5F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 60 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 61 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 62 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 63 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 64 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 65 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 66 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 67 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 68 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 69 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 6A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 6B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 6C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 6D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 6E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 6F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 70 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 71 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 72 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 73 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 74 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 75 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 76 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 77 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 78 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 79 -{"vcvtudq2pd", 0x12 ,0x428400, 0x12 , 0x164C, 0x603 , 0x0 , 0x0 , 0x1214, 0x0 , 0x100 }, // VEX 0F 7A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 7B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 7C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 7D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 7E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 7F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 80 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 81 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 82 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 83 - {"jkzd", 0x20 , 0xB0080, 0x84 , 0x95 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // VEX 0F 84 - {"jknzd", 0x20 , 0xB0080, 0x84 , 0x95 , 0x82 , 0x0 , 0x0 , 0x0 , 0x0 , 0x80 }, // VEX 0F 85 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 86 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 87 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 88 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 89 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 8A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 8B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 8C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 8D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 8E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 8F -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"kmov", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 90 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 91 - {"kmov", 0x20 , 0x30000, 0x12 , 0x95 , 0x1003, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 92 - {"kmov", 0x20 , 0x30000, 0x12 , 0x03 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 93 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 94 - {"kconcath", 0x20 , 0xB0000, 0x19 , 0x1004, 0x1095, 0x1095, 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 95 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 96 - {"kconcatl", 0x20 , 0xB0000, 0x19 , 0x1004, 0x1095, 0x1095, 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 97 - {"kortest", 0x20 , 0x30000, 0x12 , 0x95 , 0x1095, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 98 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 99 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 9A - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 9B - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 9C - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 9D - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 9E - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 9F - - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A0 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A1 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A2 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A3 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A4 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A5 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A6 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A7 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A8 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F A9 - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F AA - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F AB - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F AC - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F AD - {0, 0xCD , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x2 , 0x0 }, // VEX 0F AE. Link - {0, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // VEX 0F AF - -// Submap for 0F 38 1A, indexed by L bit and MVEX for vector size +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 00 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 01 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 02 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 03 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 04 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 05 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 06 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 07 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 08 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 09 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 0A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 0B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 0C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 0D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 0E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 0F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 10 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 11 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 12 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 13 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 14 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 15 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 16 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 17 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 18 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 19 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 1A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 1B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 1C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 1D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 1E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 1F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 20 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 21 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 22 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 23 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 24 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 25 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 26 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 27 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 28 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 29 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 2A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 2B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 2C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 2D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 2E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 2F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 30 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 31 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 32 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 33 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 34 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 35 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 36 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 37 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 38 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 39 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 3A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 3B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 3C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 3D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 3E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 3F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 40 + {"kand", 0x20 , 0xE5200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 1 }, // VEX 0F 41 + {"kandn", 0x20 , 0xE5200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 1 }, // VEX 0F 42 + {"kandnr", 0x80 , 0x30000, 0x12 , 0x95 , 0x1095, 0 , 0 , 0 , 0 , 0 , 1 }, // VEX 0F 43 + {"knot", 0x20 , 0xE5200, 0x12 , 0x1095, 0x1095, 0 , 0 , 0 , 0 , 0 , 1 }, // VEX 0F 44 + {"kor", 0x20 , 0xE5200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 1 }, // VEX 0F 45 + {"kxnor", 0x20 , 0xE5200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 1 }, // VEX 0F 46 + {"kxor", 0x20 , 0xE5200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 1 }, // VEX 0F 47 + {"kmerge2l1h",0x80 , 0x30000, 0x12 , 0x95 , 0x1095, 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 48 + {"kmerge2l1l",0x80 , 0x30000, 0x12 , 0x95 , 0x1095, 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 49 + {"kadd", 0x20 , 0xE5200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 1 }, // VEX 0F 41 + {0, 0xF0 , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // VEX 0F 4B. Link to kunpckbw + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 4C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 4D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 4E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 4F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 50 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 51 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 52 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 53 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 54 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 55 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 56 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 57 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 58 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 59 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 5A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 5B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 5C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 5D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 5E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 5F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 60 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 61 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 62 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 63 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 64 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 65 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 67 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 68 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 69 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 6A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 6B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 6C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 6D + {"vmov", 0x7 ,0x813200, 0x12 , 0x1409, 0x9 , 0 , 0 , 0x00 , 0 , 0 , 0x1 }, // VEX 0F 6E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 6F + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 70 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 71 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 72 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 73 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 74 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 75 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 76 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 77 + {0, 0xDA , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // EVEX 0F 78. Link to vcvttpd2udq + {0, 0xD6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // EVEX 0F 79. Link to vcvtps etc + {0, 0xDC , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // E/MVEX 0F 7A. Link to vcvtudq2pd + {0, 0xDD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // EVEX 0F 7B. Link to vcvtusi2sd etc + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 7C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 7D + {0, 0xE2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // VEX 0F 7E. Link to movq + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 7F + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 80 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 81 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 82 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 83 + {"jkzd", 0x20 , 0xB0080, 0x84 , 0x95 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // VEX 0F 84 + {"jknzd", 0x20 , 0xB0080, 0x84 , 0x95 , 0x82 , 0 , 0 , 0 , 0 , 0 , 0x80 }, // VEX 0F 85 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 86 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 87 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 88 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 89 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 8A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 8B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 8C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 8D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 8E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 8F +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0xEB , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , }, // VEX 0F 90. Link to kmov + {"kmov", 0x20 , 0x35200, 0x13 , 0x2009, 0x1095, 0 , 0 , 0 , 0 , 0 , 1 }, // VEX 0F 91. Name without w in KNC syntax, but code identical + {0, 0xEC , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // VEX 0F 92. Link to kmov r, k + {0, 0xEE , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }, // VEX 0F 93. Link to kmov k, r + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 94 + {"kconcath", 0x80 , 0xB0000, 0x19 , 0x1004, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 0 }, // VEX 0F 95 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 96 + {"kconcatl", 0x80 , 0xB0000, 0x19 , 0x1004, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 0 }, // VEX 0F 97 + {"kortest", 0x20 , 0x25200, 0x12 , 0x95 , 0x1095, 0 , 0 , 0 , 0 , 0 , 1 }, // VEX 0F 98 + {"ktest", 0x20 , 0x25200, 0x12 , 0x1095, 0x1095, 0 , 0 , 0 , 0 , 0 , 1 }, // VEX 0F 99 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 9A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 9B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 9C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 9D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 9E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 9F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A0 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A1 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A2 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A3 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A4 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A5 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A6 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A7 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A8 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F A9 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AA + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AB + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AC + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AD + {0, 0xCD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x4 , 0 }, // VEX 0F AE. Link + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // VEX 0F AF + + +// Shortcut opcode map for EVEX F2 0F 38 +// Indexed by first opcode byte after EVEX prefix SOpcodeDef OpcodeMapB2[] = { - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 1A, 128 bits - {"vbroadcastf128",0x19,0x178200,0x12 , 0x154B, 0x244B, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 1A, 256 bits - {"vbroadcastf32x4",0x20,0x428200,0x12, 0x164B, 0x264B, 0x0 , 0x0 , 0x1010, 0x0 , 0x100 }, // 0F 38 1A, 512 bits - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; - -// Submap for 0F 38 5A, indexed by L bit and MVEX for vector size + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 00 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 01 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 02 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 03 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 04 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 05 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 06 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 07 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 08 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 09 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 0A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 0B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 0C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 0D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 0E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 0F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 10 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 11 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 12 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 13 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 14 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 15 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 16 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 17 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 18 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 19 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 1A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 1B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 1C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 1D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 1E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 1F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 20 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 21 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 22 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 23 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 24 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 25 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 26 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 27 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 28 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 29 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 2A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 2B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 2C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 2D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 2E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 2F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 30 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 31 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 32 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 33 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 34 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 35 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 36 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 37 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 38 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 39 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 3A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 3B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 3C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 3D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 3E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 3F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 40 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 41 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 42 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 43 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 44 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 45 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 46 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 47 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 48 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 49 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 4A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 4B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 4C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 4D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 4E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 4F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 50 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 51 + {"vp4dpwssd" ,0x24 ,0x8F9800, 0x19 , 0x164B, 0x164B, 0x244B, 0 , 0x20 , 0 , 0 , 0 }, // EVEX F2 0F 38 52 + {"vp4dpwssds",0x24 ,0x8F9800, 0x19 , 0x164B, 0x164B, 0x244B, 0 , 0x20 , 0 , 0 , 0 }, // EVEX F2 0F 38 53 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 54 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 55 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 56 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 57 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 58 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 59 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 5A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 5B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 5C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 5D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 5E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 5F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 60 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 61 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 62 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 63 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 64 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 65 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 67 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 68 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 69 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 6A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 6B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 6C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 6D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 6E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 6F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 70 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 71 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 72 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 73 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 74 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 75 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 76 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 77 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 78 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 79 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 7A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 7B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 7C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 7D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 7E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 7F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 80 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 81 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 82 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 83 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 84 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 85 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 86 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 87 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 88 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 89 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 8A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 8B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 8C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 8D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 8E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 8F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 90 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 91 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 92 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 93 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 94 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 95 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 96 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 97 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 98 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 99 + {"v4fmaddps", 0x24 ,0x8F9800, 0x19 , 0x164B, 0x164B, 0x264B, 0 , 0x20 , 0 , 0 , 0 }, // EVEX F2 0F 38 9A + {"v4fmaddss", 0x24 ,0x8F9800, 0x19 , 0x144B, 0x144B, 0x244B, 0 , 0x20 , 0 , 0 , 0 }, // EVEX F2 0F 38 9B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 9C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 9D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 9E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 9F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A0 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A1 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A2 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A3 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A4 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A5 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A6 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A7 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A8 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 A9 + {"v4fnmaddps",0x24 ,0x8F9800, 0x19 , 0x164B, 0x164B, 0x264B, 0 , 0x20 , 0 , 0 , 0 }, // EVEX F2 0F 38 AA + {"v4fnmaddss",0x24 ,0x8F9800, 0x19 , 0x144B, 0x144B, 0x244B, 0 , 0x20 , 0 , 0 , 0 }, // EVEX F2 0F 38 AB + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 AC + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 AD + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F2 0F 38 AE + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // EVEX F2 0F 38 AF + + +// Shortcut opcode map for EVEX F3 0F 38 +// Indexed by first opcode byte after EVEX prefix SOpcodeDef OpcodeMapB3[] = { - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 5A, 128 bits - {"vbroadcasti128",0x1C,0x178200,0x12 , 0x1550, 0x2451, 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 5A, 256 bits - {"vbroadcasti32x4",0x20,0x428200,0x12, 0x1603, 0x2603, 0x0 , 0x0 , 0x1012, 0x0 , 0x100 }, // 0F 38 5A, 512 bits - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 00 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 01 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 02 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 03 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 04 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 05 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 06 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 07 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 08 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 09 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 0A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 0B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 0C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 0D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 0E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 0F + + {"vpmovuswb", 0x20 ,0x820400, 0x13 , 0x0F01, 0x1202, 0 , 0 , 0x2220, 0 , 0 , 0x800 }, // EVEX F3 0F 38 10 + {"vpmovusdb", 0x20 ,0x820400, 0x13 , 0x0401, 0x1203, 0 , 0 , 0x2430, 0 , 0 , 0x800 }, // EVEX F3 0F 38 11 + {"vpmovusqb", 0x20 ,0x820400, 0x13 , 0x0401, 0x1204, 0 , 0 , 0x2630, 0 , 0 , 0x800 }, // EVEX F3 0F 38 12 + {"vpmovusdw", 0x20 ,0x820400, 0x13 , 0x0F02, 0x1203, 0 , 0 , 0x2220, 0 , 0 , 0x800 }, // EVEX F3 0F 38 13 + {"vpmovusqw", 0x20 ,0x820400, 0x13 , 0x0402, 0x1204, 0 , 0 , 0x2430, 0 , 0 , 0x800 }, // EVEX F3 0F 38 14 + {"vpmovusqd", 0x20 ,0x820400, 0x13 , 0x0F03, 0x1204, 0 , 0 , 0x2220, 0 , 0 , 0x800 }, // EVEX F3 0F 38 15 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 16 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 17 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 18 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 19 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 1A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 1B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 1C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 1D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 1E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 1F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vpmovswb", 0x20 ,0x820400, 0x13 , 0x0F01, 0x1202, 0 , 0 , 0x2220, 0 , 0 , 0x800 }, // EVEX F3 0F 38 20 + {"vpmovsdb", 0x20 ,0x820400, 0x13 , 0x0401, 0x1203, 0 , 0 , 0x2430, 0 , 0 , 0x800 }, // EVEX F3 0F 38 21 + {"vpmovsqb", 0x20 ,0x820400, 0x13 , 0x0401, 0x1204, 0 , 0 , 0x2630, 0 , 0 , 0x800 }, // EVEX F3 0F 38 22 + {"vpmovsdw", 0x20 ,0x820400, 0x13 , 0x0F02, 0x1203, 0 , 0 , 0x2220, 0 , 0 , 0x800 }, // EVEX F3 0F 38 23 + {"vpmovsqw", 0x20 ,0x820400, 0x13 , 0x0402, 0x1204, 0 , 0 , 0x2430, 0 , 0 , 0x800 }, // EVEX F3 0F 38 24 + {"vpmovsqd", 0x20 ,0x820400, 0x13 , 0x0F03, 0x1204, 0 , 0 , 0x2220, 0 , 0 , 0 }, // EVEX F3 0F 38 25 + {"vptestnm", 0x20 ,0x8EC200, 0x19 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0 , 0 , 1 }, // EVEX F3 0F 38 26 + {"vptestnm", 0x20 ,0x8EB200, 0x19 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0 , 0 , 1 }, // EVEX F3 0F 38 27 + {"vpmovm2", 0x20 ,0x86C400, 0x12 , 0x1201, 0x95 , 0 , 0 , 0 , 0 , 0 , 1 }, // EVEX F3 0F 38 28 + {0, 0x12E , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // EVEX F3 0F 38 29 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 2A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 2B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 2C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 2D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 2E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 2F + + {"vpmovwb", 0x20 ,0x820400, 0x13 , 0x0F01, 0x1202, 0 , 0 , 0x2220, 0 , 0 , 0x800 }, // EVEX F3 0F 38 30 + {"vpmovdb", 0x20 ,0x820400, 0x13 , 0x0401, 0x1203, 0 , 0 , 0x2420, 0 , 0 , 0x800 }, // EVEX F3 0F 38 31 + {"vpmovqb", 0x20 ,0x820400, 0x13 , 0x0401, 0x1204, 0 , 0 , 0x2620, 0 , 0 , 0x800 }, // EVEX F3 0F 38 32 + {"vpmovdw", 0x20 ,0x820400, 0x13 , 0x0F02, 0x1203, 0 , 0 , 0x2220, 0 , 0 , 0x800 }, // EVEX F3 0F 38 33 + {"vpmovqw", 0x20 ,0x820400, 0x13 , 0x0402, 0x1204, 0 , 0 , 0x2420, 0 , 0 , 0x800 }, // EVEX F3 0F 38 34 + {"vpmovqd", 0x20 ,0x820400, 0x13 , 0x0F03, 0x1204, 0 , 0 , 0x2220, 0 , 0 , 0x800 }, // EVEX F3 0F 38 35 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 36 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 37 + {"vpmovm2", 0x20 ,0x86B400, 0x12 , 0x1201, 0x95 , 0 , 0 , 0 , 0 , 0 , 1 }, // EVEX F3 0F 38 38 + {0, 0x12F , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // EVEX F3 0F 38 39 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 3A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 3B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 3C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 3D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 3E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 3F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 40 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 41 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 42 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 43 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 44 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 45 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 46 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 47 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 48 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 49 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 4A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 4B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 4C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 4D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 4E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 4F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 50 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 51 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 52 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 53 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 54 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 55 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 56 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 57 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 58 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 59 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 5A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 5B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 5C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 5D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 5E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 5F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 60 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 61 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 62 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 63 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 64 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 65 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 67 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 68 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 69 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 6A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 6B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 6C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 6D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 6E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 6F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 70 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 71 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 72 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 73 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 74 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 75 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 76 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 77 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 78 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 79 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 7A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 7B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 7C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 7D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 7E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 7F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 80 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 81 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 82 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 83 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 84 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 85 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 86 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 87 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 88 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 89 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 8A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 8B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 8C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 8D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 8E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 8F + + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 90 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 91 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 92 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 93 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 94 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 95 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 96 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 97 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 98 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 99 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 9A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 9B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 9C + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 9D + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 9E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 9F + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A0 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A1 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A2 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A3 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A4 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A5 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A6 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A7 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A8 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 A9 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 AA + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 AB + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 AC + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 AD + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 AE + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // EVEX F3 0F 38 AF + + // Submap for vcvtfxpntpd2udq etc. Opcode byte = 0F 3A CA // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMapB4[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options -{"vcvtfxpntudq2ps",0x20 ,0x420000, 0x52 , 0x164B, 0x603 , 0x31 , 0x0 , 0x1206, 0x0 , 0x100 }, // 0F 3A CA -{"vcvtfxpntps2udq",0x20 ,0x420200, 0x52 , 0x1603, 0x64B , 0x31 , 0x0 , 0x1204, 0x0 , 0x100 }, // 66 0F 3A CA -{"vcvtfxpntpd2udq",0x20 ,0x423800, 0x52 , 0x1603, 0x64C , 0x31 , 0x0 , 0x1205, 0x0 , 0x100 }, // F2 0F 3A CA - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 3A CA +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +{"vcvtfxpntudq2ps",0x80 ,0x420000, 0x52 , 0x164B, 0x603 , 0x31 , 0 , 0 , 0x1206, 0 , 0x100 }, // 0F 3A CA +{"vcvtfxpntps2udq",0x80 ,0x420200, 0x52 , 0x1603, 0x64B , 0x31 , 0 , 0 , 0x1204, 0 , 0x100 }, // 66 0F 3A CA +{"vcvtfxpntpd2udq",0x80 ,0x423800, 0x52 , 0x1603, 0x64C , 0x31 , 0 , 0 , 0x1205, 0 , 0x100 }, // F2 0F 3A CA + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 3A CA // Submap for vcvtfxpntdq2ps etc. Opcode byte = 0F 3A CB // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMapB5[] = { -{"vcvtfxpntdq2ps",0x20 ,0x420000, 0x52 , 0x164B, 0x603 , 0x31 , 0x0 , 0x1206, 0x0 , 0x100 }, // 0F 3B CB -{"vcvtfxpntps2dq",0x20 ,0x420200, 0x52 , 0x1603, 0x64B , 0x31 , 0x0 , 0x1204, 0x0 , 0x100 }, // 66 0F 3B CB - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }, // F2 0F 3B CB - {0 , 0 , 0x0 , 0x0 , 0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 }}; // F3 0F 3B CB +{"vcvtfxpntdq2ps",0x80 ,0x420000, 0x52 , 0x164B, 0x603 , 0x31 , 0 , 0 , 0x1206, 0 , 0x100 }, // 0F 3B CB +{"vcvtfxpntps2dq",0x80 ,0x420200, 0x52 , 0x1603, 0x64B , 0x31 , 0 , 0 , 0x1204, 0 , 0x100 }, // 66 0F 3B CB + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 3B CB + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 3B CB // Submap for vgatherdps. Opcode byte = 0F 38 92 // Indexed by MVEX prefix SOpcodeDef OpcodeMapB6[] = { - {"vgatherdp", 0xCC ,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // VEX 0F 38 92. link vgatherdps - {"vgatherdps",0x20 ,0x438200, 0x1E, 0x24F , 0x224F, 0x0 , 0x0 , 0x3048, 0x0 , 0x0 }}; // MVEX 0F 38 92 + {"vgatherdp", 0xCC ,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // VEX 0F 38 92. link vgatherdps + {"vgatherdp", 0xCB ,0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // EVEX/MVEX 0F 38 92. link vgatherdps, has k register as mask -// Submap for vgatherpf.. Opcode byte = 0F 38 C6 -// Indexed by reg bits +// Submap for E/MVEX 0F 38 C6 vgatherpf.. Indexed by W bit SOpcodeDef OpcodeMapB7[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options -{"vgatherpf0hintdp",0x20,0x439200, 0x1E, 0x0 , 0x264B, 0x0 , 0x0 , 0x1048, 0x0 , 0x101 }, // MVEX 0F 38 C6 /0 -{"vgatherpf0dps",0x20,0x438200, 0x1E, 0x0 , 0x264B, 0x0 , 0x0 , 0x1048, 0x0 , 0x100 }, // MVEX 0F 38 C6 /1 -{"vgatherpf1dps",0x20,0x438200, 0x1E, 0x0 , 0x264B, 0x0 , 0x0 , 0x1048, 0x0 , 0x100 }, // MVEX 0F 38 C6 /2 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // -{"vscatterpf0hintdp",0x20,0x43B200,0x1E, 0x0 , 0x264F, 0x0 , 0x0 , 0x1048, 0x0 , 0x101 }, // MVEX 0F 38 C6 /4 -{"vscatterpf0dps",0x20,0x438200, 0x1E, 0x0 , 0x264B, 0x0 , 0x0 , 0x1048, 0x0 , 0x100 }, // MVEX 0F 38 C6 /5 -{"vscatterpf1dps",0x20,0x438200, 0x1E, 0x0 , 0x264B, 0x0 , 0x0 , 0x1048, 0x0 , 0x100 }, // MVEX 0F 38 C6 /6 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0 , 0x10D , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }, // E/MVEX 0F 38 C6. W0 + {0 , 0x10E , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x2 , 0 }}; // E/MVEX 0F 38 C6. W1 // Submap for movdqa. Opcode byte = 66 0F 6F -// Indexed by MVEX prefix +// Indexed by E/MVEX prefix SOpcodeDef OpcodeMapB8[] = { - {"movdqa", 0x12 , 0x50100, 0x12 , 0x1250, 0x250 , 0x0 , 0x0 , 0x0 , 0x0 , 0x102 }, // 66 0F 6F - {"movdqa", 0xB9 , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0xC , 0x100 }}; // MVEX.66 0F 6F. link + {"movdqa", 0x12 , 0x52100, 0x12 , 0x1250, 0x250 , 0 , 0 , 0 , 0 , 0 , 0x102 }, // 66 0F 6F + {"vmovdqa", 0x19 ,0xC53100, 0x12 , 0x1209, 0x209 , 0 , 0 , 0x30 , 0x140A, 0 , 0x1100}}; // E/MVEX.66 0F 6F -// Submap for movdqa. Opcode byte = 66 0F 6F -// Indexed by MVEX.W prefix +// Submap for movdqu. Opcode byte = F3 0F 6F +// Indexed by E/MVEX prefix SOpcodeDef OpcodeMapB9[] = { - {"vmovdqa32", 0x20 ,0x450100, 0x12 , 0x1203, 0x203 , 0x0 , 0x0 , 0x140A, 0x0 , 0x100 }, // MVEX.66.W0 0F 6F - {"vmovdqa64", 0x20 ,0x453100, 0x12 , 0x1204, 0x204 , 0x0 , 0x0 , 0x140B, 0x0 , 0x100 }}; // MVEX.66.W1 0F 6F + {"movdqu", 0x12 , 0x50400, 0x12 , 0x1250, 0x251 , 0 , 0 , 0 , 0 , 0 , 0x202 }, // F3 0F 6F + {"vmovdqu", 0x20 ,0x853400, 0x12 , 0x1209, 0x209 , 0 , 0 , 0x30 , 0 , 0 , 0x1200}}; // F3 0F 6F // Submap for movdqa. Opcode byte = 66 0F 7F -// Indexed by MVEX prefix +// Indexed by E/MVEX prefix SOpcodeDef OpcodeMapBA[] = { - {"movdqa", 0x12 , 0x50100, 0x13 , 0x250 , 0x1250, 0x0 , 0x0 , 0x0 , 0x0 , 0x102 }, // 66 0F 7F - {"movdqa", 0xBB , 0 , 0 , 0 , 0 , 0x0 , 0x0 , 0x0 , 0xC , 0 }}; // MVEX.66 0F 7F. link + {"movdqa", 0x12 , 0x52100, 0x13 , 0x250 , 0x1250, 0 , 0 , 0 , 0 , 0 , 0x102 }, // 66 0F 7F + {"vmovdqa", 0x19 ,0xC53100, 0x13 , 0x203 , 0x1203, 0 , 0 , 0x30 , 0x140E, 0 , 0x1100}}; // E/MVEX.66.W0 0F 7F -// Submap for movdqa. Opcode byte = 66 0F 7F +// Submap for movdqu. Opcode byte = F3 0F 7F // Indexed by MVEX.W prefix SOpcodeDef OpcodeMapBB[] = { - {"vmovdqa32", 0x20 ,0x450100, 0x13 , 0x203 , 0x1203, 0x0 , 0x0 , 0x140E, 0x0 , 0x100 }, // MVEX.66.W0 0F 7F - {"vmovdqa64", 0x20 ,0x453100, 0x13 , 0x204 , 0x1204, 0x0 , 0x0 , 0x140F, 0x0 , 0x100 }}; // MVEX.66.W1 0F 7F + {"movdqu", 0x12 , 0x50400, 0x13 , 0x251 , 0x1250, 0 , 0 , 0 , 0 , 0 , 0x202 }, // F3 0F 7F + {"vmovdqu", 0x20 ,0x853400, 0x13 , 0x209 , 0x1209, 0 , 0 , 0x30 , 0 , 0 ,0x1200 }}; // E/MVEX F3 0F 7F // Submap for vmovaps. Opcode byte = 0F 29 // Indexed by prefix: none/66/F2/F3 SOpcodeDef OpcodeMapBC[] = { - {"mova", 0x11 ,0x452200, 0x13 , 0x24F , 0x124F, 0x0 , 0x0 , 0x140C, 0x0 , 0x103 }, // 0F 29. movaps - {"mova", 0x11 ,0x452200, 0x13 , 0x24F , 0x124F, 0x0 , 0x0 , 0x140C, 0x0 , 0x103 }, // 66 0F 29. movapd - {0 , 0xBD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xF , 0 }, // F2 0F 29. link to vmovnraps - {0 , 0xBD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xF , 0 }}; // F3 0F 29. link to vmovnraps + {"mova", 0x11 ,0xC52200, 0x13 , 0x24F , 0x124F, 0 , 0 , 0x30 , 0x140C, 0 , 0x103 }, // 0F 29. movaps + {"mova", 0x11 ,0xC52200, 0x13 , 0x24F , 0x124F, 0 , 0 , 0x30 , 0x140C, 0 , 0x103 }, // 66 0F 29. movapd + {0 , 0xBD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xF , 0 }, // F2 0F 29. link to vmovnraps + {0 , 0xBD , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xF , 0 }}; // F3 0F 29. link to vmovnraps // Submap for vmovnraps. Opcode byte = F2/F3 0F 29 // Indexed by MVEX.E bit SOpcodeDef OpcodeMapBD[] = { - {"vmovnrap", 0x20 ,0x411C00, 0x13 ,0x224F , 0x124F, 0x0 , 0x0 , 0x180C, 0x0 , 0x101 }, // F2/F3 0F 29 - {"vmovnrngoap",0x20 ,0x411C00, 0x13 ,0x224F , 0x124F, 0x0 , 0x0 , 0x180C, 0x0 , 0x101 }}; // F2/F3 0F 29, MVEX.E + {"vmovnrap", 0x80 ,0x411C00, 0x13 ,0x224F , 0x124F, 0 , 0 , 0 , 0x180C, 0 , 0x101 }, // F2/F3 0F 29 + {"vmovnrngoap",0x80 ,0x411C00, 0x13 ,0x224F , 0x124F, 0 , 0 , 0 , 0x180C, 0 , 0x101 }}; // F2/F3 0F 29, MVEX.E // Submap for vloadunpackld. Opcode byte = 0F 38 D0 // Indexed by prefix: none/66 SOpcodeDef OpcodeMapBE[] = { - {"vloadunpackl",0x20, 0x423200,0x12 , 0x1609, 0x2609, 0x0 , 0x0 , 0x100A, 0x0 , 0x101 }, // 0F 38 D0 - {"vpackstorel" ,0x20, 0x423200,0x13 , 0x2609, 0x1609, 0x0 , 0x0 , 0x100E, 0x0 , 0x101 }}; // 66 0F 38 D0 + {"vloadunpackl",0x80, 0x423200,0x12 , 0x1609, 0x2609, 0 , 0 , 0 , 0x100A, 0 , 0x101 }, // 0F 38 D0 + {"vpackstorel" ,0x80, 0x423200,0x13 , 0x2609, 0x1609, 0 , 0 , 0 , 0x100E, 0 , 0x101 }}; // 66 0F 38 D0 // Submap for vloadunpacklps. Opcode byte = 0F 38 D1 // Indexed by prefix: none/66 SOpcodeDef OpcodeMapBF[] = { - {"vloadunpacklp",0x20,0x421200,0x12 , 0x164F, 0x264F, 0x0 , 0x0 , 0x1008, 0x0 , 0x101 }, // 0F 38 D1 - {"vpackstorelp" ,0x20,0x421200,0x13 , 0x264F, 0x164F, 0x0 , 0x0 , 0x100C, 0x0 , 0x101 }}; // 66 0F 38 D1 + {"vloadunpacklp",0x80,0x421200,0x12 , 0x164F, 0x264F, 0 , 0 , 0 , 0x1008, 0 , 0x101 }, // 0F 38 D1 + {"vpackstorelp" ,0x80,0x421200,0x13 , 0x264F, 0x164F, 0 , 0 , 0 , 0x100C, 0 , 0x101 }}; // 66 0F 38 D1 // Submap for vloadunpackhd. Opcode byte = 0F 38 D4 // Indexed by prefix: none/66 SOpcodeDef OpcodeMapC0[] = { - {"vloadunpackh",0x20, 0x423200,0x12 , 0x1609, 0x2609, 0x0 , 0x0 , 0x100A, 0x0 , 0x101 }, // 0F 38 D4 - {"vpackstoreh" ,0x20, 0x423200,0x13 , 0x2609, 0x1609, 0x0 , 0x0 , 0x100E, 0x0 , 0x101 }}; // 66 0F 38 D4 + {"vloadunpackh",0x80, 0x423200,0x12 , 0x1609, 0x2609, 0 , 0 , 0 , 0x100A, 0 , 0x101 }, // 0F 38 D4 + {"vpackstoreh" ,0x80, 0x423200,0x13 , 0x2609, 0x1609, 0 , 0 , 0 , 0x100E, 0 , 0x101 }}; // 66 0F 38 D4 // Submap for vloadunpackhps. Opcode byte = 0F 38 D5 // Indexed by prefix: none/66 SOpcodeDef OpcodeMapC1[] = { - {"vloadunpackhp",0x20,0x421200,0x12 , 0x164F, 0x264F, 0x0 , 0x0 , 0x1008, 0x0 , 0x101 }, // 0F 38 D5 - {"vpackstorehp" ,0x20,0x421200,0x13 , 0x264F, 0x164F, 0x0 , 0x0 , 0x100C, 0x0 , 0x101 }}; // 66 0F 38 D5 + {"vloadunpackhp",0x80,0x421200,0x12 , 0x164F, 0x264F, 0 , 0 , 0 , 0x1008, 0 , 0x101 }, // 0F 38 D5 + {"vpackstorehp" ,0x80,0x421200,0x13 , 0x264F, 0x164F, 0 , 0 , 0 , 0x100C, 0 , 0x101 }}; // 66 0F 38 D5 // Submap for pand. Opcode byte = 0F DB -// Indexed by MVEX prefix +// Indexed by E/MVEX prefix SOpcodeDef OpcodeMapC2[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"pand", 0x7 , 0xD0200, 0x19 , 0x1150, 0x1150, 0x150 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F DB - {"vpand", 0x20 ,0x493200, 0x19 , 0x1609, 0x1109, 0x109 , 0x0 , 0x1406, 0x0 , 0x1 }}; // MVEX 0F DB +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pand", 0x7 , 0xD0200, 0x19 , 0x1150, 0x1150, 0x150 , 0 , 0 , 0 , 0 , 0x2 }, // 0F DB + {"vpand", 0x20 ,0xC93200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }}; // MVEX 0F DB // Submap for pandn. Opcode byte = 0F DF // Indexed by MVEX prefix SOpcodeDef OpcodeMapC3[] = { - {"pandn", 0x7 , 0xD0200, 0x19 , 0x1150, 0x1150, 0x150 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F DF - {"vpandn", 0x20 ,0x493200, 0x19 , 0x1609, 0x1109, 0x109 , 0x0 , 0x1406, 0x0 , 0x1 }}; // MVEX 0F DF + {"pandn", 0x7 , 0xD0200, 0x19 , 0x1150, 0x1150, 0x150 , 0 , 0 , 0 , 0 , 0x2 }, // 0F DF + {"vpandn", 0x20 ,0xC93200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }}; // MVEX 0F DF // Submap for por. Opcode byte = 0F EB -// Indexed by MVEX prefix +// Indexed by E/MVEX prefix SOpcodeDef OpcodeMapC4[] = { - {"por", 0x7 , 0xD0200, 0x19 , 0x1150, 0x1150, 0x150 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F EB - {"vpor", 0x20 ,0x493200, 0x19 , 0x1609, 0x1109, 0x109 , 0x0 , 0x1406, 0x0 , 0x1 }}; // MVEX 0F EB + {"por", 0x7 , 0xD0200, 0x19 , 0x1150, 0x1150, 0x150 , 0 , 0 , 0 , 0 , 0x2 }, // 0F EB + {"vpor", 0x20 ,0xC93200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }}; // MVEX 0F EB // Submap for pxor. Opcode byte = 0F EF // Indexed by MVEX prefix SOpcodeDef OpcodeMapC5[] = { - {"pxor", 0x7 , 0xD0200, 0x19 , 0x1150, 0x1150, 0x150 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F EF - {"vpxor", 0x20 ,0x493200, 0x19 , 0x1609, 0x1109, 0x109 , 0x0 , 0x1406, 0x0 , 0x1 }}; // MVEX 0F EF + {"pxor", 0x7 , 0xD0200, 0x19 , 0x1150, 0x1150, 0x150 , 0 , 0 , 0 , 0 , 0x2 }, // 0F EF + {"vpxor", 0x20 ,0xC93200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }}; // MVEX 0F EF -// Submap for vpcmpd. Opcode byte = 0F 3A 1F -// Indexed by immediate byte +// Submap for vpcmpd. Opcode byte = 0F 3A 3E +// Indexed by VEX / EVEX SOpcodeDef OpcodeMapC6[] = { - {"vpcmpeqd", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1F / 0 - {"vpcmpltd", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1F / 1 - {"vpcmpled", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1F / 2 - {"vpcmpneqd", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1F / 3 - {"vpcmpnltd", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1F / 4 - {"vpcmpnled", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1F / 5 - {"vpcmpd", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0x31 , 0x1406, 0x0 , 0x100 }}; // 0F 3A 1F / > 5 + {"kextract", 0x80 , 0x38200, 0x52 , 0x1095, 0x1004, 0x11 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 3A 3E + {0, 0x112 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }}; // EVEX 0F 3A 3F. Link to vpcmp // Submap for pcmpeqd. Opcode byte = 0F 76 -// Indexed by MVEX prefix +// Indexed by E/MVEX prefix SOpcodeDef OpcodeMapC7[] = { - {"pcmpeqd", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 76 - {"vpcmpeqd", 0x20 ,0x4B8200, 0x19 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }}; // MVEX 0F 76 + {"pcmpeqd", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 76 + {"vpcmpeqd", 0x20 ,0xCBA200, 0x19 , 0x95 , 0x1203, 0x203 , 0 , 0x11 , 0x1406, 0 , 0x000 }}; // E/MVEX 0F 76 // Submap for pcmpgtd. Opcode byte = 0F 66 -// Indexed by MVEX prefix +// Indexed by E/MVEX prefix SOpcodeDef OpcodeMapC8[] = { - {"pcmpgtd", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0x0 , 0x0 , 0x0 , 0x2 }, // 0F 66 - {"vpcmpgtd", 0x20 ,0x4B8200, 0x19 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }}; // MVEX 0F 66 + {"pcmpgtd", 0x7 , 0xD0200, 0x19 , 0x1103, 0x1103, 0x103 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 66 + {"vpcmpgtd", 0x20 ,0xCBA200, 0x19 , 0x95 , 0x1203, 0x203 , 0 , 0x11 , 0x1406, 0 , 0x000 }}; // E/MVEX 0F 66 -// Submap for vpcmpud. Opcode byte = 0F 3A 1E -// Indexed by immediate byte +// Opcode map for EVEX 66 0F 79. Indexed by W bit SOpcodeDef OpcodeMapC9[] = { - {"vpcmpequd", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1E / 0 - {"vpcmpltud", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1E / 1 - {"vpcmpleud", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1E / 2 - {"vpcmpnequd",0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1E / 3 - {"vpcmpnltud",0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1E / 4 - {"vpcmpnleud",0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0 , 0x1406, 0x0 , 0x100 }, // 0F 3A 1E / 5 - {"vpcmpud", 0x20 , 0x4B8200,0x59 , 0x95 , 0x1603, 0x603 , 0x31 , 0x1406, 0x0 , 0x100 }}; // 0F 3A 1E / > 5 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +{"vcvtps2uqq", 0x20 ,0x840200, 0x12 , 0x204 , 0xF4B , 0 , 0 , 0x27 , 0 , 0 , 0 }, // EVEX 66 0F 79. W = 0 +{"vcvtpd2uqq", 0x20 ,0x841200, 0x12 , 0x204 , 0x24C , 0 , 0 , 0x27 , 0 , 0 , 0 }}; // EVEX 66 0F 79. W = 1 -// Submap for vpgatherd. Opcode byte = 0F 38 90 -// Indexed by MVEX prefix +// Opcode map for 0F 50. Indexed by prefix SOpcodeDef OpcodeMapCA[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {"vpgatherd", 0xCB , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 38 90. link - {"vpgatherd", 0x20 ,0x43B200, 0x1E, 0x209 , 0x2609, 0x0 , 0x0 , 0x304A, 0x0 , 0x1 }}; // MVEX 0F 38 90 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movmskps", 0x11 , 0x52000, 0x12 , 0x100A, 0x124B, 0 , 0 , 0 , 0 , 0 , 2 }, // 0F 50. movmskps + {"movmskpd", 0x11 , 0x52200, 0x12 , 0x100A, 0x124C, 0 , 0 , 0 , 0 , 0 , 2 }, // 66 0F 50. movmskpd + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; -// Submap for vpgatherd. Opcode byte = 0F 38 90 +// Submap for EVEX vgatherdps. Opcode byte = 0F 38 92 // Indexed by VEX.W bit SOpcodeDef OpcodeMapCB[] = { - {"vpgatherdd",0x1C , 0xEB200, 0x1E, 0x203 , 0x2203, 0x203 , 0x0 , 0x0 , 0x0 , 0x0 }, // 0F 38 90 - {"vpgatherdq",0x1C , 0xEB200, 0x1E, 0x204 , 0x2404, 0x204 , 0x0 , 0x0 , 0x0 , 0x0 }}; // 0F 38 90 + {"vgatherdps",0x20 ,0xC39200, 0x1E, 0x24F , 0x224F, 0 , 0 , 0x1090, 0x3048, 0 , 0 }, // EVEX/MVEX 0F 38 92 has k register as mask + {"vgatherdpd",0x20 ,0xC39200, 0x1E, 0x24F , 0x2F4F, 0 , 0 , 0x1090, 0x3048, 0 , 0 }}; // EVEX/MVEX 0F 38 92 has k register as mask // Submap for vgatherdps. Opcode byte = 0F 38 92 // Indexed by VEX.W bit SOpcodeDef OpcodeMapCC[] = { - {"vgatherdps",0x1C ,0x0E9200, 0x1E, 0x24B , 0x224B, 0x24B , 0x0 , 0x0 , 0x0 , 0x0 }, // VEX 0F 38 92 - {"vgatherdpd",0x1C ,0x0E9200, 0x1E, 0x24C , 0x244C, 0x44C , 0x0 , 0x0 , 0x0 , 0x0 }}; // VEX 0F 38 92 + {"vgatherdps",0x1C ,0x0E9200, 0x1E, 0x24B , 0x224B, 0x24B , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 38 92 + {"vgatherdpd",0x1C ,0x0E9200, 0x1E, 0x24C , 0x2F4C, 0x24C , 0 , 0 , 0 , 0 , 0 }}; // VEX 0F 38 92 // Submap for opcodes VEX/MVEX 0F AE -// Indexed by reg bits = 0 - 7 and mod = 3 +// Indexed by reg bits = 0 - 7 and mod < 3 to mod = 3 // These codes are with VEX or MVEX prefix. Same codes without prefix are in OpcodeMap34 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options SOpcodeDef OpcodeMapCD[] = { - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /0 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /1 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /2 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /3 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /4 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /5 - {0 , 0xCE , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // VEX 0F AE /6. Link - {0 , 0xCF , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }}; // VEX 0F AE /7. Link + {"fxsave", 0x11 , 0 , 0x11 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /0 + {"fxrstor", 0x11 , 0 , 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0x8 }, // VEX 0F AE /1 + {"vldmxcsr", 0x11 , 0x10000, 0x11 , 0 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /2 + {"vstmxcsr", 0x11 , 0x10000, 0x11 , 0x2003, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /3 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /4 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /5 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /6 + {0 , 0xCF , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // VEX 0F AE /7. Link + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE reg /0 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE reg /1 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE reg /2 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE reg /3 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE reg /4 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE reg /5 + {0 , 0xCE , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // VEX 0F AE reg /6. Link + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // VEX 0F AE reg /7 // Submap for opcodes VEX/MVEX 0F AE /6 // Indexed by prefixes 66 F2 F3 SOpcodeDef OpcodeMapCE[] = { -// name instset prefix format dest. source1 source2 source3 Swizzle link options - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /6 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 66 0F AE /6 - {"spflt" , 0x20 , 0x33400, 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // VEX F2 0F AE /6 - {"delay" , 0x20 , 0x33400, 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }}; // VEX F3 0F AE /6 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /6 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 66 0F AE /6 + {"spflt" , 0x80 , 0x33400, 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX F2 0F AE /6 + {"delay" , 0x80 , 0x33400, 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // VEX F3 0F AE /6 // Submap for opcodes VEX/MVEX 0F AE /7 // Indexed by prefixes 66 F2 F3 SOpcodeDef OpcodeMapCF[] = { - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /7 - {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 66 0F AE /7 - {"clevict0", 0x20 ,0x430800, 0x11 , 0x2006, 0 , 0 , 0 , 2 , 0 , 0 }, // VEX F2 0F AE /7 - {"clevict1", 0x20 ,0x430400, 0x11 , 0x2006, 0 , 0 , 0 , 2 , 0 , 0 }}; // VEX F3 0F AE /7 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F AE /7 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 66 0F AE /7 + {"clevict0", 0x80 ,0x430800, 0x11 , 0x2006, 0 , 0 , 0 , 0 , 2 , 0 , 0 }, // VEX F2 0F AE /7 + {"clevict1", 0x80 ,0x430400, 0x11 , 0x2006, 0 , 0 , 0 , 0 , 2 , 0 , 0 }}; // VEX F3 0F AE /7 +// Submap for opcodes 0F 38 F6 +// Indexed by prefixes 66 F2 F3 +SOpcodeDef OpcodeMapD0[] = { + {"wrss" , 0 , 0x1000 , 0x13 , 0x2009, 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 F6 + {"adcx" , 0x1D , 0x1200 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 38 F6 + {"mulx" , 0x1D , 0xB1000, 0x19 , 0x1009, 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 38 F6 + {"adox" , 0x1D , 0x1400 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 38 F6 + +SOpcodeDef OpcodeMapD1[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"prefetch", 0x1001 , 0 , 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0D /0 AMD only. Works as NOP on Intel + {"prefetchw", 0x1D , 0 , 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0D /1 + {"prefetchwt1",0x22 , 0 , 0x11 , 0 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 0D /2 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // + +// Tertiary opcode map for movnt. Opcode byte = 0F 2B +// Indexed by prefix = none, 66, F2, F3 +SOpcodeDef OpcodeMapD2[4] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"movntps", 0x11 ,0x852000, 0x13 , 0x224B, 0x124B, 0 , 0 , 0x00 , 0 , 0 , 0x102 }, // 0F 2B. movntps + {"movntpd", 0x12 ,0x852200, 0x13 , 0x224C, 0x124C, 0 , 0 , 0x00 , 0 , 0 , 0x102 }, // 66 0F 2B. movntpd + {"movntsd", 0x1004, 0x800 , 0x13 , 0x204C, 0x104C, 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 2B. movntsd (AMD only) + {"movntss", 0x1004, 0x400 , 0x13 , 0x204B, 0x104B, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 2B. movntss (AMD only) + +// opcode map for bsr and lzcnt. Opcode byte = 0F BD +// Indexed by prefix = none, 66, F2, F3 +SOpcodeDef OpcodeMapD3[4] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"bsr", 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F BD. bsr + {"bsr", 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F BD. not allowed + {"bsr", 0x3 , 0x1100 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F BD. not allowed + {"lzcnt", 0x1D ,0x11500 , 0x12 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F BD. AMD SSE4a, Intel LZCNT + +// Opcode map for blcfill etc. Opcode byte = XOP(9) 01, indexed by reg bits +SOpcodeDef OpcodeMapD4[] = { + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 01 /0 + {"blcfill", 0x1007, 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 01 /1 + {"blsfill", 0x1007 , 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 01 /2 + {"blcs" , 0x1007 , 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 01 /3 + {"tzmsk" , 0x1007 , 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 01 /4 + {"blcic" , 0x1007 , 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 01 /5 + {"blsic" , 0x1007 , 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 01 /6 + {"t1mskc", 0x1007 , 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }}; // XOP(9) 01 /7 + +// Opcode map for blcmsk etc. Opcode byte = XOP(9) 02, indexed by reg bits +SOpcodeDef OpcodeMapD5[] = { + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 02 /0 + {"blcmsk", 0x1007 , 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 02 /1 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 02 /2 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 02 /3 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 02 /4 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 02 /5 + {"blci" , 0x1007 , 0x11000, 0x18 , 0x1009, 0x9 , 0 , 0 , 0 , 0 , 0 , 0 }, // XOP(9) 02 /6 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // XOP(9) 02 /7 + +// Opcode map for EVEX 0F 79. Indexed by 66,F2,F3 prefix +SOpcodeDef OpcodeMapD6[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0xD9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // EVEX 0F 79. Link to vcvtps/pd2udq + {0, 0xC9 , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // EVEX 66 0F 79. Link to + {"vcvtsd2usi",0x20 ,0x803800, 0x12 , 0x1009, 0x4C , 0 , 0 , 0x6 , 0 , 0 , 0 }, // EVEX F2 0F 79 + {"vcvtss2usi",0x20 ,0x803800, 0x12 , 0x1009, 0x4B , 0 , 0 , 0x6 , 0 , 0 , 0 }}; // EVEX F3 0F 79 + +// Opcode map for 0F 38 A0. Indexed by VEX.W bit +SOpcodeDef OpcodeMapD7[] = { + {"vpscatterdd",0x20 , 0xC3B200,0x1E , 0x2209, 0x1209, 0 , 0 , 0x1090, 0x304E, 0 , 0x000 }, // W0 0F 38 A0 + {"vpscatterdq",0x20 , 0xC3B200,0x1E , 0x2F09, 0x1209, 0 , 0 , 0x1090, 0x304E, 0 , 0x000 }}; // W1 0F 38 A0 + +// Opcode map for 0F 38 A1. Indexed by VEX.W bit +SOpcodeDef OpcodeMapD8[] = { + {"vpscatterqd",0x20 , 0xC3B200,0x1E , 0x2209, 0x1F09, 0 , 0 , 0x1090, 0x304E, 0 , 0x000 }, // W0 0F 38 A0 + {"vpscatterqq",0x20 , 0xC3B200,0x1E , 0x2209, 0x1209, 0 , 0 , 0x1090, 0x304E, 0 , 0x000 }}; // W1 0F 38 A0 + +// Opcode map for EVEX 0F 79, pp0. Indexed by W bit +SOpcodeDef OpcodeMapD9[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +{"vcvtps2udq", 0x20 ,0x840000, 0x12 , 0x203 , 0x24B , 0 , 0 , 0x37 , 0 , 0 , 0 }, // EVEX 0F 79. W = 0 +{"vcvtpd2udq", 0x20 ,0x841000, 0x12 , 0xF03 , 0x24C , 0 , 0 , 0x37 , 0 , 0 , 0 }}; // EVEX 0F 79. W = 1 + +// Opcode map for EVEX 0F 78. Indexed by 66,F2,F3 prefix +SOpcodeDef OpcodeMapDA[] = { + {0, 0xDB , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // EVEX 0F 78. Link to vcvttpd2udq + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 EVEX 0F 78 + {"vcvttsd2usi",0x20 ,0x803800, 0x12 , 0x1009, 0x4C , 0 , 0 , 0x2 , 0 , 0 , 0 }, // F2 EVEX 0F 78 + {"vcvttss2usi",0x20 ,0x803400, 0x12 , 0x1009, 0x4B , 0 , 0 , 0x2 , 0 , 0 , 0 }}; // F3 EVEX 0F 78 + +// Opcode map for EVEX 0F 78. Indexed by W bit +SOpcodeDef OpcodeMapDB[] = { + {"vcvttps2udq",0x20 ,0x841000, 0x12 , 0x1203, 0x24B , 0 , 0 , 0x37 , 0 , 0 , 0 }, // VEX 0F 78 + {"vcvttpd2udq",0x20 ,0x841000, 0x12 , 0x1F03, 0x24C , 0 , 0 , 0x37 , 0 , 0 , 0 }}; // VEX 0F 78 + +// Opcode map for EVEX 0F 7A. Indexed by 66,F2,F3 prefix +SOpcodeDef OpcodeMapDC[] = { + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX 0F 7A + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 EVEX 0F 7A + {0 ,0x11B , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // F2 EVEX 0F 7A. Link to vcvtudq2ps + {0 ,0x11C , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // F3 E/MVEX 0F 7A. Link to vcvtudq2pd + +// Opcode map for EVEX 0F 7B. Indexed by 66,F2,F3 prefix +SOpcodeDef OpcodeMapDD[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX 0F 7B + {0, 0x11A , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 66 EVEX 0F 7B. Link to vcvtps/pd2qq + {"vcvtusi2sd",0x20 ,0x8C3800, 0x19 , 0x104C, 0x104C, 9 , 0 , 0x06 , 0 , 0 , 0 }, // F2 EVEX 0F 7B + {"vcvtusi2ss",0x20 ,0x8C3400, 0x19 , 0x104B, 0x104B, 9 , 0 , 0x06 , 0 , 0 , 0 }}; // F3 EVEX 0F 7B + +// Opcode map for 0F 3A 1B. Indexed by W bit +SOpcodeDef OpcodeMapDE[] = { + {"vextractf32x8",0x20,0x801200,0x53 , 0x54B , 0x124B, 0x31 , 0 , 0x30 , 0 , 0 , 0 }, // 0F 3A 1B. W0 + {"vextractf64x4",0x20,0x801200,0x53 , 0x54B , 0x124B, 0x31 , 0 , 0x30 , 0 , 0 , 0 }}; // 0F 3A 1B. W1 + +// Opcode map for 0F 3A 3B. Indexed by W bit +SOpcodeDef OpcodeMapDF[] = { + {"vextracti32x8",0x20,0x800200, 0x53 , 0x504 , 0x1204, 0x31 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 3A 3B + {"vextracti64x4",0x20,0x801200, 0x53 , 0x504 , 0x1204, 0x31 , 0 , 0x20 , 0 , 0 , 0 }}; // 0F 3A 3B + +// Opcode map for 0F 38 93. Indexed by EVEX present +SOpcodeDef OpcodeMapE0[] = { + {"vgatherqp", 0x95 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // 0F 38 93. Link to vpgatherqps/pd + {"vgatherqp", 0xE1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // EVEX/MVEX 0F 38 92 has k register as mask. Link by vector size + +// Opcode map for 0F 38 93. Indexed by W bit +SOpcodeDef OpcodeMapE1[] = { + {"vgatherqps",0x20 ,0xC39200, 0x1E , 0xF4F , 0x224F, 0 , 0 , 0x1090, 0x3048, 0 , 0 }, // EVEX/MVEX 0F 38 92. W0 + {"vgatherqpd",0x20 ,0xC39200, 0x1E , 0x24F , 0x224F, 0 , 0 , 0x1090, 0x3048, 0 , 0 }}; // EVEX/MVEX 0F 38 92. W1 + +// map for movd/movq. Opcode byte = 0F 7E +// Indexed by prefix: none/66/F2/F3 +SOpcodeDef OpcodeMapE2[] = { + {"vmov", 0x7 ,0x813200, 0x13 , 0x9 , 0x1409, 0 , 0 , 0x00 , 0 , 0 , 0x1 }, // VEX 0F 7E + {"vmov", 0x7 ,0x813200, 0x13 , 0x9 , 0x1409, 0 , 0 , 0x00 , 0 , 0 , 0x1 }, // 66 VEX 0F 7E + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 VEX 0F 7E + {0, 0x5B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0x3 , 0 }}; // F3 0F 7E. Link to map 5B. movq xmm,xmm/m64 + +// map for 0F 38 29 +// Indexed by EVEX +SOpcodeDef OpcodeMapE3[] = { + {"pcmpeqq", 0x16 , 0xD8200, 0x19 , 0x1204, 0x1204, 0x204 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 29 + {"vpcmpeqq", 0x20 ,0x8FB200, 0x19 , 0x95 , 0x1204, 0x204 , 0 , 0x11 , 0 , 0 , 0 }}; // EVEX 0F 38 29 + +// map for 0F 38 37 +// Indexed by EVEX +SOpcodeDef OpcodeMapE4[] = { + {"pcmpgtq", 0x16 , 0xD8200, 0x19 , 0x1204, 0x1204, 0x204 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 38 37 + {"vpcmpgtq", 0x20 ,0x8FB200, 0x19 , 0x95 , 0x1204, 0x204 , 0 , 0x11 , 0 , 0 , 0 }}; // EVEX 0F 38 37 + +// Submap for 0F 38 1A, indexed by VEX.W bit +SOpcodeDef OpcodeMapE5[] = { + {0 , 0xF8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xE , 0 }, // VEX 0F 38 1A /W0, link to vbroadcastf128 vbroadcastf32x4 + {"vbroadcastf64x2",0x20,0xC6B200,0x12, 0x124C, 0x244C, 0 , 0 , 0x20 , 0x1010, 0 , 0x100 }}; // 0F 38 1A, 512 bits + +// Map for 0F 38 39. Indexed by EVEX present +SOpcodeDef OpcodeMapE6[] = { + {"pminsd", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0 , 0 , 0x1406, 0 , 0x2 }, // 0F 38 39 + {0, 0x12D , 0 , 0x19 , 0 , 0 , 0 , 0 , 0 , 0 , 0x9 , 0 }}; // EVEX 0F 38 39 + +// Map for 0F 38 3B. Indexed by EVEX present +SOpcodeDef OpcodeMapE7[] = { + {"pminud", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0 , 0 , 0x1406, 0 , 0x2 }, // 0F 38 3B + {"vpminu", 0x15 ,0xCDB200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }}; // 0F 38 3B + +// Map for 0F 38 3D. Indexed by EVEX present +SOpcodeDef OpcodeMapE8[] = { + {"pmaxsd", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0 , 0 , 0x1406, 0 , 0x2 }, // 0F 38 3D + {"vpmaxs", 0x15 ,0xCDB200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }}; // 0F 38 3D + +// Map for 0F 38 3F. Indexed by EVEX present +SOpcodeDef OpcodeMapE9[] = { + {"pmaxud", 0x15 ,0x4D8200, 0x19 , 0x1203, 0x1203, 0x203 , 0 , 0 , 0x1406, 0 , 0x2 }, // 0F 38 3F + {"vpmaxu", 0x15 ,0xCDB200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }}; // 0F 38 3F + +// Map for 0F 38 10. Indexed by VEX prefix type +SOpcodeDef OpcodeMapEA[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pblendvb", 0x15 , 0x8200 , 0x12 , 0x1401, 0x401 , 0xAE , 0 , 0 , 0 , 0 , 0 }, // 0F 38 10 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 38 10 + {"vpsrlvw", 0x20 ,0x8FC200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x20 , 0 , 0 , 0 }, // EVEX 0F 38 10 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // MVEX 0F 38 10 + +// Map for VEX 0F 90. Indexed by memory/register +SOpcodeDef OpcodeMapEB[] = { + {"kmov", 0x20 , 0x35200, 0x12 , 0x1095, 0x2009, 0 , 0 , 0 , 0 , 0 , 1 }, // VEX 0F 90. Name without w in KNC syntax, but code identical + {"kmov", 0x20 , 0x35200, 0x12 , 0x1095, 0x95 , 0 , 0 , 0 , 0 , 0 , 1 }}; // VEX 0F 90. Name without w in KNC syntax, but code identical + +// Map for VEX 0F 92. indexed by prefix 0 66 F2 F3 +// The coding with F2 is different from other k instructions. Allow coding with 66 instead in case this is an error in the manual +SOpcodeDef OpcodeMapEC[] = { + {"kmov", 0x20 , 0x35200, 0x12 , 0x95 , 0x1003, 0 , 0 , 0 , 0 , 0 , 1 }, // VEX 0F 92. Name without w in KNC syntax, but code identical + {"kmov", 0x20 , 0x35200, 0x12 , 0x95 , 0x1003, 0 , 0 , 0 , 0 , 0 , 1 }, // 66 VEX 0F 92 + {0, 0xED , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // F2 VEX 0F 92 + +// Map for VEX 0F 92. indexed by VEX.W bit +SOpcodeDef OpcodeMapED[] = { + {"kmovd", 0x20 , 0x35200, 0x12 , 0x95 , 0x1003, 0 , 0 , 0 , 0 , 0 , 0 }, // F2 VEX 0F 92. W0 + {"kmovq", 0x20 , 0x35200, 0x12 , 0x95 , 0x1004, 0 , 0 , 0 , 0 , 0 , 0 }}; // F2 VEX 0F 92. W1 + +// Map for VEX 0F 93. indexed by prefix 0 66 F2 F3 +// The coding with F2 is different from other k instructions. Allow coding with 66 instead in case this is an error in the manual +SOpcodeDef OpcodeMapEE[] = { + {"kmov", 0x20 , 0x35200, 0x12 , 0x1003, 0x1095, 0 , 0 , 0 , 0 , 0 , 1 }, // VEX 0F 93. Name without w in KNC syntax, but code identical + {"kmov", 0x20 , 0x35200, 0x12 , 0x1003, 0x1095, 0 , 0 , 0 , 0 , 0 , 1 }, // 66 VEX 0F 93 + {0, 0xEF , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // F2 VEX 0F 93 + +// Map for VEX 0F 93. indexed by VEX.W bit +SOpcodeDef OpcodeMapEF[] = { + {"kmovd", 0x20 , 0x35200, 0x12 , 0x1003, 0x1095, 0 , 0 , 0 , 0 , 0 , 0 }, // F2 VEX 0F 93 W0 + {"kmovq", 0x20 , 0x35200, 0x12 , 0x1004, 0x1095, 0 , 0 , 0 , 0 , 0 , 0 }}; // F2 VEX 0F 93 W1 + +// Map for VEX 0F 4B. indexed by prefix 0 66 F2 F3 +SOpcodeDef OpcodeMapF0[] = { + {0, 0xF1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, + {"kunpckbw", 0x20 ,0x1E3200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 0 }, // 66 VEX 0F 4B + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +// Map for VEX 0F 4B. indexed by VEX.W bit +SOpcodeDef OpcodeMapF1[] = { + {"kunpckwd", 0x20 ,0x1E3200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 0 }, // VEX 0F 4B + {"kunpckdq", 0x20 ,0x1E3200, 0x19 , 0x1095, 0x1095, 0x1095, 0 , 0 , 0 , 0 , 0 }}; + +// Map for 0F AE /7. Indexed by 66 prefix +SOpcodeDef OpcodeMapF2[] = { + {"clflush", 0x12 , 0 , 0x11 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F AE /7 + {"clflushopt",0x22 , 0x200 , 0x11 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // 66 0F AE /7 + +// Map for 0F AE /6. Indexed by 66 prefix +SOpcodeDef OpcodeMapF3[] = { + {"xsaveopt", 0x19 , 0x2000 , 0x11 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F AE /6 + {"clwb ", 0x22 , 0x200 , 0x11 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F AE /6 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F AE /6 + {"clrssbsy", 0 , 0x400 , 0x11 , 0 , 0x2004, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F AE /6 + +// Map for 0F AE reg /7. Indexed by 66 prefix +SOpcodeDef OpcodeMapF4[] = { + {"sfence", 0x12 , 0 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // m-7 + {"pcommit", 0x22 , 0x200 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +// Opcode map for floating point cmpps/pd instructions. First two bytes = 0F C2 +// Indexed by VEX prefix type +SOpcodeDef OpcodeMapF5[] = { + {0, 0xF6 , 0 , 0x52 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }, // 0F C2. Link to cmpps etc. + {0, 0xF6 , 0 , 0x52 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }, // VEX 0F C2. Link to cmpps etc. + {0, 0xF7 , 0 , 0x52 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }, // EVEX 0F C2. Link to cmpps etc. + {0, 0xF7 , 0 , 0x52 , 0 , 0 , 0 , 0 , 0 , 0 , 0x6 , 0 }}; // MVEX 0F C2. Link to cmpps etc. + +SOpcodeDef OpcodeMapF6[] = { +// Opcode map for floating point cmpps/pd instructions. First two bytes = 0F C2 +// Indexed by immediate byte following operands = 0 - 7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cmpeq", 0x12 ,0xCD2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 00: cmpeqps/pd + {"cmplt", 0x12 ,0xCD2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 01: + {"cmple", 0x12 ,0xCD2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 02: + {"cmpunord", 0x12 ,0xCD2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 03: + {"cmpneq", 0x12 ,0xCD2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 04: + {"cmpnlt", 0x12 ,0xCD2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 05: + {"cmpnle", 0x12 ,0xCD2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 06: + {"cmpord", 0x12 ,0xCD2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 07: +// imm > 7 only with VEX + {"vcmpeq_uq", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 08: + {"vcmpnge_us",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 09: + {"vcmpngt_us",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0A: + {"vcmpfalse_oq",0x19,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0B: + {"vcmpneq_oq",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0C: + {"vcmpge_os", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0D: + {"vcmpgt_os", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0E: + {"vcmptrue_uq",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0F: + {"vcmpeq_os", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 10: + {"vcmplt_oq", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 11: + {"vcmple_oq", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 12: + {"vcmpunord_s",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 13: + {"vcmpneq_us",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 14: + {"vcmpnlt_uq",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 15: + {"vcmpnle_uq",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 16: + {"vcmpord_s", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 17: + {"vcmpeq_us", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 18: + {"vcmpnge_uq",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 19: + {"vcmpngt_uq",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1A: + {"vcmpfalse_os",0x19,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1B: + {"vcmpneq_os",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1C: + {"vcmpge_oq", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1D: + {"vcmpgt_oq", 0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1E: + {"vcmptrue_us",0x19 ,0x8E2E00, 0x59 , 0x124F, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1F: + {"vcmp", 0x19 ,0x8E2200, 0x4059, 0x124F, 0x24F , 0x24F , 0x31 , 0x13 , 0 , 0 , 0x3 }}; // 0F C2 op > 1F: cmpps/pd, imm + + +SOpcodeDef OpcodeMapF7[] = { +// Opcode map for floating point cmpps/pd instructions. EVEX 0F C2 +// Indexed by immediate byte following operands = 0 - 7 +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"cmpeq", 0x12 ,0xCD2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 00: cmpeqps/pd + {"cmplt", 0x12 ,0xCD2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 01: + {"cmple", 0x12 ,0xCD2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 02: + {"cmpunord", 0x12 ,0xCD2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 03: + {"cmpneq", 0x12 ,0xCD2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 04: + {"cmpnlt", 0x12 ,0xCD2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 05: + {"cmpnle", 0x12 ,0xCD2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 06: + {"cmpord", 0x12 ,0xCD2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0x1204, 0 , 0x3 }, // 0F C2 op 07: +// imm > 7 only with EVEX prefix, not with MVEX + {"vcmpeq_uq", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 08: + {"vcmpnge_us",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 09: + {"vcmpngt_us",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0A: + {"vcmpfalse_oq",0x19,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0B: + {"vcmpneq_oq",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0C: + {"vcmpge_os", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0D: + {"vcmpgt_os", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0E: + {"vcmptrue_uq",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 0F: + {"vcmpeq_os", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 10: + {"vcmplt_oq", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 11: + {"vcmple_oq", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 12: + {"vcmpunord_s",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 13: + {"vcmpneq_us",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 14: + {"vcmpnlt_uq",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 15: + {"vcmpnle_uq",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 16: + {"vcmpord_s", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 17: + {"vcmpeq_us", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 18: + {"vcmpnge_uq",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 19: + {"vcmpngt_uq",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1A: + {"vcmpfalse_os",0x19,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1B: + {"vcmpneq_os",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1C: + {"vcmpge_oq", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1D: + {"vcmpgt_oq", 0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1E: + {"vcmptrue_us",0x19 ,0x8E2E00, 0x59 , 0x95, 0x24F , 0x24F , 0 , 0x13 , 0 , 0 , 0x1 }, // 0F C2 op 1F: + {"vcmp", 0x19 ,0x8E2200, 0x4059, 0x95, 0x24F , 0x24F , 0x31 , 0x13 , 0 , 0 , 0x3 }}; // 0F C2 op > 1F: cmpps/pd, imm + +// Submap for 0F 38 1A / W0, indexed by EVEX +SOpcodeDef OpcodeMapF8[] = { + {"vbroadcastf128" ,0x19,0x878200,0x12, 0x154B, 0x244B, 0 , 0 , 0x20 , 0 , 0 , 0 }, // VEX 0F 38 1A + {"vbroadcastf32x4",0x10,0xC6B200,0x12, 0x124B, 0x244B, 0 , 0 , 0x20 , 0x1010, 0 , 0x100 }}; // EVEX 0F 38 1A + +// Map for 0F 3A 08. Indexed by EVEX present +SOpcodeDef OpcodeMapF9[] = { + {"roundps", 0x15 , 0x58200, 0x52 , 0x124B, 0x24B , 0x31 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 3A 08. Also in AMD instruction set + {"vrndscaleps",0x20 ,0x858200, 0x52 , 0x124B, 0x24B , 0x31 , 0 , 0x33 , 0 , 0 , 0 }}; // EVEX 0F 3A 08 + +// Map for 0F 3A 09. Indexed by EVEX present +SOpcodeDef OpcodeMapFA[] = { + {"roundpd", 0x15 ,0x858200, 0x52 , 0x124C, 0x24C , 0x31 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 3A 09. Also in AMD instruction set + {"vrndscalepd",0x20 ,0x85A200, 0x52 , 0x124C, 0x24C , 0x31 , 0 , 0x33 , 0 , 0 , 0 }}; // EVEX 0F 3A 09 + +// Map for 0F 3A 0A. Indexed by EVEX present +SOpcodeDef OpcodeMapFB[] = { + {"roundss", 0x15 , 0x98200, 0x59 , 0x104B, 0x104B, 0x4B , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 0A. Also in AMD instruction set + {"vrndscaless",0x20 ,0x8DB200, 0x59 , 0x104B, 0x004B, 0x4B , 0x31 , 0x32 , 0 , 0 , 0 }}; // EVEX 0F 3A 08 + +// Map for 0F 3A 0B. Indexed by EVEX present +SOpcodeDef OpcodeMapFC[] = { + {"roundsd", 0x15 , 0x98200, 0x59 , 0x104C, 0x104C, 0x4C , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 0B. Also in AMD instruction set + {"vrndscalesd",0x20 ,0x8DB200, 0x59 , 0x104C, 0x004C, 0x4C , 0x31 , 0x32 , 0 , 0 , 0 }}; // EVEX 0F 3A 08 + +// Map for 0F 38 2C. Indexed by EVEX present +SOpcodeDef OpcodeMapFD[] = { + {"vmaskmovps",0x19 , 0xF8200, 0x19, 0x124B, 0x124B, 0x224B, 0 , 0 , 0 , 0 , 0 }, // 0F 38 2C + {"vscalefp" ,0x20 ,0x899200, 0x19, 0x124F, 0x124F, 0x024F, 0 , 0x37 , 0 , 0 , 0x1 }}; // EVEX 0F 38 2C + +// Map for 0F 38 2D. Indexed by EVEX present +SOpcodeDef OpcodeMapFE[] = { + {"vmaskmovpd",0x19 , 0xF8200, 0x19, 0x124C, 0x124C, 0x224C, 0 , 0 , 0 , 0 , 0 }, // 0F 38 2D + {"vscalefs" ,0x20 ,0x899200, 0x19, 0x144F, 0x144F, 0x044F, 0 , 0x36 , 0 , 0 , 0x1 }}; // EVEX 0F 38 2D + +// Map for 0F 38 3A. Indexed by 66 F2 F3 prefixes +SOpcodeDef OpcodeMapFF[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 3A + {"pminuw", 0x15 ,0x8D8200, 0x19 , 0x1202, 0x1202, 0x202 , 0 , 0x20 , 0 , 0 , 0x2 }, // 66 0F 38 3A + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 38 3A + {"vpbroadcastmw2d",0x20,0x860400,0x12, 0x1203, 0x1095, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 38 2A + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +// Map for 0F 38 A". Indexed by W bit +SOpcodeDef OpcodeMap100[] = { + {"vscatterdps",0x20 ,0xC39200, 0x1E , 0x224B, 0x1209, 0 , 0 , 0x1090, 0x304C, 0 , 0x000 }, // 0F 38 A2. W0 + {"vscatterdpd",0x20 ,0xC39200, 0x1E , 0x2F4C, 0x1209, 0 , 0 , 0x1090, 0x304C, 0 , 0x000 }}; // 0F 38 A2. W1 + +// Map for 0F 38 A3. Indexed by W bit +SOpcodeDef OpcodeMap101[] = { + {"vscatterqps",0x20 ,0xC39200, 0x1E , 0x224B, 0x1F09, 0 , 0 , 0x1090, 0x304C, 0 , 0x000 }, // 0F 38 A3. W0 + {"vscatterqpd",0x20 ,0xC39200, 0x1E , 0x224C, 0x1209, 0 , 0 , 0x1090, 0x304C, 0 , 0x000 }}; // 0F 38 A3. W1 + + +// Submap for vpgatherd. Opcode byte = 0F 38 90 +// Indexed by VEX/EVEX prefix +SOpcodeDef OpcodeMap102[] = { + {0, 0x103 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }, // + {0, 0x104 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // + +// Submap for vpgatherd. Opcode byte = 0F 38 90 +// Indexed by VEX.W bit +SOpcodeDef OpcodeMap103[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vpgatherdd",0x1C ,0xCEB200, 0x1E, 0x203 , 0x2203, 0x203 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 90 + {"vpgatherdq",0x1C ,0xCEB200, 0x1E, 0x204 , 0x2F04, 0x204 , 0 , 0 , 0x100A, 0 , 0 }}; // 0F 38 90 + +// Submap for vpgatherd. Opcode byte = 0F 38 90 +// Indexed by EVEX.W bit +SOpcodeDef OpcodeMap104[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vpgatherdd",0x1C ,0xCEB200, 0x1E, 0x203 , 0x2203, 0 , 0 , 0x1090, 0x100A, 0 , 0 }, // EVEX 0F 38 90 + {"vpgatherdq",0x1C ,0xCEB200, 0x1E, 0x204 , 0x2F04, 0 , 0 , 0x1090, 0x100A, 0 , 0 }}; // EVEX 0F 38 90 + +// Submap for vpgatherq, Opcode 0F 38 91, Indexed by VEX.W bit +SOpcodeDef OpcodeMap105[] = { + {"vpgatherqd",0x1C ,0x8EB200, 0x1E, 0xF03 , 0x2203, 0xF03 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 91, W0 + {"vpgatherqq",0x1C ,0x8EB200, 0x1E, 0x204 , 0x2204, 0x204 , 0 , 0 , 0 , 0 , 0 }}; // 0F 38 91, W1 + +// Submap for vpgatherq, Opcode 0F 38 91, Indexed by EVEX.W bit +SOpcodeDef OpcodeMap106[] = { + {"vpgatherqd",0x1C ,0x8EB200, 0x1E, 0xF03 , 0x2203, 0 , 0 , 0x1090, 0 , 0 , 0 }, // EVEX 0F 38 91, W0 + {"vpgatherqq",0x1C ,0x8EB200, 0x1E, 0x204 , 0x2204, 0 , 0 , 0x1090, 0 , 0 , 0 }}; // EVEX 0F 38 91, W1 + +// Map for 0F 38 C8. Indexed by VEX prefix type +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +SOpcodeDef OpcodeMap107[] = { + {"sha1nexte", 0x22 , 0 , 0x12 , 0x1203, 0x0203, 0 , 0 , 0 , 0 , 0 , 0 }, // no VEX + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX + {"vexp2p", 0x21 ,0x809200, 0x12 , 0x124F, 0x024F, 0 , 0 , 0x33 , 0 , 0 , 0x1 }, // EVEX 0F 38 C8 + {"vexp223ps", 0x80 ,0x428200, 0x12 , 0x164B, 0x603 , 0 , 0 , 0 , 0x1201, 0 , 0x100 }}; // MVEX 0F 38 C8 + +// Map for 0F 38 C9. Indexed by VEX prefix type +SOpcodeDef OpcodeMap108[] = { + {"sha1msg1", 0x22 , 0 , 0x12 , 0x1203, 0x0203, 0 , 0 , 0 , 0 , 0 , 0 }, // no VEX + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX 0F 38 C9 + {"vlog2ps", 0x80 ,0x428200, 0x12 , 0x164B, 0x603 , 0 , 0 , 0 , 0x1201, 0 , 0x100 }}; // MVEX 0F 38 C9 + +// Map for 0F 38 CA. Indexed by VEX prefix type +SOpcodeDef OpcodeMap109[] = { + {"sha1msg2", 0x22 , 0 , 0x12 , 0x1203, 0x0203, 0 , 0 , 0 , 0 , 0 , 0 }, // no VEX + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX + {"vrcp28p", 0x21 ,0x809200, 0x12 , 0x124F, 0x024F, 0 , 0 , 0x33 , 0 , 0 , 0x1 }, // EVEX 0F 38 CA + {"vrcp23ps", 0x80 ,0x428200, 0x12 , 0x164B, 0x603 , 0 , 0 , 0 , 0x1201, 0 , 0x100 }}; // MVEX 0F 38 CA + +// Map for 0F 38 CB. Indexed by VEX prefix type +SOpcodeDef OpcodeMap10A[] = { + {"sha256rnds2",0x22 , 0 , 0x12 , 0x1203, 0x0203, 0xAE , 0 , 0 , 0 , 0 , 0 }, // no VEX + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX + {"vrcp28s", 0x21 ,0x809200, 0x12 , 0x104F, 0x004F, 0 , 0 , 0x32 , 0 , 0 , 0x1 }, // EVEX 0F 38 CB + {"vrsqrt23ps",0x80 ,0x428200, 0x12 , 0x164B, 0x603 , 0 , 0 , 0 , 0x1201, 0 , 0x100 }}; // MVEX 0F 38 CB + +// Map for 0F 38 CC. Indexed by VEX prefix type +SOpcodeDef OpcodeMap10B[] = { + {"sha256msg1",0x22 , 0 , 0x12 , 0x1203, 0x0203, 0 , 0 , 0 , 0 , 0 , 0 }, // no VEX + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX + {"vrsqrt28p", 0x21 ,0x809200, 0x12 , 0x124F, 0x024F, 0 , 0 , 0x33 , 0 , 0 , 0x1 }, // EVEX 0F 38 CC + {"vaddsetsps",0x80 ,0x4A8200, 0x19, 0x164B, 0x164B, 0x64B , 0 , 0 , 0x3304, 0 , 0x100 }}; // MVEX 0F 38 CC + +// Map for 0F 38 CD. Indexed by VEX prefix type +SOpcodeDef OpcodeMap10C[] = { + {"sha256msg2",0x22 , 0 , 0x12 , 0x1203, 0x0203, 0 , 0 , 0 , 0 , 0 , 0 }, // no VEX + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX + {"vrsqrt28s", 0x21 ,0x809200, 0x12 , 0x104F, 0x004F, 0 , 0 , 0x32 , 0 , 0 , 0x1 }, // EVEX 0F 38 CD + {"vpaddsetsd",0x80 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0 , 0 , 0x3406, 0 , 0x100 }}; // MVEX 0F 38 CD + +// Submap for MVEX 0F 38 C6. W0 +// Indexed by reg bits +SOpcodeDef OpcodeMap10D[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +{"vgatherpf0hintdp",0x80,0x439200, 0x1E, 0 , 0x264B, 0 , 0 , 0 , 0x1048, 0 , 0x101 }, // MVEX 0F 38 C6 /0 +{"vgatherpf0dps",0x21,0xC38200, 0x1E, 0 , 0x224B, 0 , 0 , 0x1010, 0x1048, 0 , 0x000 }, // MVEX 0F 38 C6 /1 +{"vgatherpf1dps",0x21,0xC38200, 0x1E, 0 , 0x224B, 0 , 0 , 0x1010, 0x1048, 0 , 0x000 }, // MVEX 0F 38 C6 /2 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // +{"vscatterpf0hintdp",0x80,0x43B200,0x1E, 0 , 0x264B, 0 , 0 , 0 , 0x1048, 0 , 0x101 }, // MVEX 0F 38 C6 /4 +{"vscatterpf0dps",0x21,0xC38200, 0x1E, 0 , 0x224B, 0 , 0 , 0x1010, 0x1048, 0 , 0x000 }, // MVEX 0F 38 C6 /5 +{"vscatterpf1dps",0x21,0xC38200, 0x1E, 0 , 0x224B, 0 , 0 , 0x1010, 0x1048, 0 , 0x000 }, // MVEX 0F 38 C6 /6 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // + +// Submap for MVEX 0F 38 C6. W1 +// Indexed by reg bits +SOpcodeDef OpcodeMap10E[] = { +{"vgatherpf0hintdpd",0x80,0x439200,0x1E, 0 , 0x264C, 0 , 0 , 0 , 0x1048, 0 , 0x100 }, // MVEX 0F 38 C6 /0 +{"vgatherpf0dpd",0x21,0xC3A200, 0x1E, 0 , 0x2F4C, 0 , 0 , 0x1010, 0x1048, 0 , 0x000 }, // MVEX 0F 38 C6 /1 +{"vgatherpf1dpd",0x21,0xC3A200, 0x1E, 0 , 0x2F4C, 0 , 0 , 0x1010, 0x1048, 0 , 0x000 }, // MVEX 0F 38 C6 /2 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // +{"vscatterpf0hintdp",0x80,0x43B200,0x1E, 0 , 0x264c, 0 , 0 , 0 , 0x1048, 0 , 0x101 }, // MVEX 0F 38 C6 /4 +{"vscatterpf0dpd",0x21,0xC3A200, 0x1E, 0 , 0x2F4C, 0 , 0 , 0x1010, 0x1048, 0 , 0x000 }, // MVEX 0F 38 C6 /5 +{"vscatterpf1dpd",0x21,0xC3A200, 0x1E, 0 , 0x2F4C, 0 , 0 , 0x1010, 0x1048, 0 , 0x100 }, // MVEX 0F 38 C6 /6 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // + +// Submap for 0F 38 C7 vgatherpf.. Indexed by reg bits +SOpcodeDef OpcodeMap10F[] = { + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // +{"vgatherpf0qp", 0x21 ,0xC39200, 0x1E, 0 , 0x224F, 0 , 0 , 0x1010, 0 , 0 , 0x1 }, // 0F 38 C7 /1 +{"vgatherpf1qp", 0x21 ,0xC39200, 0x1E, 0 , 0x224F, 0 , 0 , 0x1010, 0 , 0 , 0x1 }, // 0F 38 C7 /2 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // +{"vscatterpf0qp",0x21 ,0xC39200, 0x1E, 0 , 0x224F, 0 , 0 , 0x1010, 0 , 0 , 0x1 }, // 0F 38 C7 /5 +{"vscatterpf1qp",0x21 ,0xC39200, 0x1E, 0 , 0x224F, 0 , 0 , 0x1010, 0 , 0 , 0x1 }, // 0F 38 C7 /6 + {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // + +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +// Submap for 0F 1A. Indexed by 66 F2 F3 prefix +SOpcodeDef OpcodeMap110[] = { + {"bndldx", 0x22 , 0 , 0x12, 0x98 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 1A + {"bndmov", 0x22 , 0x200 , 0x12, 0x1098, 0x98 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 1A + {"bndcu" , 0x22 , 0x800 , 0x12, 0x98 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 1A + {"bndcl" , 0x22 , 0x400 , 0x12, 0x98 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 1A + +// Submap for 0F 1B. Indexed by 66 F2 F3 prefix +SOpcodeDef OpcodeMap111[] = { + {"bndstx", 0x22 , 0 , 0x13, 0x2006, 0x98 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 1B + {"bndmov", 0x22 , 0x200 , 0x13, 0x98 , 0x1098, 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F 1B + {"bndcn" , 0x22 , 0x800 , 0x12, 0x98 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 1B + {"bndmk" , 0x22 , 0x400 , 0x12, 0x98 , 0x2006, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F 1B + +// Submap for 0F 3A 3E. Indexed by immediate byte. VCMPUB/W +SOpcodeDef OpcodeMap112[] = { + {"vpcmpequ", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3E / 0 + {"vpcmpltu", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3E / 1 + {"vpcmpleu", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3E / 2 + {"vpcmpu", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0x31 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3E / 3 = true + {"vpcmpnequ", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3E / 4 + {"vpcmpnltu", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3E / 5 + {"vpcmpnleu", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3E / 6 + {"vpcmpu", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0x31 , 0x10 , 0 , 0 , 0x01 }}; // 0F 3A 3E / >= 7 = false + +// Submap for 0F 3A 3F. Indexed by immediate byte. VCMPB/W +SOpcodeDef OpcodeMap113[] = { + {"vpcmpeq", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3F / 0 + {"vpcmplt", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3F / 1 + {"vpcmple", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3F / 2 + {"vpcmp", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0x31 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3F / 3 = true + {"vpcmpneq", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3F / 4 + {"vpcmpnlt", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3F / 5 + {"vpcmpnle", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x10 , 0 , 0 , 0x01 }, // 0F 3A 3F / 6 + {"vpcmp", 0x20 , 0x8FC200,0x59 , 0x95 , 0x1209, 0x209 , 0x31 , 0x10 , 0 , 0 , 0x01 }}; // 0F 3A 3F / >= 7 = false + +// Submap for 0F 3A 1E. Indexed by immediate byte. VCMPUD/Q +SOpcodeDef OpcodeMap114[] = { + {"vpcmpequ", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1E / 0 + {"vpcmpltu", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1E / 1 + {"vpcmpleu", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1E / 2 + {"vpcmpu", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0x31 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1E / 3 = true + {"vpcmpnequ", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1E / 4 + {"vpcmpnltu", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1E / 5 + {"vpcmpnleu", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1E / 6 + {"vpcmpu", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0x31 , 0x11 , 0x1406, 0 , 0x01 }}; // 0F 3A 1E / >= 7 = false + +// Submap for 0F 3A 1F. Indexed by immediate byte. VCMPD/Q +SOpcodeDef OpcodeMap115[] = { + {"vpcmpeq", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1F / 0 + {"vpcmplt", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1F / 1 + {"vpcmple", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1F / 2 + {"vpcmp", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0x31 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1F / 3 = true + {"vpcmpneq", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1F / 4 + {"vpcmpnlt", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1F / 5 + {"vpcmpnle", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0 , 0x11 , 0x1406, 0 , 0x01 }, // 0F 3A 1F / 6 + {"vpcmp", 0x20 , 0xCBB200,0x59 , 0x95 , 0x1209, 0x209 , 0x31 , 0x11 , 0x1406, 0 , 0x01 }}; // 0F 3A 1F / >= 7 = false + +// Submap for pcmpeqb. Opcode byte = 0F 74 +// Indexed by E/MVEX prefix +SOpcodeDef OpcodeMap116[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"pcmpeqb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 74 + {"vpcmpeqb", 0x20 ,0x8FA200, 0x19 , 0x95 , 0x1201, 0x201 , 0 , 0x10 , 0 , 0 , 0 }}; // E/MVEX 0F 76 + +// Submap for pcmpeqw. Opcode byte = 0F 75 +// Indexed by E/MVEX prefix +SOpcodeDef OpcodeMap117[] = { + {"pcmpeqw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 75 + {"vpcmpeqw", 0x20 ,0x8FA200, 0x19 , 0x95 , 0x1202, 0x202 , 0 , 0x10 , 0 , 0 , 0 }}; // E/MVEX 0F 76 + +// Submap for pcmpgtb. Opcode byte = 0F 64 +// Indexed by EVEX prefix +SOpcodeDef OpcodeMap118[] = { + {"pcmpgtb", 0x7 , 0xD0200, 0x19 , 0x1101, 0x1101, 0x101 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 64 + {"vpcmpgtb", 0x20 ,0x8BA200, 0x19 , 0x95 , 0x1203, 0x203 , 0 , 0x10 , 0x1406, 0 , 0x000 }}; // E/MVEX 0F 64 + + +// Submap for pcmpgtw. Opcode byte = 0F 65 +// Indexed by EVEX prefix +SOpcodeDef OpcodeMap119[] = { + {"pcmpgtw", 0x7 , 0xD0200, 0x19 , 0x1102, 0x1102, 0x102 , 0 , 0 , 0 , 0 , 0x2 }, // 0F 65 + {"vpcmpgtw", 0x20 ,0x8BA200, 0x19 , 0x95 , 0x1203, 0x203 , 0 , 0x10 , 0x1406, 0 , 0x000 }}; // E/MVEX 0F 65 + + +// Opcode map for EVEX 66 0F 7B. Indexed by W bit +SOpcodeDef OpcodeMap11A[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {"vcvtps2qq", 0x20 ,0x840200, 0x12 , 0x204 , 0xF4B , 0 , 0 , 0x27 , 0 , 0 , 0 }, // EVEX 66 0F 7B. W = 0 + {"vcvtpd2qq", 0x20 ,0x841200, 0x12 , 0x204 , 0x24C , 0 , 0 , 0x27 , 0 , 0 , 0 }}; // EVEX 66 0F 7B. W = 1 + +// Opcode map for EVEX F2 0F 7A. Indexed by W bit +SOpcodeDef OpcodeMap11B[] = { + {"vcvtudq2ps",0x20 ,0xC28800, 0x12 , 0x124B, 0x203 , 0 , 0 , 0x37 , 0x1214, 0 , 0 }, // F2 EVEX 0F 7A W0 + {"vcvtuqq2ps",0x20 ,0x869800, 0x12 , 0x1F4B, 0x204 , 0 , 0 , 0x27 , 0 , 0 , 0 }}; // F2 EVEX 0F 7A W0 + +// Opcode map for EVEX F3 0F 7A. Indexed by W bit +SOpcodeDef OpcodeMap11C[] = { + {"vcvtudq2pd",0x20 ,0xC28400, 0x12 , 0x124C, 0xF03 , 0 , 0 , 0x31 , 0x1214, 0 , 0 }, // F3 E/MVEX 0F 7A W0 + {"vcvtuqq2pd",0x20 ,0x869800, 0x12 , 0x124C, 0x204 , 0 , 0 , 0x27 , 0 , 0 , 0 }}; // F2 EVEX 0F 7A W0 + +// Opcode map for 0F 3A 42. Indexed by EVEX +SOpcodeDef OpcodeMap11D[] = { + {"mpsadbw", 0x15 , 0xD8200, 0x59 , 0x1202, 0x1202, 0x201 , 0x31 , 0 , 0 , 0 , 0x2 }, // 0F 3A 42 + {"vdbpsadbw", 0x20 ,0x8E8200, 0x59 , 0x1202, 0x1202, 0x201 , 0x31 , 0x20 , 0 , 0 , 0 }}; // EVEX 0F 3A 42 + +// Opcode map for 0F 3A 19. Indexed by EVEX +SOpcodeDef OpcodeMap11E[] = { + {"vextractf128" ,0x19,0x978200,0x53, 0x450 , 0x1550, 0x31 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 19 + {0 ,0x11F,0 ,0x53, 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // EVEX 0F 3A 19 + +// Opcode map for EVEX 0F 3A 19. Indexed by W bit +SOpcodeDef OpcodeMap11F[] = { + {"vextractf32x4",0x20,0x868200,0x53, 0x44B , 0x124B, 0x31 , 0 , 0x20 , 0 , 0 , 0 }, // EVEX W0 0F 3A 19 + {"vextractf64x2",0x20,0x869200,0x53, 0x44C , 0x124C, 0x31 , 0 , 0x20 , 0 , 0 , 0 }}; // EVEX W1 0F 3A 19 + +// Opcode map for EVEX 0F 3A 39. Indexed by EVEX +SOpcodeDef OpcodeMap120[] = { + {"vextracti128",0x1C, 0x978200,0x53 , 0x406 , 0x1506, 0x31 , 0 , 0 , 0 , 0 , 0 }, // 0F 3A 39 + {0 ,0x121, 0 ,0x53 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // EVEX 0F 3A 39 + +// Opcode map for EVEX 0F 3A 39. Indexed by W bit +SOpcodeDef OpcodeMap121[] = { + {"vextracti32x4",0x20,0x868200,0x53 , 0x406 , 0x1203, 0x31 , 0 , 0x20 , 0 , 0 , 0 }, // 0F 3A 39 + {"vextracti64x2",0x20,0x869200,0x53 , 0x406 , 0x1203, 0x31 , 0 , 0x20 , 0 , 0 , 0 }}; // 0F 3A 39 + +// Opcode map for 0F 3A 18. Indexed by EVEX +SOpcodeDef OpcodeMap122[] = { + {"vinsertf128",0x19 ,0x9F8200, 0x59 , 0x1250, 0x1250, 0x450 , 0x31 , 0x30 , 0 , 0 , 0 }, // 0F 3A 18 + {0, 0x123 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; + +// Opcode map for EVEX 0F 3A 18. Indexed by W bit +SOpcodeDef OpcodeMap123[] = { + {"vinsertf32x4",0x20,0x8AB200, 0x59 , 0x1250, 0x1250, 0x44B , 0x31 , 0x20 , 0 , 0 , 0 }, // EVEX 0F 3A 18. W0 + {"vinsertf64x2",0x20,0x8AB200, 0x59 , 0x1250, 0x1250, 0x44C , 0x31 , 0x20 , 0 , 0 , 0 }}; // EVEX 0F 3A 18. W0 + +// Opcode map for EVEX 0F 3A 1A. Indexed by W bit +SOpcodeDef OpcodeMap124[] = { + {"vinsertf32x8",0x20,0x8AB200, 0x59 , 0x1250, 0x1250, 0x54B , 0x31 , 0x30 , 0 , 0 , 0 }, // 0F 3A 1A + {"vinsertf64x4",0x20,0x8AB200, 0x59 , 0x1250, 0x1250, 0x54C , 0x31 , 0x30 , 0 , 0 , 0 }}; // 0F 3A 1A + +// Opcode map for 0F 3A 38. Indexed by EVEX +SOpcodeDef OpcodeMap125[] = { + {"vinserti128",0x1C ,0x9F8200, 0x59 , 0x1206, 0x1206, 0x406 , 0x31 , 0x30 , 0 , 0 , 0 }, // 0F 3A 38 + {0, 0x126 , 0 , 0x59 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; + +// Opcode map for EVEX 0F 3A 38. Indexed by W bit +SOpcodeDef OpcodeMap126[] = { + {"vinserti32x4",0x1C ,0x8AB200, 0x59 , 0x1203, 0x1203, 0x403 , 0x31 , 0x20 , 0 , 0 , 0 }, // EVEX 0F 3A 38. W0 + {"vinserti64x2",0x20 ,0x8AB200, 0x59 , 0x1204, 0x1204, 0x404 , 0x31 , 0x20 , 0 , 0 , 0 }}; // EVEX 0F 3A 38. W1 + +// Opcode map for EVEX 0F 3A 3A. Indexed by W bit +SOpcodeDef OpcodeMap127[] = { + {"vinserti32x8",0x20,0x8AB200, 0x59 , 0x1203, 0x1203, 0x503 , 0x31 , 0x20 , 0 , 0 , 0 }, // EVEX 0F 3A 3A. W0 + {"vinserti64x4",0x20,0x8AB200, 0x59 , 0x1204, 0x1204, 0x504 , 0x31 , 0x20 , 0 , 0 , 0 }}; // EVEX 0F 3A 3A. W1 + +// Opcode map for 0F 38 B4. Indexed by VEX prefix type +SOpcodeDef OpcodeMap128[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 38 B4 + {"vpmadd52luq",0x23 ,0x8EB200, 0x19 , 0x1204, 0x1204, 0x204 , 0 , 0x21 , 0 , 0 , 0 }, // EVEX 0F 38 B4 + {"vpmadd233d",0x80 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }}; // MVEX 0F 38 B4 + +// Opcode map for 0F 38 B5. Indexed by VEX prefix type +SOpcodeDef OpcodeMap129[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // VEX 0F 38 B5 + {"vpmadd52huq",0x23 ,0x8EB200, 0x19 , 0x1204, 0x1204, 0x204 , 0 , 0x21 , 0 , 0 , 0 }, // EVEX 0F 38 B5 + {"vpmadd231d",0x80 ,0x4A8200, 0x19 , 0x1603, 0x1603, 0x603 , 0 , 0 , 0x1406, 0 , 0x100 }}; // MVEX 0F 38 B5 + +// 0F 38 19 indexed by VEX / EVEX +SOpcodeDef OpcodeMap12A[] = { + {"vbroadcastsd",0x19,0xC7A200, 0x12 , 0x124C, 0x04C , 0 , 0 , 0x20 , 0x1049, 0 , 0 }, // VEX 0F 38 19 + {0, 0x12B , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // EVEX 0F 38 19 + +// EVEX 0F 38 19 indexed by W bit +SOpcodeDef OpcodeMap12B[] = { + {"vbroadcastf32x2",0x20,0xC6B200, 0x12,0x124C, 0x04B , 0 , 0 , 0x20 , 0x1049, 0 , 0 }, // EVEX W0 0F 38 19 + {"vbroadcastsd",0x20,0xC6B200, 0x12 , 0x124C, 0x04C , 0 , 0 , 0x20 , 0x1049, 0 , 0 }}; // EVEX W1 0F 38 19 + +// Opcode map for 0F 38 38. Indexed by prefix +SOpcodeDef OpcodeMap12C[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 38 + {"pminsb", 0x15 ,0x8DA200, 0x19 , 0x1201, 0x1201, 0x201 , 0 , 0x20 , 0 , 0 , 0x2 }, // 66 0F 38 38 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 38 38 + // moved to map B2. this map can be removed +// {"vpmovm2", 0x20 ,0x86B400, 0x12 , 0x1209, 0x95 , 0 , 0 , 0 , 0 , 0 , 1 }}; // F3 0F 38 38 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +// Opcode map for EVEX 0F 38 39. Indexed by prefix +SOpcodeDef OpcodeMap12D[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F 38 39 + {"vpmins", 0x15 ,0xCDB200, 0x19 , 0x1209, 0x1209, 0x209 , 0 , 0x31 , 0x1406, 0 , 0x1 }, // 66 0F 38 39 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F 38 39 + // this entry has been replaced by a link from map B2. this may be removed + // {0, 0x12F , 0 , 0x12 , 0 , 0 , 0 , 0 , 0 , 0 , 0xC , 0 }}; // F3 0F 38 39 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +// Opcode map for EVEX 0F 38 29. Indexed by W bit +SOpcodeDef OpcodeMap12E[] = { + {"vpmovb2m", 0x20 ,0x86C400, 0x12 , 0x95 , 0x1209, 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 29 W0 + {"vpmovw2m", 0x20 ,0x86C400, 0x12 , 0x95 , 0x1209, 0 , 0 , 0 , 0 , 0 , 0 }}; // EVEX F3 0F 38 29 W1 + +// Opcode map for EVEX 0F 38 39. Indexed by W bit +SOpcodeDef OpcodeMap12F[] = { + {"vpmovd2m", 0x20 ,0x86B400, 0x12 , 0x95 , 0x1209, 0 , 0 , 0 , 0 , 0 , 0 }, // EVEX F3 0F 38 39 W0 + {"vpmovq2m", 0x20 ,0x86B400, 0x12 , 0x95 , 0x1209, 0 , 0 , 0 , 0 , 0 , 0 }}; // EVEX F3 0F 38 39 W1 + +// Opcode map for 0F 01, mod = 11b, reg = 5 +// Indexed by rm bits +SOpcodeDef OpcodeMap130[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 0 + {0, 0x131 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // rm = 1. link to incssp + {0, 0x132 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 , 0 }, // rm = 2. link to savessp + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 3 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 4 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 5 + {"rdpkru", 0 , 0x000 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 6 + {"wrpkru", 0 , 0x000 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // rm = 7 + +// Opcode map for 0F 01, mod = 11b, reg = 5, rm = 1. Indexed by prefix +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options +SOpcodeDef OpcodeMap131[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 + {"incssp", 0 , 0x400 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 + +// Opcode map for 0F 01, mod = 11b, reg = 5, rm = 2. Indexed by prefix +SOpcodeDef OpcodeMap132[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 + {"savessp", 0 , 0x400 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 + +// Opcode map for 0F 01, mod != 11b, reg = 5. Indexed by prefix +SOpcodeDef OpcodeMap133[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 + {"rstorssp", 0 , 0x400 , 0x11 , 0 , 0x2004, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 + +// Opcode map for 0F AE /5. Link by prefix +SOpcodeDef OpcodeMap134[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 + {"setssbsy", 0 , 0x400 , 0x11 , 0 , 0x2004, 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 + +// Opcode map for 0F 1E. Hint instructions. Link by prefix +SOpcodeDef OpcodeMap135[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 + {0, 0x136 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 0 }}; // F3 + +// Opcode map for F3 0F 1E. Hint instructions. Link by mod / reg +SOpcodeDef OpcodeMap136[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // mod < 3 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // mod = 3, reg = 0 + {"rdssp", 0 , 0x1400 , 0x11 , 0 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 }, // mod = 3, reg = 1 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // mod = 3, reg = 2 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // mod = 3, reg = 3 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // mod = 3, reg = 4 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // mod = 3, reg = 5 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // mod = 3, reg = 6 + {0, 0x137 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 0 }}; // mod = 3, reg = 7 + +// Opcode map for F3 0F 1E. mod = 3, reg = 7. Link by rm +SOpcodeDef OpcodeMap137[] = { +// name instset prefix format dest. source1 source2 source3 EVEX MVEX link options + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 0 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 1 + {"endbr64", 0 , 0x400 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 2 + {"endbr32", 0 , 0x400 , 0x10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 3 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 4 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 5 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // rm = 6 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // rm = 7 + +// Submap for 0F C7 reg /7, Indexed by prefixes +SOpcodeDef OpcodeMap138[] = { + {"rdseed", 0x1D , 0x1100 , 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 0F C7 reg /7 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // 66 0F C7 reg /7 + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, // F2 0F C7 reg /7 + {"rdpid", 0x1D , 0x1500 , 0x11 , 0x1009, 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; // F3 0F C7 reg /7 + + +SOpcodeDef OpcodeMap139[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +SOpcodeDef OpcodeMap13A[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +SOpcodeDef OpcodeMap13B[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +SOpcodeDef OpcodeMap13C[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +SOpcodeDef OpcodeMap13D[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +SOpcodeDef OpcodeMap13E[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; + +SOpcodeDef OpcodeMap13F[] = { + {0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }}; /************** Make pointers to all opcode maps ***************************/ @@ -4631,7 +5814,35 @@ const SOpcodeDef * const OpcodeTables[] = { OpcodeMapC0, OpcodeMapC1, OpcodeMapC2, OpcodeMapC3, OpcodeMapC4, OpcodeMapC5, OpcodeMapC6, OpcodeMapC7, OpcodeMapC8, OpcodeMapC9, OpcodeMapCA, OpcodeMapCB, - OpcodeMapCC, OpcodeMapCD, OpcodeMapCE, OpcodeMapCF + OpcodeMapCC, OpcodeMapCD, OpcodeMapCE, OpcodeMapCF, + OpcodeMapD0, OpcodeMapD1, OpcodeMapD2, OpcodeMapD3, + OpcodeMapD4, OpcodeMapD5, OpcodeMapD6, OpcodeMapD7, + OpcodeMapD8, OpcodeMapD9, OpcodeMapDA, OpcodeMapDB, + OpcodeMapDC, OpcodeMapDD, OpcodeMapDE, OpcodeMapDF, + OpcodeMapE0, OpcodeMapE1, OpcodeMapE2, OpcodeMapE3, + OpcodeMapE4, OpcodeMapE5, OpcodeMapE6, OpcodeMapE7, + OpcodeMapE8, OpcodeMapE9, OpcodeMapEA, OpcodeMapEB, + OpcodeMapEC, OpcodeMapED, OpcodeMapEE, OpcodeMapEF, + OpcodeMapF0, OpcodeMapF1, OpcodeMapF2, OpcodeMapF3, + OpcodeMapF4, OpcodeMapF5, OpcodeMapF6, OpcodeMapF7, + OpcodeMapF8, OpcodeMapF9, OpcodeMapFA, OpcodeMapFB, + OpcodeMapFC, OpcodeMapFD, OpcodeMapFE, OpcodeMapFF, + OpcodeMap100, OpcodeMap101, OpcodeMap102, OpcodeMap103, + OpcodeMap104, OpcodeMap105, OpcodeMap106, OpcodeMap107, + OpcodeMap108, OpcodeMap109, OpcodeMap10A, OpcodeMap10B, + OpcodeMap10C, OpcodeMap10D, OpcodeMap10E, OpcodeMap10F, + OpcodeMap110, OpcodeMap111, OpcodeMap112, OpcodeMap113, + OpcodeMap114, OpcodeMap115, OpcodeMap116, OpcodeMap117, + OpcodeMap118, OpcodeMap119, OpcodeMap11A, OpcodeMap11B, + OpcodeMap11C, OpcodeMap11D, OpcodeMap11E, OpcodeMap11F, + OpcodeMap120, OpcodeMap121, OpcodeMap122, OpcodeMap123, + OpcodeMap124, OpcodeMap125, OpcodeMap126, OpcodeMap127, + OpcodeMap128, OpcodeMap129, OpcodeMap12A, OpcodeMap12B, + OpcodeMap12C, OpcodeMap12D, OpcodeMap12E, OpcodeMap12F, + OpcodeMap130, OpcodeMap131, OpcodeMap132, OpcodeMap133, + OpcodeMap134, OpcodeMap135, OpcodeMap136, OpcodeMap137, + OpcodeMap138, OpcodeMap139, OpcodeMap13A, OpcodeMap13B, + OpcodeMap13C, OpcodeMap13D, OpcodeMap13E, OpcodeMap13F, }; // size of each table pointed to by OpcodeTables[] @@ -4687,7 +5898,35 @@ const uint32 OpcodeTableLength[] = { TableSize(OpcodeMapC0), TableSize(OpcodeMapC1), TableSize(OpcodeMapC2), TableSize(OpcodeMapC3), TableSize(OpcodeMapC4), TableSize(OpcodeMapC5), TableSize(OpcodeMapC6), TableSize(OpcodeMapC7), TableSize(OpcodeMapC8), TableSize(OpcodeMapC9), TableSize(OpcodeMapCA), TableSize(OpcodeMapCB), - TableSize(OpcodeMapCC), TableSize(OpcodeMapCD), TableSize(OpcodeMapCE), TableSize(OpcodeMapCF) + TableSize(OpcodeMapCC), TableSize(OpcodeMapCD), TableSize(OpcodeMapCE), TableSize(OpcodeMapCF), + TableSize(OpcodeMapD0), TableSize(OpcodeMapD1), TableSize(OpcodeMapD2), TableSize(OpcodeMapD3), + TableSize(OpcodeMapD4), TableSize(OpcodeMapD5), TableSize(OpcodeMapD6), TableSize(OpcodeMapD7), + TableSize(OpcodeMapD8), TableSize(OpcodeMapD9), TableSize(OpcodeMapDA), TableSize(OpcodeMapDB), + TableSize(OpcodeMapDC), TableSize(OpcodeMapDD), TableSize(OpcodeMapDE), TableSize(OpcodeMapDF), + TableSize(OpcodeMapE0), TableSize(OpcodeMapE1), TableSize(OpcodeMapE2), TableSize(OpcodeMapE3), + TableSize(OpcodeMapE4), TableSize(OpcodeMapE5), TableSize(OpcodeMapE6), TableSize(OpcodeMapE7), + TableSize(OpcodeMapE8), TableSize(OpcodeMapE9), TableSize(OpcodeMapEA), TableSize(OpcodeMapEB), + TableSize(OpcodeMapEC), TableSize(OpcodeMapED), TableSize(OpcodeMapEE), TableSize(OpcodeMapEF), + TableSize(OpcodeMapF0), TableSize(OpcodeMapF1), TableSize(OpcodeMapF2), TableSize(OpcodeMapF3), + TableSize(OpcodeMapF4), TableSize(OpcodeMapF5), TableSize(OpcodeMapF6), TableSize(OpcodeMapF7), + TableSize(OpcodeMapF8), TableSize(OpcodeMapF9), TableSize(OpcodeMapFA), TableSize(OpcodeMapFB), + TableSize(OpcodeMapFC), TableSize(OpcodeMapFD), TableSize(OpcodeMapFE), TableSize(OpcodeMapFF), + TableSize(OpcodeMap100), TableSize(OpcodeMap101), TableSize(OpcodeMap102), TableSize(OpcodeMap103), + TableSize(OpcodeMap104), TableSize(OpcodeMap105), TableSize(OpcodeMap106), TableSize(OpcodeMap107), + TableSize(OpcodeMap108), TableSize(OpcodeMap109), TableSize(OpcodeMap10A), TableSize(OpcodeMap10B), + TableSize(OpcodeMap10C), TableSize(OpcodeMap10D), TableSize(OpcodeMap10E), TableSize(OpcodeMap10F), + TableSize(OpcodeMap110), TableSize(OpcodeMap111), TableSize(OpcodeMap112), TableSize(OpcodeMap113), + TableSize(OpcodeMap114), TableSize(OpcodeMap115), TableSize(OpcodeMap116), TableSize(OpcodeMap117), + TableSize(OpcodeMap118), TableSize(OpcodeMap119), TableSize(OpcodeMap11A), TableSize(OpcodeMap11B), + TableSize(OpcodeMap11C), TableSize(OpcodeMap11D), TableSize(OpcodeMap11E), TableSize(OpcodeMap11F), + TableSize(OpcodeMap120), TableSize(OpcodeMap121), TableSize(OpcodeMap122), TableSize(OpcodeMap123), + TableSize(OpcodeMap124), TableSize(OpcodeMap125), TableSize(OpcodeMap126), TableSize(OpcodeMap127), + TableSize(OpcodeMap128), TableSize(OpcodeMap129), TableSize(OpcodeMap12A), TableSize(OpcodeMap12B), + TableSize(OpcodeMap12C), TableSize(OpcodeMap12D), TableSize(OpcodeMap12E), TableSize(OpcodeMap12F), + TableSize(OpcodeMap130), TableSize(OpcodeMap131), TableSize(OpcodeMap132), TableSize(OpcodeMap133), + TableSize(OpcodeMap134), TableSize(OpcodeMap135), TableSize(OpcodeMap136), TableSize(OpcodeMap137), + TableSize(OpcodeMap138), TableSize(OpcodeMap139), TableSize(OpcodeMap13A), TableSize(OpcodeMap13B), + TableSize(OpcodeMap13C), TableSize(OpcodeMap13D), TableSize(OpcodeMap13E), TableSize(OpcodeMap13F), }; // number of entries in OpcodeTables @@ -4695,17 +5934,22 @@ const uint32 NumOpcodeTables1 = TableSize(OpcodeTables); const uint32 NumOpcodeTables2 = TableSize(OpcodeTableLength); // Index to start pages, depending on VEX.mmmm bits -SOpcodeDef const * OpcodeStartPageVEX[] = { - OpcodeMapB0, // no escape, VEX.mmmm = 0 - OpcodeMapB1, // 0F escape or VEX.mmmm = 1 - OpcodeMap2, // 0F 38 escape or VEX.mmmm = 2 - OpcodeMap4}; // 0f 3A escape or VEX.mmmm = 3 +uint32 OpcodeStartPageVEX[] = { + 0xB0, // no escape, VEX.mmmm = 0 + 0xB1, // 0F escape or VEX.mmmm = 1 + 0x2, // 0F 38 escape or VEX.mmmm = 2 + 0x4, // 0f 3A escape or VEX.mmmm = 3 + 0, 0, 0, 0, // reserved for higher mmmm + 0xB2, // 0F 38 escape or EVEX.mmmm = 2 with F2 prefix (pp = 11) + 0xB3 // 0F 38 escape or EVEX.mmmm = 2 with F3 prefix (pp = 10) +}; // Index to start pages, depending on XOP.mmmm bits SOpcodeDef const * OpcodeStartPageXOP[] = { OpcodeMap64, // XOP.mmmm = 8 - OpcodeMap65}; // XOP.mmmm = 9 - + OpcodeMap65, // XOP.mmmm = 9 + OpcodeMap66 // XOP.mmmm = 0xA +}; // Number of entries in OpcodeStartPages const uint32 NumOpcodeStartPageVEX = TableSize(OpcodeStartPageVEX); @@ -4720,22 +5964,22 @@ const char * RegisterNames8[8] = { // Names of 8 bit registers with REX prefix const char * RegisterNames8x[16] = { - "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", + "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }; // Names of 16 bit registers const char * RegisterNames16[16] = { - "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", + "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }; // Names of 32 bit registers const char * RegisterNames32[16] = { - "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", + "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }; // Names of 64 bit registers const char * RegisterNames64[16] = { - "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", + "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }; // Names of segment registers @@ -4744,11 +5988,11 @@ const char * RegisterNamesSeg[8] = { // Names of control registers const char * RegisterNamesCR[16] = { - "cr0", "cr1 ?", "cr2", "cr3", "cr4", "cr5 ?", "cr6 ?", "cr7 ?", + "cr0", "cr1 ?", "cr2", "cr3", "cr4", "cr5 ?", "cr6 ?", "cr7 ?", "cr8", "cr9 ?", "cr10 ?", "cr11 ?", "cr12 ?", "cr13 ?", "cr14 ?", "cr15 ?" }; // Those with ? are illegal -// Swizzle tables: Tables of the meaning of the sss bits in a MVEX prefix +// MVEX tables: Tables of the meaning of the sss bits in a MVEX prefix SwizSpec Sf32r[8] = { // 32-bit float or integer register permutation {0x64B,64,4,""}, @@ -5012,4 +6256,11 @@ SwizSpec Sround_2[8] = { // Register operand rounding mode and suppress all exc // Table of swizzle tables for rounding mode SwizSpec const * SwizRoundTables[1][2] = { - {Sround_1,Sround_2}}; + {Sround_1,Sround_2} +}; + +// EVEX tables: Tables of rounding mode names for EVEX +const char * EVEXRoundingNames[5] = { + "rn-sae", "rd-sae", "ru-sae", "rz-sae", "sae" +}; +