From f1ce2383bac1eb5ebefef089e7154de67222be37 Mon Sep 17 00:00:00 2001 From: kobalicekp Date: Sun, 4 May 2014 23:11:12 +0200 Subject: [PATCH] - Major documentation reorganization of AsmJit (still far from perfection) - Documentation - removed verbose @brief and switched to markdown syntax which Doxygen supports. - Added inline documentation to AVX/AVX2 instructions. - Added more documentation notes to utility classes. - Modified documentation groups to be compatible with the new code layout (base/x86). - Renamed VirtualMemoryManager to VMemMgr. - Removed MemoryManager interface (not needed). - Changed JitRuntime to always create a new isolated VMemMgr instance. - Fixed WinRemoteRuntime to work with the new changes. - Added missing insertps instruction to database, assembler and compiler. - Moved global functions in x86cpuinfo to CpuUtil class. - Should notify Issue #10 --- CMakeLists.txt | 2 - src/app/test/genopcode.h | 28 +- src/app/test/testmem.cpp | 29 +- src/app/test/testsizeof.cpp | 2 +- src/app/test/testx86.cpp | 2 +- src/asmjit/asmjit.h | 259 +- src/asmjit/base.h | 187 +- src/asmjit/base/assembler.cpp | 4 +- src/asmjit/base/assembler.h | 185 +- src/asmjit/base/codegen.cpp | 6 +- src/asmjit/base/codegen.h | 104 +- src/asmjit/base/compiler.cpp | 2 +- src/asmjit/base/compiler.h | 900 +++---- src/asmjit/base/constpool.cpp | 10 +- src/asmjit/base/constpool.h | 55 +- src/asmjit/base/context.cpp | 2 +- src/asmjit/base/context_p.h | 104 +- src/asmjit/base/cpuinfo.cpp | 2 +- src/asmjit/base/cpuinfo.h | 63 +- src/asmjit/base/cputicks.h | 4 +- src/asmjit/base/defs.h | 490 ++-- src/asmjit/base/error.cpp | 5 +- src/asmjit/base/error.h | 110 +- src/asmjit/base/func.h | 239 +- src/asmjit/base/globals.h | 48 +- src/asmjit/base/intutil.h | 59 +- src/asmjit/base/lock.h | 32 +- src/asmjit/base/logger.cpp | 22 +- src/asmjit/base/logger.h | 101 +- src/asmjit/base/memorymanager.cpp | 1047 --------- src/asmjit/base/memorymanager.h | 169 -- src/asmjit/base/podlist.h | 9 +- src/asmjit/base/podvector.h | 91 +- src/asmjit/base/runtime.cpp | 22 +- src/asmjit/base/runtime.h | 81 +- src/asmjit/base/string.h | 166 +- src/asmjit/base/vectypes.h | 297 +-- src/asmjit/base/vmem.cpp | 1152 ++++++++- src/asmjit/base/vmem.h | 157 +- src/asmjit/base/zone.cpp | 2 +- src/asmjit/base/zone.h | 60 +- src/asmjit/build.h | 10 + src/asmjit/contrib/winremoteruntime.cpp | 9 +- src/asmjit/contrib/winremoteruntime.h | 28 +- src/asmjit/x86.h | 107 + src/asmjit/x86/x86assembler.cpp | 33 +- src/asmjit/x86/x86assembler.h | 2860 +++++++++++++++-------- src/asmjit/x86/x86compiler.cpp | 10 +- src/asmjit/x86/x86compiler.h | 1646 +++++++------ src/asmjit/x86/x86context.cpp | 70 +- src/asmjit/x86/x86context_p.h | 68 +- src/asmjit/x86/x86cpuinfo.cpp | 158 +- src/asmjit/x86/x86cpuinfo.h | 154 +- src/asmjit/x86/x86defs.cpp | 1603 ++++++------- src/asmjit/x86/x86defs.h | 1623 ++++++------- src/asmjit/x86/x86func.cpp | 50 +- src/asmjit/x86/x86func.h | 167 +- tools/Doxyfile | 408 ++++ tools/doc-footer.html | 21 + tools/doc-header.html | 37 + tools/doc-layout.xml | 112 + tools/doc-style.css | 1399 +++++++++++ tools/doxygen.conf | 1634 ------------- tools/doxygen.css | 405 ---- 64 files changed, 10013 insertions(+), 8908 deletions(-) create mode 100644 tools/Doxyfile create mode 100644 tools/doc-footer.html create mode 100644 tools/doc-header.html create mode 100644 tools/doc-layout.xml create mode 100644 tools/doc-style.css delete mode 100644 tools/doxygen.conf delete mode 100644 tools/doxygen.css diff --git a/CMakeLists.txt b/CMakeLists.txt index fa061e8..b776c6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,8 +234,6 @@ AsmJit_AddSource(ASMJIT_SRC asmjit/base lock.h logger.cpp logger.h - memorymanager.cpp - memorymanager.h podlist.h podvector.cpp podvector.h diff --git a/src/app/test/genopcode.h b/src/app/test/genopcode.h index b51d06f..73fe726 100644 --- a/src/app/test/genopcode.h +++ b/src/app/test/genopcode.h @@ -269,6 +269,8 @@ static void opcode(asmjit::host::Assembler& a) { a.xor_(intptr_gp0, 0); // Fpu. + a.nop(); + a.f2xm1(); a.fabs(); a.fadd(fp0, fpx); @@ -399,6 +401,8 @@ static void opcode(asmjit::host::Assembler& a) { a.fyl2xp1(); // MMX/MMX-EXT. + a.nop(); + a.movd(ptr_gp0, mm7); a.movd(eax, mm7); a.movd(mm0, ptr_gp0); @@ -501,6 +505,8 @@ static void opcode(asmjit::host::Assembler& a) { a.emms(); // 3DNOW! + a.nop(); + a.pf2id(mm0, mm7); a.pf2id(mm0, ptr_gp0); a.pf2iw(mm0, mm7); @@ -550,6 +556,8 @@ static void opcode(asmjit::host::Assembler& a) { a.femms(); // SSE. + a.nop(); + a.addps(xmm0, xmm7); a.addps(xmm0, ptr_gp0); a.addss(xmm0, xmm7); @@ -675,6 +683,8 @@ static void opcode(asmjit::host::Assembler& a) { a.xorps(xmm0, ptr_gp0); // SSE2. + a.nop(); + a.addpd(xmm0, xmm7); a.addpd(xmm0, ptr_gp0); a.addsd(xmm0, xmm7); @@ -922,7 +932,9 @@ static void opcode(asmjit::host::Assembler& a) { a.xorpd(xmm0, xmm7); a.xorpd(xmm0, ptr_gp0); - // SSE3/SSSE3/SSE4.1/SSE4.2. + // SSE3. + a.nop(); + a.addsubpd(xmm0, xmm7); a.addsubpd(xmm0, ptr_gp0); a.addsubps(xmm0, xmm7); @@ -945,6 +957,10 @@ static void opcode(asmjit::host::Assembler& a) { a.movsldup(xmm0, xmm7); a.movsldup(xmm0, ptr_gp0); a.mwait(); + + // SSSE3. + a.nop(); + a.psignb(mm0, mm7); a.psignb(mm0, ptr_gp0); a.psignb(xmm0, xmm7); @@ -1009,6 +1025,10 @@ static void opcode(asmjit::host::Assembler& a) { a.palignr(mm0, ptr_gp0, 0); a.palignr(xmm0, xmm0, 0); a.palignr(xmm0, ptr_gp0, 0); + + // SSE4.1. + a.nop(); + a.blendpd(xmm0, xmm0, 0); a.blendpd(xmm0, ptr_gp0, 0); a.blendps(xmm0, xmm0, 0); @@ -1023,6 +1043,8 @@ static void opcode(asmjit::host::Assembler& a) { a.dpps(xmm0, ptr_gp0, 0); a.extractps(gp0, xmm0, 0); a.extractps(ptr_gp0, xmm0, 0); + a.insertps(xmm0, xmm1, 0); + a.insertps(xmm0, ptr_gp0, 0); a.movntdqa(xmm0, ptr_gp0); a.mpsadbw(xmm0, xmm0, 0); a.mpsadbw(xmm0, ptr_gp0, 0); @@ -1104,6 +1126,10 @@ static void opcode(asmjit::host::Assembler& a) { a.roundpd(xmm0, ptr_gp0, 0); a.roundsd(xmm0, xmm0, 0); a.roundsd(xmm0, ptr_gp0, 0); + + // SSE4.2. + a.nop(); + a.pcmpestri(xmm0, xmm0, 0); a.pcmpestri(xmm0, ptr_gp0, 0); a.pcmpestrm(xmm0, xmm0, 0); diff --git a/src/app/test/testmem.cpp b/src/app/test/testmem.cpp index f30ddec..3bc8b5e 100644 --- a/src/app/test/testmem.cpp +++ b/src/app/test/testmem.cpp @@ -27,8 +27,8 @@ static void gen(void* a, void* b, int i) { static void verify(void* a, void* b) { int ai = *(int*)a; int bi = *(int*)b; - if (ai != bi || memcmp(a, b, ai) != 0) - { + + if (ai != bi || ::memcmp(a, b, ai) != 0) { printf("Failed to verify %p\n", a); problems++; } @@ -39,9 +39,11 @@ static void die() { exit(1); } -static void stats(MemoryManager* memmgr) { - printf("-- Used: %d\n", (int)memmgr->getUsedBytes()); - printf("-- Allocated: %d\n", (int)memmgr->getAllocatedBytes()); +static void stats(VMemMgr& memmgr) { + printf("-- Used: %d\n", + static_cast(memmgr.getUsedBytes())); + printf("-- Allocated: %d\n", + static_cast(memmgr.getAllocatedBytes())); } static void shuffle(void **a, void **b, size_t count) { @@ -60,12 +62,13 @@ static void shuffle(void **a, void **b, size_t count) { } int main(int argc, char* argv[]) { - MemoryManager* memmgr = MemoryManager::getGlobal(); + VMemMgr memmgr; size_t i; size_t count = 200000; - printf("Memory alloc/free test - %d allocations.\n\n", (int)count); + printf("Memory alloc/free test - %d allocations.\n\n", + static_cast(count)); void** a = (void**)::malloc(sizeof(void*) * count); void** b = (void**)::malloc(sizeof(void*) * count); @@ -77,7 +80,7 @@ int main(int argc, char* argv[]) { for (i = 0; i < count; i++) { int r = (rand() % 1000) + 4; - a[i] = memmgr->alloc(r); + a[i] = memmgr.alloc(r); if (a[i] == NULL) die(); ::memset(a[i], 0, r); @@ -90,7 +93,7 @@ int main(int argc, char* argv[]) { printf("Freeing virtual memory..."); for (i = 0; i < count; i++) { - if (memmgr->release(a[i]) != kErrorOk) { + if (memmgr.release(a[i]) != kErrorOk) { printf("Failed to free %p.\n", b[i]); problems++; } @@ -106,7 +109,7 @@ int main(int argc, char* argv[]) { for (i = 0; i < count; i++) { int r = (rand() % 1000) + 4; - a[i] = memmgr->alloc(r); + a[i] = memmgr.alloc(r); b[i] = ::malloc(r); if (a[i] == NULL || b[i] == NULL) die(); @@ -124,7 +127,7 @@ int main(int argc, char* argv[]) { printf("Verify and free..."); for (i = 0; i < count / 2; i++) { verify(a[i], b[i]); - if (memmgr->release(a[i]) != kErrorOk) { + if (memmgr.release(a[i]) != kErrorOk) { printf("Failed to free %p.\n", a[i]); problems++; } @@ -138,7 +141,7 @@ int main(int argc, char* argv[]) { for (i = 0; i < count / 2; i++) { int r = (rand() % 1000) + 4; - a[i] = memmgr->alloc(r); + a[i] = memmgr.alloc(r); b[i] = ::malloc(r); if (a[i] == NULL || b[i] == NULL) die(); @@ -151,7 +154,7 @@ int main(int argc, char* argv[]) { printf("Verify and free..."); for (i = 0; i < count; i++) { verify(a[i], b[i]); - if (memmgr->release(a[i]) != kErrorOk) { + if (memmgr.release(a[i]) != kErrorOk) { printf("Failed to free %p.\n", a[i]); problems++; } diff --git a/src/app/test/testsizeof.cpp b/src/app/test/testsizeof.cpp index 223269a..feeb9b3 100644 --- a/src/app/test/testsizeof.cpp +++ b/src/app/test/testsizeof.cpp @@ -44,7 +44,7 @@ int main(int argc, char* argv[]) { printf(" asmjit::CodeGen : %u\n", static_cast(sizeof(CodeGen))); printf(" asmjit::BaseAssembler : %u\n", static_cast(sizeof(BaseAssembler))); printf(" asmjit::BaseCompiler : %u\n", static_cast(sizeof(BaseCompiler))); - printf(" asmjit::BaseRuntime : %u\n", static_cast(sizeof(BaseRuntime))); + printf(" asmjit::Runtime : %u\n", static_cast(sizeof(Runtime))); printf("\n"); printf(" asmjit::Operand : %u\n", static_cast(sizeof(Operand))); printf(" asmjit::BaseReg : %u\n", static_cast(sizeof(BaseReg))); diff --git a/src/app/test/testx86.cpp b/src/app/test/testx86.cpp index 7eaff03..e440257 100644 --- a/src/app/test/testx86.cpp +++ b/src/app/test/testx86.cpp @@ -22,7 +22,7 @@ using namespace asmjit::host; // [X86Test] // ============================================================================ -//! @brief Interface used to test Compiler. +//! Interface used to test Compiler. struct X86Test { X86Test(const char* name = NULL) { _name.setString(name); } virtual ~X86Test() {} diff --git a/src/asmjit/asmjit.h b/src/asmjit/asmjit.h index c445b78..3ae2d86 100644 --- a/src/asmjit/asmjit.h +++ b/src/asmjit/asmjit.h @@ -8,9 +8,13 @@ #ifndef _ASMJIT_ASMJIT_H #define _ASMJIT_ASMJIT_H +// ============================================================================ +// [asmjit_mainpage] +// ============================================================================ + //! @mainpage //! -//! @brief AsmJit - Complete x86/x64 JIT and Remote Assembler for C++. +//! AsmJit - Complete x86/x64 JIT and Remote Assembler for C++. //! //! AsmJit is a complete JIT and remote assembler for C++ language. It can //! generate native code for x86 and x64 architectures having support for @@ -65,259 +69,8 @@ //! @section AsmJit_Main_HomePage AsmJit Homepage //! //! - http://code.google.com/p/asmjit/ -//! -//! @section AsmJit_Main_ResourcesX86 External X86/X64 Assembler Resources -//! - http://www.agner.org/optimize/ -//! - http://www.mark.masmcode.com/ (Assembler Tips) -//! - http://avisynth.org/mediawiki/Filter_SDK/Assembler_optimizing (Optimizing) -//! - http://www.ragestorm.net/distorm/ (Disassembling) -//! -//! @section AsmJit_Main_Terminology Terminology -//! -//! - Non-volatile (preserved) register - Register that can't be changed -//! by callee (callee must save and restore it if it want to use it inside). -//! -//! - Volatile (non-preserved) register - The opossite. Register that can -//! be freely used by callee. The caller must free all registers before calling -//! other function. -//! @defgroup asmjit_base Base - base (backend neutral) classes. -//! -//! Contains all AsmJit classes and helper functions that are neutral or -//! abstract. All abstract classes are reimplemented for every supported -//! architecture. -//! -//! - See @c asmjit::Assembler class for low level code generation -//! documentation. -//! - See @c asmjit::Operand for AsmJit operand's overview. -//! -//! @section AsmJit_Core_Registers Registers -//! -//! There are static objects that represents X86 and X64 registers. They can -//! be used directly (like @c eax, @c mm, @c xmm, ...) or created through -//! these functions: -//! -//! - @c asmjit::gpb_lo() - Get Gpb-lo register. -//! - @c asmjit::gpb_hi() - Get Gpb-hi register. -//! - @c asmjit::gpw() - Get Gpw register. -//! - @c asmjit::gpd() - Get Gpd register. -//! - @c asmjit::gpq() - Get Gpq Gp register. -//! - @c asmjit::gpz() - Get Gpd/Gpq register. -//! - @c asmjit::fp() - Get Fp register. -//! - @c asmjit::mm() - Get Mm register. -//! - @c asmjit::xmm() - Get Xmm register. -//! - @c asmjit::ymm() - Get Ymm register. -//! -//! @section AsmJit_Core_Addressing Addressing -//! -//! X86 and x64 architectures contains several addressing modes and most ones -//! are possible with AsmJit library. Memory represents are represented by -//! @c asmjit::BaseMem class. These functions are used to make operands that -//! represents memory addresses: -//! -//! - @c asmjit::ptr() -//! - @c asmjit::byte_ptr() -//! - @c asmjit::word_ptr() -//! - @c asmjit::dword_ptr() -//! - @c asmjit::qword_ptr() -//! - @c asmjit::tword_ptr() -//! - @c asmjit::oword_ptr() -//! - @c asmjit::yword_ptr() -//! - @c asmjit::intptr_ptr() -//! -//! Most useful function to make pointer should be @c asmjit::ptr(). It creates -//! pointer to the target with unspecified size. Unspecified size works in all -//! intrinsics where are used registers (this means that size is specified by -//! register operand or by instruction itself). For example @c asmjit::ptr() -//! can't be used with @c asmjit::Assembler::inc() instruction. In this case -//! size must be specified and it's also reason to make difference between -//! pointer sizes. -//! -//! Supported are simple address forms (register + displacement) and complex -//! address forms (register + (register << shift) + displacement). -//! -//! @section AsmJit_Core_Immediates Immediates -//! -//! Immediate values are constants thats passed directly after instruction -//! opcode. To create such value use @c asmjit::imm() or @c asmjit::imm_u() -//! methods to create signed or unsigned immediate value. -//! -//! @sa @c asmjit::BaseCompiler. - -//! @defgroup asmjit_compiler Compiler (high-level code generation). -//! -//! Contains classes related to @c asmjit::Compiler that can be used -//! to generate code using high-level constructs. -//! -//! - See @c Compiler class for high level code generation -//! documentation - calling conventions, function declaration -//! and variables management. - -//! @defgroup asmjit_config Configuration. -//! -//! Contains macros that can be redefined to fit into any project. - -//! @defgroup asmjit_cpuinfo Cpu information. -//! -//! X86 or x64 cpuid instruction allows to get information about processor -//! vendor and it's features. It's always used to detect features like MMX, -//! SSE and other newer ones. -//! -//! AsmJit library supports low level cpuid call implemented internally as -//! C++ function using inline assembler or intrinsics and also higher level -//! CPU features detection. The low level function (also used by higher level -//! one) is @c asmjit::cpuid(). -//! -//! AsmJit library also contains higher level function @c asmjit::getCpu() -//! that returns features detected by the library. The detection process is -//! done only once and the returned object is always the same. @c BaseCpuInfo -//! structure does not contain only information through @c asmjit::cpuid(), but -//! there is also small multiplatform code to detect number of processors -//! (or cores) through operating system API. -//! -//! It's recommended to use @c asmjit::cpuInfo to detect and check for -//! host processor features. -//! -//! Example how to use asmjit::cpuid(): -//! -//! @code -//! // All functions and structures are in asmjit namesapce. -//! using namespace asmjit; -//! -//! // Here will be retrieved result of cpuid call. -//! CpuId out; -//! -//! // Use cpuid function to do the job. -//! cpuid(0 /* eax */, &out /* eax, ebx, ecx, edx */); -//! -//! // If eax argument to cpuid is 0, ebx, ecx and edx registers -//! // are filled with cpu vendor. -//! char vendor[13]; -//! memcpy(i->vendor, &out.ebx, 4); -//! memcpy(i->vendor + 4, &out.edx, 4); -//! memcpy(i->vendor + 8, &out.ecx, 4); -//! vendor[12] = '\0'; -//! -//! // Print vendor -//! puts(vendor); -//! @endcode -//! -//! If the high-level interface of asmjit::BaseCpuInfo is not enough, you can -//! use low-level asmjit::cpuid() when running on x86/x64 host, but please read -//! processor manuals provided by Intel, AMD or other manufacturer for cpuid -//! details. -//! -//! Example of using @c BaseCpuInfo::getHost(): -//! -//! @code -//! // All functions and structures are in asmjit namesapce. -//! using namespace asmjit; -//! -//! // Call to cpuInfo return BaseCpuInfo structure that shouldn't be modified. -//! // Make it const by default. -//! const BaseCpuInfo* cpuInfo = BaseCpuInfo::getHost(); -//! -//! // Now you are able to get specific features. -//! -//! // Processor has SSE2 -//! if (cpuInfo->hasFeature(kCpuFeatureSse2)) { -//! // your code... -//! } -//! // Processor has MMX -//! else if (cpuInfo->hasFeature(kCpuFeature_MMX)) { -//! // your code... -//! } -//! // Processor is old, no SSE2 or MMX support. -//! else { -//! // your code... -//! } -//! @endcode -//! -//! Better example is in app/test/testcpu.cpp file. - -//! @defgroup asmjit_logging Logging and error handling. -//! -//! Contains classes related to loging. Currently logging is implemented in -//! @ref asmjit::BaseLogger class. The function @ref asmjit::BaseLogger::log() -//! can be overridden to redirect logging into any user-defined stream. -//! -//! To log your assembler output to FILE stream use this code: -//! -//! @code -//! // Create assembler -//! Assembler a; -//! -//! // Create and set file based logger -//! FileLogger logger(stderr); -//! a.setLogger(&logger); -//! @endcode -//! -//! You can see that logging goes through @c Assembler. If you are using -//! @c Compiler and you want to log messages in correct assembler order, -//! you should look at @ref Compiler::comment() method. It allows you to -//! insert text message into items stream so the @c Compiler is able to -//! send messages to @ref Assembler in correct order. -//! -//! @sa @c asmjit::BaseLogger, @c asmjit::FileLogger. - - -//! @defgroup AsmJit_MemoryManagement Virtual memory management. -//! -//! Using @c asmjit::Assembler or @c asmjit::Compiler to generate machine -//! code is not final step. Each generated code needs to run in memory -//! that is not protected against code execution. To alloc this code it's -//! needed to use operating system functions provided to enable execution -//! code in specified memory block or to allocate memory that is not -//! protected. The solution is always to use @c See asmjit::Assembler::make() -//! and @c asmjit::Compiler::make() functions that can allocate memory and -//! relocate code for you. But AsmJit also contains classes for manual memory -//! management thats internally used by AsmJit but can be used by programmers -//! too. -//! -//! Memory management contains low level and high level classes related to -//! allocating and freeing virtual memory. Low level class is -//! @c asmjit::VMem that can allocate and free full pages of virtual memory -//! provided by operating system. Higher level class is @c asmjit::MemoryManager -//! that is able to manage complete allocation and free mechanism. It -//! internally uses larger chunks of memory to make allocation fast and -//! effective. -//! -//! Using @c asmjit::VMem::alloc() is cross-platform way how to allocate this -//! kind of memory without worrying about operating system and it's API. Each -//! memory block that is no longer needed should be released by @ref -//! asmjit::VMem::release() method. Higher-level interface for virtual memory -//! allocation can be found at asmjit::MemoryManager class. -//! -//! @sa @c asmjit::VMem, @ asmjit::MemoryManager. - - -//! @addtogroup asmjit_config -//! @{ - -//! @def ASMJIT_OS_WINDOWS -//! @brief Macro that is declared if AsmJit is compiled for Windows. - -//! @def ASMJIT_OS_POSIX -//! @brief Macro that is declared if AsmJit is compiled for unix like -//! operating system. - -//! @def ASMJIT_API -//! @brief Attribute that's added to classes that can be exported if AsmJit -//! is compiled as a dll library. - -//! @def ASMJIT_ASSERT -//! @brief Assertion macro. Default implementation calls -//! @c asmjit::assertionFailed() function. - -//! @} - - -//! @namespace asmjit -//! @brief Main AsmJit library namespace. -//! -//! There are not other namespaces used in AsmJit library. - -// [Dependencies - Core] +// [Dependencies - Base] #include "base.h" // [Dependencies - X86/X64] diff --git a/src/asmjit/base.h b/src/asmjit/base.h index f1f576f..2ae5508 100644 --- a/src/asmjit/base.h +++ b/src/asmjit/base.h @@ -8,7 +8,193 @@ #ifndef _ASMJIT_BASE_H #define _ASMJIT_BASE_H +// ============================================================================ +// [asmjit_base] +// ============================================================================ + +//! @defgroup asmjit_base Base +//! +//! @brief AsmJit Base API. +//! +//! Contains all `asmjit` classes and helper functions that are architecture +//! independent or abstract. Abstract classes are implemented by the backend, +//! for example `BaseAssembler` is implemented by `x86x64::X86X64Assembler`. +//! +//! - See `BaseAssembler` for low level code generation documentation. +//! - See `BaseCompiler` for high level code generation documentation. +//! - See `Operand` for operand's overview. +//! +//! @section AsmJit_Core_Registers Registers +//! +//! There are static objects that represents X86 and X64 registers. They can +//! be used directly (like `eax`, `mm`, `xmm`, ...) or created through +//! these functions: +//! +//! - `asmjit::gpb_lo()` - Get Gpb-lo register. +//! - `asmjit::gpb_hi()` - Get Gpb-hi register. +//! - `asmjit::gpw()` - Get Gpw register. +//! - `asmjit::gpd()` - Get Gpd register. +//! - `asmjit::gpq()` - Get Gpq Gp register. +//! - `asmjit::gpz()` - Get Gpd/Gpq register. +//! - `asmjit::fp()` - Get Fp register. +//! - `asmjit::mm()` - Get Mm register. +//! - `asmjit::xmm()` - Get Xmm register. +//! - `asmjit::ymm()` - Get Ymm register. +//! +//! @section AsmJit_Core_Addressing Addressing +//! +//! X86 and x64 architectures contains several addressing modes and most ones +//! are possible with AsmJit library. Memory represents are represented by +//! `BaseMem` class. These functions are used to make operands that represents +//! memory addresses: +//! +//! - `asmjit::ptr()` +//! - `asmjit::byte_ptr()` +//! - `asmjit::word_ptr()` +//! - `asmjit::dword_ptr()` +//! - `asmjit::qword_ptr()` +//! - `asmjit::tword_ptr()` +//! - `asmjit::oword_ptr()` +//! - `asmjit::yword_ptr()` +//! - `asmjit::intptr_ptr()` +//! +//! Most useful function to make pointer should be `asmjit::ptr()`. It creates +//! pointer to the target with unspecified size. Unspecified size works in all +//! intrinsics where are used registers (this means that size is specified by +//! register operand or by instruction itself). For example `asmjit::ptr()` +//! can't be used with @c asmjit::Assembler::inc() instruction. In this case +//! size must be specified and it's also reason to make difference between +//! pointer sizes. +//! +//! Supported are simple address forms (register + displacement) and complex +//! address forms (register + (register << shift) + displacement). +//! +//! @section AsmJit_Core_Immediates Immediates +//! +//! Immediate values are constants thats passed directly after instruction +//! opcode. To create such value use @c asmjit::imm() or @c asmjit::imm_u() +//! methods to create signed or unsigned immediate value. +//! +//! @sa @c asmjit::BaseCompiler. + +// ============================================================================ +// [asmjit_base_globals] +// ============================================================================ + +//! @defgroup asmjit_base_globals Globals +//! @ingroup asmjit_base +//! +//! @brief Global definitions, macros and functions. + +// ============================================================================ +// [asmjit_base_codegen] +// ============================================================================ + +//! @defgroup asmjit_base_codegen Code Generation (Base) +//! @ingroup asmjit_base +//! +//! @brief Low-level and high-level code generation. + +// ============================================================================ +// [asmjit_base_cpu_info] +// ============================================================================ + +//! @defgroup asmjit_base_cpu_info CPU Information (Base) +//! @ingroup asmjit_base +//! +//! @brief CPU Information Interface, platform neutral. + +// ============================================================================ +// [asmjit_base_logging_and_errors] +// ============================================================================ + +//! @defgroup asmjit_base_logging_and_errors Logging and Error Handling +//! @ingroup asmjit_base +//! +//! @brief Logging and error handling. +//! +//! AsmJit contains robust interface that can be used to log the generated code +//! and to handle possible errors. Base logging interface is defined in `Logger` +//! class that is abstract and can be overridden. AsmJit contains two loggers +//! that can be used out-of-the box - `FileLogger` that logs into a `FILE*` +//! and `StringLogger` that just concatenates all log messages without sending +//! them to a stream. +//! +//! The following snippet shows how to setup a logger that logs to `stderr`: +//! +//! ~~~ +//! // `FileLogger` instance. +//! FileLogger logger(stderr); +//! +//! // `Compiler` or any other `CodeGen` interface. +//! host::Compiler c; +//! +//! // use `setLogger` to replace the `CodeGen` logger. +//! c.setLogger(&logger); +//! ~~~ +//! +//! @sa @ref `Logger`, @ref `FileLogger`, @ref `StringLogger`. + +// ============================================================================ +// [asmjit_base_util] +// ============================================================================ + +//! @defgroup asmjit_base_util Utilities +//! @ingroup asmjit_base +//! +//! @brief Utilities inside AsmJit made public. +//! +//! AsmJit contains numerous utility classes that are needed by the library +//! itself. The most useful ones have been made public and are now exported. +//! +//! POD-Containers +//! -------------- +//! +//! TODO: Documentation +//! +//! String Builder +//! -------------- +//! +//! TODO: Documentation +//! +//! Integer Utilities +//! ----------------- +//! +//! TODO: Documentation +//! +//! Zone Memory Allocator +//! --------------------- +//! +//! TODO: Documentation +//! +//! CPU Ticks +//! --------- +//! +//! TODO: Documentation + +// ============================================================================ +// [asmjit_base_vectypes] +// ============================================================================ + +//! @defgroup asmjit_base_vectypes Vector Types +//! @ingroup asmjit_base +//! +//! @brief Vector types can be used to create a data which is stored in the +//! machine code. + +// ============================================================================ +// [asmjit::] +// ============================================================================ + +//! @namespace asmjit +//! Main AsmJit library namespace. +//! +//! There are not other namespaces used in AsmJit library. + +// ============================================================================ // [Dependencies - AsmJit] +// ============================================================================ + #include "build.h" #include "base/assembler.h" @@ -24,7 +210,6 @@ #include "base/intutil.h" #include "base/lock.h" #include "base/logger.h" -#include "base/memorymanager.h" #include "base/podlist.h" #include "base/podvector.h" #include "base/string.h" diff --git a/src/asmjit/base/assembler.cpp b/src/asmjit/base/assembler.cpp index 73b015c..9b6844d 100644 --- a/src/asmjit/base/assembler.cpp +++ b/src/asmjit/base/assembler.cpp @@ -10,7 +10,7 @@ // [Dependencies - AsmJit] #include "../base/assembler.h" #include "../base/intutil.h" -#include "../base/memorymanager.h" +#include "../base/vmem.h" // [Dependenceis - C] #include @@ -24,7 +24,7 @@ namespace asmjit { // [asmjit::BaseAssembler - Construction / Destruction] // ============================================================================ -BaseAssembler::BaseAssembler(BaseRuntime* runtime) : +BaseAssembler::BaseAssembler(Runtime* runtime) : CodeGen(runtime), _buffer(NULL), _end(NULL), diff --git a/src/asmjit/base/assembler.h b/src/asmjit/base/assembler.h index febcee2..3fad186 100644 --- a/src/asmjit/base/assembler.h +++ b/src/asmjit/base/assembler.h @@ -23,22 +23,24 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_codegen //! @{ // ============================================================================ // [asmjit::LabelLink] // ============================================================================ -//! @brief Data structure used to link linked-labels. +//! @internal +//! +//! Data structure used to link linked-labels. struct LabelLink { - //! @brief Previous link. + //! Previous link. LabelLink* prev; - //! @brief Offset. + //! Offset. intptr_t offset; - //! @brief Inlined displacement. + //! Inlined displacement. intptr_t displacement; - //! @brief RelocId if link must be absolute when relocated. + //! RelocId if link must be absolute when relocated. intptr_t relocId; }; @@ -46,11 +48,13 @@ struct LabelLink { // [asmjit::LabelData] // ============================================================================ -//! @brief Label data. +//! @internal +//! +//! Label data. struct LabelData { - //! @brief Label offset. + //! Label offset. intptr_t offset; - //! @brief Label links chain. + //! Label links chain. LabelLink* links; }; @@ -58,7 +62,9 @@ struct LabelData { // [asmjit::RelocData] // ============================================================================ -//! @brief Code relocation data (relative vs absolute addresses). +//! @internal +//! +//! Code relocation data (relative vs absolute addresses). //! //! X86/X64: //! @@ -68,16 +74,16 @@ struct LabelData { //! and embedded data. In 32-bit mode we must patch all references to absolute //! address before we can call generated function. struct RelocData { - //! @brief Type of relocation. + //! Type of relocation. uint32_t type; - //! @brief Size of relocation (4 or 8 bytes). + //! Size of relocation (4 or 8 bytes). uint32_t size; - //! @brief Offset from code begin address. + //! Offset from code begin address. Ptr from; - //! @brief Relative displacement from code begin address (not to @c offset) - //! or absolute address. + //! Relative displacement from code begin address (not to `offset`) or + //! absolute address. Ptr data; }; @@ -85,10 +91,10 @@ struct RelocData { // [asmjit::BaseAssembler] // ============================================================================ -//! @brief Base assembler. +//! Base assembler. //! -//! This class implements core setialization API only. The platform specific -//! methods and intrinsics is implemented by derived classes. +//! This class implements the base interface to an assembler. The architecture +//! specific API is implemented by backends. //! //! @sa BaseCompiler. struct BaseAssembler : public CodeGen { @@ -98,66 +104,66 @@ struct BaseAssembler : public CodeGen { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref BaseAssembler instance. - ASMJIT_API BaseAssembler(BaseRuntime* runtime); - //! @brief Destroy the @ref BaseAssembler instance. + //! Create a new `BaseAssembler` instance. + ASMJIT_API BaseAssembler(Runtime* runtime); + //! Destroy the `BaseAssembler` instance. ASMJIT_API virtual ~BaseAssembler(); // -------------------------------------------------------------------------- // [Clear / Reset] // -------------------------------------------------------------------------- - //! @brief Clear everything, but not deallocate buffers. + //! Clear everything, but not deallocate buffers. ASMJIT_API void clear(); - //! @brief Reset everything (means also to free all buffers). + //! Reset everything (means also to free all buffers). ASMJIT_API void reset(); - //! @brief Called by clear() and reset() to clear all data related to derived - //! class implementation. + //! Called by clear() and reset() to clear all data related to derived class + //! implementation. ASMJIT_API virtual void _purge(); // -------------------------------------------------------------------------- // [Buffer] // -------------------------------------------------------------------------- - //! @brief Get capacity of the code buffer. + //! Get capacity of the code buffer. ASMJIT_INLINE size_t getCapacity() const { return (size_t)(_end - _buffer); } - //! @brief Get the number of remaining bytes (space between cursor and the - //! end of the buffer). + //! Get the number of remaining bytes (space between cursor and the end of + //! the buffer). ASMJIT_INLINE size_t getRemainingSpace() const { return (size_t)(_end - _cursor); } - //! @brief Get buffer. + //! Get buffer. ASMJIT_INLINE uint8_t* getBuffer() const { return _buffer; } - //! @brief Get the end of the buffer (points to the first byte that is outside). + //! Get the end of the buffer (points to the first byte that is outside). ASMJIT_INLINE uint8_t* getEnd() const { return _end; } - //! @brief Get the current position in the buffer. + //! Get the current position in the buffer. ASMJIT_INLINE uint8_t* getCursor() const { return _cursor; } - //! @brief Set the current position in the buffer. + //! Set the current position in the buffer. ASMJIT_INLINE void setCursor(uint8_t* cursor) { ASMJIT_ASSERT(cursor >= _buffer && cursor <= _end); _cursor = cursor; } - //! @brief Get the current offset in the buffer (_cursor - _buffer). + //! Get the current offset in the buffer. ASMJIT_INLINE size_t getOffset() const { return (size_t)(_cursor - _buffer); } - //! @brief Set the current offset in the buffer to @a offset and get the - //! previous offset value. + //! Set the current offset in the buffer to `offset` and get the previous + //! offset value. ASMJIT_INLINE size_t setOffset(size_t offset) { ASMJIT_ASSERT(offset < getCapacity()); @@ -166,84 +172,83 @@ struct BaseAssembler : public CodeGen { return oldOffset; } - //! @brief Grow the internal buffer. + //! Grow the internal buffer. //! - //! The internal buffer will grow at least by @a n bytes so @a n bytes - //! can be added to it. If @a n is zero or getOffset() + n - //! is not greater than the current capacity of the buffer this function - //! won't do anything. + //! The internal buffer will grow at least by `n` bytes so `n` bytes can be + //! added to it. If `n` is zero or `getOffset() + n` is not greater than the + //! current capacity of the buffer this function does nothing. ASMJIT_API Error _grow(size_t n); - //! @brief Reserve the internal buffer to at least @a n bytes. + //! Reserve the internal buffer to at least `n` bytes. ASMJIT_API Error _reserve(size_t n); - //! @brief Set byte at position @a pos. + //! Set byte at position `pos`. ASMJIT_INLINE uint8_t getByteAt(size_t pos) const { ASMJIT_ASSERT(pos + 1 <= (size_t)(_end - _buffer)); return *reinterpret_cast(_buffer + pos); } - //! @brief Set word at position @a pos. + //! Set word at position `pos`. ASMJIT_INLINE uint16_t getWordAt(size_t pos) const { ASMJIT_ASSERT(pos + 2 <= (size_t)(_end - _buffer)); return *reinterpret_cast(_buffer + pos); } - //! @brief Set dword at position @a pos. + //! Set dword at position `pos`. ASMJIT_INLINE uint32_t getDWordAt(size_t pos) const { ASMJIT_ASSERT(pos + 4 <= (size_t)(_end - _buffer)); return *reinterpret_cast(_buffer + pos); } - //! @brief Set qword at position @a pos. + //! Set qword at position `pos`. ASMJIT_INLINE uint64_t getQWordAt(size_t pos) const { ASMJIT_ASSERT(pos + 8 <= (size_t)(_end - _buffer)); return *reinterpret_cast(_buffer + pos); } - //! @brief Set int32_t at position @a pos. + //! Set int32_t at position `pos`. ASMJIT_INLINE int32_t getInt32At(size_t pos) const { ASMJIT_ASSERT(pos + 4 <= (size_t)(_end - _buffer)); return *reinterpret_cast(_buffer + pos); } - //! @brief Set uint32_t at position @a pos. + //! Set uint32_t at position `pos`. ASMJIT_INLINE uint32_t getUInt32At(size_t pos) const { ASMJIT_ASSERT(pos + 4 <= (size_t)(_end - _buffer)); return *reinterpret_cast(_buffer + pos); } - //! @brief Set byte at position @a pos. + //! Set byte at position `pos`. ASMJIT_INLINE void setByteAt(size_t pos, uint8_t x) { ASMJIT_ASSERT(pos + 1 <= (size_t)(_end - _buffer)); *reinterpret_cast(_buffer + pos) = x; } - //! @brief Set word at position @a pos. + //! Set word at position `pos`. ASMJIT_INLINE void setWordAt(size_t pos, uint16_t x) { ASMJIT_ASSERT(pos + 2 <= (size_t)(_end - _buffer)); *reinterpret_cast(_buffer + pos) = x; } - //! @brief Set dword at position @a pos. + //! Set dword at position `pos`. ASMJIT_INLINE void setDWordAt(size_t pos, uint32_t x) { ASMJIT_ASSERT(pos + 4 <= (size_t)(_end - _buffer)); *reinterpret_cast(_buffer + pos) = x; } - //! @brief Set qword at position @a pos. + //! Set qword at position `pos`. ASMJIT_INLINE void setQWordAt(size_t pos, uint64_t x) { ASMJIT_ASSERT(pos + 8 <= (size_t)(_end - _buffer)); *reinterpret_cast(_buffer + pos) = x; } - //! @brief Set int32_t at position @a pos. + //! Set int32_t at position `pos`. ASMJIT_INLINE void setInt32At(size_t pos, int32_t x) { ASMJIT_ASSERT(pos + 4 <= (size_t)(_end - _buffer)); *reinterpret_cast(_buffer + pos) = x; } - //! @brief Set uint32_t at position @a pos. + //! Set uint32_t at position `pos`. ASMJIT_INLINE void setUInt32At(size_t pos, uint32_t x) { ASMJIT_ASSERT(pos + 4 <= (size_t)(_end - _buffer)); *reinterpret_cast(_buffer + pos) = x; @@ -253,7 +258,7 @@ struct BaseAssembler : public CodeGen { // [GetCodeSize] // -------------------------------------------------------------------------- - //! @brief Get current offset in buffer (same as getOffset() + getTramplineSize()). + //! Get current offset in buffer, same as `getOffset() + getTramplineSize()`. ASMJIT_INLINE size_t getCodeSize() const { return getOffset() + getTrampolineSize(); } @@ -262,10 +267,12 @@ struct BaseAssembler : public CodeGen { // [GetTrampolineSize] // -------------------------------------------------------------------------- - //! @brief Get size of all possible trampolines needed to successfuly generate - //! relative jumps to absolute addresses. This value is only non-zero if jmp - //! of call instructions were used with immediate operand (this means jumping - //! or calling an absolute address directly). + //! Get size of all possible trampolines. + //! + //! Trampolines are needed to successfuly generate relative jumps to absolute + //! addresses. This value is only non-zero if jmp of call instructions were + //! used with immediate operand (this means jumping or calling an absolute + //! address directly). ASMJIT_INLINE size_t getTrampolineSize() const { return _trampolineSize; } @@ -274,26 +281,26 @@ struct BaseAssembler : public CodeGen { // [Label] // -------------------------------------------------------------------------- - //! @brief Get count of labels created. + //! Get count of labels created. ASMJIT_INLINE size_t getLabelsCount() const { return _labels.getLength(); } - //! @brief Get whether @a label is created. + //! Get whether `label` is created. ASMJIT_INLINE bool isLabelCreated(const Label& label) const { return static_cast(label.getId()) < _labels.getLength(); } //! @internal //! - //! @brief Get @ref LabelData by @a label. + //! Get `LabelData` by `label`. ASMJIT_INLINE LabelData* getLabelData(const Label& label) const { return getLabelDataById(label.getId()); } //! @internal //! - //! @brief Get @ref LabelData by @a id. + //! Get `LabelData` by `id`. ASMJIT_INLINE LabelData* getLabelDataById(uint32_t id) const { ASMJIT_ASSERT(id != kInvalidValue); ASMJIT_ASSERT(id < _labels.getLength()); @@ -303,30 +310,30 @@ struct BaseAssembler : public CodeGen { //! @internal //! - //! @brief Register labels for other code generator (@ref Compiler). + //! Register labels for other code generator, i.e. `Compiler`. ASMJIT_API Error _registerIndexedLabels(size_t index); //! @internal //! - //! @brief Create and initialize a new label. + //! Create and initialize a new `Label`. ASMJIT_API Error _newLabel(Label* dst); //! @internal //! - //! @brief New LabelLink instance. + //! New LabelLink instance. ASMJIT_API LabelLink* _newLabelLink(); - //! @brief Create and return new label. + //! Create and return a new `Label`. ASMJIT_INLINE Label newLabel() { Label result(NoInit); _newLabel(&result); return result; } - //! @brief Bind label to the current offset (virtual). + //! Bind label to the current offset. virtual void _bind(const Label& label) = 0; - //! @brief Bind label to the current offset (virtual). + //! Bind label to the current offset. //! //! @note Label can be bound only once! ASMJIT_INLINE void bind(const Label& label) { @@ -337,43 +344,43 @@ struct BaseAssembler : public CodeGen { // [Embed] // -------------------------------------------------------------------------- - //! @brief Embed data into the code buffer. + //! Embed data into the code buffer. ASMJIT_API Error embed(const void* data, uint32_t size); // -------------------------------------------------------------------------- // [Align] // -------------------------------------------------------------------------- - //! @brief Align target buffer to @a m bytes. + //! Align target buffer to `m` bytes. //! //! Typical usage of this is to align labels at start of the inner loops. //! - //! Inserts @c nop() instructions or CPU optimized NOPs. + //! Inserts `nop()` instructions or CPU optimized NOPs. ASMJIT_INLINE Error align(uint32_t m) { return _align(m); } - //! @brief Align target buffer to @a m bytes (virtual). + //! Align target buffer to `m` bytes (virtual). virtual Error _align(uint32_t m) = 0; // -------------------------------------------------------------------------- // [Reloc] // -------------------------------------------------------------------------- - //! @brief Simplifed version of @c relocCode() method designed for JIT. + //! Simplifed version of `relocCode()` method designed for JIT. //! //! @overload ASMJIT_INLINE size_t relocCode(void* dst) const { return _relocCode(dst, static_cast((uintptr_t)dst)); } - //! @brief Relocate code to a given address @a dst. + //! Relocate code to a given address `dst`. //! //! @param dst Where the relocated code should me stored. The pointer can be //! address returned by virtual memory allocator or your own address if you //! want only to store the code for later reuse (or load, etc...). //! @param addressBase Base address used for relocation. When using JIT code - //! generation, this will be the same as @a dst, only casted to system + //! generation, this will be the same as `dst`, only casted to system //! integer type. But when generating code for remote process then the value //! can be different. //! @@ -383,12 +390,12 @@ struct BaseAssembler : public CodeGen { //! for the function. //! //! A given buffer will be overwritten, to get number of bytes required use - //! @c getCodeSize(). + //! `getCodeSize()`. ASMJIT_INLINE size_t relocCode(void* dst, Ptr base) const { return _relocCode(dst, base); } - //! @brief Reloc code (virtual). + //! Reloc code (virtual). virtual size_t _relocCode(void* dst, Ptr base) const = 0; // -------------------------------------------------------------------------- @@ -401,7 +408,7 @@ struct BaseAssembler : public CodeGen { // [Emit] // -------------------------------------------------------------------------- - //! @brief Emit an instruction. + //! Emit an instruction. ASMJIT_API Error emit(uint32_t code); //! @overload ASMJIT_API Error emit(uint32_t code, const Operand& o0); @@ -414,7 +421,7 @@ struct BaseAssembler : public CodeGen { return _emit(code, o0, o1, o2, o3); } - //! @brief Emit an instruction with integer immediate operand. + //! Emit an instruction with integer immediate operand. ASMJIT_API Error emit(uint32_t code, int o0); //! @overload ASMJIT_API Error emit(uint32_t code, const Operand& o0, int o1); @@ -423,37 +430,37 @@ struct BaseAssembler : public CodeGen { //! @overload ASMJIT_API Error emit(uint32_t code, const Operand& o0, const Operand& o1, const Operand& o2, int o3); - //! @brief Emit an instruction (virtual). + //! Emit an instruction (virtual). virtual Error _emit(uint32_t code, const Operand& o0, const Operand& o1, const Operand& o2, const Operand& o3) = 0; // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Buffer where the code is emitted (either live or temporary). + //! Buffer where the code is emitted (either live or temporary). //! //! This is actually the base pointer of the buffer, to get the current - //! position (cursor) look at the @c _cursor member. + //! position (cursor) look at the `_cursor` member. uint8_t* _buffer; - //! @brief The end of the buffer (points to the first invalid byte). + //! The end of the buffer (points to the first invalid byte). //! //! The end of the buffer is calculated as _buffer + size. uint8_t* _end; - //! @brief The current position in code @c _buffer. + //! The current position in code `_buffer`. uint8_t* _cursor; - //! @brief Size of possible trampolines. + //! Size of possible trampolines. uint32_t _trampolineSize; - //! @brief Inline comment that will be logged by the next instruction and + //! Inline comment that will be logged by the next instruction and //! set to NULL. const char* _comment; - //! @brief Linked list of unused links (@c LabelLink* structures) + //! Unused `LabelLink` structures pool. LabelLink* _unusedLinks; - //! @brief Labels data. + //! Labels data. PodVector _labels; - //! @brief Relocations data. + //! Relocations data. PodVector _relocData; }; diff --git a/src/asmjit/base/codegen.cpp b/src/asmjit/base/codegen.cpp index a92dfc3..7837ef0 100644 --- a/src/asmjit/base/codegen.cpp +++ b/src/asmjit/base/codegen.cpp @@ -20,7 +20,7 @@ namespace asmjit { // [asmjit::CodeGen - Construction / Destruction] // ============================================================================ -CodeGen::CodeGen(BaseRuntime* runtime) : +CodeGen::CodeGen(Runtime* runtime) : _runtime(runtime), _logger(NULL), _errorHandler(NULL), @@ -40,7 +40,7 @@ CodeGen::~CodeGen() { // [asmjit::CodeGen - Logging] // ============================================================================ -Error CodeGen::setLogger(BaseLogger* logger) { +Error CodeGen::setLogger(Logger* logger) { _logger = logger; return kErrorOk; } @@ -64,7 +64,7 @@ Error CodeGen::setError(Error error, const char* message) { if (handler != NULL && handler->handleError(error, message)) return error; - BaseLogger* logger = _logger; + Logger* logger = _logger; if (logger != NULL) { logger->logFormat(kLoggerStyleComment, "*** ERROR: %s (%u).\n", message, static_cast(error)); diff --git a/src/asmjit/base/codegen.h b/src/asmjit/base/codegen.h index 561fa23..32b8e4e 100644 --- a/src/asmjit/base/codegen.h +++ b/src/asmjit/base/codegen.h @@ -20,33 +20,35 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_codegen //! @{ // ============================================================================ // [asmjit::kCodeGen] // ============================================================================ -//! @brief @ref CodeGen features. +//! Features of `CodeGen`. ASMJIT_ENUM(kCodeGen) { - //! @brief Emit optimized code-alignment sequences. + //! Emit optimized code-alignment sequences. //! - //! X86/X64: + //! X86/X64 + //! ------- //! //! Default align sequence used by X86/X64 architecture is one-byte 0x90 //! opcode that is mostly shown by disassemblers as nop. However there are //! more optimized align sequences for 2-11 bytes that may execute faster. //! If this feature is enabled asmjit will generate specialized sequences - //! for alignment between 1 to 11 bytes. Also when @ref x86x64::Compiler - //! is used, it may add rex prefixes into the code to make some instructions - //! larger so no alignment sequences are needed. + //! for alignment between 1 to 11 bytes. Also when `x86x64::Compiler` is + //! used, it may add rex prefixes into the code to make some instructions + //! greater so no alignment sequences are needed. //! - //! @default true. + //! Default true. kCodeGenOptimizedAlign = 0, - //! @brief Emit jump-prediction hints. + //! Emit jump-prediction hints. //! - //! X86/X64: + //! X86/X64 + //! ------- //! //! Jump prediction is usually based on the direction of the jump. If the //! jump is backward it is usually predicted as taken; and if the jump is @@ -55,7 +57,7 @@ ASMJIT_ENUM(kCodeGen) { //! However this behavior can be overridden by using instruction prefixes. //! If this option is enabled these hints will be emitted. //! - //! @default true. + //! Default true. kCodeGenPredictedJumps = 1 }; @@ -63,7 +65,7 @@ ASMJIT_ENUM(kCodeGen) { // [asmjit::CodeGen] // ============================================================================ -//! @brief Abstract class inherited by @ref Assembler and @ref Compiler. +//! Abstract class inherited by `Assembler` and `Compiler`. struct CodeGen { ASMJIT_NO_COPY(CodeGen) @@ -71,76 +73,76 @@ struct CodeGen { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref CodeGen instance. - ASMJIT_API CodeGen(BaseRuntime* runtime); - //! @brief Destroy the @ref CodeGen instance. + //! Create a new `CodeGen` instance. + ASMJIT_API CodeGen(Runtime* runtime); + //! Destroy the `CodeGen` instance. ASMJIT_API virtual ~CodeGen(); // -------------------------------------------------------------------------- // [Runtime] // -------------------------------------------------------------------------- - //! @brief Get runtime. - ASMJIT_INLINE BaseRuntime* getRuntime() const { return _runtime; } + //! Get runtime. + ASMJIT_INLINE Runtime* getRuntime() const { return _runtime; } // -------------------------------------------------------------------------- // [Logger] // -------------------------------------------------------------------------- - //! @brief Get whether the code generator has a logger. + //! Get whether the code generator has a logger. ASMJIT_INLINE bool hasLogger() const { return _logger != NULL; } - //! @brief Get logger. - ASMJIT_INLINE BaseLogger* getLogger() const { return _logger; } - //! @brief Set logger to @a logger. - ASMJIT_API Error setLogger(BaseLogger* logger); + //! Get logger. + ASMJIT_INLINE Logger* getLogger() const { return _logger; } + //! Set logger to `logger`. + ASMJIT_API Error setLogger(Logger* logger); // -------------------------------------------------------------------------- // [Arch] // -------------------------------------------------------------------------- - //! @brief Get target architecture. + //! Get target architecture. ASMJIT_INLINE uint32_t getArch() const { return _arch; } - //! @brief Get default register size (4 or 8 bytes). + //! Get default register size (4 or 8 bytes). ASMJIT_INLINE uint32_t getRegSize() const { return _regSize; } // -------------------------------------------------------------------------- // [Error] // -------------------------------------------------------------------------- - //! @brief Get last error code. + //! Get last error code. ASMJIT_INLINE Error getError() const { return _error; } - //! @brief Set last error code and propagate it through the error handler. + //! Set last error code and propagate it through the error handler. ASMJIT_API Error setError(Error error, const char* message = NULL); - //! @brief Clear the last error code. + //! Clear the last error code. ASMJIT_INLINE void clearError() { _error = kErrorOk; } - //! @brief Get error handler. + //! Get error handler. ASMJIT_INLINE ErrorHandler* getErrorHandler() const { return _errorHandler; } - //! @brief Set error handler. + //! Set error handler. ASMJIT_API Error setErrorHandler(ErrorHandler* handler); - //! @brief Clear error handler. + //! Clear error handler. ASMJIT_INLINE Error clearErrorHandler() { return setErrorHandler(NULL); } // -------------------------------------------------------------------------- // [Features] // -------------------------------------------------------------------------- - //! @brief Get code-generator @a feature. + //! Get code-generator `feature`. ASMJIT_API bool hasFeature(uint32_t feature) const; - //! @brief Set code-generator @a feature to @a value. + //! Set code-generator `feature` to `value`. ASMJIT_API Error setFeature(uint32_t feature, bool value); // -------------------------------------------------------------------------- // [Options] // -------------------------------------------------------------------------- - //! @brief Get options. + //! Get options. ASMJIT_INLINE uint32_t getOptions() const { return _options; } - //! @brief Set options. + //! Set options. ASMJIT_INLINE void setOptions(uint32_t options) { _options = options; } - //! @brief Get options and clear them. + //! Get options and clear them. ASMJIT_INLINE uint32_t getOptionsAndClear() { uint32_t options = _options; _options = 0; @@ -151,7 +153,7 @@ struct CodeGen { // [Purge] // -------------------------------------------------------------------------- - //! @brief Called by clear() and reset() to clear all data used by the code + //! Called by `clear()` and `reset()` to clear all data used by the code //! generator. virtual void _purge() = 0; @@ -159,37 +161,37 @@ struct CodeGen { // [Make] // -------------------------------------------------------------------------- - //! @brief Make is a convenience method to make and relocate the current code - //! into the associated runtime. + //! Make is a convenience method to make and relocate the current code and + //! add it to the associated `Runtime`. //! //! What is needed is only to cast the returned pointer to your function type - //! and then use it. If there was an error during make() @c NULL is returned - //! and the last error code can be obtained by calling @ref getError(). + //! and then use it. If there was an error during `make()` `NULL` is returned + //! and the last error code can be obtained by calling `getError()`. virtual void* make() = 0; // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Runtime. - BaseRuntime* _runtime; - //! @brief Logger. - BaseLogger* _logger; - //! @brief Error handler, called by @ref setError(). + //! Runtime. + Runtime* _runtime; + //! Logger. + Logger* _logger; + //! Error handler, called by `setError()`. ErrorHandler* _errorHandler; - //! @brief Target architecture. + //! Target architecture. uint8_t _arch; - //! @brief Get the default register size of the architecture (4 or 8 bytes). + //! Get the default register size of the architecture (4 or 8 bytes). uint8_t _regSize; - //! @brief Last error code. + //! Last error code. uint8_t _error; - //! @brief Target features. + //! Target features. uint8_t _features; - //! @brief Options for the next generated instruction (only 8-bits used). + //! Options for the next generated instruction (only 8-bits used). uint32_t _options; - //! @brief Base zone. + //! Base zone. Zone _baseZone; }; diff --git a/src/asmjit/base/compiler.cpp b/src/asmjit/base/compiler.cpp index c279bde..e8d714d 100644 --- a/src/asmjit/base/compiler.cpp +++ b/src/asmjit/base/compiler.cpp @@ -34,7 +34,7 @@ enum { kBaseCompilerDefaultLookAhead = 64 }; // [asmjit::BaseCompiler - Construction / Destruction] // ============================================================================ -BaseCompiler::BaseCompiler(BaseRuntime* runtime) : +BaseCompiler::BaseCompiler(Runtime* runtime) : CodeGen(runtime), _nodeFlowId(0), _nodeFlags(0), diff --git a/src/asmjit/base/compiler.h b/src/asmjit/base/compiler.h index 0083623..61b75f7 100644 --- a/src/asmjit/base/compiler.h +++ b/src/asmjit/base/compiler.h @@ -26,6 +26,9 @@ namespace asmjit { +//! @addtogroup asmjit_base_codegen +//! @{ + // ============================================================================ // [Forward Declarations] // ============================================================================ @@ -46,16 +49,11 @@ struct JumpNode; // [asmjit::kConstScope] // ============================================================================ -//! @brief Type of constant in constant pool +//! Scope of the constant. ASMJIT_ENUM(kConstScope) { - //! @brief Local constant. - //! - //! Local constant is always embedded right after the current function. + //! Local constant, always embedded right after the current function. kConstScopeLocal = 0, - - //! @brief Global constant. - //! - //! Global constant is embedded at the end of the currently compiled code. + //! Global constant, embedded at the end of the currently compiled code. kConstScopeGlobal = 1 }; @@ -63,55 +61,62 @@ ASMJIT_ENUM(kConstScope) { // [asmjit::kVarAttrFlags] // ============================================================================ -//! @brief Variable attribute flags. +//! Variable attribute flags. ASMJIT_ENUM(kVarAttrFlags) { - //! @brief Variable is accessed through register on input. + //! Variable is accessed through register on input. kVarAttrInReg = 0x00000001, - //! @brief Variable is accessed through register on output. + //! Variable is accessed through register on output. kVarAttrOutReg = 0x00000002, - //! @brief Variable is accessed through register on input & output. + //! Variable is accessed through register on input & output. kVarAttrInOutReg = 0x00000003, - //! @brief Variable is accessed through memory on input. + //! Variable is accessed through memory on input. kVarAttrInMem = 0x00000004, - //! @brief Variable is accessed through memory on output. + //! Variable is accessed through memory on output. kVarAttrOutMem = 0x00000008, - //! @brief Variable is accessed through memory on input & output. + //! Variable is accessed through memory on input & output. kVarAttrInOutMem = 0x0000000C, - //! @brief It can be decided whether it's better to alloc variable to register - //! or memory on the input. + //! Register allocator can decide if input will be in register or memory. kVarAttrInDecide = 0x00000010, - //! @brief It can be decided whether it's better to alloc variable to register - //! or memory on the output. + //! Register allocator can decide if output will be in register or memory. kVarAttrOutDecide = 0x00000020, - //! @brief It can be decided whether it's better to alloc variable to register - //! or memory on the input & output. + //! Register allocator can decide if in/out will be in register or memory. kVarAttrInOutDecide = 0x00000030, - //! @brief Variable is converted to other type/class on the input. + //! Variable is converted to other type/class on the input. kVarAttrInConv = 0x00000040, - //! @brief Variable is converted from other type/class on the output. + //! Variable is converted from other type/class on the output. kVarAttrOutConv = 0x00000080, - //! @brief Combination of @ref kVarAttrInConv and @ref kVarAttrOutConv. + //! Combination of `kVarAttrInConv` and `kVarAttrOutConv`. kVarAttrInOutConv = 0x000000C0, - //! @brief Variable is a function call operand. + //! Variable is a function call operand. kVarAttrInCall = 0x00000100, - //! @brief Variable is a function argument passed in register. + //! Variable is a function argument passed in register. kVarAttrInArg = 0x00000200, - //! @brief Variable is a function return value passed in register. + //! Variable is a function return value passed in register. kVarAttrOutRet = 0x00000400, - //! @brief Variable should be unused at the end of the instruction/node. + //! Variable should be unused at the end of the instruction/node. kVarAttrUnuse = 0x00000800, - kVarAttrInAll = kVarAttrInReg | kVarAttrInMem | kVarAttrInDecide | kVarAttrInCall | kVarAttrInArg, - kVarAttrOutAll = kVarAttrOutReg | kVarAttrOutMem | kVarAttrOutDecide | kVarAttrOutRet, + kVarAttrInAll = + kVarAttrInReg | + kVarAttrInMem | + kVarAttrInDecide | + kVarAttrInCall | + kVarAttrInArg, - //! @brief Variable is already allocated on the input. + kVarAttrOutAll = + kVarAttrOutReg | + kVarAttrOutMem | + kVarAttrOutDecide | + kVarAttrOutRet, + + //! Variable is already allocated on the input. kVarAttrAllocInDone = 0x00400000, - //! @brief Variable is already allocated on the output. + //! Variable is already allocated on the output. kVarAttrAllocOutDone = 0x00800000 }; @@ -119,19 +124,19 @@ ASMJIT_ENUM(kVarAttrFlags) { // [asmjit::kVarHint] // ============================================================================ -//! @brief Variable hint (used by @ref BaseCompiler). +//! Variable hint (used by `BaseCompiler)`. //! -//! @sa @ref BaseCompiler. +//! @sa `BaseCompiler`. ASMJIT_ENUM(kVarHint) { - //! @brief Alloc variable. + //! Alloc variable. kVarHintAlloc = 0, - //! @brief Spill variable. + //! Spill variable. kVarHintSpill = 1, - //! @brief Save variable if modified. + //! Save variable if modified. kVarHintSave = 2, - //! @brief Save variable if modified and mark it as unused. + //! Save variable if modified and mark it as unused. kVarHintSaveAndUnuse = 3, - //! @brief Mark variable as unused. + //! Mark variable as unused. kVarHintUnuse = 4 }; @@ -139,20 +144,20 @@ ASMJIT_ENUM(kVarHint) { // [asmjit::kVarState] // ============================================================================ -//! @brief State of variable. +//! State of variable. //! //! @note State of variable is used only during make process and it's not //! visible to the developer. ASMJIT_ENUM(kVarState) { - //! @brief Variable is currently not used. + //! Variable is currently not used. kVarStateUnused = 0, - //! @brief Variable is in register. + //! Variable is in register. //! //! Variable is currently allocated in register. kVarStateReg = 1, - //! @brief Variable is in memory location or spilled. + //! Variable is in memory location or spilled. //! //! Variable was spilled from register to memory or variable is used for //! memory only storage. @@ -163,31 +168,31 @@ ASMJIT_ENUM(kVarState) { // [asmjit::kNodeType] // ============================================================================ -//! @brief Type of node (see @ref BaseNode). +//! Type of node (see `BaseNode)`. ASMJIT_ENUM(kNodeType) { - //! @brief Invalid node (internal, can't be used). + //! Invalid node (internal, can't be used). kNodeTypeNone = 0, - //! @brief Node is an .align directive, see @ref AlignNode. + //! Node is an .align directive, see `AlignNode`. kNodeTypeAlign, - //! @brief Node is an embedded data, see @ref EmbedNode. + //! Node is an embedded data, see `EmbedNode`. kNodeTypeEmbed, - //! @brief Node is a comment, see @ref CommentNode. + //! Node is a comment, see `CommentNode`. kNodeTypeComment, - //! @brief Node is a variable hint (alloc, spill, use, unuse), see @ref HintNode. + //! Node is a variable hint (alloc, spill, use, unuse), see `HintNode`. kNodeTypeHint, - //! @brief Node is a label, see @ref TargetNode. + //! Node is a label, see `TargetNode`. kNodeTypeTarget, - //! @brief Node is an instruction, see @ref InstNode. + //! Node is an instruction, see `InstNode`. kNodeTypeInst, - //! @brief Node is a function declaration, see @ref FuncNode. + //! Node is a function declaration, see `FuncNode`. kNodeTypeFunc, - //! @brief Node is an end of the function, see @ref EndNode. + //! Node is an end of the function, see `EndNode`. kNodeTypeEnd, - //! @brief Node is a return, see @ref RetNode. + //! Node is a return, see `RetNode`. kNodeTypeRet, - //! @brief Node is a function call, see @ref CallNode. + //! Node is a function call, see `CallNode`. kNodeTypeCall, - //! @brief Node is a function call argument moved on stack, see @ref SArgNode. + //! Node is a function call argument moved on stack, see `SArgNode`. kNodeTypeSArg }; @@ -196,27 +201,27 @@ ASMJIT_ENUM(kNodeType) { // ============================================================================ ASMJIT_ENUM(kNodeFlag) { - //! @brief Whether the node was translated by @ref BaseContext. + //! Whether the node was translated by `BaseContext`. kNodeFlagIsTranslated = 0x0001, - //! @Brief Whether the @ref InstNode is a jump. + //! Whether the `InstNode` is a jump. kNodeFlagIsJmp = 0x0002, - //! @Brief Whether the @ref InstNode is a conditional jump. + //! Whether the `InstNode` is a conditional jump. kNodeFlagIsJcc = 0x0004, - //! @brief Whether the @ref InstNode is an unconditinal jump or conditional + //! Whether the `InstNode` is an unconditinal jump or conditional //! jump that is likely to be taken. kNodeFlagIsTaken = 0x0008, - //! @brief Whether the @ref Node will return from a function. + //! Whether the `Node` will return from a function. //! - //! This flag is used by both @ref EndNode and @ref RetNode. + //! This flag is used by both `EndNode` and `RetNode`. kNodeFlagIsRet = 0x0010, - //! @brief Whether the instruction is special. + //! Whether the instruction is special. kNodeFlagIsSpecial = 0x0020, - //! @brief Whether the instruction is an FPU instruction. + //! Whether the instruction is an FPU instruction. kNodeFlagIsFp = 0x0040 }; @@ -231,33 +236,33 @@ struct MemCell { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get cell offset. + //! Get cell offset. ASMJIT_INLINE int32_t getOffset() const { return _offset; } - //! @brief Set cell offset. + //! Set cell offset. ASMJIT_INLINE void setOffset(int32_t offset) { _offset = offset; } - //! @brief Get cell size. + //! Get cell size. ASMJIT_INLINE uint32_t getSize() const { return _size; } - //! @brief Set cell size. + //! Set cell size. ASMJIT_INLINE void setSize(uint32_t size) { _size = size; } - //! @brief Get cell alignment. + //! Get cell alignment. ASMJIT_INLINE uint32_t getAlignment() const { return _alignment; } - //! @brief Set cell alignment. + //! Set cell alignment. ASMJIT_INLINE void setAlignment(uint32_t alignment) { _alignment = alignment; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Next active cell. + //! Next active cell. MemCell* _next; - //! @brief Offset, relative to base-offset. + //! Offset, relative to base-offset. int32_t _offset; - //! @brief Size. + //! Size. uint32_t _size; - //! @brief Alignment. + //! Alignment. uint32_t _alignment; }; @@ -265,7 +270,7 @@ struct MemCell { // [asmjit::VarBits] // ============================================================================ -//! @brief Bit-array used by variable-liveness analysis. +//! Bit-array used by variable-liveness analysis. struct VarBits { // -------------------------------------------------------------------------- // [Enums] @@ -378,152 +383,151 @@ struct VarBits { // [asmjit::VarData] // ============================================================================ -//! @brief Base variable data. +//! Base variable data. struct VarData { // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get variable name. + //! Get variable name. ASMJIT_INLINE const char* getName() const { return _name; } - //! @brief Get variable id. + //! Get variable id. ASMJIT_INLINE uint32_t getId() const { return _id; } - //! @brief Get whether the variable has context id. + //! Get whether the variable has context id. ASMJIT_INLINE bool hasContextId() const { return _contextId != kInvalidValue; } - //! @brief Get context variable id (used only by @ref Context). + //! Get context variable id (used only by `Context)`. ASMJIT_INLINE uint32_t getContextId() const { return _contextId; } - //! @brief Set context variable id (used only by @ref Context). + //! Set context variable id (used only by `Context)`. ASMJIT_INLINE void setContextId(uint32_t contextId) { _contextId = contextId; } - //! @brief Reset context variable id (used only by @ref Context). + //! Reset context variable id (used only by `Context)`. ASMJIT_INLINE void resetContextId() { _contextId = kInvalidValue; } - //! @brief Get variable type. + //! Get variable type. ASMJIT_INLINE uint32_t getType() const { return _type; } - //! @brief Get variable class. + //! Get variable class. ASMJIT_INLINE uint32_t getClass() const { return _class; } - //! @brief Get variable flags. + //! Get variable flags. ASMJIT_INLINE uint32_t getFlags() const { return _flags; } - //! @brief Get variable priority. + //! Get variable priority. ASMJIT_INLINE uint32_t getPriority() const { return _priority; } - //! @brief Get variable state (only used by @ref Context). + //! Get variable state (only used by `Context)`. ASMJIT_INLINE uint32_t getState() const { return _state; } - //! @brief Set variable state (only used by @ref Context). + //! Set variable state (only used by `Context)`. ASMJIT_INLINE void setState(uint32_t state) { _state = static_cast(state); } - //! @brief Get register index. + //! Get register index. ASMJIT_INLINE uint32_t getRegIndex() const { return _regIndex; } - //! @brief Set register index. + //! Set register index. ASMJIT_INLINE void setRegIndex(uint32_t regIndex) { _regIndex = static_cast(regIndex); } - //! @brief Reset register index. + //! Reset register index. ASMJIT_INLINE void resetRegIndex() { _regIndex = static_cast(kInvalidReg); } - //! @brief Get whether the VarData is only memory allocated on the stack. + //! Get whether the VarData is only memory allocated on the stack. ASMJIT_INLINE bool isStack() const { return static_cast(_isStack); } - //! @brief Get whether the variable is a function argument passed through memory. + //! Get whether the variable is a function argument passed through memory. ASMJIT_INLINE bool isMemArg() const { return static_cast(_isMemArg); } - //! @brief Get variable content can be calculated by a simple instruction. + //! Get variable content can be calculated by a simple instruction. ASMJIT_INLINE bool isCalculated() const { return static_cast(_isCalculated); } - //! @brief Get whether to save variable when it's unused (spill). + //! Get whether to save variable when it's unused (spill). ASMJIT_INLINE bool saveOnUnuse() const { return static_cast(_saveOnUnuse); } - //! @brief Get whether the variable was changed. + //! Get whether the variable was changed. ASMJIT_INLINE bool isModified() const { return static_cast(_modified); } - //! @brief Set whether the variable was changed. + //! Set whether the variable was changed. ASMJIT_INLINE void setModified(bool modified) { _modified = modified; } - //! @brief Get variable alignment. + //! Get variable alignment. ASMJIT_INLINE uint32_t getAlignment() const { return _alignment; } - //! @brief Get variable size. + //! Get variable size. ASMJIT_INLINE uint32_t getSize() const { return _size; } - //! @brief Get home memory offset. + //! Get home memory offset. ASMJIT_INLINE int32_t getMemOffset() const { return _memOffset; } - //! @brief Set home memory offset. + //! Set home memory offset. ASMJIT_INLINE void setMemOffset(int32_t offset) { _memOffset = offset; } - //! @brief Get home memory cell. + //! Get home memory cell. ASMJIT_INLINE MemCell* getMemCell() const { return _memCell; } - //! @brief Set home memory cell. + //! Set home memory cell. ASMJIT_INLINE void setMemCell(MemCell* cell) { _memCell = cell; } // -------------------------------------------------------------------------- // [Accessors - Temporary Usage] // -------------------------------------------------------------------------- - //! @brief Get temporary VarAttr. + //! Get temporary VarAttr. ASMJIT_INLINE VarAttr* getVa() const { return _va; } - //! @brief Set temporary VarAttr. + //! Set temporary VarAttr. ASMJIT_INLINE void setVa(VarAttr* va) { _va = va; } - //! @brief Reset temporary VarAttr. + //! Reset temporary VarAttr. ASMJIT_INLINE void resetVa() { _va = NULL; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Variable name. + //! Variable name. const char* _name; - //! @brief Variable id. + //! Variable id. uint32_t _id; - //! @brief Context variable id (used by @ref Context only, initially set to - //! @c kInvalidValue). + //! Context variable id, used by `Context` only, initially `kInvalidValue`. uint32_t _contextId; - //! @brief Variable type. + //! Variable type. uint8_t _type; - //! @brief Variable class. + //! Variable class. uint8_t _class; - //! @brief Variable flags. + //! Variable flags. uint8_t _flags; - //! @brief Variable priority. + //! Variable priority. uint8_t _priority; - //! @brief Variable state (connected with actual @ref BaseVarState). + //! Variable state (connected with actual `BaseVarState)`. uint8_t _state; - //! @brief Actual register index (only used by @ref Context), during translate. + //! Actual register index (only used by `Context)`, during translate. uint8_t _regIndex; - //! @brief Whether the variable is only used as memory allocated on the stack. + //! Whether the variable is only used as memory allocated on the stack. uint8_t _isStack : 1; - //! @brief Whether the variable is a function argument passed through memory. + //! Whether the variable is a function argument passed through memory. uint8_t _isMemArg : 1; - //! @brief Whether variable content can be calculated by a simple instruction. + //! Whether variable content can be calculated by a simple instruction. //! //! This is used mainly by MMX and SSE2 code. This flag indicates that //! register allocator should never reserve memory for this variable, because //! the content can be generated by a single instruction (for example PXOR). uint8_t _isCalculated : 1; - //! @brief Save on unuse (at end of the variable scope). + //! Save on unuse (at end of the variable scope). uint8_t _saveOnUnuse : 1; - //! @brief Whether variable was changed (connected with actual @ref BaseVarState). + //! Whether variable was changed (connected with actual `BaseVarState)`. uint8_t _modified : 1; //! @internal uint8_t _reserved0 : 3; - //! @brief Variable natural alignment. + //! Variable natural alignment. uint8_t _alignment; - //! @brief Variable size. + //! Variable size. uint32_t _size; - //! @brief Home memory offset. + //! Home memory offset. int32_t _memOffset; - //! @brief Home memory cell, used by @c Context (initially NULL). + //! Home memory cell, used by `BaseContext` (initially NULL). MemCell* _memCell; - //! @brief Register read access statistics. + //! Register read access statistics. uint32_t rReadCount; - //! @brief Register write access statistics. + //! Register write access statistics. uint32_t rWriteCount; - //! @brief Memory read statistics. + //! Memory read statistics. uint32_t mReadCount; - //! @brief Memory write statistics. + //! Memory write statistics. uint32_t mWriteCount; // -------------------------------------------------------------------------- @@ -534,7 +538,7 @@ struct VarData { // initialized by init() phase and cleared by cleanup() phase. union { - //! @brief Temporary link to VarAttr* used by the @ref Context used in + //! Temporary link to VarAttr* used by the `Context` used in //! various phases, but always set back to NULL when finished. //! //! This temporary data is designed to be used by algorithms that need to @@ -572,72 +576,72 @@ struct VarAttr { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get VarData. + //! Get VarData. ASMJIT_INLINE VarData* getVd() const { return _vd; } - //! @brief Set VarData. + //! Set VarData. ASMJIT_INLINE void setVd(VarData* vd) { _vd = vd; } - //! @brief Get flags. + //! Get flags. ASMJIT_INLINE uint32_t getFlags() const { return _flags; } - //! @brief Set flags. + //! Set flags. ASMJIT_INLINE void setFlags(uint32_t flags) { _flags = flags; } - //! @brief Get whether @a flag is on. + //! Get whether `flag` is on. ASMJIT_INLINE bool hasFlag(uint32_t flag) { return (_flags & flag) != 0; } - //! @brief Add @a flags. + //! Add `flags`. ASMJIT_INLINE void addFlags(uint32_t flags) { _flags |= flags; } - //! @brief Mask @a flags. + //! Mask `flags`. ASMJIT_INLINE void andFlags(uint32_t flags) { _flags &= flags; } - //! @brief Clear @a flags. + //! Clear `flags`. ASMJIT_INLINE void delFlags(uint32_t flags) { _flags &= ~flags; } - //! @brief Get how many times the variable is used by the instruction/node. + //! Get how many times the variable is used by the instruction/node. ASMJIT_INLINE uint32_t getVarCount() const { return _varCount; } - //! @brief Set how many times the variable is used by the instruction/node. + //! Set how many times the variable is used by the instruction/node. ASMJIT_INLINE void setVarCount(uint32_t count) { _varCount = static_cast(count); } - //! @brief Add how many times the variable is used by the instruction/node. + //! Add how many times the variable is used by the instruction/node. ASMJIT_INLINE void addVarCount(uint32_t count = 1) { _varCount += static_cast(count); } - //! @brief Get whether the variable has to be allocated in a specific input register. + //! Get whether the variable has to be allocated in a specific input register. ASMJIT_INLINE uint32_t hasInRegIndex() const { return _inRegIndex != kInvalidReg; } - //! @brief Get the input register index or @ref kInvalidReg. + //! Get the input register index or `kInvalidReg`. ASMJIT_INLINE uint32_t getInRegIndex() const { return _inRegIndex; } - //! @brief Set the input register index. + //! Set the input register index. ASMJIT_INLINE void setInRegIndex(uint32_t index) { _inRegIndex = static_cast(index); } - //! @brief Reset the input register index. + //! Reset the input register index. ASMJIT_INLINE void resetInRegIndex() { _inRegIndex = kInvalidReg; } - //! @brief Get whether the variable has to be allocated in a specific output register. + //! Get whether the variable has to be allocated in a specific output register. ASMJIT_INLINE uint32_t hasOutRegIndex() const { return _outRegIndex != kInvalidReg; } - //! @brief Get the output register index or @ref kInvalidReg. + //! Get the output register index or `kInvalidReg`. ASMJIT_INLINE uint32_t getOutRegIndex() const { return _outRegIndex; } - //! @brief Set the output register index. + //! Set the output register index. ASMJIT_INLINE void setOutRegIndex(uint32_t index) { _outRegIndex = static_cast(index); } - //! @brief Reset the output register index. + //! Reset the output register index. ASMJIT_INLINE void resetOutRegIndex() { _outRegIndex = kInvalidReg; } - //! @brief Get whether the mandatory input registers are in used. + //! Get whether the mandatory input registers are in used. ASMJIT_INLINE bool hasInRegs() const { return _inRegs != 0; } - //! @brief Get mandatory input registers (mask). + //! Get mandatory input registers (mask). ASMJIT_INLINE uint32_t getInRegs() const { return _inRegs; } - //! @brief Set mandatory input registers (mask). + //! Set mandatory input registers (mask). ASMJIT_INLINE void setInRegs(uint32_t mask) { _inRegs = mask; } - //! @brief Add mandatory input registers (mask). + //! Add mandatory input registers (mask). ASMJIT_INLINE void addInRegs(uint32_t mask) { _inRegs |= mask; } - //! @brief And mandatory input registers (mask). + //! And mandatory input registers (mask). ASMJIT_INLINE void andInRegs(uint32_t mask) { _inRegs &= mask; } - //! @brief Clear mandatory input registers (mask). + //! Clear mandatory input registers (mask). ASMJIT_INLINE void delInRegs(uint32_t mask) { _inRegs &= ~mask; } - //! @brief Get allocable input registers (mask). + //! Get allocable input registers (mask). ASMJIT_INLINE uint32_t getAllocableRegs() const { return _allocableRegs; } - //! @brief Set allocable input registers (mask). + //! Set allocable input registers (mask). ASMJIT_INLINE void setAllocableRegs(uint32_t mask) { _allocableRegs = mask; } - //! @brief Add allocable input registers (mask). + //! Add allocable input registers (mask). ASMJIT_INLINE void addAllocableRegs(uint32_t mask) { _allocableRegs |= mask; } - //! @brief And allocable input registers (mask). + //! And allocable input registers (mask). ASMJIT_INLINE void andAllocableRegs(uint32_t mask) { _allocableRegs &= mask; } - //! @brief Clear allocable input registers (mask). + //! Clear allocable input registers (mask). ASMJIT_INLINE void delAllocableRegs(uint32_t mask) { _allocableRegs &= ~mask; } // -------------------------------------------------------------------------- @@ -654,14 +658,14 @@ struct VarAttr { // -------------------------------------------------------------------------- VarData* _vd; - //! @brief Flags. + //! Flags. uint32_t _flags; union { struct { - //! @brief How many times the variable is used by the instruction/node. + //! How many times the variable is used by the instruction/node. uint8_t _varCount; - //! @brief Input register index or @ref kInvalidReg if it's not given. + //! Input register index or `kInvalidReg` if it's not given. //! //! Even if the input register index is not given (i.e. it may by any //! register), register allocator should assign an index that will be @@ -669,9 +673,9 @@ struct VarAttr { //! in situations where one variable has to be allocated in multiple //! registers to determine the register which will be persistent. uint8_t _inRegIndex; - //! @brief Output register index or @ref kInvalidReg if it's not given. + //! Output register index or `kInvalidReg` if it's not given. //! - //! Typically @ref kInvalidReg if variable is only used on input. + //! Typically `kInvalidReg` if variable is only used on input. uint8_t _outRegIndex; //! @internal uint8_t _reserved; @@ -679,11 +683,11 @@ struct VarAttr { //! @internal //! - //! @brief Packed data #0. + //! Packed data #0. uint32_t _packed; }; - //! @brief Mandatory input registers. + //! Mandatory input registers. //! //! Mandatory input registers are required by the instruction even if //! there are duplicates. This schema allows us to allocate one variable @@ -692,7 +696,7 @@ struct VarAttr { //! call. uint32_t _inRegs; - //! @brief Allocable input registers. + //! Allocable input registers. //! //! Optional input registers is a mask of all allocable registers for a given //! variable where we have to pick one of them. This mask is usually not used @@ -706,23 +710,23 @@ struct VarAttr { // [asmjit::BaseVarInst] // ============================================================================ -//! @brief Variable allocation instructions. +//! Variable allocation instructions. struct BaseVarInst {}; // ============================================================================ // [asmjit::BaseVarState] // ============================================================================ -//! @brief Variable(s) state. +//! Variable(s) state. struct BaseVarState {}; // ============================================================================ // [asmjit::BaseNode] // ============================================================================ -//! @brief Base node. +//! Base node. //! -//! @ref Every node represents an abstract instruction, directive, label, or +//! `Every` node represents an abstract instruction, directive, label, or //! macro-instruction generated by compiler. struct BaseNode { ASMJIT_NO_COPY(BaseNode) @@ -731,123 +735,123 @@ struct BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new @ref BaseNode. + //! Create new `BaseNode`. //! //! @note Always use compiler to create nodes. ASMJIT_INLINE BaseNode(BaseCompiler* compiler, uint32_t type); // Defined-Later. - //! @brief Destroy @ref BaseNode. + //! Destroy `BaseNode`. ASMJIT_INLINE ~BaseNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get previous node in the compiler stream. + //! Get previous node in the compiler stream. ASMJIT_INLINE BaseNode* getPrev() const { return _prev; } - //! @brief Get next node in the compiler stream. + //! Get next node in the compiler stream. ASMJIT_INLINE BaseNode* getNext() const { return _next; } - //! @brief Get comment string. + //! Get comment string. ASMJIT_INLINE const char* getComment() const { return _comment; } - //! @brief Set comment string to @a str. + //! Set comment string to `str`. ASMJIT_INLINE void setComment(const char* comment) { _comment = comment; } - //! @brief Get type of node, see @ref kNodeType. + //! Get type of node, see `kNodeType`. ASMJIT_INLINE uint32_t getType() const { return _type; } - //! @brief Get node flags. + //! Get node flags. ASMJIT_INLINE uint32_t getFlags() const { return _flags; } - //! @brief Set node flags to @a flags. + //! Set node flags to `flags`. ASMJIT_INLINE void setFlags(uint32_t flags) { _flags = static_cast(flags); } - //! @brief Get whether the instruction has flag @a flag. + //! Get whether the instruction has flag `flag`. ASMJIT_INLINE bool hasFlag(uint32_t flag) const { return (static_cast(_flags) & flag) != 0; } - //! @brief Add instruction @a flags. + //! Add instruction `flags`. ASMJIT_INLINE void addFlags(uint32_t flags) { _flags |= static_cast(flags); } - //! @brief Clear instruction @a flags. + //! Clear instruction `flags`. ASMJIT_INLINE void delFlags(uint32_t flags) { _flags &= static_cast(~flags); } - //! @brief Get whether the node has beed fetched. + //! Get whether the node has beed fetched. ASMJIT_INLINE bool isFetched() const { return _flowId != 0; } - //! @brief Get whether the node has been translated. + //! Get whether the node has been translated. ASMJIT_INLINE bool isTranslated() const { return hasFlag(kNodeFlagIsTranslated); } - //! @brief Whether the instruction is an unconditional jump. + //! Whether the instruction is an unconditional jump. ASMJIT_INLINE bool isJmp() const { return hasFlag(kNodeFlagIsJmp); } - //! @brief Whether the instruction is a conditional jump. + //! Whether the instruction is a conditional jump. ASMJIT_INLINE bool isJcc() const { return hasFlag(kNodeFlagIsJcc); } - //! @brief Whether the instruction is an unconditional or conditional jump. + //! Whether the instruction is an unconditional or conditional jump. ASMJIT_INLINE bool isJmpOrJcc() const { return hasFlag(kNodeFlagIsJmp | kNodeFlagIsJcc); } - //! @brief Whether the instruction is a return. + //! Whether the instruction is a return. ASMJIT_INLINE bool isRet() const { return hasFlag(kNodeFlagIsRet); } - //! @brief Get whether the instruction is special. + //! Get whether the instruction is special. ASMJIT_INLINE bool isSpecial() const { return hasFlag(kNodeFlagIsSpecial); } - //! @brief Get whether the instruction accesses FPU. + //! Get whether the instruction accesses FPU. ASMJIT_INLINE bool isFp() const { return hasFlag(kNodeFlagIsFp); } - //! @brief Get flow index. + //! Get flow index. ASMJIT_INLINE uint32_t getFlowId() const { return _flowId; } - //! @brief Set flow index. + //! Set flow index. ASMJIT_INLINE void setFlowId(uint32_t flowId) { _flowId = flowId; } - //! @brief Get whether node contains variable allocation instructions. + //! Get whether node contains variable allocation instructions. ASMJIT_INLINE bool hasVarInst() const { return _varInst != NULL; } - //! @brief Get variable allocation instructions. + //! Get variable allocation instructions. ASMJIT_INLINE BaseVarInst* getVarInst() const { return _varInst; } - //! @brief Get variable allocation instructions . + //! Get variable allocation instructions casted to `T*`. template ASMJIT_INLINE T* getVarInst() const { return static_cast(_varInst); } - //! @brief Set variable allocation instructions. + //! Set variable allocation instructions. ASMJIT_INLINE void setVarInst(BaseVarInst* vi) { _varInst = vi; } - //! @brief Get node state. + //! Get node state. ASMJIT_INLINE BaseVarState* getState() const { return _state; } - //! @brief Get node state . + //! Get node state casted to `T*`. template ASMJIT_INLINE T* getState() const { return static_cast(_state); } - //! @brief Set node state. + //! Set node state. ASMJIT_INLINE void setState(BaseVarState* state) { _state = state; } - //! @brief Get whether the node has variable liveness bits. + //! Get whether the node has variable liveness bits. ASMJIT_INLINE bool hasLiveness() const { return _liveness != NULL; } - //! @brief Get variable liveness bits. + //! Get variable liveness bits. ASMJIT_INLINE VarBits* getLiveness() const { return _liveness; } - //! @brief Set variable liveness bits. + //! Set variable liveness bits. ASMJIT_INLINE void setLiveness(VarBits* liveness) { _liveness = liveness; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Previous node. + //! Previous node. BaseNode* _prev; - //! @brief Next node. + //! Next node. BaseNode* _next; - //! @brief Node type, see @ref kNodeType. + //! Node type, see `kNodeType`. uint8_t _type; - //! @brief Operands count (if the node has operands, otherwise zero). + //! Operands count (if the node has operands, otherwise zero). uint8_t _opCount; - //! @brief Node flags, different meaning for every node type. + //! Node flags, different meaning for every node type. uint16_t _flags; - //! @brief Flow index. + //! Flow index. uint32_t _flowId; - //! @brief Inline comment string, initially set to NULL. + //! Inline comment string, initially set to NULL. const char* _comment; - //! @brief Variable allocation instructions (initially NULL, filled by prepare + //! Variable allocation instructions (initially NULL, filled by prepare //! phase). BaseVarInst* _varInst; - //! @brief Variable liveness bits (initially NULL, filled by analysis phase). + //! Variable liveness bits (initially NULL, filled by analysis phase). VarBits* _liveness; - //! @brief Saved state. + //! Saved state. //! //! Initially NULL, not all nodes have saved state, only branch/flow control //! nodes. @@ -858,7 +862,7 @@ struct BaseNode { // [asmjit::AlignNode] // ============================================================================ -//! @brief Align node. +//! Align node. struct AlignNode : public BaseNode { ASMJIT_NO_COPY(AlignNode) @@ -866,28 +870,28 @@ struct AlignNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref AlignNode instance. + //! Create a new `AlignNode` instance. ASMJIT_INLINE AlignNode(BaseCompiler* compiler, uint32_t size) : BaseNode(compiler, kNodeTypeAlign) { _size = size; } - //! @brief Destroy the @ref AlignNode instance. + //! Destroy the `AlignNode` instance. ASMJIT_INLINE ~AlignNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get align size in bytes. + //! Get align size in bytes. ASMJIT_INLINE uint32_t getSize() const { return _size; } - //! @brief Set align size in bytes to @a size. + //! Set align size in bytes to `size`. ASMJIT_INLINE void setSize(uint32_t size) { _size = size; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Size of the alignment. + //! Size of the alignment. uint32_t _size; }; @@ -895,7 +899,7 @@ struct AlignNode : public BaseNode { // [asmjit::EmbedNode] // ============================================================================ -//! @brief Embed node. +//! Embed node. //! //! Embed node is used to embed data into final assembler stream. The data is //! considered to be RAW; No analysis is performed on RAW data. @@ -912,7 +916,7 @@ struct EmbedNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref EmbedNode instance. + //! Create a new `EmbedNode` instance. ASMJIT_INLINE EmbedNode(BaseCompiler* compiler, void* data, uint32_t size) : BaseNode(compiler, kNodeTypeEmbed) { _size = size; if (size <= kInlineBufferSize) { @@ -924,29 +928,29 @@ struct EmbedNode : public BaseNode { } } - //! @brief Destroy the @ref EmbedNode instance. + //! Destroy the `EmbedNode` instance. ASMJIT_INLINE ~EmbedNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get pointer to data. + //! Get pointer to data. uint8_t* getData() { return getSize() <= kInlineBufferSize ? const_cast(_data.buf) : _data.ptr; } - //! @brief Get size of data. + //! Get size of data. uint32_t getSize() const { return _size; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Size of the embedded data. + //! Size of the embedded data. uint32_t _size; union { - //! @brief data buffer. + //! data buffer. uint8_t buf[kInlineBufferSize]; - //! @brief Data buffer. + //! Data buffer. uint8_t* ptr; } _data; }; @@ -955,7 +959,7 @@ struct EmbedNode : public BaseNode { // [asmjit::CommentNode] // ============================================================================ -//! @brief Comment node. +//! Comment node. //! //! Comments allows to comment your assembler stream for better debugging //! and visualization. Comments are usually ignored in release builds unless @@ -967,12 +971,12 @@ struct CommentNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref CommentNode instance. + //! Create a new `CommentNode` instance. ASMJIT_INLINE CommentNode(BaseCompiler* compiler, const char* comment) : BaseNode(compiler, kNodeTypeComment) { _comment = comment; } - //! @brief Destroy the @ref CommentNode instance. + //! Destroy the `CommentNode` instance. ASMJIT_INLINE ~CommentNode() {} }; @@ -980,7 +984,7 @@ struct CommentNode : public BaseNode { // [asmjit::HintNode] // ============================================================================ -//! @brief Hint node. +//! Hint node. struct HintNode : public BaseNode { ASMJIT_NO_COPY(HintNode) @@ -988,42 +992,42 @@ struct HintNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref HintNode instance. + //! Create a new `HintNode` instance. ASMJIT_INLINE HintNode(BaseCompiler* compiler, VarData* vd, uint32_t hint, uint32_t value) : BaseNode(compiler, kNodeTypeHint) { _vd = vd; _hint = hint; _value = value; } - //! @brief Destroy the @ref HintNode instance. + //! Destroy the `HintNode` instance. ASMJIT_INLINE ~HintNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get variable. + //! Get variable. ASMJIT_INLINE VarData* getVd() const { return _vd; } - //! @brief Get hint it (see @ref kVarHint). + //! Get hint it (see `kVarHint)`. ASMJIT_INLINE uint32_t getHint() const{ return _hint; } - //! @brief Set hint it (see @ref kVarHint). + //! Set hint it (see `kVarHint)`. ASMJIT_INLINE void setHint(uint32_t hint) { _hint = hint; } - //! @brief Get hint value. + //! Get hint value. ASMJIT_INLINE uint32_t getValue() const { return _value; } - //! @brief Set hint value. + //! Set hint value. ASMJIT_INLINE void setValue(uint32_t value) { _value = value; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Variable. + //! Variable. VarData* _vd; - //! @brief Hint id. + //! Hint id. uint32_t _hint; - //! @brief Value. + //! Value. uint32_t _value; }; @@ -1031,7 +1035,7 @@ struct HintNode : public BaseNode { // [asmjit::TargetNode] // ============================================================================ -//! @brief label node. +//! label node. struct TargetNode : public BaseNode { ASMJIT_NO_COPY(TargetNode) @@ -1039,55 +1043,55 @@ struct TargetNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref TargetNode instance. + //! Create a new `TargetNode` instance. ASMJIT_INLINE TargetNode(BaseCompiler* compiler, uint32_t labelId) : BaseNode(compiler, kNodeTypeTarget) { _id = labelId; _numRefs = 0; _from = NULL; } - //! @brief Destroy the @ref TargetNode instance. + //! Destroy the `TargetNode` instance. ASMJIT_INLINE ~TargetNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get target label. + //! Get target label. ASMJIT_INLINE Label getLabel() const { return Label(_id); } - //! @brief Get target label id. + //! Get target label id. ASMJIT_INLINE uint32_t getLabelId() const { return _id; } - //! @brief Get first jmp instruction. + //! Get first jmp instruction. ASMJIT_INLINE JumpNode* getFrom() const { return _from; } - //! @brief Get whether the node has assigned state. + //! Get whether the node has assigned state. ASMJIT_INLINE bool hasState() const { return _state != NULL; } - //! @brief Get state for this target. + //! Get state for this target. ASMJIT_INLINE BaseVarState* getState() const { return _state; } - //! @brief Set state for this target. + //! Set state for this target. ASMJIT_INLINE void setState(BaseVarState* state) { _state = state; } - //! @brief Get number of jumps to this target. + //! Get number of jumps to this target. ASMJIT_INLINE uint32_t getNumRefs() const { return _numRefs; } - //! @brief Set number of jumps to this target. + //! Set number of jumps to this target. ASMJIT_INLINE void setNumRefs(uint32_t i) { _numRefs = i; } - //! @brief Add number of jumps to this target. + //! Add number of jumps to this target. ASMJIT_INLINE void addNumRefs(uint32_t i = 1) { _numRefs += i; } - //! @brief Subtract number of jumps to this target. + //! Subtract number of jumps to this target. ASMJIT_INLINE void subNumRefs(uint32_t i = 1) { _numRefs -= i; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Label id. + //! Label id. uint32_t _id; - //! @brief Count of jumps here. + //! Count of jumps here. uint32_t _numRefs; - //! @brief First jump instruction that points to this target (label). + //! First jump instruction that points to this target (label). JumpNode* _from; }; @@ -1095,7 +1099,7 @@ struct TargetNode : public BaseNode { // [asmjit::InstNode] // ============================================================================ -//! @brief Instruction node. +//! Instruction node. struct InstNode : public BaseNode { ASMJIT_NO_COPY(InstNode) @@ -1103,7 +1107,7 @@ struct InstNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref InstNode instance. + //! Create a new `InstNode` instance. ASMJIT_INLINE InstNode(BaseCompiler* compiler, uint32_t code, uint32_t options, Operand* opList, uint32_t opCount) : BaseNode(compiler, kNodeTypeInst) { _code = static_cast(code); _options = static_cast(options); @@ -1114,19 +1118,19 @@ struct InstNode : public BaseNode { _updateMemOp(); } - //! @brief Destroy the @ref InstNode instance. + //! Destroy the `InstNode` instance. ASMJIT_INLINE ~InstNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get instruction code, see @c kInstCode. + //! Get instruction code, see `kInstCode`. ASMJIT_INLINE uint32_t getCode() const { return _code; } - //! @brief Set instruction code to @a code. + //! Set instruction code to `code`. //! //! Please do not modify instruction code if you are not know what you are //! doing. Incorrect instruction code or operands can raise assertion() at @@ -1135,34 +1139,34 @@ struct InstNode : public BaseNode { _code = static_cast(code); } - //! @brief Whether the instruction is an unconditional jump or whether the + //! Whether the instruction is an unconditional jump or whether the //! instruction is a conditional jump which is likely to be taken. ASMJIT_INLINE bool isTaken() const { return hasFlag(kNodeFlagIsTaken); } - //! @brief Get emit options. + //! Get emit options. ASMJIT_INLINE uint32_t getOptions() const { return _options; } - //! @brief Set emit options. + //! Set emit options. ASMJIT_INLINE void setOptions(uint32_t options) { _options = static_cast(options); } - //! @brief Add emit options. + //! Add emit options. ASMJIT_INLINE void addOptions(uint32_t options) { _options |= static_cast(options); } - //! @brief Mask emit options. + //! Mask emit options. ASMJIT_INLINE void andOptions(uint32_t options) { _options &= static_cast(options); } - //! @brief Clear emit options. + //! Clear emit options. ASMJIT_INLINE void delOptions(uint32_t options) { _options &= static_cast(~options); } - //! @brief Get operands list. + //! Get operands list. ASMJIT_INLINE Operand* getOpList() { return _opList; } @@ -1171,30 +1175,29 @@ struct InstNode : public BaseNode { return _opList; } - //! @brief Get operands count. + //! Get operands count. ASMJIT_INLINE uint32_t getOpCount() const { return _opCount; } - //! @brief Get whether the instruction contains a memory operand. + //! Get whether the instruction contains a memory operand. ASMJIT_INLINE bool hasMemOp() const { return _memOpIndex != 0xFF; } - //! @brief Set memory operand index (in opList), 0xFF means that instruction + //! Set memory operand index (in opList), 0xFF means that instruction //! doesn't have a memory operand. ASMJIT_INLINE void setMemOpIndex(uint32_t index) { _memOpIndex = static_cast(index); } - //! @brief Reset memory operand index, setting it to 0xFF. + //! Reset memory operand index, setting it to 0xFF. ASMJIT_INLINE void resetMemOpIndex() { _memOpIndex = 0xFF; } - //! @brief Get memory operand. + //! Get memory operand. //! - //! @note Can only be called if the instruction has such operand, see @ref - //! hasMemOp(). + //! Can only be called if the instruction has such operand, see `hasMemOp()`. ASMJIT_INLINE BaseMem* getMemOp() const { ASMJIT_ASSERT(hasMemOp()); return static_cast(&_opList[_memOpIndex]); @@ -1229,14 +1232,14 @@ _Update: // [Members] // -------------------------------------------------------------------------- - //! @brief Instruction code, see @c kInstCode. + //! Instruction code, see `kInstCode`. uint16_t _code; - //! @brief Instruction options, see @c kInstOptions. + //! Instruction options, see `kInstOptions`. uint8_t _options; //! @internal uint8_t _memOpIndex; - //! @brief Operands list. + //! Operands list. Operand* _opList; }; @@ -1244,7 +1247,7 @@ _Update: // [asmjit::JumpNode] // ============================================================================ -//! @brief Jump node. +//! Jump node. struct JumpNode : public InstNode { ASMJIT_NO_COPY(JumpNode) @@ -1267,9 +1270,9 @@ struct JumpNode : public InstNode { // [Members] // -------------------------------------------------------------------------- - //! @brief Target node. + //! Target node. TargetNode* _target; - //! @brief Next jump to the same target in a single linked-list. + //! Next jump to the same target in a single linked-list. JumpNode *_jumpNext; }; @@ -1277,13 +1280,13 @@ struct JumpNode : public InstNode { // [asmjit::FuncNode] // ============================================================================ -//! @brief Function declaration node. +//! Function declaration node. //! //! Functions are base blocks for generating assembler output. Each generated //! assembler stream needs standard entry and leave sequences which are compatible //! with the operating system ABI. //! -//! @ref FuncNode can be used to generate function prolog and epilog which are +//! `FuncNode` can be used to generate function prolog and epilog which are //! compatible with a given function calling convention and to allocate and //! manage variables that can be allocated/spilled during compilation phase. struct FuncNode : public BaseNode { @@ -1293,10 +1296,9 @@ struct FuncNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @c FuncNode instance. + //! Create a new `FuncNode` instance. //! - //! @note Always use @ref asmjit::BaseCompiler::addFunc() to create a - //! @ref FuncNode instance. + //! Always use `BaseCompiler::addFunc()` to create a `FuncNode` instance. ASMJIT_INLINE FuncNode(BaseCompiler* compiler) : BaseNode(compiler, kNodeTypeFunc), _entryNode(NULL), @@ -1314,87 +1316,87 @@ struct FuncNode : public BaseNode { _memStackSize(0), _callStackSize(0) {} - //! @brief Destroy the @c FuncNode instance. + //! Destroy the `FuncNode` instance. ASMJIT_INLINE ~FuncNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get function entry @ref TargetNode. + //! Get function entry `TargetNode`. ASMJIT_INLINE TargetNode* getEntryNode() const { return _entryNode; } - //! @brief Get function exit @ref TargetNode. + //! Get function exit `TargetNode`. ASMJIT_INLINE TargetNode* getExitNode() const { return _exitNode; } - //! @brief Get function entry label. + //! Get function entry label. ASMJIT_INLINE Label getEntryLabel() const { return _entryNode->getLabel(); } - //! @brief Get function exit label. + //! Get function exit label. ASMJIT_INLINE Label getExitLabel() const { return _exitNode->getLabel(); } - //! @brief Get function @ref EndNode. + //! Get function `EndNode`. ASMJIT_INLINE EndNode* getEnd() const { return _end; } - //! @brief Get function declaration. + //! Get function declaration. ASMJIT_INLINE FuncDecl* getDecl() const { return _decl; } - //! @brief Get arguments list. + //! Get arguments list. ASMJIT_INLINE VarData** getArgList() const { return _argList; } - //! @brief Get arguments count. + //! Get arguments count. ASMJIT_INLINE uint32_t getArgCount() const { return _decl->getArgCount(); } - //! @brief Get argument at @a i. + //! Get argument at `i`. ASMJIT_INLINE VarData* getArg(uint32_t i) const { ASMJIT_ASSERT(i < getArgCount()); return _argList[i]; } - //! @brief Set argument at @a i. + //! Set argument at `i`. ASMJIT_INLINE void setArg(uint32_t i, VarData* vd) { ASMJIT_ASSERT(i < getArgCount()); _argList[i] = vd; } - //! @brief Reset argument at @a i. + //! Reset argument at `i`. ASMJIT_INLINE void resetArg(uint32_t i) { ASMJIT_ASSERT(i < getArgCount()); _argList[i] = NULL; } - //! @brief Get function hints. + //! Get function hints. ASMJIT_INLINE uint32_t getFuncHints() const { return _funcHints; } - //! @brief Get function flags. + //! Get function flags. ASMJIT_INLINE uint32_t getFuncFlags() const { return _funcFlags; } - //! @brief Get whether the _funcFlags has @a flag + //! Get whether the _funcFlags has `flag` ASMJIT_INLINE bool hasFuncFlag(uint32_t flag) const { return (_funcFlags & flag) != 0; } - //! @brief Set function @a flag. + //! Set function `flag`. ASMJIT_INLINE void addFuncFlags(uint32_t flags) { _funcFlags |= flags; } - //! @brief Clear function @a flag. + //! Clear function `flag`. ASMJIT_INLINE void clearFuncFlags(uint32_t flags) { _funcFlags &= ~flags; } - //! @brief Get whether the function is naked. + //! Get whether the function is naked. ASMJIT_INLINE bool isNaked() const { return hasFuncFlag(kFuncFlagIsNaked); } - //! @brief Get whether the function is also a caller. + //! Get whether the function is also a caller. ASMJIT_INLINE bool isCaller() const { return hasFuncFlag(kFuncFlagIsCaller); } - //! @brief Get whether the required stack alignment is lower than expected one, + //! Get whether the required stack alignment is lower than expected one, //! thus it has to be aligned manually. ASMJIT_INLINE bool isStackMisaligned() const { return hasFuncFlag(kFuncFlagIsStackMisaligned); } - //! @brief Get whether the stack pointer is adjusted inside function prolog/epilog. + //! Get whether the stack pointer is adjusted inside function prolog/epilog. ASMJIT_INLINE bool isStackAdjusted() const { return hasFuncFlag(kFuncFlagIsStackAdjusted); } - //! @brief Get whether the function is finished. + //! Get whether the function is finished. ASMJIT_INLINE bool isFinished() const { return hasFuncFlag(kFuncFlagIsFinished); } - //! @brief Get expected stack alignment. + //! Get expected stack alignment. ASMJIT_INLINE uint32_t getExpectedStackAlignment() const { return _expectedStackAlignment; } - //! @brief Set expected stack alignment. + //! Set expected stack alignment. ASMJIT_INLINE void setExpectedStackAlignment(uint32_t alignment) { _expectedStackAlignment = alignment; } - //! @brief Get required stack alignment. + //! Get required stack alignment. ASMJIT_INLINE uint32_t getRequiredStackAlignment() const { return _requiredStackAlignment; } - //! @brief Set required stack alignment. + //! Set required stack alignment. ASMJIT_INLINE void setRequiredStackAlignment(uint32_t alignment) { _requiredStackAlignment = alignment; } - //! @brief Update required stack alignment so it's not lower than expected + //! Update required stack alignment so it's not lower than expected //! stack alignment. ASMJIT_INLINE void updateRequiredStackAlignment() { if (_requiredStackAlignment <= _expectedStackAlignment) { @@ -1406,32 +1408,32 @@ struct FuncNode : public BaseNode { } } - //! @brief Set stack "Red Zone" size. + //! Set stack "Red Zone" size. ASMJIT_INLINE uint32_t getRedZoneSize() const { return _redZoneSize; } - //! @brief Get stack "Red Zone" size. + //! Get stack "Red Zone" size. ASMJIT_INLINE void setRedZoneSize(uint32_t s) { _redZoneSize = static_cast(s); } - //! @brief Set stack "Spill Zone" size. + //! Set stack "Spill Zone" size. ASMJIT_INLINE uint32_t getSpillZoneSize() const { return _spillZoneSize; } - //! @brief Get stack "Spill Zone" size. + //! Get stack "Spill Zone" size. ASMJIT_INLINE void setSpillZoneSize(uint32_t s) { _spillZoneSize = static_cast(s); } - //! @brief Get stack size used by function arguments. + //! Get stack size used by function arguments. ASMJIT_INLINE uint32_t getArgStackSize() const { return _argStackSize; } - //! @brief Get stack size used by variables and memory allocated on the stack. + //! Get stack size used by variables and memory allocated on the stack. ASMJIT_INLINE uint32_t getMemStackSize() const { return _memStackSize; } - //! @brief Get stack size used by function calls. + //! Get stack size used by function calls. ASMJIT_INLINE uint32_t getCallStackSize() const { return _callStackSize; } - //! @brief Merge stack size used by function call with @a s. + //! Merge stack size used by function call with `s`. ASMJIT_INLINE void mergeCallStackSize(uint32_t s) { if (_callStackSize < s) _callStackSize = s; } // -------------------------------------------------------------------------- // [Hints] // -------------------------------------------------------------------------- - //! @brief Set function hint. + //! Set function hint. ASMJIT_INLINE void setHint(uint32_t hint, uint32_t value) { ASMJIT_ASSERT(hint <= 31); ASMJIT_ASSERT(value <= 1); @@ -1440,7 +1442,7 @@ struct FuncNode : public BaseNode { _funcHints |= (value << hint); } - //! @brief Get function hint. + //! Get function hint. ASMJIT_INLINE uint32_t getHint(uint32_t hint) const { ASMJIT_ASSERT(hint <= 31); return (_funcHints >> hint) & 0x1; @@ -1450,44 +1452,44 @@ struct FuncNode : public BaseNode { // [Members] // -------------------------------------------------------------------------- - //! @brief Function entry. + //! Function entry. TargetNode* _entryNode; - //! @brief Function exit. + //! Function exit. TargetNode* _exitNode; - //! @brief Function declaration. + //! Function declaration. FuncDecl* _decl; - //! @brief Function end. + //! Function end. EndNode* _end; - //! @brief Arguments list as @ref VarData. + //! Arguments list as `VarData`. VarData** _argList; - //! @brief Function hints; + //! Function hints; uint32_t _funcHints; - //! @brief Function flags. + //! Function flags. uint32_t _funcFlags; - //! @brief Expected stack alignment (we depend on this value). + //! Expected stack alignment (we depend on this value). //! //! @note It can be global alignment given by the OS or described by an //! target platform ABI. uint32_t _expectedStackAlignment; - //! @brief Required stack alignment (usually for multimedia instructions). + //! Required stack alignment (usually for multimedia instructions). uint32_t _requiredStackAlignment; - //! @brief The "Red Zone" suze - count of bytes which might be accessed + //! The "Red Zone" suze - count of bytes which might be accessed //! without adjusting the stack pointer. uint16_t _redZoneSize; - //! @brief Spill zone size (zone used by WIN64ABI). + //! Spill zone size (zone used by WIN64ABI). uint16_t _spillZoneSize; - //! @brief Stack size needed for function arguments. + //! Stack size needed for function arguments. uint32_t _argStackSize; - //! @brief Stack size needed for all variables and memory allocated on + //! Stack size needed for all variables and memory allocated on //! the stack. uint32_t _memStackSize; - //! @brief Stack size needed to call other functions. + //! Stack size needed to call other functions. uint32_t _callStackSize; }; @@ -1495,7 +1497,7 @@ struct FuncNode : public BaseNode { // [asmjit::EndNode] // ============================================================================ -//! @brief End of function/block node. +//! End of function/block node. struct EndNode : public BaseNode { ASMJIT_NO_COPY(EndNode) @@ -1503,12 +1505,12 @@ struct EndNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref EndNode instance. + //! Create a new `EndNode` instance. ASMJIT_INLINE EndNode(BaseCompiler* compiler) : BaseNode(compiler, kNodeTypeEnd) { _flags |= kNodeFlagIsRet; } - //! @brief Destroy the @ref EndNode instance. + //! Destroy the `EndNode` instance. ASMJIT_INLINE ~EndNode() {} }; @@ -1516,7 +1518,7 @@ struct EndNode : public BaseNode { // [asmjit::RetNode] // ============================================================================ -//! @brief Function return node. +//! Function return node. struct RetNode : public BaseNode { ASMJIT_NO_COPY(RetNode) @@ -1524,26 +1526,26 @@ struct RetNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref RetNode instance. + //! Create a new `RetNode` instance. ASMJIT_INLINE RetNode(BaseCompiler* compiler, const Operand& o0, const Operand& o1) : BaseNode(compiler, kNodeTypeRet) { _flags |= kNodeFlagIsRet; _ret[0] = o0; _ret[1] = o1; } - //! @brief Destroy the @ref RetNode instance. + //! Destroy the `RetNode` instance. ASMJIT_INLINE ~RetNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get the first return operand. + //! Get the first return operand. ASMJIT_INLINE Operand& getFirst() { return _ret[0]; } //! @overload ASMJIT_INLINE const Operand& getFirst() const { return _ret[0]; } - //! @brief Get the second return operand. + //! Get the second return operand. ASMJIT_INLINE Operand& getSecond() { return _ret[1]; } //! @overload ASMJIT_INLINE const Operand& getSecond() const { return _ret[1]; } @@ -1552,7 +1554,7 @@ struct RetNode : public BaseNode { // [Members] // -------------------------------------------------------------------------- - //! @brief Ret operand(s). + //! Ret operand(s). Operand _ret[2]; }; @@ -1560,7 +1562,7 @@ struct RetNode : public BaseNode { // [asmjit::CallNode] // ============================================================================ -//! @brief Function-call node. +//! Function-call node. struct CallNode : public BaseNode { ASMJIT_NO_COPY(CallNode) @@ -1568,29 +1570,29 @@ struct CallNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref CallNode instance. + //! Create a new `CallNode` instance. ASMJIT_INLINE CallNode(BaseCompiler* compiler, const Operand& target) : BaseNode(compiler, kNodeTypeCall), _decl(NULL), _target(target), _args(NULL) {} - //! @brief Destroy the @ref CallNode instance. + //! Destroy the `CallNode` instance. ASMJIT_INLINE ~CallNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get function declaration. + //! Get function declaration. ASMJIT_INLINE FuncDecl* getDecl() const { return _decl; } - //! @brief Get target operand. + //! Get target operand. ASMJIT_INLINE Operand& getTarget() { return _target; } //! @overload ASMJIT_INLINE const Operand& getTarget() const { return _target; } - //! @brief Get return at @a i. + //! Get return at `i`. ASMJIT_INLINE Operand& getRet(uint32_t i = 0) { ASMJIT_ASSERT(i < 2); return _ret[i]; @@ -1601,7 +1603,7 @@ struct CallNode : public BaseNode { return _ret[i]; } - //! @brief Get argument at @a i. + //! Get argument at `i`. ASMJIT_INLINE Operand& getArg(uint32_t i) { ASMJIT_ASSERT(i < kFuncArgCountLoHi); return _args[i]; @@ -1616,14 +1618,14 @@ struct CallNode : public BaseNode { // [Members] // -------------------------------------------------------------------------- - //! @brief Function declaration. + //! Function declaration. FuncDecl* _decl; - //! @brief Target (address of function, register, label, ...). + //! Target (address of function, register, label, ...). Operand _target; - //! @brief Return. + //! Return. Operand _ret[2]; - //! @brief Arguments. + //! Arguments. Operand* _args; }; @@ -1631,7 +1633,7 @@ struct CallNode : public BaseNode { // [asmjit::SArgNode] // ============================================================================ -//! @brief Function-call 'argument on the stack' node. +//! Function-call 'argument on the stack' node. struct SArgNode : public BaseNode { ASMJIT_NO_COPY(SArgNode) @@ -1639,7 +1641,7 @@ struct SArgNode : public BaseNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref SArgNode instance. + //! Create a new `SArgNode` instance. ASMJIT_INLINE SArgNode(BaseCompiler* compiler, CallNode* call, VarData* sVd, VarData* cVd) : BaseNode(compiler, kNodeTypeSArg), _call(call), @@ -1647,32 +1649,32 @@ struct SArgNode : public BaseNode { _cVd(cVd), _args(0) {} - //! @brief Destroy the @ref SArgNode instance. + //! Destroy the `SArgNode` instance. ASMJIT_INLINE ~SArgNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get the associated function-call. + //! Get the associated function-call. ASMJIT_INLINE CallNode* getCall() const { return _call; } - //! @brief Get source variable. + //! Get source variable. ASMJIT_INLINE VarData* getSVd() const { return _sVd; } - //! @brief Get conversion variable. + //! Get conversion variable. ASMJIT_INLINE VarData* getCVd() const { return _cVd; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Associated @ref CallNode. + //! Associated `CallNode`. CallNode* _call; - //! @brief Source variable. + //! Source variable. VarData* _sVd; - //! @brief Temporary variable used for conversion (or NULL). + //! Temporary variable used for conversion (or NULL). VarData* _cVd; - //! @brief Affected arguments bit-array. + //! Affected arguments bit-array. uint32_t _args; }; @@ -1680,7 +1682,7 @@ struct SArgNode : public BaseNode { // [asmjit::BaseCompiler] // ============================================================================ -//! @brief Base compiler. +//! Base compiler. //! //! @sa BaseAssembler. struct BaseCompiler : public CodeGen { @@ -1690,33 +1692,33 @@ struct BaseCompiler : public CodeGen { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref BaseCompiler instance. - ASMJIT_API BaseCompiler(BaseRuntime* runtime); - //! @brief Destroy the @ref BaseCompiler instance. + //! Create a new `BaseCompiler` instance. + ASMJIT_API BaseCompiler(Runtime* runtime); + //! Destroy the `BaseCompiler` instance. ASMJIT_API virtual ~BaseCompiler(); // -------------------------------------------------------------------------- // [LookAhead] // -------------------------------------------------------------------------- - //! @brief Get maximum look ahead. + //! Get maximum look ahead. ASMJIT_INLINE uint32_t getMaxLookAhead() const { return _maxLookAhead; } - //! @brief Set maximum look ahead to @a val. + //! Set maximum look ahead to `val`. ASMJIT_INLINE void setMaxLookAhead(uint32_t val) { _maxLookAhead = val; } // -------------------------------------------------------------------------- // [Clear / Reset] // -------------------------------------------------------------------------- - //! @brief Clear everything, but keep buffers allocated. + //! Clear everything, but keep buffers allocated. //! //! @note This method will destroy your code. ASMJIT_API void clear(); - //! @brief Clear everything and reset all buffers. + //! Clear everything and reset all buffers. //! //! @note This method will destroy your code. ASMJIT_API void reset(); - //! @brief Called by clear() and reset() to clear all data related to derived + //! Called by clear() and reset() to clear all data related to derived //! class implementation. ASMJIT_API virtual void _purge(); @@ -1748,65 +1750,65 @@ struct BaseCompiler : public CodeGen { return new(p) T(this, p0, p1, p2); } - //! @brief Get first node. + //! Get first node. ASMJIT_INLINE BaseNode* getFirstNode() const { return _firstNode; } - //! @brief Get last node. + //! Get last node. ASMJIT_INLINE BaseNode* getLastNode() const { return _lastNode; } - //! @brief Get current node. + //! Get current node. //! - //! @note If this method returns @c NULL it means that nothing has been emitted + //! @note If this method returns `NULL` it means that nothing has been emitted //! yet. ASMJIT_INLINE BaseNode* getCursor() const { return _cursor; } - //! @brief Set the current node without returning the previous node (private). + //! Set the current node without returning the previous node (private). ASMJIT_INLINE void _setCursor(BaseNode* node) { _cursor = node; } - //! @brief Set the current node to @a node and return the previous one. + //! Set the current node to `node` and return the previous one. ASMJIT_API BaseNode* setCursor(BaseNode* node); - //! @brief Add node @a node after current and set current to @a node. + //! Add node `node` after current and set current to `node`. ASMJIT_API BaseNode* addNode(BaseNode* node); - //! @brief Add node before @a ref. + //! Add node before `ref`. ASMJIT_API BaseNode* addNodeBefore(BaseNode* node, BaseNode* ref); - //! @brief Add node after @a ref. + //! Add node after `ref`. ASMJIT_API BaseNode* addNodeAfter(BaseNode* node, BaseNode* ref); - //! @brief Remove node @a node. + //! Remove node `node`. ASMJIT_API BaseNode* removeNode(BaseNode* node); - //! @brief Remove multiple nodes. + //! Remove multiple nodes. ASMJIT_API void removeNodes(BaseNode* first, BaseNode* last); // -------------------------------------------------------------------------- // [Func] // -------------------------------------------------------------------------- - //! @brief Get current function. + //! Get current function. ASMJIT_INLINE FuncNode* getFunc() const { return _func; } // -------------------------------------------------------------------------- // [Align] // -------------------------------------------------------------------------- - //! @brief Create a new @ref AlignNode. + //! Create a new `AlignNode`. ASMJIT_API AlignNode* newAlign(uint32_t m); - //! @brief Add a new @ref AlignNode. + //! Add a new `AlignNode`. ASMJIT_API AlignNode* addAlign(uint32_t m); - //! @brief Align target buffer to @a m bytes. + //! Align target buffer to `m` bytes. //! //! Typical usage of this is to align labels at start of the inner loops. //! - //! Inserts @c nop() instructions or CPU optimized NOPs. + //! Inserts `nop()` instructions or CPU optimized NOPs. ASMJIT_INLINE AlignNode* align(uint32_t m) { return addAlign(m); } // -------------------------------------------------------------------------- // [Target] // -------------------------------------------------------------------------- - //! @brief Create a new @ref TargetNode. + //! Create a new `TargetNode`. ASMJIT_API TargetNode* newTarget(); - //! @brief Add a new @ref TargetNode. + //! Add a new `TargetNode`. ASMJIT_API TargetNode* addTarget(); - //! @brief Get @ref TargetNode by @a id. + //! Get `TargetNode` by `id`. ASMJIT_INLINE TargetNode* getTargetById(uint32_t id) { ASMJIT_ASSERT(OperandUtil::isLabelId(id)); ASMJIT_ASSERT(id < _targets.getLength()); @@ -1814,7 +1816,7 @@ struct BaseCompiler : public CodeGen { return _targets[id]; } - //! @brief Get @ref TargetNode by @a label. + //! Get `TargetNode` by `label`. ASMJIT_INLINE TargetNode* getTarget(const Label& label) { return getTargetById(label.getId()); } @@ -1823,27 +1825,27 @@ struct BaseCompiler : public CodeGen { // [Label] // -------------------------------------------------------------------------- - //! @brief Get count of created labels. + //! Get count of created labels. ASMJIT_INLINE size_t getLabelsCount() const { return _targets.getLength(); } - //! @brief Get whether @a label is created. + //! Get whether `label` is created. ASMJIT_INLINE bool isLabelCreated(const Label& label) const { return static_cast(label.getId()) < _targets.getLength(); } //! @internal //! - //! @brief Create and initialize a new label. + //! Create and initialize a new `Label`. ASMJIT_API Error _newLabel(Label* dst); - //! @brief Create and return new label. + //! Create and return a new `Label`. ASMJIT_INLINE Label newLabel() { Label result(NoInit); _newLabel(&result); return result; } - //! @brief Bind label to the current offset. + //! Bind label to the current offset. //! //! @note Label can be bound only once! ASMJIT_API void bind(const Label& label); @@ -1852,54 +1854,54 @@ struct BaseCompiler : public CodeGen { // [Embed] // -------------------------------------------------------------------------- - //! @brief Create a new @ref EmbedNode. + //! Create a new `EmbedNode`. ASMJIT_API EmbedNode* newEmbed(const void* data, uint32_t size); - //! @brief Add a new @ref EmbedNode. + //! Add a new `EmbedNode`. ASMJIT_API EmbedNode* addEmbed(const void* data, uint32_t size); - //! @brief Embed data. + //! Embed data. ASMJIT_INLINE EmbedNode* embed(const void* data, uint32_t size) { return addEmbed(data, size); } // -------------------------------------------------------------------------- // [Comment] // -------------------------------------------------------------------------- - //! @brief Create a new @ref CommentNode. + //! Create a new `CommentNode`. ASMJIT_API CommentNode* newComment(const char* str); - //! @brief Add a new @ref CommentNode. + //! Add a new `CommentNode`. ASMJIT_API CommentNode* addComment(const char* str); - //! @brief Emit a single comment line. + //! Emit a single comment line. ASMJIT_API CommentNode* comment(const char* fmt, ...); // -------------------------------------------------------------------------- // [Hint] // -------------------------------------------------------------------------- - //! @brief Create a new @ref HintNode. + //! Create a new `HintNode`. ASMJIT_API HintNode* newHint(BaseVar& var, uint32_t hint, uint32_t value); - //! @brief Add a new @ref HintNode. + //! Add a new `HintNode`. ASMJIT_API HintNode* addHint(BaseVar& var, uint32_t hint, uint32_t value); // -------------------------------------------------------------------------- // [Vars] // -------------------------------------------------------------------------- - //! @brief Get whether variable @a var is created. + //! Get whether variable `var` is created. ASMJIT_INLINE bool isVarCreated(const BaseVar& var) const { return static_cast(var.getId() & kOperandIdNum) < _vars.getLength(); } //! @internal //! - //! @brief Get @ref VarData by @a var. + //! Get `VarData` by `var`. ASMJIT_INLINE VarData* getVd(const BaseVar& var) const { return getVdById(var.getId()); } //! @internal //! - //! @brief Get @ref VarData by @a id. + //! Get `VarData` by `id`. ASMJIT_INLINE VarData* getVdById(uint32_t id) const { ASMJIT_ASSERT(id != kInvalidValue); ASMJIT_ASSERT(static_cast(id & kOperandIdNum) < _vars.getLength()); @@ -1909,43 +1911,43 @@ struct BaseCompiler : public CodeGen { //! @internal //! - //! @brief Get an array of 'VarData*'. + //! Get an array of 'VarData*'. ASMJIT_INLINE VarData** _getVdArray() const { return const_cast(_vars.getData()); } //! @internal //! - //! @brief Create a new @ref VarData. + //! Create a new `VarData`. ASMJIT_API VarData* _newVd(uint32_t type, uint32_t size, uint32_t c, const char* name); - //! @brief Create a new @ref BaseVar. + //! Create a new `BaseVar`. virtual Error _newVar(BaseVar* var, uint32_t type, const char* name) = 0; - //! @brief Alloc variable @a var. + //! Alloc variable `var`. ASMJIT_API void alloc(BaseVar& var); - //! @brief Alloc variable @a var using @a regIndex as a register index. + //! Alloc variable `var` using `regIndex` as a register index. ASMJIT_API void alloc(BaseVar& var, uint32_t regIndex); - //! @brief Alloc variable @a var using @a reg as a demanded register. + //! Alloc variable `var` using `reg` as a demanded register. ASMJIT_API void alloc(BaseVar& var, const BaseReg& reg); - //! @brief Spill variable @a var. + //! Spill variable `var`. ASMJIT_API void spill(BaseVar& var); - //! @brief Save variable @a var if modified. + //! Save variable `var` if modified. ASMJIT_API void save(BaseVar& var); - //! @brief Unuse variable @a var. + //! Unuse variable `var`. ASMJIT_API void unuse(BaseVar& var); - //! @brief Get priority of variable @a var. + //! Get priority of variable `var`. ASMJIT_API uint32_t getPriority(BaseVar& var) const; - //! @brief Set priority of variable @a var to @a priority. + //! Set priority of variable `var` to `priority`. ASMJIT_API void setPriority(BaseVar& var, uint32_t priority); - //! @brief Get save-on-unuse @a var property. + //! Get save-on-unuse `var` property. ASMJIT_API bool getSaveOnUnuse(BaseVar& var) const; - //! @brief Set save-on-unuse @a var property to @a value. + //! Set save-on-unuse `var` property to `value`. ASMJIT_API void setSaveOnUnuse(BaseVar& var, bool value); - //! @brief Rename variable @a var to @a name. + //! Rename variable `var` to `name`. //! //! @note Only new name will appear in the logger. ASMJIT_API void rename(BaseVar& var, const char* name); @@ -1956,7 +1958,7 @@ struct BaseCompiler : public CodeGen { //! @internal //! - //! @brief Create a new memory chunk allocated on the current function's stack. + //! Create a new memory chunk allocated on the current function's stack. virtual Error _newStack(BaseMem* mem, uint32_t size, uint32_t alignment, const char* name) = 0; // -------------------------------------------------------------------------- @@ -1965,61 +1967,61 @@ struct BaseCompiler : public CodeGen { //! @internal //! - //! @brief Put data to a constant-pool and get a memory reference to it. + //! Put data to a constant-pool and get a memory reference to it. virtual Error _newConst(BaseMem* mem, uint32_t scope, const void* data, size_t size) = 0; // -------------------------------------------------------------------------- // [Serialize] // -------------------------------------------------------------------------- - //! @brief Send assembled code to @a assembler. + //! Send assembled code to `assembler`. virtual Error serialize(BaseAssembler& assembler) = 0; // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Flow id added to each node created (used only by @ref Context). + //! Flow id added to each node created (used only by `Context)`. uint32_t _nodeFlowId; - //! @brief Flags added to each node created (used only by @ref Context). + //! Flags added to each node created (used only by `Context)`. uint32_t _nodeFlags; - //! @brief Maximum count of nodes to look ahead when allocating/spilling + //! Maximum count of nodes to look ahead when allocating/spilling //! registers. uint32_t _maxLookAhead; - //! @brief Variable mapping (translates incoming kVarType into target). + //! Variable mapping (translates incoming kVarType into target). const uint8_t* _targetVarMapping; - //! @brief First node. + //! First node. BaseNode* _firstNode; - //! @brief Last node. + //! Last node. BaseNode* _lastNode; - //! @brief Current node. + //! Current node. BaseNode* _cursor; - //! @brief Current function. + //! Current function. FuncNode* _func; - //! @brief Variable zone. + //! Variable zone. Zone _varZone; - //! @brief String/data zone. + //! String/data zone. Zone _stringZone; - //! @brief Local constant pool zone. + //! Local constant pool zone. Zone _localConstZone; - //! @brief Targets. + //! Targets. PodVector _targets; - //! @brief Variables. + //! Variables. PodVector _vars; - //! @brief Local constant pool, flushed at the end of each function. + //! Local constant pool, flushed at the end of each function. ConstPool _localConstPool; - //! @brief Global constant pool, flushed at the end of the compilation. + //! Global constant pool, flushed at the end of the compilation. ConstPool _globalConstPool; - //! @brief Label to start of the local constant pool. + //! Label to start of the local constant pool. Label _localConstPoolLabel; - //! @brief Label to start of the global constant pool. + //! Label to start of the global constant pool. Label _globalConstPoolLabel; }; @@ -2044,6 +2046,8 @@ ASMJIT_INLINE BaseNode::BaseNode(BaseCompiler* compiler, uint32_t type) { _state = NULL; } +//! @} + } // asmjit namespace // [Api-End] diff --git a/src/asmjit/base/constpool.cpp b/src/asmjit/base/constpool.cpp index 0e900f3..9058c98 100644 --- a/src/asmjit/base/constpool.cpp +++ b/src/asmjit/base/constpool.cpp @@ -31,7 +31,7 @@ const ConstPoolNode ConstPoolTree::_sentinel = { { //! @internal //! -//! @brief Remove left horizontal links. +//! Remove left horizontal links. static ASMJIT_INLINE ConstPoolNode* ConstPoolTree_skewNode(ConstPoolNode* node) { if (node->_link[0]->_level == node->_level && node->_level != 0 ) { ConstPoolNode *save = node->_link[0]; @@ -45,7 +45,7 @@ static ASMJIT_INLINE ConstPoolNode* ConstPoolTree_skewNode(ConstPoolNode* node) //! @internal //! -//! @brief Remove consecutive horizontal links. +//! Remove consecutive horizontal links. static ASMJIT_INLINE ConstPoolNode* ConstPoolTree_splitNode(ConstPoolNode* node) { if (node->_link[1]->_link[1]->_level == node->_level && node->_level != 0) { ConstPoolNode *save = node->_link[1]; @@ -159,7 +159,7 @@ void ConstPool::reset() { // [asmjit::ConstPool - Ops] // ============================================================================ -ASMJIT_INLINE size_t ConstPool_getGapIndex(size_t size) { +static ASMJIT_INLINE size_t ConstPool_getGapIndex(size_t size) { if (size <= 1) return ConstPool::kIndex1; else if (size <= 3) @@ -172,7 +172,7 @@ ASMJIT_INLINE size_t ConstPool_getGapIndex(size_t size) { return ConstPool::kIndex16; } -ASMJIT_INLINE ConstPoolGap* ConstPool_allocGap(ConstPool* self) { +static ASMJIT_INLINE ConstPoolGap* ConstPool_allocGap(ConstPool* self) { ConstPoolGap* gap = self->_gapPool; if (gap == NULL) return self->_zone->allocT(); @@ -181,7 +181,7 @@ ASMJIT_INLINE ConstPoolGap* ConstPool_allocGap(ConstPool* self) { return gap; } -ASMJIT_INLINE void ConstPool_freeGap(ConstPool* self, ConstPoolGap* gap) { +static ASMJIT_INLINE void ConstPool_freeGap(ConstPool* self, ConstPoolGap* gap) { gap->_next = self->_gapPool; self->_gapPool = gap; } diff --git a/src/asmjit/base/constpool.h b/src/asmjit/base/constpool.h index 8ff894e..fcf5f05 100644 --- a/src/asmjit/base/constpool.h +++ b/src/asmjit/base/constpool.h @@ -17,13 +17,16 @@ namespace asmjit { +//! @addtogroup asmjit_base_util +//! @{ + // ============================================================================ // [asmjit::ConstPoolNode] // ============================================================================ //! @internal //! -//! @brief Zone-allocated constant-pool node. +//! Zone-allocated constant-pool node. struct ConstPoolNode { // -------------------------------------------------------------------------- // [Accessors] @@ -37,13 +40,13 @@ struct ConstPoolNode { // [Members] // -------------------------------------------------------------------------- - //! @brief Left/Right nodes. + //! Left/Right nodes. ConstPoolNode* _link[2]; - //! @brief Horizontal level for balance. + //! Horizontal level for balance. uint32_t _level : 31; - //! @brief Whether this constant is shared with another. + //! Whether this constant is shared with another. uint32_t _shared : 1; - //! @brief Data offset from the beginning of the pool. + //! Data offset from the beginning of the pool. uint32_t _offset; }; @@ -53,10 +56,10 @@ struct ConstPoolNode { //! @internal //! -//! @brief Zone-allocated constant-pool tree. +//! Zone-allocated constant-pool tree. struct ConstPoolTree { enum { - //! @brief Maximum tree height == log2(1 << 64). + //! Maximum tree height == log2(1 << 64). kHeightLimit = 64 }; @@ -169,11 +172,11 @@ struct ConstPoolTree { // [Members] // -------------------------------------------------------------------------- - //! @brief Root of the tree + //! Root of the tree ConstPoolNode* _root; - //! @brief Length of the tree (count of nodes). + //! Length of the tree (count of nodes). size_t _length; - //! @brief Size of the data. + //! Size of the data. size_t _dataSize; }; @@ -183,13 +186,13 @@ struct ConstPoolTree { //! @internal //! -//! @brief Zone-allocated constant-pool gap. +//! Zone-allocated constant-pool gap. struct ConstPoolGap { - //! @brief Link to the next gap + //! Link to the next gap ConstPoolGap* _next; - //! @brief Offset of the gap. + //! Offset of the gap. size_t _offset; - //! @brief Remaining bytes of the gap (basically a gap size). + //! Remaining bytes of the gap (basically a gap size). size_t _length; }; @@ -197,6 +200,7 @@ struct ConstPoolGap { // [asmjit::ConstPool] // ============================================================================ +//! Constant pool. struct ConstPool { ASMJIT_NO_COPY(ConstPool) @@ -227,21 +231,22 @@ struct ConstPool { // [Ops] // -------------------------------------------------------------------------- - //! @brief Get whether the constant-pool is empty. + //! Get whether the constant-pool is empty. ASMJIT_INLINE bool isEmpty() const { return _size == 0; } - //! @brief Get the size of the constant-pool in bytes. + //! Get the size of the constant-pool in bytes. ASMJIT_INLINE size_t getSize() const { return _size; } + //! Get minimum alignment. ASMJIT_INLINE size_t getAlignment() const { return _alignment; } - //! @brief Add a constant to the constant pool. + //! Add a constant to the constant pool. //! //! The constant must have known size, which is 1, 2, 4, 8, 16 or 32 bytes. //! The constant is added to the pool only if it doesn't not exist, otherwise @@ -264,28 +269,30 @@ struct ConstPool { // [Fill] // -------------------------------------------------------------------------- - //! @brief Fill the destination with the constants from the pool. + //! Fill the destination with the constants from the pool. ASMJIT_API void fill(void* dst); // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Zone allocator. + //! Zone allocator. Zone* _zone; - //! @brief Tree per size. + //! Tree per size. ConstPoolTree _tree[kIndexCount]; - //! @brief Gaps per size. + //! Gaps per size. ConstPoolGap* _gaps[kIndexCount]; - //! @brief Gaps pool + //! Gaps pool ConstPoolGap* _gapPool; - //! @brief Size of the pool (in bytes). + //! Size of the pool (in bytes). size_t _size; - //! @brief Alignemnt. + //! Alignemnt. size_t _alignment; }; +//! @} + } // asmjit namespace // [Api-End] diff --git a/src/asmjit/base/context.cpp b/src/asmjit/base/context.cpp index 59be4e7..28a933a 100644 --- a/src/asmjit/base/context.cpp +++ b/src/asmjit/base/context.cpp @@ -298,7 +298,7 @@ Error BaseContext::removeUnreachableCode() { //! @internal //! -//! @brief Translate the given function @a func. +//! Translate the given function `func`. void BaseContext::cleanup() { VarData** array = _contextVd.getData(); size_t length = _contextVd.getLength(); diff --git a/src/asmjit/base/context_p.h b/src/asmjit/base/context_p.h index b870a35..c7a0a62 100644 --- a/src/asmjit/base/context_p.h +++ b/src/asmjit/base/context_p.h @@ -17,10 +17,17 @@ namespace asmjit { +//! @addtogroup asmjit_base_codegen +//! @{ + // ============================================================================ // [asmjit::BaseContext] // ============================================================================ +//! @internal +//! +//! Code generation context is the logic behind `BaseCompiler`. The context is +//! used to compile the code stored in `BaseCompiler`. struct BaseContext { ASMJIT_NO_COPY(BaseContext) @@ -35,41 +42,41 @@ struct BaseContext { // [Reset] // -------------------------------------------------------------------------- - //! @brief Reset the whole context. + //! Reset the whole context. virtual void reset(); // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get compiler. + //! Get compiler. ASMJIT_INLINE BaseCompiler* getCompiler() const { return _compiler; } - //! @brief Get function. + //! Get function. ASMJIT_INLINE FuncNode* getFunc() const { return _func; } - //! @brief Get stop node. + //! Get stop node. ASMJIT_INLINE BaseNode* getStop() const { return _stop; } - //! @brief Get start of the current scope. + //! Get start of the current scope. ASMJIT_INLINE BaseNode* getStart() const { return _start; } - //! @brief Get end of the current scope. + //! Get end of the current scope. ASMJIT_INLINE BaseNode* getEnd() const { return _end; } - //! @brief Get extra block. + //! Get extra block. ASMJIT_INLINE BaseNode* getExtraBlock() const { return _extraBlock; } - //! @brief Set extra block. + //! Set extra block. ASMJIT_INLINE void setExtraBlock(BaseNode* node) { _extraBlock = node; } // -------------------------------------------------------------------------- // [Error] // -------------------------------------------------------------------------- - //! @brief Get the last error code. + //! Get the last error code. ASMJIT_INLINE Error getError() const { return getCompiler()->getError(); } - //! @brief Set the last error code and propagate it through the error handler. + //! Set the last error code and propagate it through the error handler. ASMJIT_INLINE Error setError(Error error, const char* message = NULL) { return getCompiler()->setError(error, message); } @@ -78,19 +85,20 @@ struct BaseContext { // [State] // -------------------------------------------------------------------------- - //! @brief Get current state. - ASMJIT_INLINE BaseVarState* getState() const { return _state; } + //! Get current state. + ASMJIT_INLINE BaseVarState* getState() const { + return _state; + } - //! @brief Load current state from @a target state. + //! Load current state from `target` state. virtual void loadState(BaseVarState* src) = 0; - //! @brief Save current state, returning new @ref BaseVarState instance. + //! Save current state, returning new `BaseVarState` instance. virtual BaseVarState* saveState() = 0; - //! @brief Change the current state to @a target state. + //! Change the current state to `target` state. virtual void switchState(BaseVarState* src) = 0; - //! @brief Change the current state to the intersection of two states @a a - //! and @a b. + //! Change the current state to the intersection of two states `a` and `b`. virtual void intersectStates(BaseVarState* a, BaseVarState* b) = 0; // -------------------------------------------------------------------------- @@ -140,7 +148,7 @@ struct BaseContext { // [Fetch] // -------------------------------------------------------------------------- - //! @brief Fetch. + //! Fetch. //! //! Fetch iterates over all nodes and gathers information about all variables //! used. The process generates information required by register allocator, @@ -151,14 +159,14 @@ struct BaseContext { // [RemoveUnreachableCode] // -------------------------------------------------------------------------- - //! @brief Remove unreachable code. + //! Remove unreachable code. virtual Error removeUnreachableCode(); // -------------------------------------------------------------------------- // [Analyze] // -------------------------------------------------------------------------- - //! @brief Preform variable liveness analysis. + //! Preform variable liveness analysis. //! //! Analysis phase iterates over nodes in reverse order and generates a bit //! array describing variables that are alive at every node in the function. @@ -180,7 +188,7 @@ struct BaseContext { // [Translate] // -------------------------------------------------------------------------- - //! @brief Translate code by allocating registers and handling state changes. + //! Translate code by allocating registers and handling state changes. virtual Error translate() = 0; // -------------------------------------------------------------------------- @@ -205,70 +213,72 @@ struct BaseContext { // [Members] // -------------------------------------------------------------------------- - //! @brief Compiler. + //! Compiler. BaseCompiler* _compiler; - //! @brief Function. + //! Function. FuncNode* _func; - //! @brief Zone allocator. + //! Zone allocator. Zone _baseZone; - //! @brief Start of the current active scope. + //! Start of the current active scope. BaseNode* _start; - //! @brief End of the current active scope. + //! End of the current active scope. BaseNode* _end; - //! @brief Node that is used to insert extra code after the function body. + //! Node that is used to insert extra code after the function body. BaseNode* _extraBlock; - //! @brief Stop node. + //! Stop node. BaseNode* _stop; - //! @brief Unreachable nodes. + //! Unreachable nodes. PodList _unreachableList; - //! @brief Jump nodes. + //! Jump nodes. PodList _jccList; - //! @brief All variables used by the current function. + //! All variables used by the current function. PodVector _contextVd; - //! @brief Memory used to spill variables. + //! Memory used to spill variables. MemCell* _memVarCells; - //! @brief Memory used to alloc memory on the stack. + //! Memory used to alloc memory on the stack. MemCell* _memStackCells; - //! @brief Count of 1-byte cells. + //! Count of 1-byte cells. uint32_t _mem1ByteVarsUsed; - //! @brief Count of 2-byte cells. + //! Count of 2-byte cells. uint32_t _mem2ByteVarsUsed; - //! @brief Count of 4-byte cells. + //! Count of 4-byte cells. uint32_t _mem4ByteVarsUsed; - //! @brief Count of 8-byte cells. + //! Count of 8-byte cells. uint32_t _mem8ByteVarsUsed; - //! @brief Count of 16-byte cells. + //! Count of 16-byte cells. uint32_t _mem16ByteVarsUsed; - //! @brief Count of 32-byte cells. + //! Count of 32-byte cells. uint32_t _mem32ByteVarsUsed; - //! @brief Count of 64-byte cells. + //! Count of 64-byte cells. uint32_t _mem64ByteVarsUsed; - //! @brief Count of stack memory cells. + //! Count of stack memory cells. uint32_t _memStackCellsUsed; - //! @brief Maximum memory alignment used by the function. + //! Maximum memory alignment used by the function. uint32_t _memMaxAlign; - //! @brief Count of bytes used by variables. + //! Count of bytes used by variables. uint32_t _memVarTotal; - //! @brief Count of bytes used by stack. + //! Count of bytes used by stack. uint32_t _memStackTotal; - //! @brief Count of bytes used by variables and stack after alignment. + //! Count of bytes used by variables and stack after alignment. uint32_t _memAllTotal; - //! @brief Default lenght of annotated instruction. + //! Default lenght of annotated instruction. uint32_t _annotationLength; - //! @brief Current state (used by register allocator). + //! Current state (used by register allocator). BaseVarState* _state; }; +//! @} + } // asmjit namespace // [Api-End] diff --git a/src/asmjit/base/cpuinfo.cpp b/src/asmjit/base/cpuinfo.cpp index 2272980..558d3ad 100644 --- a/src/asmjit/base/cpuinfo.cpp +++ b/src/asmjit/base/cpuinfo.cpp @@ -62,7 +62,7 @@ uint32_t BaseCpuInfo::detectNumberOfCores() { #if defined(ASMJIT_HOST_X86) || defined(ASMJIT_HOST_X64) struct HostCpuInfo : public x86x64::CpuInfo { ASMJIT_INLINE HostCpuInfo() : CpuInfo() { - x86x64::hostCpuDetect(this); + x86x64::CpuUtil::detect(this); } }; #else diff --git a/src/asmjit/base/cpuinfo.h b/src/asmjit/base/cpuinfo.h index cecf68a..ddc8e96 100644 --- a/src/asmjit/base/cpuinfo.h +++ b/src/asmjit/base/cpuinfo.h @@ -16,30 +16,30 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_cpu_info //! @{ // ============================================================================ // [asmjit::kCpuVendor] // ============================================================================ -//! @brief Cpu vendor IDs. +//! Cpu vendor IDs. //! //! Cpu vendor IDs are specific for AsmJit library. Vendor ID is not directly //! read from cpuid result, instead it's based on CPU vendor string. ASMJIT_ENUM(kCpuVendor) { - //! @brief Unknown CPU vendor. + //! Unknown CPU vendor. kCpuVendorUnknown = 0, - //! @brief Intel CPU vendor. + //! Intel CPU vendor. kCpuVendorIntel = 1, - //! @brief AMD CPU vendor. + //! AMD CPU vendor. kCpuVendorAmd = 2, - //! @brief National Semiconductor CPU vendor (applies also to Cyrix processors). + //! National Semiconductor CPU vendor (applies also to Cyrix processors). kCpuVendorNSM = 3, - //! @brief Transmeta CPU vendor. + //! Transmeta CPU vendor. kCpuVendorTransmeta = 4, - //! @brief VIA CPU vendor. + //! VIA CPU vendor. kCpuVendorVia = 5 }; @@ -47,11 +47,14 @@ ASMJIT_ENUM(kCpuVendor) { // [asmjit::BaseCpuInfo] // ============================================================================ -//! @brief Base cpu information. +//! Base cpu information. struct BaseCpuInfo { ASMJIT_NO_COPY(BaseCpuInfo) - enum { kFeaturesPerUInt32 = static_cast(sizeof(uint32_t)) * 8 }; + //! @internal + enum { + kFeaturesPerUInt32 = static_cast(sizeof(uint32_t)) * 8 + }; // -------------------------------------------------------------------------- // [Construction / Destruction] @@ -63,23 +66,23 @@ struct BaseCpuInfo { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get CPU vendor string. + //! Get CPU vendor string. ASMJIT_INLINE const char* getVendorString() const { return _vendorString; } - //! @brief Get CPU brand string. + //! Get CPU brand string. ASMJIT_INLINE const char* getBrandString() const { return _brandString; } - //! @brief Get CPU vendor ID. + //! Get CPU vendor ID. ASMJIT_INLINE uint32_t getVendorId() const { return _vendorId; } - //! @brief Get CPU family ID. + //! Get CPU family ID. ASMJIT_INLINE uint32_t getFamily() const { return _family; } - //! @brief Get CPU model ID. + //! Get CPU model ID. ASMJIT_INLINE uint32_t getModel() const { return _model; } - //! @brief Get CPU stepping. + //! Get CPU stepping. ASMJIT_INLINE uint32_t getStepping() const { return _stepping; } - //! @brief Get CPU cores count (or sum of all cores of all procesors). + //! Get CPU cores count (or sum of all cores of all procesors). ASMJIT_INLINE uint32_t getCoresCount() const { return _coresCount; } - //! @brief Get whether CPU has a @a feature. + //! Get whether CPU has a `feature`. ASMJIT_INLINE bool hasFeature(uint32_t feature) const { ASMJIT_ASSERT(feature < sizeof(_features) * 8); @@ -87,7 +90,7 @@ struct BaseCpuInfo { (_features[feature / kFeaturesPerUInt32] >> (feature % kFeaturesPerUInt32)) & 0x1); } - //! @brief Add CPU @a feature. + //! Add a CPU `feature`. ASMJIT_INLINE BaseCpuInfo& addFeature(uint32_t feature) { ASMJIT_ASSERT(feature < sizeof(_features) * 8); @@ -99,36 +102,36 @@ struct BaseCpuInfo { // [Statics] // -------------------------------------------------------------------------- - //! @brief Detect number of cores (or sum of all cores of all processors). + //! Detect number of cores (or sum of all cores of all processors). static ASMJIT_API uint32_t detectNumberOfCores(); - //! @brief Get host cpu. + //! Get host cpu. static ASMJIT_API const BaseCpuInfo* getHost(); // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Size of the structure in bytes. + //! Size of the structure in bytes. uint32_t _size; - //! @brief Cpu short vendor string. + //! Cpu short vendor string. char _vendorString[16]; - //! @brief Cpu long vendor string (brand). + //! Cpu long vendor string (brand). char _brandString[64]; - //! @brief Cpu vendor id (see @c asmjit::kCpuVendor enum). + //! Cpu vendor id, see `asmjit::kCpuVendor`. uint32_t _vendorId; - //! @brief Cpu family ID. + //! Cpu family ID. uint32_t _family; - //! @brief Cpu model ID. + //! Cpu model ID. uint32_t _model; - //! @brief Cpu stepping. + //! Cpu stepping. uint32_t _stepping; - //! @brief Cpu cores count (or sum of all CPU cores of all processors). + //! Cpu cores count (or sum of all CPU cores of all processors). uint32_t _coresCount; - //! @brief Cpu features bitfield. + //! Cpu features bitfield. uint32_t _features[4]; }; diff --git a/src/asmjit/base/cputicks.h b/src/asmjit/base/cputicks.h index 0c23df8..696e858 100644 --- a/src/asmjit/base/cputicks.h +++ b/src/asmjit/base/cputicks.h @@ -16,14 +16,16 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_util //! @{ // ============================================================================ // [asmjit::CpuTicks] // ============================================================================ +//! CPU ticks utilities. struct CpuTicks { + //! Get the current CPU ticks for benchmarking (1ms resolution). static ASMJIT_API uint32_t now(); }; diff --git a/src/asmjit/base/defs.h b/src/asmjit/base/defs.h index 33dc0d3..b038e65 100644 --- a/src/asmjit/base/defs.h +++ b/src/asmjit/base/defs.h @@ -16,7 +16,7 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_codegen //! @{ // ============================================================================ @@ -30,19 +30,19 @@ struct BaseCompiler; // [asmjit::kOperandType] // ============================================================================ -//! @brief Operand types that can be encoded in @ref Operand. +//! Operand types that can be encoded in `Operand`. ASMJIT_ENUM(kOperandType) { - //! @brief Invalid operand, used only internally (not initialized Operand). + //! Invalid operand, used only internally (not initialized Operand). kOperandTypeNone = 0, - //! @brief Operand is a register. + //! Operand is a register. kOperandTypeReg = 1, - //! @brief Operand is a variable. + //! Operand is a variable. kOperandTypeVar = 2, - //! @brief Operand is a memory. + //! Operand is a memory. kOperandTypeMem = 3, - //! @brief Operand is an immediate value. + //! Operand is an immediate value. kOperandTypeImm = 4, - //! @brief Operand is a label. + //! Operand is a label. kOperandTypeLabel = 5 }; @@ -50,11 +50,11 @@ ASMJIT_ENUM(kOperandType) { // [asmjit::kOperandId] // ============================================================================ -//! @brief Operand id masks used to determine the operand type. +//! Operand id masks used to determine the operand type. ASMJIT_ENUM(kOperandId) { - //! @brief Operand id refers to @ref BaseVar. + //! Operand id refers to `BaseVar`. kOperandIdVar = 0x80000000U, - //! @brief Operand id to real index mask. + //! Operand id to real index mask. kOperandIdNum = 0x7FFFFFFFU }; @@ -62,12 +62,12 @@ ASMJIT_ENUM(kOperandId) { // [asmjit::kRegClass] // ============================================================================ -//! @brief Register class. +//! Register class. ASMJIT_ENUM(kRegClass) { - //! @brief Gp register class (any architecture). + //! Gp register class (any architecture). kRegClassGp = 0, - //! @brief Invalid register class. + //! Invalid register class. kRegClassInvalid = 0xFF }; @@ -75,9 +75,9 @@ ASMJIT_ENUM(kRegClass) { // [asmjit::kInstCode] // ============================================================================ -//! @brief Instruction codes (stub). +//! Instruction codes (stub). ASMJIT_ENUM(kInstCode) { - //! @brief No instruction. + //! No instruction. kInstNone = 0 }; @@ -85,12 +85,12 @@ ASMJIT_ENUM(kInstCode) { // [asmjit::kInstOptions] // ============================================================================ -//! @brief Instruction options (stub). +//! Instruction options (stub). ASMJIT_ENUM(kInstOptions) { - //! @brief No instruction options. + //! No instruction options. kInstOptionNone = 0x00, - //! @brief Emit short form of the instruction. + //! Emit short form of the instruction. //! //! X86/X64: //! @@ -101,18 +101,18 @@ ASMJIT_ENUM(kInstOptions) { //! assembler/compiler stream is unusable. kInstOptionShortForm = 0x01, - //! @brief Emit long form of the instruction. + //! Emit long form of the instruction. //! //! X86/X64: //! //! Long form is mosrlt related to jmp and jcc instructions, but like the - //! @ref kInstOptionShortForm option it can be used by other instructions + //! `kInstOptionShortForm` option it can be used by other instructions //! supporting both 8-bit and 32-bit immediates. kInstOptionLongForm = 0x02, - //! @brief Condition is likely to be taken (instruction). + //! Condition is likely to be taken (instruction). kInstOptionTaken = 0x04, - //! @brief Condition is unlikely to be taken (instruction). + //! Condition is unlikely to be taken (instruction). kInstOptionNotTaken = 0x08 }; @@ -120,21 +120,21 @@ ASMJIT_ENUM(kInstOptions) { // [asmjit::kSize] // ============================================================================ -//! @brief Common size of registers and pointers. +//! Common size of registers and pointers. ASMJIT_ENUM(kSize) { - //! @brief 1 byte size. + //! 1 byte size (BYTE). kSizeByte = 1, - //! @brief 2 bytes size. + //! 2 bytes size (WORD). kSizeWord = 2, - //! @brief 4 bytes size. + //! 4 bytes size (DWORD). kSizeDWord = 4, - //! @brief 8 bytes size. + //! 8 bytes size (QWORD). kSizeQWord = 8, - //! @brief 10 bytes size. + //! 10 bytes size (TWORD). kSizeTWord = 10, - //! @brief 16 bytes size. + //! 16 bytes size (OWORD / DQWORD). kSizeOWord = 16, - //! @brief 32 bytes size. + //! 32 bytes size (YWORD / QQWORD). kSizeYWord = 32 }; @@ -142,29 +142,27 @@ ASMJIT_ENUM(kSize) { // [asmjit::kMemType] // ============================================================================ -//! @brief Type of memory operand. +//! Type of memory operand. ASMJIT_ENUM(kMemType) { - //! @brief Memory operand is a combination of base register, optional index - //! register and optional displacement. + //! Memory operand is a combination of base register and optional index register + //! and displacement. //! - //! @note The @ref Assembler interprets @ref kMemTypeBaseIndex and @ref - //! kMemTypeStackIndex types the same way, but @ref Compiler interprets - //! @ref kMemTypeBaseIndex as [base + index] and @ref kMemTypeStackIndex as - //! [stack(base) + index]. + //! The `BaseAssembler` interprets `kMemTypeBaseIndex` and `kMemTypeStackIndex` + //! types the same way, but `Compiler` interprets `kMemTypeBaseIndex` as + //! `[base + index]` and `kMemTypeStackIndex` as `[stack(base) + index]`. kMemTypeBaseIndex = 0, - //! @brief Memory operand is a combination of variable's memory location, + //! Memory operand is a combination of variable's memory location, //! optional index register and displacement. //! - //! @note The @ref Assembler interprets @ref kMemTypeBaseIndex and @ref - //! kMemTypeStackIndex types in the same way, but @ref Compiler interprets - //! @ref kMemTypeBaseIndex as [base + index] and @ref kMemTypeStackIndex as - //! [stack(base) + index]. + //! The `BaseAssembler` interprets `kMemTypeBaseIndex` and `kMemTypeStackIndex` + //! types in the same way, but `BaseCompiler` interprets `kMemTypeBaseIndex` as + //! `[base + index]` and `kMemTypeStackIndex` as `[stack(base) + index]`. kMemTypeStackIndex = 1, - //! @brief Memory operand refers to the memory location specified by a label. + //! Memory operand refers to the memory location specified by a label. kMemTypeLabel = 2, - //! @brief Memory operand is an absolute memory location. + //! Memory operand is an absolute memory location. //! //! Supported mostly by x86, truncated to a 32-bit value when running in //! 64-bit mode (x64). @@ -176,34 +174,34 @@ ASMJIT_ENUM(kMemType) { // ============================================================================ ASMJIT_ENUM(kVarType) { - //! @brief Variable is signed 8-bit integer. + //! Variable is signed 8-bit integer. kVarTypeInt8 = 0, - //! @brief Variable is unsigned 8-bit integer. + //! Variable is unsigned 8-bit integer. kVarTypeUInt8 = 1, - //! @brief Variable is signed 16-bit integer. + //! Variable is signed 16-bit integer. kVarTypeInt16 = 2, - //! @brief Variable is unsigned 16-bit integer. + //! Variable is unsigned 16-bit integer. kVarTypeUInt16 = 3, - //! @brief Variable is signed 32-bit integer. + //! Variable is signed 32-bit integer. kVarTypeInt32 = 4, - //! @brief Variable is unsigned 32-bit integer. + //! Variable is unsigned 32-bit integer. kVarTypeUInt32 = 5, - //! @brief Variable is signed 64-bit integer. + //! Variable is signed 64-bit integer. kVarTypeInt64 = 6, - //! @brief Variable is unsigned 64-bit integer. + //! Variable is unsigned 64-bit integer. kVarTypeUInt64 = 7, - //! @brief Variable is target @c intptr_t (not compatible with host @c intptr_t). + //! Variable is target `intptr_t`, not compatible with host `intptr_t`. kVarTypeIntPtr = 8, - //! @brief Variable is target @c uintptr_t (not compatible with host @c uintptr_t). + //! Variable is target `uintptr_t`, not compatible with host `uintptr_t`. kVarTypeUIntPtr = 9, - //! @brief Variable is 32-bit floating point (single precision). + //! Variable is 32-bit floating point (single precision). kVarTypeFp32 = 10, - //! @brief Variable is 64-bit floating point (double precision). + //! Variable is 64-bit floating point (double precision). kVarTypeFp64 = 11, - //! @brief Invalid variable type. + //! Invalid variable type. kVarTypeInvalid = 0xFF, //! @internal @@ -232,17 +230,17 @@ ASMJIT_ENUM(kRelocMode) { // [asmjit::Ptr] // ============================================================================ -//! @brief 64-bit signed pointer, compatible with JIT and non-JIT generators. +//! 64-bit signed pointer, compatible with JIT and non-JIT generators. typedef int64_t SignedPtr; -//! @brief 64-bit unsigned pointer, compatible with JIT and non-JIT generators. +//! 64-bit unsigned pointer, compatible with JIT and non-JIT generators. typedef uint64_t Ptr; // ============================================================================ // [asmjit::Operand] // ============================================================================ -//! @brief Operand can contain register, memory location, immediate, or label. +//! Operand can contain register, memory location, immediate, or label. struct Operand { // -------------------------------------------------------------------------- // [Structs] @@ -250,145 +248,144 @@ struct Operand { //! @internal //! - //! @brief Base operand data. + //! Base operand data. struct BaseOp { - //! @brief Type of operand, see @c kOperandType. + //! Type of operand, see `kOperandType`. uint8_t op; - //! @brief Size of operand (register, address, immediate, or variable). + //! Size of operand (register, address, immediate, or variable). uint8_t size; - //! @brief Flags, each operand uses this byte for something else. + //! Flags, each operand uses this byte for something else. uint8_t reserved0; - //! @brief Reserved (not used). + //! Reserved (not used). uint8_t reserved1; - //! @brief Operand id (private variable for @ref BaseAssembler and - //! @ref BaseCompiler classes). + //! Operand id, identifier used by `BaseAssembler` and `BaseCompiler`. //! - //! @note Uninitialized operand has always set id to @ref kInvalidValue. + //! @note Uninitialized operand has always set id to `kInvalidValue`. uint32_t id; }; //! @internal //! - //! @brief Register or Variable operand data. + //! Register or Variable operand data. struct VRegOp { - //! @brief Type of operand, @c kOperandTypeReg. + //! Type of operand, `kOperandTypeReg`. uint8_t op; - //! @brief Size of register or variable. + //! Size of register or variable. uint8_t size; union { - //! @brief Register code = (type << 8) | index. + //! Register code = (type << 8) | index. uint16_t code; - //! @brief Register type and index access. + //! Register type and index access. struct { #if defined(ASMJIT_HOST_LE) - //! @brief Register index. + //! Register index. uint8_t index; - //! @brief Register type. + //! Register type. uint8_t type; #else - //! @brief Register type. + //! Register type. uint8_t type; - //! @brief Register index. + //! Register index. uint8_t index; #endif // ASMJIT_HOST }; }; - //! @brief Variable id (used by @ref BaseCompiler to identify variables). + //! Variable id, used by `BaseCompiler` to identify variables. uint32_t id; - //! @brief Variable type. + //! Variable type. uint32_t vType; //! @internal //! - //! @brief Unused. + //! Unused. uint32_t vUnused; }; //! @internal //! - //! @brief Memory or Variable operand data. + //! Memory or Variable operand data. struct VMemOp { - //! @brief Type of operand, @c kOperandTypeMem. + //! Type of operand, `kOperandTypeMem`. uint8_t op; - //! @brief Size of the pointer in bytes. + //! Size of the pointer in bytes. uint8_t size; - //! @brief Type of the memory operand, see @ref kMemType. + //! Type of the memory operand, see `kMemType`. uint8_t type; //! X86/X64 layout: - //! - segment [3 bits], see @ref kSeg. + //! - segment [3 bits], see `x86x64::kSeg`. //! - shift [2 bits], index register shift (0 to 3). uint8_t flags; - //! @brief Base register, variable or label id. + //! Base register, variable or label id. uint32_t base; - //! @brief Index register or variable. + //! Index register or variable. uint32_t index; - //! @brief 32-bit displacement or absolute address. + //! 32-bit displacement or absolute address. int32_t displacement; }; //! @internal //! - //! @brief Immediate operand data. + //! Immediate operand data. struct ImmOp { - //! @brief Type of operand, @ref kOperandTypeImm. + //! Type of operand, `kOperandTypeImm`. uint8_t op; - //! @brief Size of immediate (or 0 to autodetect). + //! Size of immediate (or 0 to autodetect). uint8_t size; - //! @brief Reserved (not used). + //! Reserved (not used). uint8_t reserved0; - //! @brief Reserved (not used). + //! Reserved (not used). uint8_t reserved1; - //! @brief Operand id (@ref kInvalidValue). + //! Operand id, always set to `kInvalidValue`. uint32_t id; union { - //! @brief 8x signed 8-bit immediate values. + //! 8x signed 8-bit immediate values. int8_t _i8[8]; - //! @brief 8x unsigned 8-bit immediate values. + //! 8x unsigned 8-bit immediate values. uint8_t _u8[8]; - //! @brief 4x signed 16-bit immediate values. + //! 4x signed 16-bit immediate values. int16_t _i16[4]; - //! @brief 4x unsigned 16-bit immediate values. + //! 4x unsigned 16-bit immediate values. uint16_t _u16[4]; - //! @brief 2x signed 32-bit immediate values. + //! 2x signed 32-bit immediate values. int32_t _i32[2]; - //! @brief 2x unsigned 32-bit immediate values. + //! 2x unsigned 32-bit immediate values. uint32_t _u32[2]; - //! @brief 1x signed 64-bit immediate value. + //! 1x signed 64-bit immediate value. int64_t _i64[1]; - //! @brief 1x unsigned 64-bit immediate value. + //! 1x unsigned 64-bit immediate value. uint64_t _u64[1]; - //! @brief 2x SP-FP values. + //! 2x SP-FP values. float _f32[2]; - //! @brief 1x DP-FP value. + //! 1x DP-FP value. double _f64[1]; } value; }; //! @internal //! - //! @brief Label operand data. + //! Label operand data. struct LabelOp { - //! @brief Type of operand, @c kOperandTypeLabel. + //! Type of operand, `kOperandTypeLabel`. uint8_t op; - //! @brief Reserved (not used). + //! Reserved (not used). uint8_t size; - //! @brief Reserved (not used). + //! Reserved (not used). uint8_t reserved0; - //! @brief Reserved (not used). + //! Reserved (not used). uint8_t reserved1; - //! @brief Operand id. + //! Operand id. uint32_t id; }; @@ -396,13 +393,13 @@ struct Operand { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create an uninitialized operand. + //! Create an uninitialized operand. ASMJIT_INLINE Operand() { _init_packed_op_sz_b0_b1_id(kOperandTypeNone, 0, 0, 0, kInvalidValue); _init_packed_d2_d3(0, 0); } - //! @brief Create a reference to @a other operand. + //! Create a reference to `other` operand. ASMJIT_INLINE Operand(const Operand& other) { _init(other); } @@ -413,7 +410,7 @@ struct Operand { // [Operand] // -------------------------------------------------------------------------- - //! @brief Clone Operand. + //! Clone `Operand`. ASMJIT_INLINE Operand clone() const { return Operand(*this); } @@ -424,7 +421,7 @@ struct Operand { //! @internal //! - //! @brief Initialize operand to @a other (used by constructors). + //! Initialize operand to `other` (used by constructors). ASMJIT_INLINE void _init(const Operand& other) { ::memcpy(this, &other, sizeof(Operand)); } @@ -453,7 +450,7 @@ struct Operand { //! @internal //! - //! @brief Initialize operand to @a other (used by assign operators). + //! Initialize operand to `other` (used by assign operators). ASMJIT_INLINE void _copy(const Operand& other) { ::memcpy(this, &other, sizeof(Operand)); } @@ -472,44 +469,44 @@ struct Operand { // [Type] // -------------------------------------------------------------------------- - //! @brief Get type of the operand, see @ref kOperandType. + //! Get type of the operand, see `kOperandType`. ASMJIT_INLINE uint32_t getOp() const { return _base.op; } - //! @brief Get whether the operand is none (@ref kOperandTypeNone). + //! Get whether the operand is none - `kOperandTypeNone`. ASMJIT_INLINE bool isNone() const { return (_base.op == kOperandTypeNone); } - //! @brief Get whether the operand is any register (@ref kOperandTypeReg). + //! Get whether the operand is a register - `kOperandTypeReg`. ASMJIT_INLINE bool isReg() const { return (_base.op == kOperandTypeReg); } - //! @brief Get whether the operand is variable (@ref kOperandTypeVar). + //! Get whether the operand is a variable - `kOperandTypeVar`. ASMJIT_INLINE bool isVar() const { return (_base.op == kOperandTypeVar); } - //! @brief Get whether the operand is memory address (@ref kOperandTypeMem). + //! Get whether the operand is a memory address - `kOperandTypeMem`. ASMJIT_INLINE bool isMem() const { return (_base.op == kOperandTypeMem); } - //! @brief Get whether the operand is an immediate value (@ref kOperandTypeImm). + //! Get whether the operand is an immediate value - `kOperandTypeImm`. ASMJIT_INLINE bool isImm() const { return (_base.op == kOperandTypeImm); } - //! @brief Get whether the operand is label (@ref kOperandTypeLabel). + //! Get whether the operand is a label - `kOperandTypeLabel`. ASMJIT_INLINE bool isLabel() const { return (_base.op == kOperandTypeLabel); } // -------------------------------------------------------------------------- // [Type - Combined] // -------------------------------------------------------------------------- - //! @brief Get whether the operand is register of @a type. + //! Get whether the operand is register of `type`. ASMJIT_INLINE bool isRegType(uint32_t type) const { return (_packed[0].u32[0] & IntUtil::pack32_2x8_1x16(0xFF, 0, 0xFF00)) == IntUtil::pack32_2x8_1x16(kOperandTypeReg, 0, (type << 8)); } - //! @brief Get whether the operand is register and of @a type and @a index. + //! Get whether the operand is register and of `type` and `index`. ASMJIT_INLINE bool isRegCode(uint32_t type, uint32_t index) const { return (_packed[0].u32[0] & IntUtil::pack32_2x8_1x16(0xFF, 0, 0xFFFF)) == IntUtil::pack32_2x8_1x16(kOperandTypeReg, 0, (type << 8) + index); } - //! @brief Get whether the operand is a register or memory. + //! Get whether the operand is a register or memory. ASMJIT_INLINE bool isRegOrMem() const { ASMJIT_ASSERT(kOperandTypeReg == 1); ASMJIT_ASSERT(kOperandTypeMem == 3); return (static_cast(_base.op) | 0x2U) == 0x3U; } - //! @brief Get whether the operand is variable or memory. + //! Get whether the operand is variable or memory. ASMJIT_INLINE bool isVarOrMem() const { ASMJIT_ASSERT(kOperandTypeVar == 2); ASMJIT_ASSERT(kOperandTypeMem == 3); @@ -520,18 +517,19 @@ struct Operand { // [Size] // -------------------------------------------------------------------------- - //! @brief Get size of the operand in bytes. + //! Get size of the operand in bytes. ASMJIT_INLINE uint32_t getSize() const { return _base.size; } // -------------------------------------------------------------------------- // [Id] // -------------------------------------------------------------------------- - //! @brief Get operand id (Operand id's are used internally by - //! @ref BaseAssembler and @ref BaseCompiler classes). + //! Get operand id. + //! + //! Operand id's are used internally by `BaseAssembler` and `BaseCompiler`. //! - //! @note There is no way how to change or remove operand id. If you don't - //! need the operand just assign different operand to this one. + //! There is no way to change or remove operand id. Unneeded operands can be + //! simply reassigned by `operator=`. ASMJIT_INLINE uint32_t getId() const { return _base.id; } // -------------------------------------------------------------------------- @@ -539,18 +537,18 @@ struct Operand { // -------------------------------------------------------------------------- union { - //! @brief Base data. + //! Base data. BaseOp _base; - //! @brief Register or variable data. + //! Register or variable data. VRegOp _vreg; - //! @brief Memory data. + //! Memory data. VMemOp _vmem; - //! @brief Immediate data. + //! Immediate data. ImmOp _imm; - //! @brief Label data. + //! Label data. LabelOp _label; - //! @brief Packed operand as two 64-bit integers. + //! Packed operand as two 64-bit integers. UInt64 _packed[2]; }; }; @@ -561,35 +559,35 @@ ASMJIT_VAR const Operand noOperand; // [asmjit::OperandUtil] // ============================================================================ -//! @brief Operand utilities. +//! Operand utilities. struct OperandUtil { - //! @brief Make variable id. + //! Make variable id. static ASMJIT_INLINE uint32_t makeVarId(uint32_t id) { return id | kOperandIdVar; } - //! @brief Make label id. + //! Make label id. static ASMJIT_INLINE uint32_t makeLabelId(uint32_t id) { return id; } - //! @brief Strip variable id bit so it becomes a pure index to VarData[] array. + //! Strip variable id bit so it becomes a pure index to `VarData[]` array. static ASMJIT_INLINE uint32_t stripVarId(uint32_t id) { return id & 0x7FFFFFFFU; } - //! @brief Get whether the id refers to @ref BaseVar. + //! Get whether the id refers to `BaseVar`. //! - //! @note The function will never return @c true if the id is @c kInvalidValue. + //! @note The function will never return `true` if the id is `kInvalidValue`. //! The trick is to compare a given id to -1 (kInvalidValue) so we check both //! using only one comparison. static ASMJIT_INLINE bool isVarId(uint32_t id) { return static_cast(id) < -1; } - //! @brief Get whether the id refers to @ref Label. + //! Get whether the id refers to `Label`. //! - //! @note The function will never return @c true if the id is @c kInvalidValue. + //! @note The function will never return `true` if the id is `kInvalidValue`. static ASMJIT_INLINE bool isLabelId(uint32_t id) { return static_cast(id) >= 0; } @@ -599,23 +597,23 @@ struct OperandUtil { // [asmjit::BaseReg] // ============================================================================ -//! @brief Base class for all register operands. +//! Base class for all register operands. struct BaseReg : public Operand { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a dummy base register. + //! Create a dummy base register. ASMJIT_INLINE BaseReg() : Operand(NoInit) { _init_packed_op_sz_w0_id(kOperandTypeReg, 0, (kInvalidReg << 8) + kInvalidReg, kInvalidValue); } - //! @brief Create a new base register. + //! Create a new base register. ASMJIT_INLINE BaseReg(uint32_t type, uint32_t index, uint32_t size) : Operand(NoInit) { _init_packed_op_sz_w0_id(kOperandTypeReg, size, (type << 8) + index, kInvalidValue); } - //! @brief Create a new reference to @a other. + //! Create a new reference to `other`. ASMJIT_INLINE BaseReg(const BaseReg& other) : Operand(other) {} explicit ASMJIT_INLINE BaseReg(const _NoInit&) : Operand(NoInit) {} @@ -624,37 +622,37 @@ struct BaseReg : public Operand { // [BaseReg Specific] // -------------------------------------------------------------------------- - //! @brief Clone BaseReg operand. + //! Clone `BaseReg` operand. ASMJIT_INLINE BaseReg clone() const { return BaseReg(*this); } - //! @brief Get whether register code is equal to @a type. + //! Get whether register code is equal to `type`. ASMJIT_INLINE bool isRegType(uint32_t type) const { return _vreg.type == type; } - //! @brief Get whether register code is equal to @a type. + //! Get whether register code is equal to `type`. ASMJIT_INLINE bool isRegCode(uint32_t code) const { return _vreg.code == code; } - //! @brief Get whether register code is equal to @a type. + //! Get whether register code is equal to `type`. ASMJIT_INLINE bool isRegCode(uint32_t type, uint32_t index) const { return _vreg.code == (type << 8) + index; } - //! @brief Get register code that equals to '(type << 8) + index'. + //! Get register code that equals to '(type << 8) + index'. ASMJIT_INLINE uint32_t getRegCode() const { return _vreg.code; } - //! @brief Get register type. + //! Get register type. ASMJIT_INLINE uint32_t getRegType() const { return _vreg.type; } - //! @brief Get register index. + //! Get register index. ASMJIT_INLINE uint32_t getRegIndex() const { return _vreg.index; } @@ -664,32 +662,32 @@ struct BaseReg : public Operand { return _Type_(*this); \ } \ \ - /*! @brief Set register @a size. */ \ + /*! Set register `size`. */ \ ASMJIT_INLINE _Type_& setSize(uint32_t size) { \ _vreg.size = static_cast(size); \ return *this; \ } \ \ - /*! @brief Set register @a code. */ \ + /*! Set register `code`. */ \ ASMJIT_INLINE _Type_& setCode(uint32_t code) { \ _vreg.code = static_cast(code); \ return *this; \ } \ \ - /*! @brief Set register @a type and @a index. */ \ + /*! Set register `type` and `index`. */ \ ASMJIT_INLINE _Type_& setCode(uint32_t type, uint32_t index) { \ _vreg.type = static_cast(type); \ _vreg.index = static_cast(index); \ return *this; \ } \ \ - /*! @brief Set register @a type. */ \ + /*! Set register `type`. */ \ ASMJIT_INLINE _Type_& setType(uint32_t type) { \ _vreg.type = static_cast(type); \ return *this; \ } \ \ - /*! @brief Set register @a index. */ \ + /*! Set register `index`. */ \ ASMJIT_INLINE _Type_& setIndex(uint32_t index) { \ _vreg.index = static_cast(index); \ return *this; \ @@ -705,7 +703,7 @@ struct BaseReg : public Operand { // [asmjit::BaseMem] // ============================================================================ -//! @brief Base class for all memory operands. +//! Base class for all memory operands. struct BaseMem : public Operand { // -------------------------------------------------------------------------- // [Construction / Destruction] @@ -722,39 +720,40 @@ struct BaseMem : public Operand { // [BaseMem Specific] // -------------------------------------------------------------------------- - //! @brief Clone BaseMem operand. + //! Clone `BaseMem` operand. ASMJIT_INLINE BaseMem clone() const { return BaseMem(*this); } - //! @brief Reset BaseMem operand. + //! Reset `BaseMem` operand. ASMJIT_INLINE void reset() { _init_packed_op_sz_b0_b1_id(kOperandTypeMem, 0, kMemTypeBaseIndex, 0, kInvalidValue); _init_packed_d2_d3(kInvalidValue, 0); } - //! @brief Get the type of the memory operand, see @c kMemType. + //! Get the type of the memory operand, see `kMemType`. ASMJIT_INLINE uint32_t getMemType() const { return _vmem.type; } - //! @brief Get whether the type of the memory operand is either @ref - //! kMemTypeBaseIndex or @ref kMemTypeStackIndex. + //! Get whether the type of the memory operand is either `kMemTypeBaseIndex` + //! or `kMemTypeStackIndex`. ASMJIT_INLINE bool isBaseIndexType() const { return _vmem.type <= kMemTypeStackIndex; } - //! @brief Get whether the memory operand has base register. + //! Get whether the memory operand has base register. ASMJIT_INLINE bool hasBase() const { return _vmem.base != kInvalidValue; } - //! @brief Get memory operand base id, or @c kInvalidValue. + //! Get memory operand base id, or `kInvalidValue`. ASMJIT_INLINE uint32_t getBase() const { return _vmem.base; } - //! @brief Set memory operand size. + //! Set memory operand size. ASMJIT_INLINE BaseMem& setSize(uint32_t size) { _vmem.size = static_cast(size); return *this; } - //! @brief Get memory operand relative displacement. - ASMJIT_INLINE int32_t getDisplacement() const - { return _vmem.displacement; } + //! Get memory operand relative displacement. + ASMJIT_INLINE int32_t getDisplacement() const { + return _vmem.displacement; + } - //! @brief Set memory operand relative displacement. + //! Set memory operand relative displacement. ASMJIT_INLINE BaseMem& setDisplacement(int32_t disp) { _vmem.displacement = disp; return *this; @@ -780,7 +779,7 @@ struct BaseMem : public Operand { // [asmjit::BaseVar] // ============================================================================ -//! @brief Base class for all variables. +//! Base class for all variables. struct BaseVar : public Operand { // -------------------------------------------------------------------------- // [Construction / Destruction] @@ -799,7 +798,7 @@ struct BaseVar : public Operand { // [BaseVar Specific] // -------------------------------------------------------------------------- - //! @brief Clone BaseVar operand. + //! Clone `BaseVar` operand. ASMJIT_INLINE BaseVar clone() const { return BaseVar(*this); } @@ -822,32 +821,32 @@ struct BaseVar : public Operand { // [asmjit::Imm] // ============================================================================ -//! @brief Immediate operand. +//! Immediate operand. //! -//! Immediate operand is usually part of instruction itself (it's inlined after -//! or before instruction opcode). Immediates can be only signed or unsigned +//! Immediate operand is usually part of instruction itself. It's inlined after +//! or before the instruction opcode. Immediates can be only signed or unsigned //! integers. //! -//! To create immediate operand, use @c imm() and @c imm_u() constructors or -//! constructors provided by @c Immediate class itself. +//! To create immediate operand use `imm()` or `imm_u()` non-members or `Imm` +//! constructors. struct Imm : public Operand { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new immediate value (initial value is 0). + //! Create a new immediate value (initial value is 0). Imm() : Operand(NoInit) { _init_packed_op_sz_b0_b1_id(kOperandTypeImm, 0, 0, 0, kInvalidValue); _imm.value._i64[0] = 0; } - //! @brief Create a new signed immediate value, assigning the value to @a val. + //! Create a new signed immediate value, assigning the value to `val`. explicit Imm(int64_t val) : Operand(NoInit) { _init_packed_op_sz_b0_b1_id(kOperandTypeImm, 0, 0, 0, kInvalidValue); _imm.value._i64[0] = val; } - //! @brief Create a new immediate value from @a other. + //! Create a new immediate value from `other`. ASMJIT_INLINE Imm(const Imm& other) : Operand(other) {} explicit ASMJIT_INLINE Imm(const _NoInit&) : Operand(NoInit) {} @@ -856,44 +855,44 @@ struct Imm : public Operand { // [Immediate Specific] // -------------------------------------------------------------------------- - //! @brief Clone Imm operand. + //! Clone `Imm` operand. ASMJIT_INLINE Imm clone() const { return Imm(*this); } - //! @brief Get whether the immediate can be casted to 8-bit signed integer. + //! Get whether the immediate can be casted to 8-bit signed integer. ASMJIT_INLINE bool isInt8() const { return IntUtil::isInt8(_imm.value._i64[0]); } - //! @brief Get whether the immediate can be casted to 8-bit unsigned integer. + //! Get whether the immediate can be casted to 8-bit unsigned integer. ASMJIT_INLINE bool isUInt8() const { return IntUtil::isUInt8(_imm.value._i64[0]); } - //! @brief Get whether the immediate can be casted to 16-bit signed integer. + //! Get whether the immediate can be casted to 16-bit signed integer. ASMJIT_INLINE bool isInt16() const { return IntUtil::isInt16(_imm.value._i64[0]); } - //! @brief Get whether the immediate can be casted to 16-bit unsigned integer. + //! Get whether the immediate can be casted to 16-bit unsigned integer. ASMJIT_INLINE bool isUInt16() const { return IntUtil::isUInt16(_imm.value._i64[0]); } - //! @brief Get whether the immediate can be casted to 32-bit signed integer. + //! Get whether the immediate can be casted to 32-bit signed integer. ASMJIT_INLINE bool isInt32() const { return IntUtil::isInt32(_imm.value._i64[0]); } - //! @brief Get whether the immediate can be casted to 32-bit unsigned integer. + //! Get whether the immediate can be casted to 32-bit unsigned integer. ASMJIT_INLINE bool isUInt32() const { return IntUtil::isUInt32(_imm.value._i64[0]); } - //! @brief Get immediate value as 8-bit signed integer. + //! Get immediate value as 8-bit signed integer. ASMJIT_INLINE int8_t getInt8() const { return _imm.value._i8[_ASMJIT_HOST_INDEX(8, 0)]; } - //! @brief Get immediate value as 8-bit unsigned integer. + //! Get immediate value as 8-bit unsigned integer. ASMJIT_INLINE uint8_t getUInt8() const { return _imm.value._u8[_ASMJIT_HOST_INDEX(8, 0)]; } - //! @brief Get immediate value as 16-bit signed integer. + //! Get immediate value as 16-bit signed integer. ASMJIT_INLINE int16_t getInt16() const { return _imm.value._i16[_ASMJIT_HOST_INDEX(4, 0)]; } - //! @brief Get immediate value as 16-bit unsigned integer. + //! Get immediate value as 16-bit unsigned integer. ASMJIT_INLINE uint16_t getUInt16() const { return _imm.value._u16[_ASMJIT_HOST_INDEX(4, 0)]; } - //! @brief Get immediate value as 32-bit signed integer. + //! Get immediate value as 32-bit signed integer. ASMJIT_INLINE int32_t getInt32() const { return _imm.value._i32[_ASMJIT_HOST_INDEX(2, 0)]; } - //! @brief Get immediate value as 32-bit unsigned integer. + //! Get immediate value as 32-bit unsigned integer. ASMJIT_INLINE uint32_t getUInt32() const { return _imm.value._u32[_ASMJIT_HOST_INDEX(2, 0)]; } - //! @brief Get immediate value as 64-bit signed integer. + //! Get immediate value as 64-bit signed integer. ASMJIT_INLINE int64_t getInt64() const { return _imm.value._i64[0]; } - //! @brief Get immediate value as 64-bit unsigned integer. + //! Get immediate value as 64-bit unsigned integer. ASMJIT_INLINE uint64_t getUInt64() const { return _imm.value._u64[0]; } - //! @brief Get immediate value as intptr_t. + //! Get immediate value as `intptr_t`. ASMJIT_INLINE intptr_t getIntPtr() const { if (sizeof(intptr_t) == sizeof(int64_t)) return static_cast(getInt64()); @@ -901,7 +900,7 @@ struct Imm : public Operand { return static_cast(getInt32()); } - //! @brief Get immediate value as uintptr_t. + //! Get immediate value as `uintptr_t`. ASMJIT_INLINE uintptr_t getUIntPtr() const { if (sizeof(uintptr_t) == sizeof(uint64_t)) return static_cast(getUInt64()); @@ -909,16 +908,16 @@ struct Imm : public Operand { return static_cast(getUInt32()); } - //! @brief Get Lo 32-bit signed integer. + //! Get low 32-bit signed integer. ASMJIT_INLINE int32_t getInt32Lo() const { return _imm.value._i32[_ASMJIT_HOST_INDEX(2, 0)]; } - //! @brief Get Lo 32-bit signed integer. + //! Get low 32-bit signed integer. ASMJIT_INLINE uint32_t getUInt32Lo() const { return _imm.value._u32[_ASMJIT_HOST_INDEX(2, 0)]; } - //! @brief Get Hi 32-bit signed integer. + //! Get high 32-bit signed integer. ASMJIT_INLINE int32_t getInt32Hi() const { return _imm.value._i32[_ASMJIT_HOST_INDEX(2, 1)]; } - //! @brief Get Hi 32-bit signed integer. + //! Get high 32-bit signed integer. ASMJIT_INLINE uint32_t getUInt32Hi() const { return _imm.value._u32[_ASMJIT_HOST_INDEX(2, 1)]; } - //! @brief Set immediate value to 8-bit signed integer @a val. + //! Set immediate value to 8-bit signed integer `val`. ASMJIT_INLINE Imm& setInt8(int8_t val) { if (kArchHost64Bit) { _imm.value._i64[0] = static_cast(val); @@ -931,7 +930,7 @@ struct Imm : public Operand { return *this; } - //! @brief Set immediate value to 8-bit unsigned integer @a val. + //! Set immediate value to 8-bit unsigned integer `val`. ASMJIT_INLINE Imm& setUInt8(uint8_t val) { if (kArchHost64Bit) { _imm.value._u64[0] = static_cast(val); @@ -943,7 +942,7 @@ struct Imm : public Operand { return *this; } - //! @brief Set immediate value to 16-bit signed integer @a val. + //! Set immediate value to 16-bit signed integer `val`. ASMJIT_INLINE Imm& setInt16(int16_t val) { if (kArchHost64Bit) { _imm.value._i64[0] = static_cast(val); @@ -956,7 +955,7 @@ struct Imm : public Operand { return *this; } - //! @brief Set immediate value to 16-bit unsigned integer @a val. + //! Set immediate value to 16-bit unsigned integer `val`. ASMJIT_INLINE Imm& setUInt16(uint16_t val) { if (kArchHost64Bit) { _imm.value._u64[0] = static_cast(val); @@ -968,7 +967,7 @@ struct Imm : public Operand { return *this; } - //! @brief Set immediate value to 32-bit signed integer @a val. + //! Set immediate value to 32-bit signed integer `val`. ASMJIT_INLINE Imm& setInt32(int32_t val) { if (kArchHost64Bit) { _imm.value._i64[0] = static_cast(val); @@ -980,7 +979,7 @@ struct Imm : public Operand { return *this; } - //! @brief Set immediate value to 32-bit unsigned integer @a val. + //! Set immediate value to 32-bit unsigned integer `val`. ASMJIT_INLINE Imm& setUInt32(uint32_t val) { if (kArchHost64Bit) { _imm.value._u64[0] = static_cast(val); @@ -992,31 +991,31 @@ struct Imm : public Operand { return *this; } - //! @brief Set immediate value to 64-bit signed integer @a val. + //! Set immediate value to 64-bit signed integer `val`. ASMJIT_INLINE Imm& setInt64(int64_t val) { _imm.value._i64[0] = val; return *this; } - //! @brief Set immediate value to 64-bit unsigned integer @a val. + //! Set immediate value to 64-bit unsigned integer `val`. ASMJIT_INLINE Imm& setUInt64(uint64_t val) { _imm.value._u64[0] = val; return *this; } - //! @brief Set immediate value to intptr_t @a val. + //! Set immediate value to intptr_t `val`. ASMJIT_INLINE Imm& setIntPtr(intptr_t val) { _imm.value._i64[0] = static_cast(val); return *this; } - //! @brief Set immediate value to uintptr_t @a val. + //! Set immediate value to uintptr_t `val`. ASMJIT_INLINE Imm& setUIntPtr(uintptr_t val) { _imm.value._u64[0] = static_cast(val); return *this; } - //! @brief Set immediate value as unsigned type to @a val. + //! Set immediate value as unsigned type to `val`. ASMJIT_INLINE Imm& setPtr(void* p) { return setIntPtr((intptr_t)p); } // -------------------------------------------------------------------------- @@ -1069,55 +1068,64 @@ struct Imm : public Operand { // [Operator Overload] // -------------------------------------------------------------------------- - //! @brief Assign @a other to the immediate operand. - ASMJIT_INLINE Imm& operator=(const Imm& other) { _copy(other); return *this; } + //! Assign `other` to the immediate operand. + ASMJIT_INLINE Imm& operator=(const Imm& other) { + _copy(other); + return *this; + } }; -//! @brief Create signed immediate value operand. -static ASMJIT_INLINE Imm imm(int64_t val) { return Imm(val); } -//! @brief Create unsigned immediate value operand. -static ASMJIT_INLINE Imm imm_u(uint64_t val) { return Imm(static_cast(val)); } -//! @brief Create void* pointer immediate value operand. -static ASMJIT_INLINE Imm imm_ptr(void* p) { return Imm(static_cast((intptr_t)p)); } +//! Create signed immediate value operand. +static ASMJIT_INLINE Imm imm(int64_t val) { + return Imm(val); +} + +//! Create unsigned immediate value operand. +static ASMJIT_INLINE Imm imm_u(uint64_t val) { + return Imm(static_cast(val)); +} + +//! Create void* pointer immediate value operand. +static ASMJIT_INLINE Imm imm_ptr(void* p) { + return Imm(static_cast((intptr_t)p)); +} // ============================================================================ // [asmjit::Label] // ============================================================================ -//! @brief Label (jump target or data location). +//! Label (jump target or data location). //! -//! Label represents locations typically used as jump targets, but may be also -//! used as position where are stored constants or static variables. If you -//! want to use @c Label you need first to associate it with @ref BaseAssembler -//! or @ref BaseCompiler instance. To create new label use @ref -//! BaseAssembler::newLabel() or @ref BaseCompiler::newLabel(). +//! Label represents a location in code typically used as jump targets, but may +//! be also reference data or static variables. Label has to be explicitly +//! created by a code-generator by calling `CodeGen::newLabel()` where `CodeGen` +//! is your code generator, which derives from `BaseAssembler` or `BaseCompiler`. //! //! Example of using labels: //! -//! @code +//! ~~~ //! // Create Assembler/Compiler. -//! Assembler a; +//! host::Assembler a; //! //! // Create Label instance. //! Label L_1(a); //! //! // ... your code ... //! -//! // Using label, see @ref asmjit::BaseAssembler or @ref asmjit::BaseCompiler. +//! // Using label. //! a.jump(L_1); //! //! // ... your code ... //! -//! // Bind label to current position, see @ref asmjit::BaseAssembler::bind() -//! // or @ref asmjit::BaseCompiler::bind(). +//! // Bind label to the current position, see `CodeGen::bind()`. //! a.bind(L_1); -//! @endcode +//! ~~~ struct Label : public Operand { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new, unassociated label. + //! Create new, unassociated label. ASMJIT_INLINE Label() : Operand(NoInit) { reset(); } @@ -1127,12 +1135,12 @@ struct Label : public Operand { _init_packed_d2_d3(0, 0); } - //! @brief Create new initialized label. + //! Create new initialized label. explicit ASMJIT_INLINE Label(BaseAssembler& a); - //! @brief Create new initialized label. + //! Create new initialized label. explicit ASMJIT_INLINE Label(BaseCompiler& c); - //! @brief Create reference to another label. + //! Create reference to another label. ASMJIT_INLINE Label(const Label& other) : Operand(other) {} explicit ASMJIT_INLINE Label(const _NoInit&) : Operand(NoInit) {} diff --git a/src/asmjit/base/error.cpp b/src/asmjit/base/error.cpp index 99cdf0d..83d6108 100644 --- a/src/asmjit/base/error.cpp +++ b/src/asmjit/base/error.cpp @@ -27,7 +27,10 @@ ErrorHandler::~ErrorHandler() {} // [asmjit::ErrorHandler - Interface] // ============================================================================ -ErrorHandler* ErrorHandler::addRef() const { return const_cast(this); } +ErrorHandler* ErrorHandler::addRef() const { + return const_cast(this); +} + void ErrorHandler::release() {} // ============================================================================ diff --git a/src/asmjit/base/error.h b/src/asmjit/base/error.h index 9a30808..ad4a493 100644 --- a/src/asmjit/base/error.h +++ b/src/asmjit/base/error.h @@ -13,80 +13,82 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_logging_and_errors //! @{ // ============================================================================ // [asmjit::kError] // ============================================================================ -//! @brief AsmJit error codes. +//! AsmJit error codes. ASMJIT_ENUM(kError) { - //! @brief No error (success). + //! No error (success). //! //! This is default state and state you want. kErrorOk = 0, - //! @brief Heap memory allocation failed. + //! Heap memory allocation failed. kErrorNoHeapMemory = 1, - //! @brief Virtual memory allocation failed. + //! Virtual memory allocation failed. kErrorNoVirtualMemory = 2, - //! @brief Invalid argument. + //! Invalid argument. kErrorInvalidArgument = 3, - //! @brief Invalid state. + //! Invalid state. kErrorInvalidState = 4, - //! @brief Unknown instruction. This happens only if instruction code is + //! Unknown instruction. This happens only if instruction code is //! out of bounds. Shouldn't happen. kErrorAssemblerUnknownInst = 5, - //! @brief Illegal instruction, usually generated by asmjit::Assembler + //! Illegal instruction, usually generated by asmjit::Assembler //! class when emitting instruction opcode. If this error is generated the //! target buffer is not affected by this invalid instruction. //! //! You can also get this status code if you are under x64 (64-bit x86) and //! you tried to decode instruction using AH, BH, CH or DH register with REX //! prefix. These registers can't be accessed if REX prefix is used and AsmJit - //! didn't check for this situation in intrinsics (@c Compiler takes care of + //! didn't check for this situation in intrinsics (`BaseCompiler` takes care of //! this and rearrange registers if needed). //! - //! Examples that will raise @c kErrorAssemblerIllegalInst error (a is - //! @c Assembler instance): + //! Example of raising `kErrorAssemblerIllegalInst` error. //! - //! @code - //! a.mov(dword_ptr(eax), al); // Invalid address size. - //! a.mov(byte_ptr(r10), ah); // Undecodable instruction (AH used with r10 - //! // that can be encoded by using REX prefix only) - //! @endcode + //! ~~~ + //! // Invalid address size. + //! a.mov(dword_ptr(eax), al); + //! + //! // Undecodable instruction - AH used with r10 that can be encoded by using + //! // REX prefix only. + //! a.mov(byte_ptr(r10), ah); + //! ~~~ //! //! @note In debug mode you get assertion failure instead of setting error //! code. kErrorAssemblerIllegalInst = 6, - //! @brief Illegal addressing used (unencodable). + //! Illegal addressing used (unencodable). kErrorAssemblerIllegalAddr = 7, - //! @brief Short jump instruction used, but displacement is out of bounds. + //! Short jump instruction used, but displacement is out of bounds. kErrorAssemblerIllegalShortJump = 8, - //! @brief No function defined. + //! No function defined. kErrorCompilerNoFunc = 9, - //! @brief Function generation is not finished by using @c Compiler::endFunc() + //! Function generation is not finished by using `BaseCompiler::endFunc()` //! or something bad happened during generation related to function. This can //! be missing compiler node, etc... kErrorCompilerIncompleteFunc = 10, - //! @brief Tried to generate a function with overlapped arguments. + //! Tried to generate a function with overlapped arguments. kErrorCompilerOverlappedArgs = 11, - //! @brief Compiler can't allocate registers. + //! Compiler can't allocate registers. kErrorCompilerNoRegs = 12, - //! @brief Compiler can't allocate registers, because they overlap. + //! Compiler can't allocate registers, because they overlap. kErrorCompilerOverlappedRegs = 13, - //! @brief Tried to call function with an incompatible argument. + //! Tried to call function with an incompatible argument. kErrorCompilerIncompatibleArg = 14, - //! @brief Incompatible return value. + //! Incompatible return value. kErrorCompilerIncompatibleRet = 15, - //! @brief Count of AsmJit status codes. Can grow in future. + //! Count of AsmJit status codes. Can grow in future. kErrorCount = 16 }; @@ -100,42 +102,48 @@ typedef uint32_t Error; // [asmjit::ErrorHandler] // ============================================================================ +//! Error handler. +//! +//! Error handler can be used to override the default behavior of `CodeGen` +//! error handling and propagation. See `handleError` on how to override it. +//! +//! Please note that `addRef` and `release` functions are used, but there is +//! no reference counting implemented by default, reimplement to change the +//! default behavior. struct ErrorHandler { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref ErrorHandler. + //! Create a new `ErrorHandler`. ASMJIT_API ErrorHandler(); - //! @brief Destroy the @ref ErrorHandler. + //! Destroy the `ErrorHandler`. ASMJIT_API virtual ~ErrorHandler(); // -------------------------------------------------------------------------- // [Interface] // -------------------------------------------------------------------------- - //! @brief Reference this error handler. + //! Reference this error handler. //! //! @note This member function is provided for convenience. The default //! implementation does nothing. If you are working in environment where - //! multiple @ref ErrorHandler instances are used in different @ref Assembler - //! and @ref Compiler instances (or in multithreaded environment) you might - //! want to provide your own functionality for reference counting. In that - //! case override @ref addRef() and @ref release() functions to inc/dec your - //! reference count value. + //! multiple `ErrorHandler` instances are used by a different code generators + //! you may provide your own functionality for reference counting. In that + //! case `addRef()` and `release()` functions should be overridden. ASMJIT_API virtual ErrorHandler* addRef() const; - //! @brief Release this error handler. + //! Release this error handler. //! - //! @note This member function is provided for convenience. See @ref addRef() + //! @note This member function is provided for convenience. See `addRef()` //! for more detailed information related to reference counting. ASMJIT_API virtual void release(); - //! @brief Error handler (pure). + //! Error handler (pure). //! //! Error handler is called when an error happened. An error can happen in - //! many places, but error handler is mostly used by @ref Assembler and - //! @ref Compiler classes to report anything that may prevent correct code + //! many places, but error handler is mostly used by `BaseAssembler` and + //! `BaseCompiler` classes to report anything that may prevent correct code //! generation. There are multiple ways how the error handler can be used //! and each has it's pros/cons. //! @@ -144,22 +152,22 @@ struct ErrorHandler { //! exceptions it is exception-safe and handleError() can report an incoming //! error by throwing an exception of any type. It's guaranteed that the //! exception won't be catched by AsmJit and will be propagated to the code - //! calling AsmJit @ref Assembler or @ref Compiler. Alternative to throwing + //! calling AsmJit `BaseAssembler` or `BaseCompiler`. Alternative to throwing //! exception is using setjmp() / longjmp() pair from the standard C library. //! //! If the exception or setjmp() / longjmp() mechanism is used, the state of - //! the @ref Assember or @ref Compiler is unchanged and if it's possible the + //! the `BaseAssember` or `BaseCompiler` is unchanged and if it's possible the //! execution (instruction serialization) can continue. However if the error //! happened during any phase that translates or modifies the stored code - //! (for example relocation done by @ref Assembler or analysis/translation - //! done by @ref Compiler) the execution can't continue and the error will - //! be also stored in @ref Assembler or @ref Compiler. + //! (for example relocation done by `BaseAssembler` or analysis/translation + //! done by `BaseCompiler`) the execution can't continue and the error will + //! be also stored in `BaseAssembler` or `BaseCompiler`. //! //! Finally, if exceptions nor setjmp() / longjmp() mechanisms were used, //! you can still implement a compatible design by returning from your error - //! handler. Returning @c true means that error was reported and AsmJit - //! should continue execution. When @c false is returned, AsmJit sets the - //! error immediately to the @ref Assembler or @ref Compiler and execution + //! handler. Returning `true` means that error was reported and AsmJit + //! should continue execution. When `false` is returned, AsmJit sets the + //! error immediately to the `BaseAssembler` or `BaseCompiler` and execution //! shouldn't continue (this is the default behavior in case no error handler //! is used). virtual bool handleError(Error code, const char* message) = 0; @@ -169,8 +177,9 @@ struct ErrorHandler { // [asmjit::ErrorUtil] // ============================================================================ +//! Error utilities. struct ErrorUtil { - //! @brief Get printable version of AsmJit @ref kError code. + //! Get printable version of AsmJit `kError` code. static ASMJIT_API const char* asString(Error code); }; @@ -178,6 +187,9 @@ struct ErrorUtil { // [ASMJIT_PROPAGATE_ERROR] // ============================================================================ +//! @internal +//! +//! Used by AsmJit to return the `_Exp_` result if it's an error. #define ASMJIT_PROPAGATE_ERROR(_Exp_) \ do { \ ::asmjit::Error errval_ = (_Exp_); \ diff --git a/src/asmjit/base/func.h b/src/asmjit/base/func.h index 602e46f..e1d5a3d 100644 --- a/src/asmjit/base/func.h +++ b/src/asmjit/base/func.h @@ -17,6 +17,9 @@ namespace asmjit { +//! @addtogroup asmjit_base_codegen +//! @{ + // ============================================================================ // [Forward Declarations] // ============================================================================ @@ -28,8 +31,12 @@ struct FnTypeId; // [asmjit::kFuncConv] // ============================================================================ +//! Function calling convention. +//! +//! For a platform specific calling conventions, see: +//! - `x86x64::kFuncConv` - X86/X64 calling conventions. ASMJIT_ENUM(kFuncConv) { - //! @brief Calling convention is invalid (can't be used). + //! Calling convention is invalid (can't be used). kFuncConvNone = 0 }; @@ -37,43 +44,54 @@ ASMJIT_ENUM(kFuncConv) { // [asmjit::kFuncHint] // ============================================================================ -//! @brief Function hints. +//! Function hints. +//! +//! For a platform specific calling conventions, see: +//! - `x86x64::kFuncHint` - X86/X64 function hints. ASMJIT_ENUM(kFuncHint) { - //! @brief Make a naked function (default true). + //! Make a naked function (default true). //! //! Naked function is function without using standard prolog/epilog sequence). //! - //! @section X86/X64 + //! X86/X64 Specific + //! ---------------- //! //! Standard prolog sequence is: //! - //! "push zbp" - //! "mov zsp, zbp" - //! "sub zsp, StackAdjustment" + //! ~~~ + //! push zbp + //! mov zsp, zbp + //! sub zsp, StackAdjustment + //! ~~~ //! - //! which is equal to: + //! which is an equivalent to: //! - //! "enter StackAdjustment, 0" + //! ~~~ + //! enter StackAdjustment, 0 + //! ~~~ //! //! Standard epilog sequence is: //! - //! "mov zsp, zbp" - //! "pop zbp" - //! "ret" + //! ~~~ + //! mov zsp, zbp + //! pop zbp + //! ~~~ //! - //! which is equal to: + //! which is an equavalent to: //! - //! "leave" - //! "ret" + //! ~~~ + //! leave + //! ~~~ //! //! Naked functions can omit the prolog/epilog sequence. The advantage of //! doing such modification is that EBP/RBP register can be used by the //! register allocator which can result in less spills/allocs. kFuncHintNaked = 0, - //! @brief Generate compact function prolog/epilog if possible. + //! Generate compact function prolog/epilog if possible. //! - //! @section X86/X64 + //! X86/X64 Specific + //! ---------------- //! //! Use shorter, but possible slower prolog/epilog sequence to save/restore //! registers. @@ -84,22 +102,26 @@ ASMJIT_ENUM(kFuncHint) { // [asmjit::kFuncFlags] // ============================================================================ -//! @brief Function flags. +//! Function flags. +//! +//! For a platform specific calling conventions, see: +//! - `x86x64::kFuncFlags` - X86/X64 function flags. ASMJIT_ENUM(kFuncFlags) { - //! @brief Whether the function is using naked (minimal) prolog / epilog. + //! Whether the function is using naked (minimal) prolog / epilog. kFuncFlagIsNaked = 0x00000001, - //! @brief Whether an another function is called from this function. + //! Whether an another function is called from this function. kFuncFlagIsCaller = 0x00000002, - //! @brief Whether the stack is not aligned to the required stack alignment, + //! Whether the stack is not aligned to the required stack alignment, //! thus it has to be aligned manually. kFuncFlagIsStackMisaligned = 0x00000004, - //! @brief Whether the stack pointer is adjusted by the stack size needed + //! Whether the stack pointer is adjusted by the stack size needed //! to save registers and function variables. //! - //! @section X86/X64 + //! X86/X64 Specific + //! ---------------- //! //! Stack pointer (ESP/RSP) is adjusted by 'sub' instruction in prolog and by //! 'add' instruction in epilog (only if function is not naked). If function @@ -107,7 +129,7 @@ ASMJIT_ENUM(kFuncFlags) { //! adjust the stack (like "and zsp, -Alignment"). kFuncFlagIsStackAdjusted = 0x00000008, - //! @brief Whether the function is finished using @c Compiler::endFunc(). + //! Whether the function is finished using `BaseCompiler::endFunc()`. kFuncFlagIsFinished = 0x80000000 }; @@ -115,14 +137,14 @@ ASMJIT_ENUM(kFuncFlags) { // [asmjit::kFuncDir] // ============================================================================ -//! @brief Function arguments direction. +//! Function arguments direction. ASMJIT_ENUM(kFuncDir) { - //! @brief Arguments are passed left to right. + //! Arguments are passed left to right. //! //! This arguments direction is unusual to C programming, it's used by pascal //! compilers and in some calling conventions by Borland compiler). kFuncDirLtr = 0, - //! @brief Arguments are passed right ro left + //! Arguments are passed right ro left //! //! This is default argument direction in C programming. kFuncDirRtl = 1 @@ -133,7 +155,7 @@ ASMJIT_ENUM(kFuncDir) { // ============================================================================ enum { - //! @brief Invalid stack offset in function or function parameter. + //! Invalid stack offset in function or function parameter. kFuncStackInvalid = -1 }; @@ -141,19 +163,19 @@ enum { // [asmjit::kFuncArg] // ============================================================================ -//! @brief Function argument (lo/hi) specification. +//! Function argument (lo/hi) specification. ASMJIT_ENUM(kFuncArg) { - //! @brief Maxumum number of function arguments supported by AsmJit. + //! Maxumum number of function arguments supported by AsmJit. kFuncArgCount = 16, - //! @brief Extended maximum number of arguments (used internally). + //! Extended maximum number of arguments (used internally). kFuncArgCountLoHi = kFuncArgCount * 2, - //! @brief Index to the LO part of function argument (default). + //! Index to the LO part of function argument (default). //! //! This value is typically omitted and added only if there is HI argument //! accessed. kFuncArgLo = 0, - //! @brief Index to the HI part of function argument. + //! Index to the HI part of function argument. //! //! HI part of function argument depends on target architecture. On x86 it's //! typically used to transfer 64-bit integers (they form a pair of 32-bit @@ -165,11 +187,11 @@ ASMJIT_ENUM(kFuncArg) { // [asmjit::kFuncRet] // ============================================================================ -//! @brief Function return value (lo/hi) specification. +//! Function return value (lo/hi) specification. ASMJIT_ENUM(kFuncRet) { - //! @brief Index to the LO part of function return value. + //! Index to the LO part of function return value. kFuncRetLo = 0, - //! @brief Index to the HI part of function return value. + //! Index to the HI part of function return value. kFuncRetHi = 1 }; @@ -187,44 +209,45 @@ ASMJIT_ENUM(kFuncRet) { //! @internal //! -//! @brief Declare C/C++ type-id mapped to @c asmjit::kVarType. +//! Declare C/C++ type-id mapped to `kVarType`. #define ASMJIT_DECLARE_TYPE_ID(_T_, _Id_) \ template<> \ struct TypeId<_T_> { enum { kId = _Id_ }; } -//! @brief Function builder 'void' type. +//! Function builder 'void' type. struct FnVoid {}; -//! @brief Function builder 'int8_t' type. +//! Function builder 'int8_t' type. struct FnInt8 {}; -//! @brief Function builder 'uint8_t' type. +//! Function builder 'uint8_t' type. struct FnUInt8 {}; -//! @brief Function builder 'int16_t' type. +//! Function builder 'int16_t' type. struct FnInt16 {}; -//! @brief Function builder 'uint16_t' type. +//! Function builder 'uint16_t' type. struct FnUInt16 {}; -//! @brief Function builder 'int32_t' type. +//! Function builder 'int32_t' type. struct FnInt32 {}; -//! @brief Function builder 'uint32_t' type. +//! Function builder 'uint32_t' type. struct FnUInt32 {}; -//! @brief Function builder 'int64_t' type. +//! Function builder 'int64_t' type. struct FnInt64 {}; -//! @brief Function builder 'uint64_t' type. +//! Function builder 'uint64_t' type. struct FnUInt64 {}; -//! @brief Function builder 'intptr_t' type. +//! Function builder 'intptr_t' type. struct FnIntPtr {}; -//! @brief Function builder 'uintptr_t' type. +//! Function builder 'uintptr_t' type. struct FnUIntPtr {}; -//! @brief Function builder 'float' type. +//! Function builder 'float' type. struct FnFloat {}; -//! @brief Function builder 'double' type. +//! Function builder 'double' type. struct FnDouble {}; +#if !defined(ASMJIT_DOCGEN) ASMJIT_DECLARE_TYPE_CORE(kVarTypeIntPtr); ASMJIT_DECLARE_TYPE_ID(void, kVarTypeInvalid); @@ -259,15 +282,13 @@ ASMJIT_DECLARE_TYPE_ID(FnFloat, kVarTypeFp32); ASMJIT_DECLARE_TYPE_ID(double, kVarTypeFp64); ASMJIT_DECLARE_TYPE_ID(FnDouble, kVarTypeFp64); +#endif // !ASMJIT_DOCGEN // ============================================================================ // [asmjit::FuncInOut] // ============================================================================ -//! @brief Function in/out (argument or a return value). -//! -//! This class contains function argument or return value translated from the -//! @ref FuncPrototype. +//! Function in/out - argument or return value translated from `FuncPrototype`. struct FuncInOut { // -------------------------------------------------------------------------- // [Accessors] @@ -281,7 +302,7 @@ struct FuncInOut { ASMJIT_INLINE bool hasStackOffset() const { return _stackOffset != kFuncStackInvalid; } ASMJIT_INLINE int32_t getStackOffset() const { return static_cast(_stackOffset); } - //! @brief Get whether the argument / return value is assigned. + //! Get whether the argument / return value is assigned. ASMJIT_INLINE bool isSet() const { return (_regIndex != kInvalidReg) | (_stackOffset != kFuncStackInvalid); } @@ -290,7 +311,7 @@ struct FuncInOut { // [Reset] // -------------------------------------------------------------------------- - //! @brief Reset the function argument to "unassigned state". + //! Reset the function argument to "unassigned state". ASMJIT_INLINE void reset() { _packed = 0xFFFFFFFF; } // -------------------------------------------------------------------------- @@ -299,15 +320,15 @@ struct FuncInOut { union { struct { - //! @brief Variable type, see @c kVarType. + //! Variable type, see `kVarType`. uint8_t _varType; - //! @brief Register index if argument / return value is a register. + //! Register index if argument / return value is a register. uint8_t _regIndex; - //! @brief Stack offset if argument / return value is on the stack. + //! Stack offset if argument / return value is on the stack. int16_t _stackOffset; }; - //! @brief All members packed into single 32-bit integer. + //! All members packed into single 32-bit integer. uint32_t _packed; }; }; @@ -316,32 +337,32 @@ struct FuncInOut { // [asmjit::FuncPrototype] // ============================================================================ -//! @brief Function prototype. +//! Function prototype. //! //! Function prototype contains information about function return type, count //! of arguments and their types. Function prototype is a low level structure //! which doesn't contain platform specific or calling convention specific -//! information. Function prototype is used to create a @ref FuncDecl. +//! information. Function prototype is used to create a `FuncDecl`. struct FuncPrototype { // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get function return value. + //! Get function return value. ASMJIT_INLINE uint32_t getRet() const { return _ret; } - //! @brief Get function arguments' IDs. + //! Get function arguments' IDs. ASMJIT_INLINE const uint32_t* getArgList() const { return _argList; } - //! @brief Get count of function arguments. + //! Get count of function arguments. ASMJIT_INLINE uint32_t getArgCount() const { return _argCount; } - //! @brief Get argument at index @a id. + //! Get argument at index `id`. ASMJIT_INLINE uint32_t getArg(uint32_t id) const { ASMJIT_ASSERT(id < _argCount); return _argList[id]; } - //! @brief Set function definition - return type and arguments. + //! Set function definition - return type and arguments. ASMJIT_INLINE void _setPrototype(uint32_t ret, const uint32_t* argList, uint32_t argCount) { _ret = ret; _argList = argList; @@ -361,62 +382,62 @@ struct FuncPrototype { // [asmjit::FuncDecl] // ============================================================================ -//! @brief Function declaration. +//! Function declaration. struct FuncDecl { // -------------------------------------------------------------------------- // [Accessors - Calling Convention] // -------------------------------------------------------------------------- - //! @brief Get function calling convention, see @c kFuncConv. + //! Get function calling convention, see `kFuncConv`. ASMJIT_INLINE uint32_t getConvention() const { return _convention; } - //! @brief Get whether the callee pops the stack. + //! Get whether the callee pops the stack. ASMJIT_INLINE uint32_t getCalleePopsStack() const { return _calleePopsStack; } - //! @brief Get direction of arguments passed on the stack. + //! Get direction of arguments passed on the stack. //! - //! Direction should be always @c kFuncDirRtl. + //! Direction should be always `kFuncDirRtl`. //! //! @note This is related to used calling convention, it's not affected by //! number of function arguments or their types. ASMJIT_INLINE uint32_t getDirection() const { return _direction; } - //! @brief Get stack size needed for function arguments passed on the stack. + //! Get stack size needed for function arguments passed on the stack. ASMJIT_INLINE uint32_t getArgStackSize() const { return _argStackSize; } - //! @brief Get size of "Red Zone". + //! Get size of "Red Zone". ASMJIT_INLINE uint32_t getRedZoneSize() const { return _redZoneSize; } - //! @brief Get size of "Spill Zone". + //! Get size of "Spill Zone". ASMJIT_INLINE uint32_t getSpillZoneSize() const { return _spillZoneSize; } // -------------------------------------------------------------------------- // [Accessors - Arguments and Return] // -------------------------------------------------------------------------- - //! @brief Get whether the function has a return value. + //! Get whether the function has a return value. ASMJIT_INLINE bool hasRet() const { return _retCount != 0; } - //! @brief Get count of function return values. + //! Get count of function return values. ASMJIT_INLINE uint32_t getRetCount() const { return _retCount; } - //! @brief Get function return value. + //! Get function return value. ASMJIT_INLINE FuncInOut& getRet(uint32_t index = kFuncRetLo) { return _retList[index]; } - //! @brief Get function return value. + //! Get function return value. ASMJIT_INLINE const FuncInOut& getRet(uint32_t index = kFuncRetLo) const { return _retList[index]; } - //! @brief Get count of function arguments. + //! Get count of function arguments. ASMJIT_INLINE uint32_t getArgCount() const { return _argCount; } - //! @brief Get function arguments array. + //! Get function arguments array. ASMJIT_INLINE FuncInOut* getArgList() { return _argList; } - //! @brief Get function arguments array (const). + //! Get function arguments array (const). ASMJIT_INLINE const FuncInOut* getArgList() const { return _argList; } - //! @brief Get function argument at index @a index. + //! Get function argument at index `index`. ASMJIT_INLINE FuncInOut& getArg(size_t index) { ASMJIT_ASSERT(index < kFuncArgCountLoHi); return _argList[index]; } - //! @brief Get function argument at index @a index. + //! Get function argument at index `index`. ASMJIT_INLINE const FuncInOut& getArg(size_t index) const { ASMJIT_ASSERT(index < kFuncArgCountLoHi); return _argList[index]; @@ -431,38 +452,38 @@ struct FuncDecl { // [Members] // -------------------------------------------------------------------------- - //! @brief Calling convention. + //! Calling convention. uint8_t _convention; - //! @brief Whether a callee pops stack. + //! Whether a callee pops stack. uint8_t _calleePopsStack : 1; - //! @brief Direction for arguments passed on the stack, see @c kFuncDir. + //! Direction for arguments passed on the stack, see `kFuncDir`. uint8_t _direction : 1; - //! @brief Reserved #0 (alignment). + //! Reserved #0 (alignment). uint8_t _reserved0 : 6; - //! @brief Count of arguments (in @c _argList). + //! Count of arguments in `_argList`. uint8_t _argCount; - //! @brief Count of return value(s). + //! Count of return value(s). uint8_t _retCount; - //! @brief Count of bytes consumed by arguments on the stack (aligned). + //! Count of bytes consumed by arguments on the stack (aligned). uint32_t _argStackSize; - //! @brief Size of "Red Zone". + //! Size of "Red Zone". //! //! @note Used by AMD64-ABI (128 bytes). uint16_t _redZoneSize; - //! @brief Size of "Spill Zone". + //! Size of "Spill Zone". //! //! @note Used by WIN64-ABI (32 bytes). uint16_t _spillZoneSize; - //! @brief Function arguments (including HI arguments) mapped to physical + //! Function arguments (including HI arguments) mapped to physical //! registers and stack offset. FuncInOut _argList[kFuncArgCountLoHi]; - //! @brief Function return value(s). + //! Function return value(s). FuncInOut _retList[2]; }; @@ -470,7 +491,7 @@ struct FuncDecl { // [asmjit::FuncBuilderX] // ============================================================================ -//! @brief Custom function builder for up to 32 function arguments. +//! Custom function builder for up to 32 function arguments. struct FuncBuilderX : public FuncPrototype { // -------------------------------------------------------------------------- // [Construction / Destruction] @@ -484,7 +505,7 @@ struct FuncBuilderX : public FuncPrototype { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Set return type to @a retType. + //! Set return type to `retType`. ASMJIT_INLINE void setRet(uint32_t retType) { _ret = retType; } @@ -523,7 +544,7 @@ struct FuncBuilderX : public FuncPrototype { #define _TID(_T_) TypeId<_T_>::kId -//! @brief Function builder (no args). +//! Function builder (no args). template struct FuncBuilder0 : public FuncPrototype { ASMJIT_INLINE FuncBuilder0() { @@ -531,7 +552,7 @@ struct FuncBuilder0 : public FuncPrototype { } }; -//! @brief Function builder (1 argument). +//! Function builder (1 argument). template struct FuncBuilder1 : public FuncPrototype { ASMJIT_INLINE FuncBuilder1() { @@ -540,7 +561,7 @@ struct FuncBuilder1 : public FuncPrototype { } }; -//! @brief Function builder (2 arguments). +//! Function builder (2 arguments). template struct FuncBuilder2 : public FuncPrototype { ASMJIT_INLINE FuncBuilder2() { @@ -549,7 +570,7 @@ struct FuncBuilder2 : public FuncPrototype { } }; -//! @brief Function builder (3 arguments). +//! Function builder (3 arguments). template struct FuncBuilder3 : public FuncPrototype { ASMJIT_INLINE FuncBuilder3() { @@ -558,7 +579,7 @@ struct FuncBuilder3 : public FuncPrototype { } }; -//! @brief Function builder (4 arguments). +//! Function builder (4 arguments). template struct FuncBuilder4 : public FuncPrototype { ASMJIT_INLINE FuncBuilder4() { @@ -567,7 +588,7 @@ struct FuncBuilder4 : public FuncPrototype { } }; -//! @brief Function builder (5 arguments). +//! Function builder (5 arguments). template struct FuncBuilder5 : public FuncPrototype { ASMJIT_INLINE FuncBuilder5() { @@ -576,7 +597,7 @@ struct FuncBuilder5 : public FuncPrototype { } }; -//! @brief Function builder (6 arguments). +//! Function builder (6 arguments). template struct FuncBuilder6 : public FuncPrototype { ASMJIT_INLINE FuncBuilder6() { @@ -585,7 +606,7 @@ struct FuncBuilder6 : public FuncPrototype { } }; -//! @brief Function builder (7 arguments). +//! Function builder (7 arguments). template struct FuncBuilder7 : public FuncPrototype { ASMJIT_INLINE FuncBuilder7() { @@ -594,7 +615,7 @@ struct FuncBuilder7 : public FuncPrototype { } }; -//! @brief Function builder (8 arguments). +//! Function builder (8 arguments). template struct FuncBuilder8 : public FuncPrototype { ASMJIT_INLINE FuncBuilder8() { @@ -603,7 +624,7 @@ struct FuncBuilder8 : public FuncPrototype { } }; -//! @brief Function builder (9 arguments). +//! Function builder (9 arguments). template struct FuncBuilder9 : public FuncPrototype { ASMJIT_INLINE FuncBuilder9() { @@ -612,7 +633,7 @@ struct FuncBuilder9 : public FuncPrototype { } }; -//! @brief Function builder (10 arguments). +//! Function builder (10 arguments). template struct FuncBuilder10 : public FuncPrototype { ASMJIT_INLINE FuncBuilder10() { @@ -623,6 +644,8 @@ struct FuncBuilder10 : public FuncPrototype { #undef _TID +//! @} + } // asmjit namespace // [Api-End] diff --git a/src/asmjit/base/globals.h b/src/asmjit/base/globals.h index 0e3d40b..091c1af 100644 --- a/src/asmjit/base/globals.h +++ b/src/asmjit/base/globals.h @@ -16,7 +16,7 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_globals //! @{ // ============================================================================ @@ -26,25 +26,25 @@ namespace asmjit { static const size_t kInvalidIndex = ~static_cast(0); ASMJIT_ENUM(kGlobals) { - //! @brief Invalid value or operand id. + //! Invalid value or operand id. kInvalidValue = 0xFFFFFFFF, - //! @brief Invalid register index. + //! Invalid register index. kInvalidReg = 0xFF, - //! @brief Minimum reserved bytes in @ref Buffer. + //! Minimum reserved bytes in `Buffer`. kBufferGrow = 32U, - //! @brief Minimum size of assembler/compiler code buffer. + //! Minimum size of assembler/compiler code buffer. kMemAllocMinimum = 4096, - //! @brief Memory grow threshold. + //! Memory grow threshold. //! //! After the grow threshold is reached the capacity won't be doubled //! anymore. kMemAllocGrowMax = 8192 * 1024, - //! @brief Host memory allocator overhead. + //! Host memory allocator overhead. //! //! We decrement the overhead from our pools so the host operating system //! doesn't need allocate an extra virtual page to put the data it needs @@ -58,17 +58,17 @@ ASMJIT_ENUM(kGlobals) { // [asmjit::kArch] // ============================================================================ -//! @brief Architecture. +//! Architecture. ASMJIT_ENUM(kArch) { - //! @brief No/Unknown architecture. + //! No/Unknown architecture. kArchNone = 0, - //! @brief X86 architecture. + //! X86 architecture. kArchX86 = 1, - //! @brief X64 architecture, also called AMD64. + //! X64 architecture, also called AMD64. kArchX64 = 2, - //! @brief Arm architecture. + //! Arm architecture. kArchArm = 4, #if defined(ASMJIT_HOST_X86) @@ -83,25 +83,32 @@ ASMJIT_ENUM(kArch) { kArchHost = kArchArm, #endif // ASMJIT_HOST_ARM - //! @brief Whether the host is 64-bit. + //! Whether the host is 64-bit. kArchHost64Bit = sizeof(intptr_t) >= 8 }; +//! @} + // ============================================================================ // [asmjit::Init / NoInit] // ============================================================================ +#if !defined(ASMJIT_DOCGEN) struct _Init {}; static const _Init Init = {}; struct _NoInit {}; static const _NoInit NoInit = {}; +#endif // !ASMJIT_DOCGEN // ============================================================================ // [asmjit::Assert] // ============================================================================ -//! @brief Called in debug build on assertion failure. +//! @addtogroup asmjit_base_logging_and_errors +//! @{ + +//! Called in debug build on assertion failure. //! //! @param exp Expression that failed. //! @param file Source file name where it happened. @@ -128,16 +135,21 @@ ASMJIT_API void assertionFailed(const char* exp, const char* file, int line); // [asmjit_cast<>] // ============================================================================ -//! @brief Cast used to cast pointer to function. It's like reinterpret_cast<>, +//! @addtogroup asmjit_base_util +//! @{ + +//! Cast used to cast pointer to function. It's like reinterpret_cast<>, //! but uses internally C style cast to work with MinGW. //! -//! If you are using single compiler and @c reinterpret_cast<> works for you, -//! there is no reason to use @c asmjit_cast<>. If you are writing +//! If you are using single compiler and `reinterpret_cast<>` works for you, +//! there is no reason to use `asmjit_cast<>`. If you are writing //! cross-platform software with various compiler support, consider using -//! @c asmjit_cast<> instead of @c reinterpret_cast<>. +//! `asmjit_cast<>` instead of `reinterpret_cast<>`. template static ASMJIT_INLINE T asmjit_cast(Z* p) { return (T)p; } +//! @} + // [Api-End] #include "../apiend.h" diff --git a/src/asmjit/base/intutil.h b/src/asmjit/base/intutil.h index 3df824c..440c64e 100644 --- a/src/asmjit/base/intutil.h +++ b/src/asmjit/base/intutil.h @@ -20,13 +20,14 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_util //! @{ // ============================================================================ // [asmjit::IntTraits] // ============================================================================ +//! @internal template struct IntTraits { enum { @@ -46,31 +47,40 @@ struct IntTraits { // [asmjit::IntUtil] // ============================================================================ +//! Integer utilities. struct IntUtil { // -------------------------------------------------------------------------- // [Float <-> Int] // -------------------------------------------------------------------------- + //! @internal union Float { int32_t i; float f; }; + //! @internal union Double { int64_t i; double d; }; + //! Bit-cast `float` to 32-bit integer. static ASMJIT_INLINE int32_t floatAsInt(float f) { Float m; m.f = f; return m.i; } + //! Bit-cast 32-bit integer to `float`. static ASMJIT_INLINE float intAsFloat(int32_t i) { Float m; m.i = i; return m.f; } + //! Bit-cast `double` to 64-bit integer. static ASMJIT_INLINE int64_t doubleAsInt(double d) { Double m; m.d = d; return m.i; } + //! Bit-cast 64-bit integer to `double`. static ASMJIT_INLINE double intAsDouble(int64_t i) { Double m; m.i = i; return m.d; } // -------------------------------------------------------------------------- // [AsmJit - Pack / Unpack] // -------------------------------------------------------------------------- + //! Pack two 8-bit integer and one 16-bit integer into a 32-bit integer as it + //! is an array of `{u0,u1,w2}`. static ASMJIT_INLINE uint32_t pack32_2x8_1x16(uint32_t u0, uint32_t u1, uint32_t w2) { #if defined(ASMJIT_HOST_LE) return u0 + (u1 << 8) + (w2 << 16); @@ -79,6 +89,7 @@ struct IntUtil { #endif // ASMJIT_HOST } + //! Pack four 8-bit integer into a 32-bit integer as it is an array of `{u0,u1,u2,u3}`. static ASMJIT_INLINE uint32_t pack32_4x8(uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) { #if defined(ASMJIT_HOST_LE) return u0 + (u1 << 8) + (u2 << 16) + (u3 << 24); @@ -87,6 +98,7 @@ struct IntUtil { #endif // ASMJIT_HOST } + //! Pack two 32-bit integer into a 64-bit integer as it is an array of `{u0,u1}`. static ASMJIT_INLINE uint64_t pack64_2x32(uint32_t u0, uint32_t u1) { #if defined(ASMJIT_HOST_LE) return (static_cast(u1) << 32) + u0; @@ -102,9 +114,11 @@ struct IntUtil { // NOTE: Because some environments declare min() and max() as macros, it has // been decided to use different name so we never collide with them. + //! Get minimum value of `a` and `b`. template static ASMJIT_INLINE T iMin(const T& a, const T& b) { return a < b ? a : b; } + //! Get maximum value of `a` and `b`. template static ASMJIT_INLINE T iMax(const T& a, const T& b) { return a > b ? a : b; } @@ -112,6 +126,7 @@ struct IntUtil { // [AsmJit - MaxUInt] // -------------------------------------------------------------------------- + //! Get maximum unsigned value of `T`. template static ASMJIT_INLINE T maxUInt() { return ~T(0); } @@ -119,6 +134,7 @@ struct IntUtil { // [AsmJit - InInterval] // -------------------------------------------------------------------------- + //! Get whether `x` is greater or equal than `start` and less or equal than `end`. template static ASMJIT_INLINE bool inInterval(const T& x, const T& start, const T& end) { return x >= start && x <= end; @@ -128,8 +144,7 @@ struct IntUtil { // [AsmJit - IsInt/IsUInt] // -------------------------------------------------------------------------- - //! @brief Get whether the given integer @a x can be casted to a signed 8-bit - //! integer. + //! Get whether the given integer `x` can be casted to a signed 8-bit integer. template static ASMJIT_INLINE bool isInt8(T x) { if (IntTraits::kIsSigned) @@ -138,8 +153,7 @@ struct IntUtil { return x <= T(127); } - //! @brief Get whether the given integer @a x can be casted to an unsigned 8-bit - //! integer. + //! Get whether the given integer `x` can be casted to an unsigned 8-bit integer. template static ASMJIT_INLINE bool isUInt8(T x) { if (IntTraits::kIsSigned) @@ -148,8 +162,7 @@ struct IntUtil { return sizeof(T) <= sizeof(uint8_t) ? true : x <= T(255); } - //! @brief Get whether the given integer @a x can be casted to a signed 16-bit - //! integer. + //! Get whether the given integer `x` can be casted to a signed 16-bit integer. template static ASMJIT_INLINE bool isInt16(T x) { if (IntTraits::kIsSigned) @@ -158,8 +171,7 @@ struct IntUtil { return x >= T(0) && (sizeof(T) <= sizeof(int16_t) ? true : x <= T(32767)); } - //! @brief Get whether the given integer @a x can be casted to an unsigned 16-bit - //! integer. + //! Get whether the given integer `x` can be casted to an unsigned 16-bit integer. template static ASMJIT_INLINE bool isUInt16(T x) { if (IntTraits::kIsSigned) @@ -168,8 +180,7 @@ struct IntUtil { return sizeof(T) <= sizeof(uint16_t) ? true : x <= T(65535); } - //! @brief Get whether the given integer @a x can be casted to a signed 32-bit - //! integer. + //! Get whether the given integer `x` can be casted to a signed 32-bit integer. template static ASMJIT_INLINE bool isInt32(T x) { if (IntTraits::kIsSigned) @@ -178,8 +189,7 @@ struct IntUtil { return x >= T(0) && (sizeof(T) <= sizeof(int32_t) ? true : x <= T(2147483647)); } - //! @brief Get whether the given integer @a x can be casted to an unsigned 32-bit - //! integer. + //! Get whether the given integer `x` can be casted to an unsigned 32-bit integer. template static ASMJIT_INLINE bool isUInt32(T x) { if (IntTraits::kIsSigned) @@ -192,6 +202,7 @@ struct IntUtil { // [AsmJit - IsPowerOf2] // -------------------------------------------------------------------------- + //! Get whether the `n` value is a power of two (only one bit is set). template static ASMJIT_INLINE bool isPowerOf2(T n) { return n != 0 && (n & (n - 1)) == 0; @@ -201,49 +212,59 @@ struct IntUtil { // [AsmJit - Mask] // -------------------------------------------------------------------------- + //! Generate a bit-mask that has `x` bit set. static ASMJIT_INLINE uint32_t mask(uint32_t x) { ASMJIT_ASSERT(x < 32); return (1U << x); } + //! Generate a bit-mask that has `x0` and `x1` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1) { return mask(x0) | mask(x1); } + //! Generate a bit-mask that has `x0`, `x1` and `x2` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1, uint32_t x2) { return mask(x0) | mask(x1) | mask(x2); } + //! Generate a bit-mask that has `x0`, `x1`, `x2` and `x3` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3) { return mask(x0) | mask(x1) | mask(x2) | mask(x3); } + //! Generate a bit-mask that has `x0`, `x1`, `x2`, `x3` and `x4` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t x4) { return mask(x0) | mask(x1) | mask(x2) | mask(x3) | mask(x4) ; } + //! Generate a bit-mask that has `x0`, `x1`, `x2`, `x3`, `x4` and `x5` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t x4, uint32_t x5) { return mask(x0) | mask(x1) | mask(x2) | mask(x3) | mask(x4) | mask(x5) ; } + //! Generate a bit-mask that has `x0`, `x1`, `x2`, `x3`, `x4`, `x5` and `x6` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t x4, uint32_t x5, uint32_t x6) { return mask(x0) | mask(x1) | mask(x2) | mask(x3) | mask(x4) | mask(x5) | mask(x6) ; } + //! Generate a bit-mask that has `x0`, `x1`, `x2`, `x3`, `x4`, `x5`, `x6` and `x7` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t x4, uint32_t x5, uint32_t x6, uint32_t x7) { return mask(x0) | mask(x1) | mask(x2) | mask(x3) | mask(x4) | mask(x5) | mask(x6) | mask(x7) ; } + //! Generate a bit-mask that has `x0`, `x1`, `x2`, `x3`, `x4`, `x5`, `x6`, `x7` and `x8` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t x4, uint32_t x5, uint32_t x6, uint32_t x7, uint32_t x8) { return mask(x0) | mask(x1) | mask(x2) | mask(x3) | mask(x4) | mask(x5) | mask(x6) | mask(x7) | mask(x8) ; } + //! Generate a bit-mask that has `x0`, `x1`, `x2`, `x3`, `x4`, `x5`, `x6`, `x7`, `x8` and `x9` bits set. static ASMJIT_INLINE uint32_t mask(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t x4, uint32_t x5, uint32_t x6, uint32_t x7, uint32_t x8, uint32_t x9) { return mask(x0) | mask(x1) | mask(x2) | mask(x3) | mask(x4) | mask(x5) | mask(x6) | mask(x7) | @@ -254,6 +275,7 @@ struct IntUtil { // [AsmJit - Bits] // -------------------------------------------------------------------------- + //! Generate a bit-mask that has `x` most significant bits set. static ASMJIT_INLINE uint32_t bits(uint32_t x) { // Shifting more bits that the type has has undefined behavior. Everything // we need is that application shouldn't crash because of that, but the @@ -271,6 +293,7 @@ struct IntUtil { // [AsmJit - HasBit] // -------------------------------------------------------------------------- + //! Get whether `x` has bit `n` set. static ASMJIT_INLINE bool hasBit(uint32_t x, uint32_t n) { return static_cast((x >> n) & 0x1); } @@ -279,7 +302,9 @@ struct IntUtil { // [AsmJit - BitCount] // -------------------------------------------------------------------------- - // From http://graphics.stanford.edu/~seander/bithacks.html . + //! Get count of bits in `x`. + //! + //! Taken from http://graphics.stanford.edu/~seander/bithacks.html . static ASMJIT_INLINE uint32_t bitCount(uint32_t x) { x = x - ((x >> 1) & 0x55555555U); x = (x & 0x33333333U) + ((x >> 2) & 0x33333333U); @@ -290,6 +315,7 @@ struct IntUtil { // [AsmJit - FindFirstBit] // -------------------------------------------------------------------------- + //! @internal static ASMJIT_INLINE uint32_t findFirstBitSlow(uint32_t mask) { // This is a reference (slow) implementation of findFirstBit(), used when // we don't have compiler support for this task. The implementation speed @@ -308,6 +334,7 @@ struct IntUtil { return 0xFFFFFFFFU; } + //! Find a first bit in `mask`. static ASMJIT_INLINE uint32_t findFirstBit(uint32_t mask) { #if defined(_MSC_VER) DWORD i; @@ -369,13 +396,13 @@ struct IntUtil { return (base % alignment) == 0; } - //! @brief Align @a base to @a alignment. + //! Align `base` to `alignment`. template static ASMJIT_INLINE T alignTo(T base, T alignment) { return (base + (alignment - 1)) & ~(alignment - 1); } - //! @brief Get delta required to align @a base to @a alignment. + //! Get delta required to align `base` to `alignment`. template static ASMJIT_INLINE T deltaTo(T base, T alignment) { return alignTo(base, alignment) - base; diff --git a/src/asmjit/base/lock.h b/src/asmjit/base/lock.h index c909a8b..f39870d 100644 --- a/src/asmjit/base/lock.h +++ b/src/asmjit/base/lock.h @@ -26,14 +26,14 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_util //! @{ // ============================================================================ // [asmjit::Lock] // ============================================================================ -//! @brief Lock - used in thread-safe code for locking. +//! Lock - used in thread-safe code for locking. struct Lock { ASMJIT_NO_COPY(Lock) @@ -44,14 +44,14 @@ struct Lock { #if defined(ASMJIT_OS_WINDOWS) typedef CRITICAL_SECTION Handle; - //! @brief Create a new @ref Lock instance. + //! Create a new `Lock` instance. ASMJIT_INLINE Lock() { InitializeCriticalSection(&_handle); } - //! @brief Destroy the @ref Lock instance. + //! Destroy the `Lock` instance. ASMJIT_INLINE ~Lock() { DeleteCriticalSection(&_handle); } - //! @brief Lock. + //! Lock. ASMJIT_INLINE void lock() { EnterCriticalSection(&_handle); } - //! @brief Unlock. + //! Unlock. ASMJIT_INLINE void unlock() { LeaveCriticalSection(&_handle); } #endif // ASMJIT_OS_WINDOWS @@ -63,14 +63,14 @@ struct Lock { #if defined(ASMJIT_OS_POSIX) typedef pthread_mutex_t Handle; - //! @brief Create a new @ref Lock instance. + //! Create a new `Lock` instance. ASMJIT_INLINE Lock() { pthread_mutex_init(&_handle, NULL); } - //! @brief Destroy the @ref Lock instance. + //! Destroy the `Lock` instance. ASMJIT_INLINE ~Lock() { pthread_mutex_destroy(&_handle); } - //! @brief Lock. + //! Lock. ASMJIT_INLINE void lock() { pthread_mutex_lock(&_handle); } - //! @brief Unlock. + //! Unlock. ASMJIT_INLINE void unlock() { pthread_mutex_unlock(&_handle); } #endif // ASMJIT_OS_POSIX @@ -78,7 +78,7 @@ struct Lock { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get handle. + //! Get handle. ASMJIT_INLINE Handle& getHandle() { return _handle; } //! @overload ASMJIT_INLINE const Handle& getHandle() const { return _handle; } @@ -87,7 +87,7 @@ struct Lock { // [Members] // -------------------------------------------------------------------------- - //! @brief Handle. + //! Handle. Handle _handle; }; @@ -95,7 +95,7 @@ struct Lock { // [asmjit::AutoLock] // ============================================================================ -//! @brief Scope auto locker. +//! Scope auto locker. struct AutoLock { ASMJIT_NO_COPY(AutoLock) @@ -103,12 +103,12 @@ struct AutoLock { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Locks @a target. + //! Autolock `target`, scoped. ASMJIT_INLINE AutoLock(Lock& target) : _target(target) { _target.lock(); } - //! @brief Unlocks target. + //! Autounlock `target`. ASMJIT_INLINE ~AutoLock() { _target.unlock(); } @@ -117,7 +117,7 @@ struct AutoLock { // [Members] // -------------------------------------------------------------------------- - //! @brief Pointer to target (lock). + //! Pointer to target (lock). Lock& _target; }; diff --git a/src/asmjit/base/logger.cpp b/src/asmjit/base/logger.cpp index 615c202..7bcb94f 100644 --- a/src/asmjit/base/logger.cpp +++ b/src/asmjit/base/logger.cpp @@ -21,21 +21,21 @@ namespace asmjit { // ============================================================================ -// [asmjit::BaseLogger - Construction / Destruction] +// [asmjit::Logger - Construction / Destruction] // ============================================================================ -BaseLogger::BaseLogger() { +Logger::Logger() { _options = 0; ::memset(_indentation, 0, ASMJIT_ARRAY_SIZE(_indentation)); } -BaseLogger::~BaseLogger() {} +Logger::~Logger() {} // ============================================================================ -// [asmjit::BaseLogger - Logging] +// [asmjit::Logger - Logging] // ============================================================================ -void BaseLogger::logFormat(uint32_t style, const char* fmt, ...) { +void Logger::logFormat(uint32_t style, const char* fmt, ...) { char buf[1024]; size_t len; @@ -47,7 +47,7 @@ void BaseLogger::logFormat(uint32_t style, const char* fmt, ...) { logString(style, buf, len); } -void BaseLogger::logBinary(uint32_t style, const void* data, size_t size) { +void Logger::logBinary(uint32_t style, const void* data, size_t size) { static const char prefix[] = ".data "; static const char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; @@ -78,10 +78,10 @@ void BaseLogger::logBinary(uint32_t style, const void* data, size_t size) { } // ============================================================================ -// [asmjit::BaseLogger - LogBinary] +// [asmjit::Logger - LogBinary] // ============================================================================ -void BaseLogger::setOption(uint32_t id, bool value) { +void Logger::setOption(uint32_t id, bool value) { if (id >= kLoggerOptionCount) return; @@ -94,10 +94,10 @@ void BaseLogger::setOption(uint32_t id, bool value) { } // ============================================================================ -// [asmjit::BaseLogger - Indentation] +// [asmjit::Logger - Indentation] // ============================================================================ -void BaseLogger::setIndentation(const char* indentation) { +void Logger::setIndentation(const char* indentation) { ::memset(_indentation, 0, ASMJIT_ARRAY_SIZE(_indentation)); if (!indentation) return; @@ -120,7 +120,7 @@ FileLogger::~FileLogger() {} // [asmjit::FileLogger - Accessors] // ============================================================================ -//! @brief Set file stream. +//! Set file stream. void FileLogger::setStream(FILE* stream) { _stream = stream; } diff --git a/src/asmjit/base/logger.h b/src/asmjit/base/logger.h index c58e981..52b0383 100644 --- a/src/asmjit/base/logger.h +++ b/src/asmjit/base/logger.h @@ -20,24 +20,24 @@ namespace asmjit { -//! @addtogroup asmjit_logging +//! @addtogroup asmjit_base_logging_and_errors //! @{ // ============================================================================ // [asmjit::kLoggerOption] // ============================================================================ -//! @brief Logger options. +//! Logger options. ASMJIT_ENUM(kLoggerOption) { - //! @brief Whether to output instructions also in binary form. + //! Whether to output instructions also in binary form. kLoggerOptionBinaryForm = 0, - //! @brief Whether to output immediates as hexadecimal numbers. + //! Whether to output immediates as hexadecimal numbers. kLoggerOptionHexImmediate = 1, - //! @brief Whether to output displacements as hexadecimal numbers. + //! Whether to output displacements as hexadecimal numbers. kLoggerOptionHexDisplacement = 2, - //! @brief Count of logger options. + //! Count of logger options. kLoggerOptionCount = 3 }; @@ -45,6 +45,7 @@ ASMJIT_ENUM(kLoggerOption) { // [asmjit::kLoggerStyle] // ============================================================================ +//! Logger style. ASMJIT_ENUM(kLoggerStyle) { kLoggerStyleDefault = 0, kLoggerStyleDirective = 1, @@ -59,77 +60,75 @@ ASMJIT_ENUM(kLoggerStyle) { // [asmjit::Logger] // ============================================================================ -//! @brief Abstract logging class. +//! Abstract logging class. //! //! This class can be inherited and reimplemented to fit into your logging -//! subsystem. When reimplementing use @c asmjit::Logger::log() method to -//! log into your stream. +//! subsystem. When reimplementing use `Logger::log()` method to log into +//! a custom stream. //! -//! This class also contain @c _enabled member that can be used to enable +//! This class also contain `_enabled` member that can be used to enable //! or disable logging. -struct BaseLogger { - ASMJIT_NO_COPY(BaseLogger) +struct Logger { + ASMJIT_NO_COPY(Logger) // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a @ref BaseLogger instance. - ASMJIT_API BaseLogger(); - //! @brief Destroy the @ref BaseLogger instance. - ASMJIT_API virtual ~BaseLogger(); + //! Create a `Logger` instance. + ASMJIT_API Logger(); + //! Destroy the `Logger` instance. + ASMJIT_API virtual ~Logger(); // -------------------------------------------------------------------------- // [Logging] // -------------------------------------------------------------------------- - //! @brief Abstract method to log output. - //! - //! Default implementation that is in @c asmjit::Logger is to do nothing. - //! It's virtual to fit to your logging system. + //! Log output. virtual void logString(uint32_t style, const char* buf, size_t len = kInvalidIndex) = 0; - //! @brief Log formatter message (like sprintf) sending output to @c logString() method. + //! Log formatter message (like sprintf) sending output to `logString()` method. ASMJIT_API void logFormat(uint32_t style, const char* fmt, ...); - //! @brief Log binary data. + //! Log binary data. ASMJIT_API void logBinary(uint32_t style, const void* data, size_t size); // -------------------------------------------------------------------------- // [Options] // -------------------------------------------------------------------------- - //! @brief Get all logger options as a single integer. - ASMJIT_INLINE uint32_t getOptions() const - { return _options; } + //! Get all logger options as a single integer. + ASMJIT_INLINE uint32_t getOptions() const { + return _options; + } - //! @brief Get the given logger option. + //! Get the given logger option. ASMJIT_INLINE bool getOption(uint32_t id) const { ASMJIT_ASSERT(id < kLoggerOptionCount); return static_cast((_options >> id) & 0x1); } - //! @brief Set the given logger option. + //! Set the given logger option. ASMJIT_API void setOption(uint32_t id, bool value); // -------------------------------------------------------------------------- // [Indentation] // -------------------------------------------------------------------------- - //! @brief Get indentation. + //! Get indentation. ASMJIT_INLINE const char* getIndentation() const { return _indentation; } - //! @brief Set indentation. + //! Set indentation. ASMJIT_API void setIndentation(const char* indentation); - //! @brief Reset indentation. + //! Reset indentation. ASMJIT_INLINE void resetIndentation() { setIndentation(NULL); } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Options, see @ref kLoggerOption. + //! Options, see `kLoggerOption`. uint32_t _options; - //! @brief Indentation. + //! Indentation. char _indentation[12]; }; @@ -137,35 +136,33 @@ struct BaseLogger { // [asmjit::FileLogger] // ============================================================================ -//! @brief Logger that can log to standard C @c FILE* stream. -struct FileLogger : public BaseLogger { +//! Logger that can log to standard C `FILE*` stream. +struct FileLogger : public Logger { ASMJIT_NO_COPY(FileLogger) // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @c FileLogger. - //! @param stream FILE stream where logging will be sent (can be @c NULL - //! to disable logging). + //! Create a new `FileLogger` that logs to a `FILE` stream. ASMJIT_API FileLogger(FILE* stream = NULL); - //! @brief Destroy the @ref FileLogger. + //! Destroy the `FileLogger`. ASMJIT_API virtual ~FileLogger(); // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get @c FILE* stream. + //! Get `FILE*` stream. //! - //! @note Return value can be @c NULL. + //! @note Return value can be `NULL`. ASMJIT_INLINE FILE* getStream() const { return _stream; } - //! @brief Set @c FILE* stream. + //! Set `FILE*` stream. //! - //! @param stream @c FILE stream where to log output (can be @c NULL to - //! disable logging). + //! @param stream `FILE` stream where to log output, can be set to `NULL` to + //! disable logging. ASMJIT_API void setStream(FILE* stream); // -------------------------------------------------------------------------- @@ -178,7 +175,7 @@ struct FileLogger : public BaseLogger { // [Members] // -------------------------------------------------------------------------- - //! @brief C file stream. + //! C file stream. FILE* _stream; }; @@ -186,31 +183,31 @@ struct FileLogger : public BaseLogger { // [asmjit::StringLogger] // ============================================================================ -//! @brief String logger. -struct StringLogger : public BaseLogger { +//! String logger. +struct StringLogger : public Logger { ASMJIT_NO_COPY(StringLogger) // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new @ref StringLogger. + //! Create new `StringLogger`. ASMJIT_API StringLogger(); - //! @brief Destroy the @ref StringLogger. + //! Destroy the `StringLogger`. ASMJIT_API virtual ~StringLogger(); // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get char* pointer which represents the resulting + //! Get char* pointer which represents the resulting //! string. //! - //! The pointer is owned by @ref StringLogger, it can't be modified or freed. + //! The pointer is owned by `StringLogger`, it can't be modified or freed. ASMJIT_INLINE const char* getString() const { return _stringBuilder.getData(); } - //! @brief Clear the resulting string. + //! Clear the resulting string. ASMJIT_INLINE void clearString() { _stringBuilder.clear(); } // -------------------------------------------------------------------------- @@ -223,7 +220,7 @@ struct StringLogger : public BaseLogger { // [Members] // -------------------------------------------------------------------------- - //! @brief Output. + //! Output. StringBuilder _stringBuilder; }; diff --git a/src/asmjit/base/memorymanager.cpp b/src/asmjit/base/memorymanager.cpp index 20e7549..e69de29 100644 --- a/src/asmjit/base/memorymanager.cpp +++ b/src/asmjit/base/memorymanager.cpp @@ -1,1047 +0,0 @@ -// [AsmJit] -// Complete x86/x64 JIT and Remote Assembler for C++. -// -// [License] -// Zlib - See LICENSE.md file in the package. - -// [Export] -#define ASMJIT_EXPORTS - -// [Dependencies - AsmJit] -#include "../base/error.h" -#include "../base/globals.h" -#include "../base/lock.h" -#include "../base/memorymanager.h" -#include "../base/vmem.h" - -// [Api-Begin] -#include "../apibegin.h" - -// This file contains implementation of virtual memory management for AsmJit -// library. The initial concept is to keep this implementation simple but -// efficient. There are several goals I decided to write implementation myself. -// -// Goals: -// - We need usually to allocate blocks of 64 bytes long and more. -// - Alignment of allocated blocks is large - 32 bytes or 64 bytes. -// - Keep memory manager information outside allocated virtual memory pages -// (these pages allows execution of code). -// - Keep implementation small. -// -// I think that implementation is not small and probably not too much readable, -// so there is small know how. -// -// - Implementation is based on bit arrays and binary trees. Bit arrays -// contains information about allocated and unused blocks of memory. Each -// block size describes MemNode::density member. Count of blocks are -// stored in MemNode::blocks member. For example if density is 64 and -// count of blocks is 20, memory node contains 64*20 bytes of memory and -// smallest possible allocation (and also alignment) is 64 bytes. So density -// describes also memory alignment. Binary trees are used to enable fast -// lookup into all addresses allocated by memory manager instance. This is -// used mainly in MemoryManagerPrivate::release(). -// -// Bit array looks like this (empty = unused, X = used) - Size of block 64 -// ------------------------------------------------------------------------- -// | |X|X| | | | | |X|X|X|X|X|X| | | | | | | | | | | | |X| | | | |X|X|X| | | -// ------------------------------------------------------------------------- -// Bits array shows that there are 12 allocated blocks of 64 bytes, so total -// allocated size is 768 bytes. Maximum count of continuous blocks is 12 -// (see largest gap). - -namespace asmjit { - -// ============================================================================ -// [Ops] -// ============================================================================ - -enum { kBitsPerEntity = (sizeof(size_t) * 8) }; - -static void _SetBits(size_t* buf, size_t index, size_t len) { - if (len == 0) - return; - - size_t i = index / kBitsPerEntity; // size_t[] - size_t j = index % kBitsPerEntity; // size_t[][] bit index - - // How many bytes process in the first group. - size_t c = kBitsPerEntity - j; - if (c > len) c = len; - - // Offset. - buf += i; - - *buf++ |= ((~(size_t)0) >> (kBitsPerEntity - c)) << j; - len -= c; - - while (len >= kBitsPerEntity) { - *buf++ = ~(size_t)0; - len -= kBitsPerEntity; - } - - if (len) - *buf |= ((~(size_t)0) >> (kBitsPerEntity - len)); -} - -// ============================================================================ -// [asmjit::MemNode] -// ============================================================================ - -#define M_DIV(x, y) ((x) / (y)) -#define M_MOD(x, y) ((x) % (y)) - -struct RbNode { - // -------------------------------------------------------------------------- - // [Red-black tree node, key is mem pointer]. - // -------------------------------------------------------------------------- - - // Implementation is based on article by Julienne Walker (Public Domain), - // including C code and original comments. Thanks for the excellent article. - - // Left[0] and right[1] nodes. - RbNode* node[2]; - // Whether the node is RED. - uint32_t red; - - // -------------------------------------------------------------------------- - // [Chunk Memory] - // -------------------------------------------------------------------------- - - // Virtual memory address. - uint8_t* mem; -}; - -// Get whether the node is red (NULL or node with red flag). -ASMJIT_INLINE bool rbIsRed(RbNode* node) { - return node != NULL && node->red; -} - -struct MemNode : public RbNode { - // -------------------------------------------------------------------------- - // [Node double-linked list] - // -------------------------------------------------------------------------- - - MemNode* prev; // Prev node in list. - MemNode* next; // Next node in list. - - // -------------------------------------------------------------------------- - // [Chunk Data] - // -------------------------------------------------------------------------- - - size_t size; // How many bytes contain this node. - size_t blocks; // How many blocks are here. - size_t density; // Minimum count of allocated bytes in this node (also alignment). - size_t used; // How many bytes are used in this node. - size_t largestBlock; // Contains largest block that can be allocated. - - size_t* baUsed; // Contains bits about used blocks (0 = unused, 1 = used). - size_t* baCont; // Contains bits about continuous blocks (0 = stop , 1 = continue). - - // -------------------------------------------------------------------------- - // [Methods] - // -------------------------------------------------------------------------- - - // Get available space. - ASMJIT_INLINE size_t getAvailable() const { return size - used; } - - ASMJIT_INLINE void fillData(MemNode* other) { - mem = other->mem; - - size = other->size; - blocks = other->blocks; - density = other->density; - used = other->used; - largestBlock = other->largestBlock; - baUsed = other->baUsed; - baCont = other->baCont; - } -}; - -// ============================================================================ -// [asmjit::PermanentNode] -// ============================================================================ - -//! @brief Permanent node. -struct PermanentNode { - uint8_t* mem; // Base pointer (virtual memory address). - size_t size; // Count of bytes allocated. - size_t used; // Count of bytes used. - PermanentNode* prev; // Pointer to prev chunk or NULL. - - // Get available space. - ASMJIT_INLINE size_t getAvailable() const { return size - used; } -}; - -// ============================================================================ -// [asmjit::MemoryManagerPrivate] -// ============================================================================ - -struct MemoryManagerPrivate { - // -------------------------------------------------------------------------- - // [Construction / Destruction] - // -------------------------------------------------------------------------- - -#if !defined(ASMJIT_OS_WINDOWS) - MemoryManagerPrivate(); -#else - MemoryManagerPrivate(HANDLE hProcess); -#endif // ASMJIT_OS_WINDOWS - ~MemoryManagerPrivate(); - - // -------------------------------------------------------------------------- - // [Allocation] - // -------------------------------------------------------------------------- - - MemNode* createNode(size_t size, size_t density); - - void reset(bool keepVirtualMemory); - - void* allocPermanent(size_t vsize); - void* allocFreeable(size_t vsize); - Error release(void* address); - Error shrink(void* address, size_t used); - - // Helpers to avoid ifdefs in the code. - ASMJIT_INLINE uint8_t* allocVirtualMemory(size_t size, size_t* vsize) { -#if !defined(ASMJIT_OS_WINDOWS) - return (uint8_t*)VMem::alloc(size, vsize, true); -#else - return (uint8_t*)VMem::allocProcessMemory(_hProcess, size, vsize, true); -#endif - } - - ASMJIT_INLINE void freeVirtualMemory(void* vmem, size_t vsize) { -#if !defined(ASMJIT_OS_WINDOWS) - VMem::release(vmem, vsize); -#else - VMem::releaseProcessMemory(_hProcess, vmem, vsize); -#endif - } - - // -------------------------------------------------------------------------- - // [NodeList RB-Tree] - // -------------------------------------------------------------------------- - - bool checkTree(); - - void insertNode(MemNode* node); - MemNode* removeNode(MemNode* node); - MemNode* findPtr(uint8_t* mem); - - // -------------------------------------------------------------------------- - // [Members] - // -------------------------------------------------------------------------- - -#if defined(ASMJIT_OS_WINDOWS) - HANDLE _hProcess; // Process where to allocate memory. -#endif // ASMJIT_OS_WINDOWS - Lock _lock; // Lock for thread safety. - - size_t _newChunkSize; // Default node size. - size_t _newChunkDensity; // Default node density. - size_t _allocated; // How many bytes are allocated. - size_t _used; // How many bytes are used. - - // Memory nodes list. - MemNode* _first; - MemNode* _last; - MemNode* _optimal; - - // Memory nodes tree. - MemNode* _root; - - // Permanent memory. - PermanentNode* _permanent; - - // Whether to keep virtual memory after destroy. - bool _keepVirtualMemory; -}; - -// ============================================================================ -// [asmjit::MemoryManagerPrivate - Construction / Destruction] -// ============================================================================ - -#if !defined(ASMJIT_OS_WINDOWS) -MemoryManagerPrivate::MemoryManagerPrivate() : -#else -MemoryManagerPrivate::MemoryManagerPrivate(HANDLE hProcess) : - _hProcess(hProcess), -#endif - _newChunkSize(65536), - _newChunkDensity(64), - _allocated(0), - _used(0), - _root(NULL), - _first(NULL), - _last(NULL), - _optimal(NULL), - _permanent(NULL), - _keepVirtualMemory(false) {} - -MemoryManagerPrivate::~MemoryManagerPrivate() { - // Freeable memory cleanup - Also frees the virtual memory if configured to. - reset(_keepVirtualMemory); - - // Permanent memory cleanup - Never frees the virtual memory. - PermanentNode* node = _permanent; - while (node) { - PermanentNode* prev = node->prev; - ::free(node); - node = prev; - } -} - -// ============================================================================ -// [asmjit::MemoryManagerPrivate - Allocation] -// ============================================================================ - -// Allocate virtual memory node and MemNode structure. -// -// Returns MemNode* on success, otherwise NULL. -MemNode* MemoryManagerPrivate::createNode(size_t size, size_t density) { - size_t vsize; - uint8_t* vmem = allocVirtualMemory(size, &vsize); - - // Out of memory. - if (vmem == NULL) return NULL; - - size_t blocks = (vsize / density); - size_t bsize = (((blocks + 7) >> 3) + sizeof(size_t) - 1) & ~(size_t)(sizeof(size_t) - 1); - - MemNode* node = static_cast(::malloc(sizeof(MemNode))); - uint8_t* data = static_cast(::malloc(bsize * 2)); - - // Out of memory. - if (node == NULL || data == NULL) { - freeVirtualMemory(vmem, vsize); - if (node) ::free(node); - if (data) ::free(data); - return NULL; - } - - // Initialize RbNode data. - node->node[0] = NULL; - node->node[1] = NULL; - node->red = 1; - node->mem = vmem; - - // Initialize MemNode data. - node->prev = NULL; - node->next = NULL; - - node->size = vsize; - node->blocks = blocks; - node->density = density; - node->used = 0; - node->largestBlock = vsize; - - ::memset(data, 0, bsize * 2); - node->baUsed = reinterpret_cast(data); - node->baCont = reinterpret_cast(data + bsize); - - return node; -} - -void MemoryManagerPrivate::reset(bool keepVirtualMemory) { - MemNode* node = _first; - - while (node) { - MemNode* next = node->next; - - if (!keepVirtualMemory) - freeVirtualMemory(node->mem, node->size); - - ::free(node->baUsed); - ::free(node); - - node = next; - } - - _allocated = 0; - _used = 0; - - _root = NULL; - _first = NULL; - _last = NULL; - _optimal = NULL; -} - -void* MemoryManagerPrivate::allocPermanent(size_t vsize) { - static const size_t permanentAlignment = 32; - static const size_t permanentNodeSize = 32768; - - size_t over = vsize % permanentAlignment; - if (over) - over = permanentAlignment - over; - - size_t alignedSize = vsize + over; - AutoLock locked(_lock); - - PermanentNode* node = _permanent; - - // Try to find space in allocated chunks. - while (node && alignedSize > node->getAvailable()) - node = node->prev; - - // Or allocate new node. - if (node == NULL) { - size_t nodeSize = permanentNodeSize; - - if (vsize > nodeSize) - nodeSize = vsize; - - node = static_cast(::malloc(sizeof(PermanentNode))); - - // Out of memory. - if (node == NULL) - return NULL; - - node->mem = allocVirtualMemory(nodeSize, &node->size); - - // Out of memory. - if (node->mem == NULL) { - ::free(node); - return NULL; - } - - node->used = 0; - node->prev = _permanent; - _permanent = node; - } - - // Finally, copy function code to our space we reserved for. - uint8_t* result = node->mem + node->used; - - // Update Statistics. - node->used += alignedSize; - _used += alignedSize; - - // Code can be null to only reserve space for code. - return static_cast(result); -} - -void* MemoryManagerPrivate::allocFreeable(size_t vsize) { - size_t i; // Current index. - size_t need; // How many we need to be freed. - size_t minVSize; - - // Align to 32 bytes (our default alignment). - vsize = (vsize + 31) & ~(size_t)31; - if (vsize == 0) return NULL; - - AutoLock locked(_lock); - MemNode* node = _optimal; - - minVSize = _newChunkSize; - - // Try to find memory block in existing nodes. - while (node) { - // Skip this node? - if ((node->getAvailable() < vsize) || (node->largestBlock < vsize && node->largestBlock != 0)) { - MemNode* next = node->next; - if (node->getAvailable() < minVSize && node == _optimal && next) _optimal = next; - node = next; - continue; - } - - size_t* up = node->baUsed; // Current ubits address. - size_t ubits; // Current ubits[0] value. - size_t bit; // Current bit mask. - size_t blocks = node->blocks; // Count of blocks in node. - size_t cont = 0; // How many bits are currently freed in find loop. - size_t maxCont = 0; // Largest continuous block (bits count). - size_t j; - - need = M_DIV((vsize + node->density - 1), node->density); - i = 0; - - // Try to find node that is large enough. - while (i < blocks) { - ubits = *up++; - - // Fast skip used blocks. - if (ubits == ~(size_t)0) { - if (cont > maxCont) maxCont = cont; - cont = 0; - - i += kBitsPerEntity; - continue; - } - - size_t max = kBitsPerEntity; - if (i + max > blocks) - max = blocks - i; - - for (j = 0, bit = 1; j < max; bit <<= 1) { - j++; - if ((ubits & bit) == 0) { - if (++cont == need) { i += j; i -= cont; goto _Found; } - continue; - } - - if (cont > maxCont) maxCont = cont; - cont = 0; - } - - i += kBitsPerEntity; - } - - // Because we traversed entire node, we can set largest node size that - // will be used to cache next traversing.. - node->largestBlock = maxCont * node->density; - - node = node->next; - } - - // If we are here, we failed to find existing memory block and we must - // allocate new. - { - size_t chunkSize = _newChunkSize; - if (chunkSize < vsize) chunkSize = vsize; - - node = createNode(chunkSize, _newChunkDensity); - if (node == NULL) return NULL; - - // Update binary tree. - insertNode(node); - ASMJIT_ASSERT(checkTree()); - - // Alloc first node at start. - i = 0; - need = (vsize + node->density - 1) / node->density; - - // Update statistics. - _allocated += node->size; - } - -_Found: - // Update bits. - _SetBits(node->baUsed, i, need); - _SetBits(node->baCont, i, need - 1); - - // Update statistics. - { - size_t u = need * node->density; - node->used += u; - node->largestBlock = 0; - _used += u; - } - - // And return pointer to allocated memory. - uint8_t* result = node->mem + i * node->density; - ASMJIT_ASSERT(result >= node->mem && result <= node->mem + node->size - vsize); - return result; -} - -Error MemoryManagerPrivate::release(void* address) { - if (address == NULL) - return kErrorOk; - - AutoLock locked(_lock); - - MemNode* node = findPtr((uint8_t*)address); - if (node == NULL) - return kErrorInvalidArgument; - - size_t offset = (size_t)((uint8_t*)address - (uint8_t*)node->mem); - size_t bitpos = M_DIV(offset, node->density); - size_t i = (bitpos / kBitsPerEntity); - - size_t* up = node->baUsed + i; // Current ubits address. - size_t* cp = node->baCont + i; // Current cbits address. - size_t ubits = *up; // Current ubits[0] value. - size_t cbits = *cp; // Current cbits[0] value. - size_t bit = (size_t)1 << (bitpos % kBitsPerEntity); - - size_t cont = 0; - bool stop; - - for (;;) { - stop = (cbits & bit) == 0; - ubits &= ~bit; - cbits &= ~bit; - - bit <<= 1; - cont++; - - if (stop || bit == 0) { - *up = ubits; - *cp = cbits; - if (stop) - break; - - ubits = *++up; - cbits = *++cp; - bit = 1; - } - } - - // If the freed block is fully allocated node then it's needed to - // update 'optimal' pointer in memory manager. - if (node->used == node->size) { - MemNode* cur = _optimal; - - do { - cur = cur->prev; - if (cur == node) { - _optimal = node; - break; - } - } while (cur); - } - - // Statistics. - cont *= node->density; - if (node->largestBlock < cont) - node->largestBlock = cont; - - node->used -= cont; - _used -= cont; - - // If page is empty, we can free it. - if (node->used == 0) { - // Free memory associated with node (this memory is not accessed - // anymore so it's safe). - freeVirtualMemory(node->mem, node->size); - ::free(node->baUsed); - - node->baUsed = NULL; - node->baCont = NULL; - - // Statistics. - _allocated -= node->size; - - // Remove node. This function can return different node than - // passed into, but data is copied into previous node if needed. - ::free(removeNode(node)); - ASMJIT_ASSERT(checkTree()); - } - - return kErrorOk; -} - -Error MemoryManagerPrivate::shrink(void* address, size_t used) { - if (address == NULL) - return kErrorOk; - - if (used == 0) - return release(address); - - AutoLock locked(_lock); - - MemNode* node = findPtr((uint8_t*)address); - if (node == NULL) - return kErrorInvalidArgument; - - size_t offset = (size_t)((uint8_t*)address - (uint8_t*)node->mem); - size_t bitpos = M_DIV(offset, node->density); - size_t i = (bitpos / kBitsPerEntity); - - size_t* up = node->baUsed + i; // Current ubits address. - size_t* cp = node->baCont + i; // Current cbits address. - size_t ubits = *up; // Current ubits[0] value. - size_t cbits = *cp; // Current cbits[0] value. - size_t bit = (size_t)1 << (bitpos % kBitsPerEntity); - - size_t cont = 0; - size_t usedBlocks = (used + node->density - 1) / node->density; - - bool stop; - - // Find the first block we can mark as free. - for (;;) { - stop = (cbits & bit) == 0; - if (stop) - return kErrorOk; - - if (++cont == usedBlocks) - break; - - bit <<= 1; - if (bit == 0) { - ubits = *++up; - cbits = *++cp; - bit = 1; - } - } - - // Free the tail blocks. - cont = ~(size_t)0; - goto _EnterFreeLoop; - - for (;;) { - stop = (cbits & bit) == 0; - ubits &= ~bit; - -_EnterFreeLoop: - cbits &= ~bit; - - bit <<= 1; - cont++; - - if (stop || bit == 0) { - *up = ubits; - *cp = cbits; - if (stop) - break; - - ubits = *++up; - cbits = *++cp; - bit = 1; - } - } - - // Statistics. - cont *= node->density; - if (node->largestBlock < cont) - node->largestBlock = cont; - - node->used -= cont; - _used -= cont; - - return kErrorOk; -} - -// ============================================================================ -// [asmjit::MemoryManagerPrivate - NodeList RB-Tree] -// ============================================================================ - -static int rbAssert(RbNode* root) { - if (root == NULL) - return 1; - - RbNode* ln = root->node[0]; - RbNode* rn = root->node[1]; - - // Red violation. - ASMJIT_ASSERT( !(rbIsRed(root) && (rbIsRed(ln) || rbIsRed(rn))) ); - - int lh = rbAssert(ln); - int rh = rbAssert(rn); - - // Invalid btree. - ASMJIT_ASSERT(ln == NULL || ln->mem < root->mem); - ASMJIT_ASSERT(rn == NULL || rn->mem > root->mem); - - // Black violation. - ASMJIT_ASSERT( !(lh != 0 && rh != 0 && lh != rh) ); - - // Only count black links. - if (lh != 0 && rh != 0) - return rbIsRed(root) ? lh : lh + 1; - else - return 0; -} - -static ASMJIT_INLINE RbNode* rbRotateSingle(RbNode* root, int dir) { - RbNode* save = root->node[!dir]; - - root->node[!dir] = save->node[dir]; - save->node[dir] = root; - - root->red = 1; - save->red = 0; - - return save; -} - -static ASMJIT_INLINE RbNode* rbRotateDouble(RbNode* root, int dir) { - root->node[!dir] = rbRotateSingle(root->node[!dir], !dir); - return rbRotateSingle(root, dir); -} - -bool MemoryManagerPrivate::checkTree() { - return rbAssert(_root) > 0; -} - -void MemoryManagerPrivate::insertNode(MemNode* node) { - if (_root == NULL) { - // Empty tree case. - _root = node; - } - else { - // False tree root. - RbNode head = { 0 }; - - // Grandparent & parent. - RbNode* g = NULL; - RbNode* t = &head; - - // Iterator & parent. - RbNode* p = NULL; - RbNode* q = t->node[1] = _root; - - int dir = 0, last; - - // Search down the tree. - for (;;) { - if (q == NULL) { - // Insert new node at the bottom. - q = node; - p->node[dir] = node; - } - else if (rbIsRed(q->node[0]) && rbIsRed(q->node[1])) { - // Color flip. - q->red = 1; - q->node[0]->red = 0; - q->node[1]->red = 0; - } - - // Fix red violation. - if (rbIsRed(q) && rbIsRed(p)) { - int dir2 = t->node[1] == g; - t->node[dir2] = q == p->node[last] ? rbRotateSingle(g, !last) : rbRotateDouble(g, !last); - } - - // Stop if found. - if (q == node) - break; - - last = dir; - dir = q->mem < node->mem; - - // Update helpers. - if (g != NULL) - t = g; - - g = p; - p = q; - q = q->node[dir]; - } - - // Update root. - _root = static_cast(head.node[1]); - } - - // Make root black. - _root->red = 0; - - // Link with others. - node->prev = _last; - - if (_first == NULL) { - _first = node; - _last = node; - _optimal = node; - } - else { - node->prev = _last; - _last->next = node; - _last = node; - } -} - -MemNode* MemoryManagerPrivate::removeNode(MemNode* node) { - // False tree root. - RbNode head = { 0 }; - - // Helpers. - RbNode* q = &head; - RbNode* p = NULL; - RbNode* g = NULL; - - // Found item. - RbNode* f = NULL; - int dir = 1; - - // Set up. - q->node[1] = _root; - - // Search and push a red down. - while (q->node[dir] != NULL) { - int last = dir; - - // Update helpers. - g = p; - p = q; - q = q->node[dir]; - dir = q->mem < node->mem; - - // Save found node. - if (q == node) - f = q; - - // Push the red node down. - if (!rbIsRed(q) && !rbIsRed(q->node[dir])) { - if (rbIsRed(q->node[!dir])) { - p = p->node[last] = rbRotateSingle(q, dir); - } - else if (!rbIsRed(q->node[!dir])) { - RbNode* s = p->node[!last]; - - if (s != NULL) { - if (!rbIsRed(s->node[!last]) && !rbIsRed(s->node[last])) { - // Color flip. - p->red = 0; - s->red = 1; - q->red = 1; - } - else { - int dir2 = g->node[1] == p; - - if (rbIsRed(s->node[last])) - g->node[dir2] = rbRotateDouble(p, last); - else if (rbIsRed(s->node[!last])) - g->node[dir2] = rbRotateSingle(p, last); - - // Ensure correct coloring. - q->red = g->node[dir2]->red = 1; - g->node[dir2]->node[0]->red = 0; - g->node[dir2]->node[1]->red = 0; - } - } - } - } - } - - // Replace and remove. - ASMJIT_ASSERT(f != NULL); - ASMJIT_ASSERT(f != &head); - ASMJIT_ASSERT(q != &head); - - if (f != q) { - ASMJIT_ASSERT(f != &head); - static_cast(f)->fillData(static_cast(q)); - } - - p->node[p->node[1] == q] = q->node[q->node[0] == NULL]; - - // Update root and make it black. - _root = static_cast(head.node[1]); - if (_root != NULL) - _root->red = 0; - - // Unlink. - MemNode* next = static_cast(q)->next; - MemNode* prev = static_cast(q)->prev; - - if (prev) - prev->next = next; - else - _first = next; - - if (next) - next->prev = prev; - else - _last = prev; - - if (_optimal == q) - _optimal = prev ? prev : next; - - return static_cast(q); -} - -MemNode* MemoryManagerPrivate::findPtr(uint8_t* mem) { - MemNode* cur = _root; - - while (cur != NULL) { - uint8_t* curMem = cur->mem; - if (mem < curMem) { - // Go left. - cur = static_cast(cur->node[0]); - continue; - } - else { - uint8_t* curEnd = curMem + cur->size; - if (mem >= curEnd) { - // Go right. - cur = static_cast(cur->node[1]); - continue; - } - else { - // Match. - break; - } - } - } - return cur; -} - -// ============================================================================ -// [asmjit::MemoryManager] -// ============================================================================ - -MemoryManager::MemoryManager() {} -MemoryManager::~MemoryManager() {} - -MemoryManager* MemoryManager::getGlobal() { - static VirtualMemoryManager memmgr; - return &memmgr; -} - -// ============================================================================ -// [asmjit::VirtualMemoryManager] -// ============================================================================ - -#if !defined(ASMJIT_OS_WINDOWS) -VirtualMemoryManager::VirtualMemoryManager() { - MemoryManagerPrivate* d = new(std::nothrow) MemoryManagerPrivate(); - _d = static_cast(d); -} -#else -VirtualMemoryManager::VirtualMemoryManager() { - MemoryManagerPrivate* d = new(std::nothrow) MemoryManagerPrivate(GetCurrentProcess()); - _d = static_cast(d); -} - -VirtualMemoryManager::VirtualMemoryManager(HANDLE hProcess) { - MemoryManagerPrivate* d = new(std::nothrow) MemoryManagerPrivate(hProcess); - _d = static_cast(d); -} -#endif // ASMJIT_OS_WINDOWS - -VirtualMemoryManager::~VirtualMemoryManager() { - MemoryManagerPrivate* d = static_cast(_d); - delete d; -} - -void VirtualMemoryManager::reset() { - MemoryManagerPrivate* d = static_cast(_d); - - // Calling MemoryManager::reset() will never keep allocated memory. - return d->reset(false); -} - -void* VirtualMemoryManager::alloc(size_t size, uint32_t type) { - MemoryManagerPrivate* d = static_cast(_d); - - if (type == kVirtualAllocPermanent) - return d->allocPermanent(size); - else - return d->allocFreeable(size); -} - -Error VirtualMemoryManager::release(void* address) { - MemoryManagerPrivate* d = static_cast(_d); - return d->release(address); -} - -Error VirtualMemoryManager::shrink(void* address, size_t used) { - MemoryManagerPrivate* d = static_cast(_d); - return d->shrink(address, used); -} - -size_t VirtualMemoryManager::getUsedBytes() { - MemoryManagerPrivate* d = static_cast(_d); - return d->_used; -} - -size_t VirtualMemoryManager::getAllocatedBytes() { - MemoryManagerPrivate* d = static_cast(_d); - return d->_allocated; -} - -bool VirtualMemoryManager::getKeepVirtualMemory() const { - MemoryManagerPrivate* d = static_cast(_d); - return d->_keepVirtualMemory; -} - -void VirtualMemoryManager::setKeepVirtualMemory(bool keepVirtualMemory) { - MemoryManagerPrivate* d = static_cast(_d); - d->_keepVirtualMemory = keepVirtualMemory; -} - -} // asmjit namespace - -// [Api-End] -#include "../apiend.h" diff --git a/src/asmjit/base/memorymanager.h b/src/asmjit/base/memorymanager.h index d6756e7..e69de29 100644 --- a/src/asmjit/base/memorymanager.h +++ b/src/asmjit/base/memorymanager.h @@ -1,169 +0,0 @@ -// [AsmJit] -// Complete x86/x64 JIT and Remote Assembler for C++. -// -// [License] -// Zlib - See LICENSE.md file in the package. - -// [Guard] -#ifndef _ASMJIT_BASE_MEMORYMANAGER_H -#define _ASMJIT_BASE_MEMORYMANAGER_H - -// [Dependencies - AsmJit] -#include "../base/defs.h" -#include "../base/error.h" - -// [Api-Begin] -#include "../apibegin.h" - -namespace asmjit { - -//! @addtogroup AsmJit_MemoryManagement -//! @{ - -// ============================================================================ -// [asmjit::kVirtualAlloc] -// ============================================================================ - -//! @brief Type of virtual memory allocation, see @ref MemoryManager::alloc(). -ASMJIT_ENUM(kVirtualAlloc) { - //! @brief Normal memory allocation, has to be freed by @ref MemoryManager::release(). - kVirtualAllocFreeable = 0, - //! @brief Allocate permanent memory, can't be freed. - kVirtualAllocPermanent = 1 -}; - -// ============================================================================ -// [asmjit::MemoryManager] -// ============================================================================ - -//! @brief Virtual memory manager interface. -//! -//! This class is pure virtual. You can get default virtual memory manager using -//! @c getGlobal() method. If you want to create more memory managers with same -//! functionality as global memory manager use @c VirtualMemoryManager class. -struct MemoryManager { - // -------------------------------------------------------------------------- - // [Construction / Destruction] - // -------------------------------------------------------------------------- - - //! @brief Create memory manager instance. - ASMJIT_API MemoryManager(); - //! @brief Destroy memory manager instance, this means also to free all memory - //! blocks. - ASMJIT_API virtual ~MemoryManager(); - - // -------------------------------------------------------------------------- - // [Interface] - // -------------------------------------------------------------------------- - - //! @brief Free all allocated memory. - virtual void reset() = 0; - - //! @brief Allocate a @a size bytes of virtual memory. - //! - //! Note that if you are implementing your own virtual memory manager then you - //! can quitly ignore type of allocation. This is mainly for AsmJit to memory - //! manager that allocated memory will be never freed. - virtual void* alloc(size_t size, uint32_t type = kVirtualAllocFreeable) = 0; - //! @brief Free previously allocated memory at a given @a address. - virtual Error release(void* address) = 0; - //! @brief Free some tail memory. - virtual Error shrink(void* address, size_t used) = 0; - - //! @brief Get how many bytes are currently used. - virtual size_t getUsedBytes() = 0; - //! @brief Get how many bytes are currently allocated. - virtual size_t getAllocatedBytes() = 0; - - // -------------------------------------------------------------------------- - // [Statics] - // -------------------------------------------------------------------------- - - //! @brief Get global memory manager instance. - //! - //! Global instance is instance of @c VirtualMemoryManager class. Global memory - //! manager is used by default by @ref Assembler::make() and @ref Compiler::make() - //! methods. - static ASMJIT_API MemoryManager* getGlobal(); -}; - -// ============================================================================ -// [asmjit::VirtualMemoryManager] -// ============================================================================ - -//! @brief Reference implementation of memory manager that uses @ref asmjit::VMem -//! class to allocate chunks of virtual memory and bit arrays to manage it. -struct VirtualMemoryManager : public MemoryManager { - // -------------------------------------------------------------------------- - // [Construction / Destruction] - // -------------------------------------------------------------------------- - - //! @brief Create a @c VirtualMemoryManager instance. - ASMJIT_API VirtualMemoryManager(); - -#if defined(ASMJIT_OS_WINDOWS) - //! @brief Create a @c VirtualMemoryManager instance for process @a hProcess. - //! - //! This is specialized version of constructor available only for windows and - //! usable to alloc/free memory of different process. - explicit ASMJIT_API VirtualMemoryManager(HANDLE hProcess); -#endif // ASMJIT_OS_WINDOWS - - //! @brief Destroy the @c VirtualMemoryManager instance, this means also to - //! free all blocks. - ASMJIT_API virtual ~VirtualMemoryManager(); - - // -------------------------------------------------------------------------- - // [Interface] - // -------------------------------------------------------------------------- - - ASMJIT_API virtual void reset(); - - ASMJIT_API virtual void* alloc(size_t size, uint32_t type = kVirtualAllocFreeable); - ASMJIT_API virtual Error release(void* address); - ASMJIT_API virtual Error shrink(void* address, size_t used); - - ASMJIT_API virtual size_t getUsedBytes(); - ASMJIT_API virtual size_t getAllocatedBytes(); - - // -------------------------------------------------------------------------- - // [Virtual Memory Manager Specific] - // -------------------------------------------------------------------------- - - //! @brief Get whether to keep allocated memory after memory manager is - //! destroyed. - //! - //! @sa @c setKeepVirtualMemory(). - ASMJIT_API bool getKeepVirtualMemory() const; - - //! @brief Set whether to keep allocated memory after memory manager is - //! destroyed. - //! - //! This method is usable when patching code of remote process. You need to - //! allocate process memory, store generated assembler into it and patch the - //! method you want to redirect (into your code). This method affects only - //! VirtualMemoryManager destructor. After destruction all internal - //! structures are freed, only the process virtual memory remains. - //! - //! @note Memory allocated with kVirtualAllocPermanent is always kept. - //! - //! @sa @c getKeepVirtualMemory(). - ASMJIT_API void setKeepVirtualMemory(bool keepVirtualMemory); - - // -------------------------------------------------------------------------- - // [Members] - // -------------------------------------------------------------------------- - - //! @brief Pointer to private data hidden out of the public API. - void* _d; -}; - -//! @} - -} // asmjit namespace - -// [Api-End] -#include "../apiend.h" - -// [Guard] -#endif // _ASMJIT_BASE_MEMORYMANAGER_H diff --git a/src/asmjit/base/podlist.h b/src/asmjit/base/podlist.h index 628a406..d0e84ec 100644 --- a/src/asmjit/base/podlist.h +++ b/src/asmjit/base/podlist.h @@ -17,13 +17,14 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_util //! @{ // ============================================================================ // [asmjit::PodList] // ============================================================================ +//! @internal template struct PodList { ASMJIT_NO_COPY(PodList) @@ -37,12 +38,12 @@ struct PodList { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get next node. + //! Get next node. ASMJIT_INLINE Link* getNext() const { return _next; } - //! @brief Get value. + //! Get value. ASMJIT_INLINE T getValue() const { return _value; } - //! @brief Set value to @a value. + //! Set value to `value`. ASMJIT_INLINE void setValue(const T& value) { _value = value; } // -------------------------------------------------------------------------- diff --git a/src/asmjit/base/podvector.h b/src/asmjit/base/podvector.h index 00645ef..9b82a1e 100644 --- a/src/asmjit/base/podvector.h +++ b/src/asmjit/base/podvector.h @@ -18,20 +18,23 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_util //! @{ // ============================================================================ // [asmjit::PodVectorData] // ============================================================================ +//! @internal struct PodVectorData { - //! @brief Get data. - ASMJIT_INLINE void* getData() const { return (void*)(this + 1); } + //! Get data. + ASMJIT_INLINE void* getData() const { + return (void*)(this + 1); + } - //! @brief Capacity of the vector. + //! Capacity of the vector. size_t capacity; - //! @brief Length of the vector. + //! Length of the vector. size_t length; }; @@ -39,6 +42,7 @@ struct PodVectorData { // [asmjit::PodVectorBase] // ============================================================================ +//! @internal struct PodVectorBase { static ASMJIT_API const PodVectorData _nullData; @@ -46,11 +50,11 @@ struct PodVectorBase { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new instance of @ref PodVectorBase. + //! Create a new instance of `PodVectorBase`. ASMJIT_INLINE PodVectorBase() : _d(const_cast(&_nullData)) {} - //! @brief Destroy the @ref PodVectorBase and data. + //! Destroy the `PodVectorBase` and data. ASMJIT_INLINE ~PodVectorBase() { if (_d != &_nullData) ::free(_d); @@ -76,7 +80,7 @@ public: // [asmjit::PodVector] // ============================================================================ -//! @brief Template used to store and manage array of POD data. +//! Template used to store and manage array of POD data. //! //! This template has these adventages over other vector<> templates: //! - Non-copyable (designed to be non-copyable, we want it) @@ -91,38 +95,51 @@ struct PodVector : PodVectorBase { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new instance of @ref PodVector<>. + //! Create a new instance of `PodVector`. ASMJIT_INLINE PodVector() {} - //! @brief Destroy the @ref PodVector<> and data. + //! Destroy the `PodVector<>` and data. ASMJIT_INLINE ~PodVector() {} // -------------------------------------------------------------------------- // [Data] // -------------------------------------------------------------------------- - //! @brief Get whether the vector is empty. - ASMJIT_INLINE bool isEmpty() const { return _d->length == 0; } - //! @brief Get length. - ASMJIT_INLINE size_t getLength() const { return _d->length; } - //! @brief Get capacity. - ASMJIT_INLINE size_t getCapacity() const { return _d->capacity; } + //! Get whether the vector is empty. + ASMJIT_INLINE bool isEmpty() const { + return _d->length == 0; + } + + //! Get length. + ASMJIT_INLINE size_t getLength() const { + return _d->length; + } + + //! Get capacity. + ASMJIT_INLINE size_t getCapacity() const { + return _d->capacity; + } + + //! Get data. + ASMJIT_INLINE T* getData() { + return static_cast(_d->getData()); + } - //! @brief Get data. - ASMJIT_INLINE T* getData() { return static_cast(_d->getData()); } //! @overload - ASMJIT_INLINE const T* getData() const { return static_cast(_d->getData()); } + ASMJIT_INLINE const T* getData() const { + return static_cast(_d->getData()); + } // -------------------------------------------------------------------------- // [Clear / Reset] // -------------------------------------------------------------------------- - //! @brief Clear vector data, but don't free an internal buffer. + //! Clear vector data, but don't free an internal buffer. ASMJIT_INLINE void clear() { if (_d != &_nullData) _d->length = 0; } - //! @brief Clear vector data and free internal buffer. + //! Clear vector data and free internal buffer. ASMJIT_INLINE void reset() { if (_d != &_nullData) { ::free(_d); @@ -134,19 +151,21 @@ struct PodVector : PodVectorBase { // [Grow / Reserve] // -------------------------------------------------------------------------- - //! @brief Called to grow the buffer to fit at least @a n elements more. - ASMJIT_INLINE Error _grow(size_t n) - { return PodVectorBase::_grow(n, sizeof(T)); } + //! Called to grow the buffer to fit at least `n` elements more. + ASMJIT_INLINE Error _grow(size_t n) { + return PodVectorBase::_grow(n, sizeof(T)); + } - //! @brief Realloc internal array to fit at least @a to items. - ASMJIT_INLINE Error _reserve(size_t n) - { return PodVectorBase::_reserve(n, sizeof(T)); } + //! Realloc internal array to fit at least `n` items. + ASMJIT_INLINE Error _reserve(size_t n) { + return PodVectorBase::_reserve(n, sizeof(T)); + } // -------------------------------------------------------------------------- // [Ops] // -------------------------------------------------------------------------- - //! @brief Prepend @a item to vector. + //! Prepend `item` to vector. Error prepend(const T& item) { PodVectorData* d = _d; @@ -162,7 +181,7 @@ struct PodVector : PodVectorBase { return kErrorOk; } - //! @brief Insert an @a item at the @a index. + //! Insert an `item` at the `index`. Error insert(size_t index, const T& item) { PodVectorData* d = _d; ASMJIT_ASSERT(index <= d->length); @@ -180,7 +199,7 @@ struct PodVector : PodVectorBase { return kErrorOk; } - //! @brief Append @a item to vector. + //! Append `item` to vector. Error append(const T& item) { PodVectorData* d = _d; @@ -195,7 +214,7 @@ struct PodVector : PodVectorBase { return kErrorOk; } - //! @brief Get index of @a val or kInvalidIndex if not found. + //! Get index of `val` or `kInvalidIndex` if not found. size_t indexOf(const T& val) const { PodVectorData* d = _d; @@ -209,7 +228,7 @@ struct PodVector : PodVectorBase { return kInvalidIndex; } - //! @brief Remove item at index @a i. + //! Remove item at index `i`. void removeAt(size_t i) { PodVectorData* d = _d; ASMJIT_ASSERT(i < d->length); @@ -219,26 +238,26 @@ struct PodVector : PodVectorBase { ::memmove(data, data + 1, d->length - i); } - //! @brief Swap this pod-vector with @a other. + //! Swap this pod-vector with `other`. void swap(PodVector& other) { T* otherData = other._d; other._d = _d; _d = otherData; } - //! @brief Get item at index @a i. + //! Get item at index `i`. ASMJIT_INLINE T& operator[](size_t i) { ASMJIT_ASSERT(i < getLength()); return getData()[i]; } - //! @brief Get item at index @a i. + //! Get item at index `i`. ASMJIT_INLINE const T& operator[](size_t i) const { ASMJIT_ASSERT(i < getLength()); return getData()[i]; } - //! @brief Allocate and append a new item and return its address. + //! Allocate and append a new item and return its address. T* newElement() { PodVectorData* d = _d; diff --git a/src/asmjit/base/runtime.cpp b/src/asmjit/base/runtime.cpp index f322ca4..3a2a9e5 100644 --- a/src/asmjit/base/runtime.cpp +++ b/src/asmjit/base/runtime.cpp @@ -12,7 +12,6 @@ #include "../base/cpuinfo.h" #include "../base/defs.h" #include "../base/error.h" -#include "../base/memorymanager.h" #include "../base/runtime.h" // [Api-Begin] @@ -21,19 +20,18 @@ namespace asmjit { // ============================================================================ -// [asmjit::BaseRuntime - Construction / Destruction] +// [asmjit::Runtime - Construction / Destruction] // ============================================================================ -BaseRuntime::BaseRuntime() {} -BaseRuntime::~BaseRuntime() {} +Runtime::Runtime() {} +Runtime::~Runtime() {} // ============================================================================ // [asmjit::JitRuntime - Construction / Destruction] // ============================================================================ -JitRuntime::JitRuntime(MemoryManager* memmgr) : - _memoryManager(memmgr ? memmgr : MemoryManager::getGlobal()), - _allocType(kVirtualAllocFreeable) {} +JitRuntime::JitRuntime() : + _allocType(kVMemAllocFreeable) {} JitRuntime::~JitRuntime() {} @@ -82,8 +80,7 @@ Error JitRuntime::add(void** dst, BaseAssembler* assembler) { return kErrorCompilerNoFunc; } - MemoryManager* memmgr = getMemoryManager(); - void* p = memmgr->alloc(codeSize, getAllocType()); + void* p = _memMgr.alloc(codeSize, getAllocType()); if (p == NULL) { *dst = NULL; @@ -93,9 +90,9 @@ Error JitRuntime::add(void** dst, BaseAssembler* assembler) { // Relocate the code. size_t relocSize = assembler->relocCode(p); - // Return unused memory to MemoryManager. + // Return unused memory to `VMemMgr`. if (relocSize < codeSize) - memmgr->shrink(p, relocSize); + _memMgr.shrink(p, relocSize); // Return the code. *dst = p; @@ -103,8 +100,7 @@ Error JitRuntime::add(void** dst, BaseAssembler* assembler) { } Error JitRuntime::release(void* p) { - MemoryManager* memmgr = getMemoryManager(); - return memmgr->release(p); + return _memMgr.release(p); } } // asmjit namespace diff --git a/src/asmjit/base/runtime.h b/src/asmjit/base/runtime.h index 1133bb7..32aaeca 100644 --- a/src/asmjit/base/runtime.h +++ b/src/asmjit/base/runtime.h @@ -10,63 +10,57 @@ // [Dependencies - AsmJit] #include "../base/error.h" +#include "../base/vmem.h" // [Api-Begin] #include "../apibegin.h" namespace asmjit { +//! @addtogroup asmjit_base_codegen +//! @{ + // ============================================================================ // [Forward Declarations] // ============================================================================ struct BaseAssembler; struct BaseCpuInfo; -struct MemoryManager; // ============================================================================ -// [asmjit::BaseRuntime] +// [asmjit::Runtime] // ============================================================================ -//! @brief Base runtime. -struct BaseRuntime { - ASMJIT_NO_COPY(BaseRuntime) +//! Base runtime. +struct Runtime { + ASMJIT_NO_COPY(Runtime) // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a @ref BaseRuntime instance. - ASMJIT_API BaseRuntime(); - //! @brief Destroy the @ref BaseRuntime instance. - ASMJIT_API virtual ~BaseRuntime(); + //! Create a `Runtime` instance. + ASMJIT_API Runtime(); + //! Destroy the `Runtime` instance. + ASMJIT_API virtual ~Runtime(); // -------------------------------------------------------------------------- // [Interface] // -------------------------------------------------------------------------- - //! @brief Get stack alignment of target runtime. + //! Get stack alignment of target runtime. virtual uint32_t getStackAlignment() = 0; - //! @brief Get CPU information. + //! Get CPU information. virtual const BaseCpuInfo* getCpuInfo() = 0; - //! @brief Allocate memory for code generated in @a assembler and reloc it - //! to the target location. + //! Allocate a memory needed for a code generated by `BaseAssembler` and + //! relocate it to the target location. //! - //! This method is universal allowing any preprocessing / postprocessing - //! with code generated by @ref BaseAssembler or @ref BaseCompiler. Because - //! @ref BaseCompiler always uses @ref BaseAssembler it's allowed to access - //! only the @ref BaseAssembler instance. - //! - //! This method is always last step when using code generation. You can use - //! it to allocate memory for JIT code, saving code to remote process or a - //! file. - //! - //! @retrurn Status code, see @ref kError. + //! Returns Status code as `kError`. virtual Error add(void** dst, BaseAssembler* assembler) = 0; - //! @brief Release memory allocated by add. + //! Release memory allocated by `add`. virtual Error release(void* p) = 0; }; @@ -74,21 +68,21 @@ struct BaseRuntime { // [asmjit::JitRuntime] // ============================================================================ -//! @brief JIT runtime. -struct JitRuntime : public BaseRuntime { +//! JIT runtime. +struct JitRuntime : public Runtime { ASMJIT_NO_COPY(JitRuntime) // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a @c JitRuntime instance. - ASMJIT_API JitRuntime(MemoryManager* memmgr = NULL); - //! @brief Destroy the @c JitRuntime instance. + //! Create a `JitRuntime` instance. + ASMJIT_API JitRuntime(); + //! Destroy the `JitRuntime` instance. ASMJIT_API virtual ~JitRuntime(); // -------------------------------------------------------------------------- - // [Memory Manager and Alloc Type] + // [Accessors] // -------------------------------------------------------------------------- // Note: These members can be ignored by all derived classes. They are here @@ -96,13 +90,20 @@ struct JitRuntime : public BaseRuntime { // code patching or making dynamic loadable libraries/executables) ignore // members accessed by these accessors. - //! @brief Get the @c MemoryManager instance. - ASMJIT_INLINE MemoryManager* getMemoryManager() const { return _memoryManager; } + //! Get the `VMemMgr` instance. + ASMJIT_INLINE VMemMgr* getMemMgr() const { + return const_cast(&_memMgr); + } - //! @brief Get the type of allocation. - ASMJIT_INLINE uint32_t getAllocType() const { return _allocType; } - //! @brief Set the type of allocation. - ASMJIT_INLINE void setAllocType(uint32_t allocType) { _allocType = allocType; } + //! Get the type of allocation. + ASMJIT_INLINE uint32_t getAllocType() const { + return _allocType; + } + + //! Set the type of allocation. + ASMJIT_INLINE void setAllocType(uint32_t allocType) { + _allocType = allocType; + } // -------------------------------------------------------------------------- // [Interface] @@ -118,12 +119,14 @@ struct JitRuntime : public BaseRuntime { // [Members] // -------------------------------------------------------------------------- - //! @brief Memory manager. - MemoryManager* _memoryManager; - //! @brief Type of allocation. + //! Virtual memory manager. + VMemMgr _memMgr; + //! Type of allocation. uint32_t _allocType; }; +//! @} + } // asmjit namespace // [Api-End] diff --git a/src/asmjit/base/string.h b/src/asmjit/base/string.h index eb10ecb..bcd9b7a 100644 --- a/src/asmjit/base/string.h +++ b/src/asmjit/base/string.h @@ -20,18 +20,20 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_util //! @{ // ============================================================================ // [asmjit::kStringOp] // ============================================================================ -//! @brief String operation. +//! @internal +//! +//! String operation. ASMJIT_ENUM(kStringOp) { - //! @brief Replace the current string by a given content. + //! Replace the current string by a given content. kStringOpSet = 0, - //! @brief Append a given content to the current string. + //! Append a given content to the current string. kStringOpAppend = 1 }; @@ -39,7 +41,9 @@ ASMJIT_ENUM(kStringOp) { // [asmjit::kStringFormat] // ============================================================================ -//! @brief String format flags. +//! @internal +//! +//! String format flags. ASMJIT_ENUM(kStringFormat) { kStringFormatShowSign = 0x00000001, kStringFormatShowSpace = 0x00000002, @@ -51,7 +55,9 @@ ASMJIT_ENUM(kStringFormat) { // [asmjit::StringUtil] // ============================================================================ -//! @brief String utilities. +//! @internal +//! +//! String utilities. struct StringUtil { static ASMJIT_INLINE size_t nlen(const char* s, size_t maxlen) { size_t i; @@ -66,7 +72,9 @@ struct StringUtil { // [asmjit::StringBuilder] // ============================================================================ -//! @brief String builder. +//! @internal +//! +//! String builder. //! //! String builder was designed to be able to build a string using append like //! operation to append numbers, other strings, or signle characters. It can @@ -90,31 +98,31 @@ struct StringBuilder { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get string builder capacity. + //! Get string builder capacity. ASMJIT_INLINE size_t getCapacity() const { return _capacity; } - //! @brief Get length. + //! Get length. ASMJIT_INLINE size_t getLength() const { return _length; } - //! @brief Get null-terminated string data. + //! Get null-terminated string data. ASMJIT_INLINE char* getData() { return _data; } - //! @brief Get null-terminated string data (const). + //! Get null-terminated string data (const). ASMJIT_INLINE const char* getData() const { return _data; } // -------------------------------------------------------------------------- // [Prepare / Reserve] // -------------------------------------------------------------------------- - //! @brief Prepare to set/append. + //! Prepare to set/append. ASMJIT_API char* prepare(uint32_t op, size_t len); - //! @brief Reserve @a to bytes in string builder. + //! Reserve `to` bytes in string builder. ASMJIT_API bool reserve(size_t to); // -------------------------------------------------------------------------- // [Clear] // -------------------------------------------------------------------------- - //! @brief Clear the content in String builder. + //! Clear the content in String builder. ASMJIT_API void clear(); // -------------------------------------------------------------------------- @@ -132,77 +140,91 @@ struct StringBuilder { // [Set] // -------------------------------------------------------------------------- - //! @brief Replace the current content by @a str of @a len. - ASMJIT_INLINE bool setString(const char* str, size_t len = kInvalidIndex) - { return _opString(kStringOpSet, str, len); } + //! Replace the current content by `str` of `len`. + ASMJIT_INLINE bool setString(const char* str, size_t len = kInvalidIndex) { + return _opString(kStringOpSet, str, len); + } - //! @brief Replace the current content by formatted string @a fmt. - ASMJIT_INLINE bool setVFormat(const char* fmt, va_list ap) - { return _opVFormat(kStringOpSet, fmt, ap); } + //! Replace the current content by formatted string `fmt`. + ASMJIT_INLINE bool setVFormat(const char* fmt, va_list ap) { + return _opVFormat(kStringOpSet, fmt, ap); + } - //! @brief Replace the current content by formatted string @a fmt. + //! Replace the current content by formatted string `fmt`. ASMJIT_API bool setFormat(const char* fmt, ...); - //! @brief Replace the current content by @a c character. - ASMJIT_INLINE bool setChar(char c) - { return _opChar(kStringOpSet, c); } + //! Replace the current content by `c` character. + ASMJIT_INLINE bool setChar(char c) { + return _opChar(kStringOpSet, c); + } - //! @brief Replace the current content by @a c of @a len. - ASMJIT_INLINE bool setChars(char c, size_t len) - { return _opChars(kStringOpSet, c, len); } + //! Replace the current content by `c` of `len`. + ASMJIT_INLINE bool setChars(char c, size_t len) { + return _opChars(kStringOpSet, c, len); + } - //! @brief Replace the current content by @a i.. - ASMJIT_INLINE bool setInt(uint64_t i, uint32_t base = 0, size_t width = 0, uint32_t flags = 0) - { return _opNumber(kStringOpSet, i, base, width, flags | kStringFormatSigned); } + //! Replace the current content by formatted integer `i`. + ASMJIT_INLINE bool setInt(uint64_t i, uint32_t base = 0, size_t width = 0, uint32_t flags = 0) { + return _opNumber(kStringOpSet, i, base, width, flags | kStringFormatSigned); + } - //! @brief Replace the current content by @a i.. - ASMJIT_INLINE bool setUInt(uint64_t i, uint32_t base = 0, size_t width = 0, uint32_t flags = 0) - { return _opNumber(kStringOpSet, i, base, width, flags); } + //! Replace the current content by formatted integer `i`. + ASMJIT_INLINE bool setUInt(uint64_t i, uint32_t base = 0, size_t width = 0, uint32_t flags = 0) { + return _opNumber(kStringOpSet, i, base, width, flags); + } - //! @brief Replace the current content by the given @a data converted to a HEX string. - ASMJIT_INLINE bool setHex(const void* data, size_t len) - { return _opHex(kStringOpSet, data, len); } + //! Replace the current content by the given `data` converted to a HEX string. + ASMJIT_INLINE bool setHex(const void* data, size_t len) { + return _opHex(kStringOpSet, data, len); + } // -------------------------------------------------------------------------- // [Append] // -------------------------------------------------------------------------- - //! @brief Append @a str of @a len. - ASMJIT_INLINE bool appendString(const char* str, size_t len = kInvalidIndex) - { return _opString(kStringOpAppend, str, len); } + //! Append `str` of `len`. + ASMJIT_INLINE bool appendString(const char* str, size_t len = kInvalidIndex) { + return _opString(kStringOpAppend, str, len); + } - //! @brief Append a formatted string @a fmt to the current content. - ASMJIT_INLINE bool appendVFormat(const char* fmt, va_list ap) - { return _opVFormat(kStringOpAppend, fmt, ap); } + //! Append a formatted string `fmt` to the current content. + ASMJIT_INLINE bool appendVFormat(const char* fmt, va_list ap) { + return _opVFormat(kStringOpAppend, fmt, ap); + } - //! @brief Append a formatted string @a fmt to the current content. + //! Append a formatted string `fmt` to the current content. ASMJIT_API bool appendFormat(const char* fmt, ...); - //! @brief Append @a c character. - ASMJIT_INLINE bool appendChar(char c) - { return _opChar(kStringOpAppend, c); } + //! Append `c` character. + ASMJIT_INLINE bool appendChar(char c) { + return _opChar(kStringOpAppend, c); + } - //! @brief Append @a c of @a len. - ASMJIT_INLINE bool appendChars(char c, size_t len) - { return _opChars(kStringOpAppend, c, len); } + //! Append `c` of `len`. + ASMJIT_INLINE bool appendChars(char c, size_t len) { + return _opChars(kStringOpAppend, c, len); + } - //! @brief Append @a i. - ASMJIT_INLINE bool appendInt(int64_t i, uint32_t base = 0, size_t width = 0, uint32_t flags = 0) - { return _opNumber(kStringOpAppend, static_cast(i), base, width, flags | kStringFormatSigned); } + //! Append `i`. + ASMJIT_INLINE bool appendInt(int64_t i, uint32_t base = 0, size_t width = 0, uint32_t flags = 0) { + return _opNumber(kStringOpAppend, static_cast(i), base, width, flags | kStringFormatSigned); + } - //! @brief Append @a i. - ASMJIT_INLINE bool appendUInt(uint64_t i, uint32_t base = 0, size_t width = 0, uint32_t flags = 0) - { return _opNumber(kStringOpAppend, i, base, width, flags); } + //! Append `i`. + ASMJIT_INLINE bool appendUInt(uint64_t i, uint32_t base = 0, size_t width = 0, uint32_t flags = 0) { + return _opNumber(kStringOpAppend, i, base, width, flags); + } - //! @brief Append the given @a data converted to a HEX string. - ASMJIT_INLINE bool appendHex(const void* data, size_t len) - { return _opHex(kStringOpAppend, data, len); } + //! Append the given `data` converted to a HEX string. + ASMJIT_INLINE bool appendHex(const void* data, size_t len) { + return _opHex(kStringOpAppend, data, len); + } // -------------------------------------------------------------------------- // [_Append] // -------------------------------------------------------------------------- - //! @brief Append @a str of @a len (inlined, without buffer overflow check). + //! Append `str` of `len`, inlined, without buffer overflow check. ASMJIT_INLINE void _appendString(const char* str, size_t len = kInvalidIndex) { // len should be a constant if we are inlining. if (len == kInvalidIndex) { @@ -230,7 +252,7 @@ struct StringBuilder { } } - //! @brief Append @a c character (inlined, without buffer overflow check). + //! Append `c` character, inlined, without buffer overflow check. ASMJIT_INLINE void _appendChar(char c) { ASMJIT_ASSERT(_capacity - _length >= 1); @@ -239,7 +261,7 @@ struct StringBuilder { _data[_length] = '\0'; } - //! @brief Append @a c of @a len (inlined, without buffer overflow check). + //! Append `c` of `len`, inlined, without buffer overflow check. ASMJIT_INLINE void _appendChars(char c, size_t len) { ASMJIT_ASSERT(_capacity - _length >= len); @@ -282,10 +304,12 @@ struct StringBuilder { // [Eq] // -------------------------------------------------------------------------- - //! @brief Check for equality with other @a str. + //! Check for equality with other `str` of `len`. ASMJIT_API bool eq(const char* str, size_t len = kInvalidIndex) const; - //! @brief Check for equality with StringBuilder @a other. - ASMJIT_INLINE bool eq(const StringBuilder& other) const { return eq(other._data); } + //! Check for equality with `other`. + ASMJIT_INLINE bool eq(const StringBuilder& other) const { + return eq(other._data); + } // -------------------------------------------------------------------------- // [Operator Overload] @@ -301,13 +325,13 @@ struct StringBuilder { // [Members] // -------------------------------------------------------------------------- - //! @brief String data. + //! String data. char* _data; - //! @brief Length. + //! Length. size_t _length; - //! @brief Capacity. + //! Capacity. size_t _capacity; - //! @brief Whether the string can be freed. + //! Whether the string can be freed. size_t _canFree; }; @@ -315,6 +339,7 @@ struct StringBuilder { // [asmjit::StringBuilderT] // ============================================================================ +//! @internal template struct StringBuilderT : public StringBuilder { ASMJIT_NO_COPY(StringBuilderT) @@ -336,8 +361,9 @@ struct StringBuilderT : public StringBuilder { // [Members] // -------------------------------------------------------------------------- - //! @brief Embedded data. - char _embeddedData[static_cast(N + 1 + sizeof(intptr_t)) & ~static_cast(sizeof(intptr_t) - 1)]; + //! Embedded data. + char _embeddedData[static_cast( + N + 1 + sizeof(intptr_t)) & ~static_cast(sizeof(intptr_t) - 1)]; }; //! @} diff --git a/src/asmjit/base/vectypes.h b/src/asmjit/base/vectypes.h index e9f8ecc..7eee34e 100644 --- a/src/asmjit/base/vectypes.h +++ b/src/asmjit/base/vectypes.h @@ -16,17 +16,20 @@ namespace asmjit { +//! @addtogroup asmjit_base_vectypes +//! @{ + // ============================================================================ // [asmjit::Vec64Data] // ============================================================================ -//! @brief 64-bit vector register data. +//! 64-bit vector register data. union Vec64Data { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Set all eight signed 8-bit integers. + //! Set all eight signed 8-bit integers. static ASMJIT_INLINE Vec64Data fromSb( int8_t x0, int8_t x1, int8_t x2, int8_t x3, int8_t x4, int8_t x5, int8_t x6, int8_t x7) { @@ -35,7 +38,7 @@ union Vec64Data { return self; } - //! @brief Set all eight signed 8-bit integers. + //! Set all eight signed 8-bit integers. static ASMJIT_INLINE Vec64Data fromSb( int8_t x0) { @@ -44,7 +47,7 @@ union Vec64Data { return self; } - //! @brief Set all eight unsigned 8-bit integers. + //! Set all eight unsigned 8-bit integers. static ASMJIT_INLINE Vec64Data fromUb( uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7) { @@ -53,7 +56,7 @@ union Vec64Data { return self; } - //! @brief Set all eight unsigned 8-bit integers. + //! Set all eight unsigned 8-bit integers. static ASMJIT_INLINE Vec64Data fromUb( uint8_t x0) { @@ -62,7 +65,7 @@ union Vec64Data { return self; } - //! @brief Set all four signed 16-bit integers. + //! Set all four signed 16-bit integers. static ASMJIT_INLINE Vec64Data fromSw( int16_t x0, int16_t x1, int16_t x2, int16_t x3) { @@ -71,7 +74,7 @@ union Vec64Data { return self; } - //! @brief Set all four signed 16-bit integers. + //! Set all four signed 16-bit integers. static ASMJIT_INLINE Vec64Data fromSw( int16_t x0) { @@ -80,7 +83,7 @@ union Vec64Data { return self; } - //! @brief Set all four unsigned 16-bit integers. + //! Set all four unsigned 16-bit integers. static ASMJIT_INLINE Vec64Data fromUw( uint16_t x0, uint16_t x1, uint16_t x2, uint16_t x3) { @@ -89,7 +92,7 @@ union Vec64Data { return self; } - //! @brief Set all four unsigned 16-bit integers. + //! Set all four unsigned 16-bit integers. static ASMJIT_INLINE Vec64Data fromUw( uint16_t x0) { @@ -98,7 +101,7 @@ union Vec64Data { return self; } - //! @brief Set all two signed 32-bit integers. + //! Set all two signed 32-bit integers. static ASMJIT_INLINE Vec64Data fromSd( int32_t x0, int32_t x1) { @@ -107,7 +110,7 @@ union Vec64Data { return self; } - //! @brief Set all two signed 32-bit integers. + //! Set all two signed 32-bit integers. static ASMJIT_INLINE Vec64Data fromSd( int32_t x0) { @@ -116,7 +119,7 @@ union Vec64Data { return self; } - //! @brief Set all two unsigned 32-bit integers. + //! Set all two unsigned 32-bit integers. static ASMJIT_INLINE Vec64Data fromUd( uint32_t x0, uint32_t x1) { @@ -125,7 +128,7 @@ union Vec64Data { return self; } - //! @brief Set all two unsigned 32-bit integers. + //! Set all two unsigned 32-bit integers. static ASMJIT_INLINE Vec64Data fromUd( uint32_t x0) { @@ -134,7 +137,7 @@ union Vec64Data { return self; } - //! @brief Set signed 64-bit integer. + //! Set signed 64-bit integer. static ASMJIT_INLINE Vec64Data fromSq( int64_t x0) { @@ -143,7 +146,7 @@ union Vec64Data { return self; } - //! @brief Set unsigned 64-bit integer. + //! Set unsigned 64-bit integer. static ASMJIT_INLINE Vec64Data fromUq( uint64_t x0) { @@ -152,7 +155,7 @@ union Vec64Data { return self; } - //! @brief Set all two SP-FP values. + //! Set all two SP-FP values. static ASMJIT_INLINE Vec64Data fromSf( float x0, float x1) { @@ -161,7 +164,7 @@ union Vec64Data { return self; } - //! @brief Set all two SP-FP values. + //! Set all two SP-FP values. static ASMJIT_INLINE Vec64Data fromSf( float x0) { @@ -170,7 +173,7 @@ union Vec64Data { return self; } - //! @brief Set all two SP-FP values. + //! Set all two SP-FP values. static ASMJIT_INLINE Vec64Data fromDf( double x0) { @@ -183,7 +186,7 @@ union Vec64Data { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Set all eight signed 8-bit integers. + //! Set all eight signed 8-bit integers. ASMJIT_INLINE void setSb( int8_t x0, int8_t x1, int8_t x2, int8_t x3, int8_t x4, int8_t x5, int8_t x6, int8_t x7) { @@ -191,14 +194,14 @@ union Vec64Data { sb[4] = x4; sb[5] = x5; sb[6] = x6; sb[7] = x7; } - //! @brief Set all eight signed 8-bit integers. + //! Set all eight signed 8-bit integers. ASMJIT_INLINE void setSb( int8_t x0) { setUb(static_cast(x0)); } - //! @brief Set all eight unsigned 8-bit integers. + //! Set all eight unsigned 8-bit integers. ASMJIT_INLINE void setUb( uint8_t x0, uint8_t x1, uint8_t x2, uint8_t x3, uint8_t x4, uint8_t x5, uint8_t x6, uint8_t x7) { @@ -206,7 +209,7 @@ union Vec64Data { ub[4] = x4; ub[5] = x5; ub[6] = x6; ub[7] = x7; } - //! @brief Set all eight unsigned 8-bit integers. + //! Set all eight unsigned 8-bit integers. ASMJIT_INLINE void setUb( uint8_t x0) { @@ -221,28 +224,28 @@ union Vec64Data { } } - //! @brief Set all four signed 16-bit integers. + //! Set all four signed 16-bit integers. ASMJIT_INLINE void setSw( int16_t x0, int16_t x1, int16_t x2, int16_t x3) { sw[0] = x0; sw[1] = x1; sw[2] = x2; sw[3] = x3; } - //! @brief Set all four signed 16-bit integers. + //! Set all four signed 16-bit integers. ASMJIT_INLINE void setSw( int16_t x0) { setUw(static_cast(x0)); } - //! @brief Set all four unsigned 16-bit integers. + //! Set all four unsigned 16-bit integers. ASMJIT_INLINE void setUw( uint16_t x0, uint16_t x1, uint16_t x2, uint16_t x3) { uw[0] = x0; uw[1] = x1; uw[2] = x2; uw[3] = x3; } - //! @brief Set all four unsigned 16-bit integers. + //! Set all four unsigned 16-bit integers. ASMJIT_INLINE void setUw( uint16_t x0) { @@ -257,63 +260,63 @@ union Vec64Data { } } - //! @brief Set all two signed 32-bit integers. + //! Set all two signed 32-bit integers. ASMJIT_INLINE void setSd( int32_t x0, int32_t x1) { sd[0] = x0; sd[1] = x1; } - //! @brief Set all two signed 32-bit integers. + //! Set all two signed 32-bit integers. ASMJIT_INLINE void setSd( int32_t x0) { sd[0] = x0; sd[1] = x0; } - //! @brief Set all two unsigned 32-bit integers. + //! Set all two unsigned 32-bit integers. ASMJIT_INLINE void setUd( uint32_t x0, uint32_t x1) { ud[0] = x0; ud[1] = x1; } - //! @brief Set all two unsigned 32-bit integers. + //! Set all two unsigned 32-bit integers. ASMJIT_INLINE void setUd( uint32_t x0) { ud[0] = x0; ud[1] = x0; } - //! @brief Set signed 64-bit integer. + //! Set signed 64-bit integer. ASMJIT_INLINE void setSq( int64_t x0) { sq[0] = x0; } - //! @brief Set unsigned 64-bit integer. + //! Set unsigned 64-bit integer. ASMJIT_INLINE void setUq( uint64_t x0) { uq[0] = x0; } - //! @brief Set all two SP-FP values. + //! Set all two SP-FP values. ASMJIT_INLINE void setSf( float x0, float x1) { sf[0] = x0; sf[1] = x1; } - //! @brief Set all two SP-FP values. + //! Set all two SP-FP values. ASMJIT_INLINE void setSf( float x0) { sf[0] = x0; sf[1] = x0; } - //! @brief Set all two SP-FP values. + //! Set all two SP-FP values. ASMJIT_INLINE void setDf( double x0) { @@ -324,26 +327,26 @@ union Vec64Data { // [Members] // -------------------------------------------------------------------------- - //! @brief Array of eight signed 8-bit integers. + //! Array of eight signed 8-bit integers. int8_t sb[8]; - //! @brief Array of eight unsigned 8-bit integers. + //! Array of eight unsigned 8-bit integers. uint8_t ub[8]; - //! @brief Array of four signed 16-bit integers. + //! Array of four signed 16-bit integers. int16_t sw[4]; - //! @brief Array of four unsigned 16-bit integers. + //! Array of four unsigned 16-bit integers. uint16_t uw[4]; - //! @brief Array of two signed 32-bit integers. + //! Array of two signed 32-bit integers. int32_t sd[2]; - //! @brief Array of two unsigned 32-bit integers. + //! Array of two unsigned 32-bit integers. uint32_t ud[2]; - //! @brief Array of one signed 64-bit integer. + //! Array of one signed 64-bit integer. int64_t sq[1]; - //! @brief Array of one unsigned 64-bit integer. + //! Array of one unsigned 64-bit integer. uint64_t uq[1]; - //! @brief Array of two SP-FP values. + //! Array of two SP-FP values. float sf[2]; - //! @brief Array of one DP-FP value. + //! Array of one DP-FP value. double df[1]; }; @@ -351,13 +354,13 @@ union Vec64Data { // [asmjit::Vec128Data] // ============================================================================ -//! @brief 128-bit vector register data. +//! 128-bit vector register data. union Vec128Data { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Set all sixteen signed 8-bit integers. + //! Set all sixteen signed 8-bit integers. static ASMJIT_INLINE Vec128Data fromSb( int8_t x0 , int8_t x1 , int8_t x2 , int8_t x3 , int8_t x4 , int8_t x5 , int8_t x6 , int8_t x7 , @@ -369,7 +372,7 @@ union Vec128Data { return self; } - //! @brief Set all sixteen signed 8-bit integers. + //! Set all sixteen signed 8-bit integers. static ASMJIT_INLINE Vec128Data fromSb( int8_t x0) { @@ -378,7 +381,7 @@ union Vec128Data { return self; } - //! @brief Set all sixteen unsigned 8-bit integers. + //! Set all sixteen unsigned 8-bit integers. static ASMJIT_INLINE Vec128Data fromUb( uint8_t x0 , uint8_t x1 , uint8_t x2 , uint8_t x3 , uint8_t x4 , uint8_t x5 , uint8_t x6 , uint8_t x7 , @@ -390,7 +393,7 @@ union Vec128Data { return self; } - //! @brief Set all sixteen unsigned 8-bit integers. + //! Set all sixteen unsigned 8-bit integers. static ASMJIT_INLINE Vec128Data fromUb( uint8_t x0) { @@ -399,7 +402,7 @@ union Vec128Data { return self; } - //! @brief Set all eight signed 16-bit integers. + //! Set all eight signed 16-bit integers. static ASMJIT_INLINE Vec128Data fromSw( int16_t x0, int16_t x1, int16_t x2, int16_t x3, int16_t x4, int16_t x5, int16_t x6, int16_t x7) { @@ -408,7 +411,7 @@ union Vec128Data { return self; } - //! @brief Set all eight signed 16-bit integers. + //! Set all eight signed 16-bit integers. static ASMJIT_INLINE Vec128Data fromSw( int16_t x0) { @@ -417,7 +420,7 @@ union Vec128Data { return self; } - //! @brief Set all eight unsigned 16-bit integers. + //! Set all eight unsigned 16-bit integers. static ASMJIT_INLINE Vec128Data fromUw( uint16_t x0, uint16_t x1, uint16_t x2, uint16_t x3, uint16_t x4, uint16_t x5, uint16_t x6, uint16_t x7) { @@ -426,7 +429,7 @@ union Vec128Data { return self; } - //! @brief Set all eight unsigned 16-bit integers. + //! Set all eight unsigned 16-bit integers. static ASMJIT_INLINE Vec128Data fromUw( uint16_t x0) { @@ -435,7 +438,7 @@ union Vec128Data { return self; } - //! @brief Set all four signed 32-bit integers. + //! Set all four signed 32-bit integers. static ASMJIT_INLINE Vec128Data fromSd( int32_t x0, int32_t x1, int32_t x2, int32_t x3) { @@ -444,7 +447,7 @@ union Vec128Data { return self; } - //! @brief Set all four signed 32-bit integers. + //! Set all four signed 32-bit integers. static ASMJIT_INLINE Vec128Data fromSd( int32_t x0) { @@ -453,7 +456,7 @@ union Vec128Data { return self; } - //! @brief Set all four unsigned 32-bit integers. + //! Set all four unsigned 32-bit integers. static ASMJIT_INLINE Vec128Data fromUd( uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3) { @@ -462,7 +465,7 @@ union Vec128Data { return self; } - //! @brief Set all four unsigned 32-bit integers. + //! Set all four unsigned 32-bit integers. static ASMJIT_INLINE Vec128Data fromUd( uint32_t x0) { @@ -471,7 +474,7 @@ union Vec128Data { return self; } - //! @brief Set all two signed 64-bit integers. + //! Set all two signed 64-bit integers. static ASMJIT_INLINE Vec128Data fromSq( int64_t x0, int64_t x1) { @@ -480,7 +483,7 @@ union Vec128Data { return self; } - //! @brief Set all two signed 64-bit integers. + //! Set all two signed 64-bit integers. static ASMJIT_INLINE Vec128Data fromSq( int64_t x0) { @@ -489,7 +492,7 @@ union Vec128Data { return self; } - //! @brief Set all two unsigned 64-bit integers. + //! Set all two unsigned 64-bit integers. static ASMJIT_INLINE Vec128Data fromUq( uint64_t x0, uint64_t x1) { @@ -498,7 +501,7 @@ union Vec128Data { return self; } - //! @brief Set all two unsigned 64-bit integers. + //! Set all two unsigned 64-bit integers. static ASMJIT_INLINE Vec128Data fromUq( uint64_t x0) { @@ -507,7 +510,7 @@ union Vec128Data { return self; } - //! @brief Set all four SP-FP floats. + //! Set all four SP-FP floats. static ASMJIT_INLINE Vec128Data fromSf( float x0, float x1, float x2, float x3) { @@ -516,7 +519,7 @@ union Vec128Data { return self; } - //! @brief Set all four SP-FP floats. + //! Set all four SP-FP floats. static ASMJIT_INLINE Vec128Data fromSf( float x0) { @@ -525,7 +528,7 @@ union Vec128Data { return self; } - //! @brief Set all two DP-FP floats. + //! Set all two DP-FP floats. static ASMJIT_INLINE Vec128Data fromDf( double x0, double x1) { @@ -534,7 +537,7 @@ union Vec128Data { return self; } - //! @brief Set all two DP-FP floats. + //! Set all two DP-FP floats. static ASMJIT_INLINE Vec128Data fromDf( double x0) { @@ -547,7 +550,7 @@ union Vec128Data { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Set all sixteen signed 8-bit integers. + //! Set all sixteen signed 8-bit integers. ASMJIT_INLINE void setSb( int8_t x0 , int8_t x1 , int8_t x2 , int8_t x3 , int8_t x4 , int8_t x5 , int8_t x6 , int8_t x7 , @@ -560,14 +563,14 @@ union Vec128Data { sb[12] = x12; sb[13] = x13; sb[14] = x14; sb[15] = x15; } - //! @brief Set all sixteen signed 8-bit integers. + //! Set all sixteen signed 8-bit integers. ASMJIT_INLINE void setSb( int8_t x0) { setUb(static_cast(x0)); } - //! @brief Set all sixteen unsigned 8-bit integers. + //! Set all sixteen unsigned 8-bit integers. ASMJIT_INLINE void setUb( uint8_t x0 , uint8_t x1 , uint8_t x2 , uint8_t x3 , uint8_t x4 , uint8_t x5 , uint8_t x6 , uint8_t x7 , @@ -580,7 +583,7 @@ union Vec128Data { ub[12] = x12; ub[13] = x13; ub[14] = x14; ub[15] = x15; } - //! @brief Set all sixteen unsigned 8-bit integers. + //! Set all sixteen unsigned 8-bit integers. ASMJIT_INLINE void setUb( uint8_t x0) { @@ -598,7 +601,7 @@ union Vec128Data { } } - //! @brief Set all eight signed 16-bit integers. + //! Set all eight signed 16-bit integers. ASMJIT_INLINE void setSw( int16_t x0, int16_t x1, int16_t x2, int16_t x3, int16_t x4, int16_t x5, int16_t x6, int16_t x7) { @@ -606,14 +609,14 @@ union Vec128Data { sw[4] = x4; sw[5] = x5; sw[6] = x6; sw[7] = x7; } - //! @brief Set all eight signed 16-bit integers. + //! Set all eight signed 16-bit integers. ASMJIT_INLINE void setSw( int16_t x0) { setUw(static_cast(x0)); } - //! @brief Set all eight unsigned 16-bit integers. + //! Set all eight unsigned 16-bit integers. ASMJIT_INLINE void setUw( uint16_t x0, uint16_t x1, uint16_t x2, uint16_t x3, uint16_t x4, uint16_t x5, uint16_t x6, uint16_t x7) { @@ -621,7 +624,7 @@ union Vec128Data { uw[4] = x4; uw[5] = x5; uw[6] = x6; uw[7] = x7; } - //! @brief Set all eight unsigned 16-bit integers. + //! Set all eight unsigned 16-bit integers. ASMJIT_INLINE void setUw( uint16_t x0) { @@ -639,28 +642,28 @@ union Vec128Data { } } - //! @brief Set all four signed 32-bit integers. + //! Set all four signed 32-bit integers. ASMJIT_INLINE void setSd( int32_t x0, int32_t x1, int32_t x2, int32_t x3) { sd[0] = x0; sd[1] = x1; sd[2] = x2; sd[3] = x3; } - //! @brief Set all four signed 32-bit integers. + //! Set all four signed 32-bit integers. ASMJIT_INLINE void setSd( int32_t x0) { setUd(static_cast(x0)); } - //! @brief Set all four unsigned 32-bit integers. + //! Set all four unsigned 32-bit integers. ASMJIT_INLINE void setUd( uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3) { ud[0] = x0; ud[1] = x1; ud[2] = x2; ud[3] = x3; } - //! @brief Set all four unsigned 32-bit integers. + //! Set all four unsigned 32-bit integers. ASMJIT_INLINE void setUd( uint32_t x0) { @@ -677,56 +680,56 @@ union Vec128Data { } } - //! @brief Set all two signed 64-bit integers. + //! Set all two signed 64-bit integers. ASMJIT_INLINE void setSq( int64_t x0, int64_t x1) { sq[0] = x0; sq[1] = x1; } - //! @brief Set all two signed 64-bit integers. + //! Set all two signed 64-bit integers. ASMJIT_INLINE void setSq( int64_t x0) { sq[0] = x0; sq[1] = x0; } - //! @brief Set all two unsigned 64-bit integers. + //! Set all two unsigned 64-bit integers. ASMJIT_INLINE void setUq( uint64_t x0, uint64_t x1) { uq[0] = x0; uq[1] = x1; } - //! @brief Set all two unsigned 64-bit integers. + //! Set all two unsigned 64-bit integers. ASMJIT_INLINE void setUq( uint64_t x0) { uq[0] = x0; uq[1] = x0; } - //! @brief Set all four SP-FP floats. + //! Set all four SP-FP floats. ASMJIT_INLINE void setSf( float x0, float x1, float x2, float x3) { sf[0] = x0; sf[1] = x1; sf[2] = x2; sf[3] = x3; } - //! @brief Set all four SP-FP floats. + //! Set all four SP-FP floats. ASMJIT_INLINE void setSf( float x0) { sf[0] = x0; sf[1] = x0; sf[2] = x0; sf[3] = x0; } - //! @brief Set all two DP-FP floats. + //! Set all two DP-FP floats. ASMJIT_INLINE void setDf( double x0, double x1) { df[0] = x0; df[1] = x1; } - //! @brief Set all two DP-FP floats. + //! Set all two DP-FP floats. ASMJIT_INLINE void setDf( double x0) { @@ -737,26 +740,26 @@ union Vec128Data { // [Members] // -------------------------------------------------------------------------- - //! @brief Array of sixteen signed 8-bit integers. + //! Array of sixteen signed 8-bit integers. int8_t sb[16]; - //! @brief Array of sixteen unsigned 8-bit integers. + //! Array of sixteen unsigned 8-bit integers. uint8_t ub[16]; - //! @brief Array of eight signed 16-bit integers. + //! Array of eight signed 16-bit integers. int16_t sw[8]; - //! @brief Array of eight unsigned 16-bit integers. + //! Array of eight unsigned 16-bit integers. uint16_t uw[8]; - //! @brief Array of four signed 32-bit integers. + //! Array of four signed 32-bit integers. int32_t sd[4]; - //! @brief Array of four unsigned 32-bit integers. + //! Array of four unsigned 32-bit integers. uint32_t ud[4]; - //! @brief Array of two signed 64-bit integers. + //! Array of two signed 64-bit integers. int64_t sq[2]; - //! @brief Array of two unsigned 64-bit integers. + //! Array of two unsigned 64-bit integers. uint64_t uq[2]; - //! @brief Array of four 32-bit single precision floating points. + //! Array of four 32-bit single precision floating points. float sf[4]; - //! @brief Array of two 64-bit double precision floating points. + //! Array of two 64-bit double precision floating points. double df[2]; }; @@ -764,13 +767,13 @@ union Vec128Data { // [asmjit::Vec256Data] // ============================================================================ -//! @brief 256-bit vector register data. +//! 256-bit vector register data. union Vec256Data { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Set all thirty two signed 8-bit integers. + //! Set all thirty two signed 8-bit integers. static ASMJIT_INLINE Vec256Data fromSb( int8_t x0 , int8_t x1 , int8_t x2 , int8_t x3 , int8_t x4 , int8_t x5 , int8_t x6 , int8_t x7 , @@ -788,7 +791,7 @@ union Vec256Data { return self; } - //! @brief Set all thirty two signed 8-bit integers. + //! Set all thirty two signed 8-bit integers. static ASMJIT_INLINE Vec256Data fromSb( int8_t x0) { @@ -797,7 +800,7 @@ union Vec256Data { return self; } - //! @brief Set all thirty two unsigned 8-bit integers. + //! Set all thirty two unsigned 8-bit integers. static ASMJIT_INLINE Vec256Data fromUb( uint8_t x0 , uint8_t x1 , uint8_t x2 , uint8_t x3 , uint8_t x4 , uint8_t x5 , uint8_t x6 , uint8_t x7 , @@ -815,7 +818,7 @@ union Vec256Data { return self; } - //! @brief Set all thirty two unsigned 8-bit integers. + //! Set all thirty two unsigned 8-bit integers. static ASMJIT_INLINE Vec256Data fromUb( uint8_t x0) { @@ -824,7 +827,7 @@ union Vec256Data { return self; } - //! @brief Set all sixteen signed 16-bit integers. + //! Set all sixteen signed 16-bit integers. static ASMJIT_INLINE Vec256Data fromSw( int16_t x0, int16_t x1, int16_t x2 , int16_t x3 , int16_t x4 , int16_t x5 , int16_t x6 , int16_t x7 , int16_t x8, int16_t x9, int16_t x10, int16_t x11, int16_t x12, int16_t x13, int16_t x14, int16_t x15) @@ -834,7 +837,7 @@ union Vec256Data { return self; } - //! @brief Set all sixteen signed 16-bit integers. + //! Set all sixteen signed 16-bit integers. static ASMJIT_INLINE Vec256Data fromSw( int16_t x0) { @@ -843,7 +846,7 @@ union Vec256Data { return self; } - //! @brief Set all sixteen unsigned 16-bit integers. + //! Set all sixteen unsigned 16-bit integers. static ASMJIT_INLINE Vec256Data fromUw( uint16_t x0, uint16_t x1, uint16_t x2 , uint16_t x3 , uint16_t x4 , uint16_t x5 , uint16_t x6 , uint16_t x7 , uint16_t x8, uint16_t x9, uint16_t x10, uint16_t x11, uint16_t x12, uint16_t x13, uint16_t x14, uint16_t x15) @@ -853,7 +856,7 @@ union Vec256Data { return self; } - //! @brief Set all sixteen unsigned 16-bit integers. + //! Set all sixteen unsigned 16-bit integers. static ASMJIT_INLINE Vec256Data fromUw( uint16_t x0) { @@ -862,7 +865,7 @@ union Vec256Data { return self; } - //! @brief Set all eight signed 32-bit integers. + //! Set all eight signed 32-bit integers. static ASMJIT_INLINE Vec256Data fromSd( int32_t x0, int32_t x1, int32_t x2, int32_t x3, int32_t x4, int32_t x5, int32_t x6, int32_t x7) @@ -872,7 +875,7 @@ union Vec256Data { return self; } - //! @brief Set all eight signed 32-bit integers. + //! Set all eight signed 32-bit integers. static ASMJIT_INLINE Vec256Data fromSd( int32_t x0) { @@ -881,7 +884,7 @@ union Vec256Data { return self; } - //! @brief Set all eight unsigned 32-bit integers. + //! Set all eight unsigned 32-bit integers. static ASMJIT_INLINE Vec256Data fromUd( uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t x4, uint32_t x5, uint32_t x6, uint32_t x7) @@ -891,7 +894,7 @@ union Vec256Data { return self; } - //! @brief Set all eight unsigned 32-bit integers. + //! Set all eight unsigned 32-bit integers. static ASMJIT_INLINE Vec256Data fromUd( uint32_t x0) { @@ -900,7 +903,7 @@ union Vec256Data { return self; } - //! @brief Set all four signed 64-bit integers. + //! Set all four signed 64-bit integers. static ASMJIT_INLINE Vec256Data fromSq( int64_t x0, int64_t x1, int64_t x2, int64_t x3) { @@ -909,7 +912,7 @@ union Vec256Data { return self; } - //! @brief Set all four signed 64-bit integers. + //! Set all four signed 64-bit integers. static ASMJIT_INLINE Vec256Data fromSq( int64_t x0) { @@ -918,7 +921,7 @@ union Vec256Data { return self; } - //! @brief Set all four unsigned 64-bit integers. + //! Set all four unsigned 64-bit integers. static ASMJIT_INLINE Vec256Data fromUq( uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3) { @@ -927,7 +930,7 @@ union Vec256Data { return self; } - //! @brief Set all four unsigned 64-bit integers. + //! Set all four unsigned 64-bit integers. static ASMJIT_INLINE Vec256Data fromUq( uint64_t x0) { @@ -936,7 +939,7 @@ union Vec256Data { return self; } - //! @brief Set all eight SP-FP floats. + //! Set all eight SP-FP floats. static ASMJIT_INLINE Vec256Data fromSf( float x0, float x1, float x2, float x3, float x4, float x5, float x6, float x7) @@ -946,7 +949,7 @@ union Vec256Data { return self; } - //! @brief Set all eight SP-FP floats. + //! Set all eight SP-FP floats. static ASMJIT_INLINE Vec256Data fromSf( float x0) { @@ -955,7 +958,7 @@ union Vec256Data { return self; } - //! @brief Set all four DP-FP floats. + //! Set all four DP-FP floats. static ASMJIT_INLINE Vec256Data fromDf( double x0, double x1, double x2, double x3) { @@ -964,7 +967,7 @@ union Vec256Data { return self; } - //! @brief Set all four DP-FP floats. + //! Set all four DP-FP floats. static ASMJIT_INLINE Vec256Data fromDf( double x0) { @@ -977,7 +980,7 @@ union Vec256Data { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Set all thirty two signed 8-bit integers. + //! Set all thirty two signed 8-bit integers. ASMJIT_INLINE void setSb( int8_t x0 , int8_t x1 , int8_t x2 , int8_t x3 , int8_t x4 , int8_t x5 , int8_t x6 , int8_t x7 , @@ -998,14 +1001,14 @@ union Vec256Data { sb[28] = x28; sb[29] = x29; sb[30] = x30; sb[31] = x31; } - //! @brief Set all thirty two signed 8-bit integers. + //! Set all thirty two signed 8-bit integers. ASMJIT_INLINE void setSb( int8_t x0) { setUb(static_cast(x0)); } - //! @brief Set all thirty two unsigned 8-bit integers. + //! Set all thirty two unsigned 8-bit integers. ASMJIT_INLINE void setUb( uint8_t x0 , uint8_t x1 , uint8_t x2 , uint8_t x3 , uint8_t x4 , uint8_t x5 , uint8_t x6 , uint8_t x7 , @@ -1026,7 +1029,7 @@ union Vec256Data { ub[28] = x28; ub[29] = x29; ub[30] = x30; ub[31] = x31; } - //! @brief Set all thirty two unsigned 8-bit integers. + //! Set all thirty two unsigned 8-bit integers. ASMJIT_INLINE void setUb( uint8_t x0) { @@ -1050,7 +1053,7 @@ union Vec256Data { } } - //! @brief Set all sixteen signed 16-bit integers. + //! Set all sixteen signed 16-bit integers. ASMJIT_INLINE void setSw( int16_t x0, int16_t x1, int16_t x2, int16_t x3, int16_t x4, int16_t x5, int16_t x6, int16_t x7, int16_t x8, int16_t x9, int16_t x10, int16_t x11, int16_t x12, int16_t x13, int16_t x14, int16_t x15) @@ -1061,14 +1064,14 @@ union Vec256Data { sw[12] = x12; sw[13] = x13; sw[14] = x14; sw[15] = x15; } - //! @brief Set all sixteen signed 16-bit integers. + //! Set all sixteen signed 16-bit integers. ASMJIT_INLINE void setSw( int16_t x0) { setUw(static_cast(x0)); } - //! @brief Set all sixteen unsigned 16-bit integers. + //! Set all sixteen unsigned 16-bit integers. ASMJIT_INLINE void setUw( uint16_t x0, uint16_t x1, uint16_t x2 , uint16_t x3 , uint16_t x4 , uint16_t x5 , uint16_t x6 , uint16_t x7 , uint16_t x8, uint16_t x9, uint16_t x10, uint16_t x11, uint16_t x12, uint16_t x13, uint16_t x14, uint16_t x15) @@ -1079,7 +1082,7 @@ union Vec256Data { uw[12] = x12; uw[13] = x13; uw[14] = x14; uw[15] = x15; } - //! @brief Set all eight unsigned 16-bit integers. + //! Set all eight unsigned 16-bit integers. ASMJIT_INLINE void setUw( uint16_t x0) { @@ -1103,7 +1106,7 @@ union Vec256Data { } } - //! @brief Set all eight signed 32-bit integers. + //! Set all eight signed 32-bit integers. ASMJIT_INLINE void setSd( int32_t x0, int32_t x1, int32_t x2, int32_t x3, int32_t x4, int32_t x5, int32_t x6, int32_t x7) @@ -1112,14 +1115,14 @@ union Vec256Data { sd[4] = x4; sd[5] = x5; sd[6] = x6; sd[7] = x7; } - //! @brief Set all eight signed 32-bit integers. + //! Set all eight signed 32-bit integers. ASMJIT_INLINE void setSd( int32_t x0) { setUd(static_cast(x0)); } - //! @brief Set all eight unsigned 32-bit integers. + //! Set all eight unsigned 32-bit integers. ASMJIT_INLINE void setUd( uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3, uint32_t x4, uint32_t x5, uint32_t x6, uint32_t x7) @@ -1128,7 +1131,7 @@ union Vec256Data { ud[4] = x4; ud[5] = x5; ud[6] = x6; ud[7] = x7; } - //! @brief Set all eight unsigned 32-bit integers. + //! Set all eight unsigned 32-bit integers. ASMJIT_INLINE void setUd( uint32_t x0) { @@ -1151,35 +1154,35 @@ union Vec256Data { } } - //! @brief Set all four signed 64-bit integers. + //! Set all four signed 64-bit integers. ASMJIT_INLINE void setSq( int64_t x0, int64_t x1, int64_t x2, int64_t x3) { sq[0] = x0; sq[1] = x1; sq[2] = x2; sq[3] = x3; } - //! @brief Set all four signed 64-bit integers. + //! Set all four signed 64-bit integers. ASMJIT_INLINE void setSq( int64_t x0) { sq[0] = x0; sq[1] = x0; sq[2] = x0; sq[3] = x0; } - //! @brief Set all four unsigned 64-bit integers. + //! Set all four unsigned 64-bit integers. ASMJIT_INLINE void setUq( uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3) { uq[0] = x0; uq[1] = x1; uq[2] = x2; uq[3] = x3; } - //! @brief Set all four unsigned 64-bit integers. + //! Set all four unsigned 64-bit integers. ASMJIT_INLINE void setUq( uint64_t x0) { uq[0] = x0; uq[1] = x0; uq[2] = x0; uq[3] = x0; } - //! @brief Set all eight SP-FP floats. + //! Set all eight SP-FP floats. ASMJIT_INLINE void setSf( float x0, float x1, float x2, float x3, float x4, float x5, float x6, float x7) @@ -1188,7 +1191,7 @@ union Vec256Data { sf[4] = x4; sf[5] = x5; sf[6] = x6; sf[7] = x7; } - //! @brief Set all eight SP-FP floats. + //! Set all eight SP-FP floats. ASMJIT_INLINE void setSf( float x0) { @@ -1196,14 +1199,14 @@ union Vec256Data { sf[4] = x0; sf[5] = x0; sf[6] = x0; sf[7] = x0; } - //! @brief Set all four DP-FP floats. + //! Set all four DP-FP floats. ASMJIT_INLINE void setDf( double x0, double x1, double x2, double x3) { df[0] = x0; df[1] = x1; df[2] = x2; df[3] = x3; } - //! @brief Set all four DP-FP floats. + //! Set all four DP-FP floats. ASMJIT_INLINE void setDf( double x0) { @@ -1214,26 +1217,26 @@ union Vec256Data { // [Members] // -------------------------------------------------------------------------- - //! @brief Array of thirty two signed 8-bit integers. + //! Array of thirty two signed 8-bit integers. int8_t sb[32]; - //! @brief Array of thirty two unsigned 8-bit integers. + //! Array of thirty two unsigned 8-bit integers. uint8_t ub[32]; - //! @brief Array of sixteen signed 16-bit integers. + //! Array of sixteen signed 16-bit integers. int16_t sw[16]; - //! @brief Array of sixteen unsigned 16-bit integers. + //! Array of sixteen unsigned 16-bit integers. uint16_t uw[16]; - //! @brief Array of eight signed 32-bit integers. + //! Array of eight signed 32-bit integers. int32_t sd[8]; - //! @brief Array of eight unsigned 32-bit integers. + //! Array of eight unsigned 32-bit integers. uint32_t ud[8]; - //! @brief Array of four signed 64-bit integers. + //! Array of four signed 64-bit integers. int64_t sq[4]; - //! @brief Array of four unsigned 64-bit integers. + //! Array of four unsigned 64-bit integers. uint64_t uq[4]; - //! @brief Array of eight 32-bit single precision floating points. + //! Array of eight 32-bit single precision floating points. float sf[8]; - //! @brief Array of four 64-bit double precision floating points. + //! Array of four 64-bit double precision floating points. double df[4]; }; diff --git a/src/asmjit/base/vmem.cpp b/src/asmjit/base/vmem.cpp index 07648f8..7abe488 100644 --- a/src/asmjit/base/vmem.cpp +++ b/src/asmjit/base/vmem.cpp @@ -8,7 +8,10 @@ #define ASMJIT_EXPORTS // [Dependencies - AsmJit] +#include "../base/error.h" +#include "../base/globals.h" #include "../base/intutil.h" +#include "../base/lock.h" #include "../base/vmem.h" // [Dependencies - Windows] @@ -26,22 +29,57 @@ // [Api-Begin] #include "../apibegin.h" +// This file contains implementation of virtual memory management for AsmJit +// library. The initial concept is to keep this implementation simple but +// efficient. There are several goals I decided to write implementation myself. +// +// Goals: +// - We need usually to allocate blocks of 64 bytes long and more. +// - Alignment of allocated blocks is large - 32 bytes or 64 bytes. +// - Keep memory manager information outside allocated virtual memory pages +// (these pages allows execution of code). +// - Keep implementation small. +// +// I think that implementation is not small and probably not too much readable, +// so there is small know how. +// +// - Implementation is based on bit arrays and binary trees. Bit arrays +// contains information about allocated and unused blocks of memory. Each +// block size describes MemNode::density member. Count of blocks are +// stored in MemNode::blocks member. For example if density is 64 and +// count of blocks is 20, memory node contains 64*20 bytes of memory and +// smallest possible allocation (and also alignment) is 64 bytes. So density +// describes also memory alignment. Binary trees are used to enable fast +// lookup into all addresses allocated by memory manager instance. This is +// used mainly in VMemPrivate::release(). +// +// Bit array looks like this (empty = unused, X = used) - Size of block 64 +// ------------------------------------------------------------------------- +// | |X|X| | | | | |X|X|X|X|X|X| | | | | | | | | | | | |X| | | | |X|X|X| | | +// ------------------------------------------------------------------------- +// Bits array shows that there are 12 allocated blocks of 64 bytes, so total +// allocated size is 768 bytes. Maximum count of continuous blocks is 12 +// (see largest gap). + namespace asmjit { // ============================================================================ -// [asmjit::VMem - Windows] +// [asmjit::VMemUtil - Windows] // ============================================================================ +// Windows specific implementation using `VirtualAllocEx` and `VirtualFree`. #if defined(ASMJIT_OS_WINDOWS) struct VMemLocal { VMemLocal() { SYSTEM_INFO info; GetSystemInfo(&info); + hProcess = GetCurrentProcess(); alignment = info.dwAllocationGranularity; pageSize = IntUtil::roundUpToPowerOf2(info.dwPageSize); } + HANDLE hProcess; size_t alignment; size_t pageSize; }; @@ -51,47 +89,56 @@ static VMemLocal& vm() { return vm; }; -void* VMem::alloc(size_t length, size_t* allocated, bool canExecute) { - return allocProcessMemory(GetCurrentProcess(), length, allocated, canExecute); -} - -void VMem::release(void* addr, size_t length) { - return releaseProcessMemory(GetCurrentProcess(), addr, length); -} - -void* VMem::allocProcessMemory(HANDLE hProcess, size_t length, size_t* allocated, bool canExecute) { - // VirtualAlloc rounds allocated size to page size automatically. - size_t msize = IntUtil::roundUp(length, vm().pageSize); - - // Windows XP SP2 / Vista allow Data Excution Prevention (DEP). - WORD protect = canExecute ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; - LPVOID mbase = VirtualAllocEx(hProcess, NULL, msize, MEM_COMMIT | MEM_RESERVE, protect); - if (mbase == NULL) return NULL; - - ASMJIT_ASSERT(IntUtil::isAligned(reinterpret_cast(mbase), vm().alignment)); - - if (allocated != NULL) - *allocated = msize; - return mbase; -} - -void VMem::releaseProcessMemory(HANDLE hProcess, void* addr, size_t /* length */) { - VirtualFreeEx(hProcess, addr, 0, MEM_RELEASE); -} - -size_t VMem::getAlignment() { +size_t VMemUtil::getAlignment() { return vm().alignment; } -size_t VMem::getPageSize() { +size_t VMemUtil::getPageSize() { return vm().pageSize; } + +void* VMemUtil::alloc(size_t length, size_t* allocated, bool canExecute) { + return allocProcessMemory(static_cast(0), length, allocated, canExecute); +} + +void VMemUtil::release(void* addr, size_t length) { + return releaseProcessMemory(static_cast(0), addr, length); +} + +void* VMemUtil::allocProcessMemory(HANDLE hProcess, size_t length, size_t* allocated, bool canExecute) { + VMemLocal& vmLocal = vm(); + + if (hProcess == static_cast(0)) + hProcess = vmLocal.hProcess; + + // VirtualAlloc rounds allocated size to a page size automatically. + size_t mSize = IntUtil::roundUp(length, vmLocal.pageSize); + + // Windows XP SP2 / Vista allow Data Excution Prevention (DEP). + WORD protect = canExecute ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE; + LPVOID mBase = VirtualAllocEx(hProcess, NULL, mSize, MEM_COMMIT | MEM_RESERVE, protect); + + if (mBase == NULL) + return NULL; + + ASMJIT_ASSERT(IntUtil::isAligned( + reinterpret_cast(mBase), vmLocal.alignment)); + + if (allocated != NULL) + *allocated = mSize; + return mBase; +} + +void VMemUtil::releaseProcessMemory(HANDLE hProcess, void* addr, size_t /* length */) { + VirtualFreeEx(hProcess, addr, 0, MEM_RELEASE); +} #endif // ASMJIT_OS_WINDOWS // ============================================================================ -// [asmjit::VMem - Posix] +// [asmjit::VMemUtil - Posix] // ============================================================================ +// Posix specific implementation using `mmap` and `munmap`. #if defined(ASMJIT_OS_POSIX) // MacOS uses MAP_ANON instead of MAP_ANONYMOUS. @@ -113,7 +160,15 @@ static VMemLocal& vm() { return vm; } -void* VMem::alloc(size_t length, size_t* allocated, bool canExecute) { +size_t VMemUtil::getAlignment() { + return vm().alignment; +} + +size_t VMemUtil::getPageSize() { + return vm().pageSize; +} + +void* VMemUtil::alloc(size_t length, size_t* allocated, bool canExecute) { size_t msize = IntUtil::roundUp(length, vm().pageSize); int protection = PROT_READ | PROT_WRITE | (canExecute ? PROT_EXEC : 0); @@ -126,20 +181,1025 @@ void* VMem::alloc(size_t length, size_t* allocated, bool canExecute) { return mbase; } -void VMem::release(void* addr, size_t length) { - munmap(addr, length); -} - -size_t VMem::getAlignment() { - return vm().alignment; -} - -size_t VMem::getPageSize() { - return vm().pageSize; +void VMemUtil::release(void* addr, size_t length) { + ::munmap(addr, length); } #endif // ASMJIT_OS_POSIX -} // asmjit namespace +// ============================================================================ +// [VMem - Ops] +// ============================================================================ -// [Api-End] -#include "../apiend.h" +//! @internal +enum { + kBitsPerEntity = (sizeof(size_t) * 8) +}; + +//! @internal +//! +//! Set `len` bits in `buf` starting at `index` bit index. +static void _SetBits(size_t* buf, size_t index, size_t len) { + if (len == 0) + return; + + size_t i = index / kBitsPerEntity; // size_t[] + size_t j = index % kBitsPerEntity; // size_t[][] bit index + + // How many bytes process in the first group. + size_t c = kBitsPerEntity - j; + if (c > len) c = len; + + // Offset. + buf += i; + + *buf++ |= ((~(size_t)0) >> (kBitsPerEntity - c)) << j; + len -= c; + + while (len >= kBitsPerEntity) { + *buf++ = ~(size_t)0; + len -= kBitsPerEntity; + } + + if (len) + *buf |= ((~(size_t)0) >> (kBitsPerEntity - len)); +} + +// ============================================================================ +// [asmjit::MemNode] +// ============================================================================ + +#define M_DIV(x, y) ((x) / (y)) +#define M_MOD(x, y) ((x) % (y)) + +//! @internal +//! +//! Base red-black tree node. +struct RbNode { + // -------------------------------------------------------------------------- + // [Red-black tree node, key is mem pointer]. + // -------------------------------------------------------------------------- + + // Implementation is based on article by Julienne Walker (Public Domain), + // including C code and original comments. Thanks for the excellent article. + + // Left[0] and right[1] nodes. + RbNode* node[2]; + // Whether the node is RED. + uint32_t red; + + // -------------------------------------------------------------------------- + // [Chunk Memory] + // -------------------------------------------------------------------------- + + // Virtual memory address. + uint8_t* mem; +}; + +//! @internal +//! +//! Get whether the node is red (NULL or node with red flag). +static ASMJIT_INLINE bool rbIsRed(RbNode* node) { + return node != NULL && node->red; +} + +struct MemNode : public RbNode { + // -------------------------------------------------------------------------- + // [Helpers] + // -------------------------------------------------------------------------- + + // Get available space. + ASMJIT_INLINE size_t getAvailable() const { return size - used; } + + ASMJIT_INLINE void fillData(MemNode* other) { + mem = other->mem; + + size = other->size; + blocks = other->blocks; + density = other->density; + used = other->used; + largestBlock = other->largestBlock; + baUsed = other->baUsed; + baCont = other->baCont; + } + + // -------------------------------------------------------------------------- + // [Members] + // -------------------------------------------------------------------------- + + MemNode* prev; // Prev node in list. + MemNode* next; // Next node in list. + + size_t size; // How many bytes contain this node. + size_t blocks; // How many blocks are here. + size_t density; // Minimum count of allocated bytes in this node (also alignment). + size_t used; // How many bytes are used in this node. + size_t largestBlock; // Contains largest block that can be allocated. + + size_t* baUsed; // Contains bits about used blocks (0 = unused, 1 = used). + size_t* baCont; // Contains bits about continuous blocks (0 = stop , 1 = continue). +}; + +// ============================================================================ +// [asmjit::PermanentNode] +// ============================================================================ + +//! @internal +//! +//! Permanent node. +struct PermanentNode { + // -------------------------------------------------------------------------- + // [Helpers] + // -------------------------------------------------------------------------- + + //! Get available space. + ASMJIT_INLINE size_t getAvailable() const { + return size - used; + } + + // -------------------------------------------------------------------------- + // [Members] + // -------------------------------------------------------------------------- + + uint8_t* mem; // Base pointer (virtual memory address). + size_t size; // Count of bytes allocated. + size_t used; // Count of bytes used. + PermanentNode* prev; // Pointer to prev chunk or NULL. +}; + +// ============================================================================ +// [asmjit::VMemPrivate] +// ============================================================================ + +//! @internal +struct VMemPrivate { + // -------------------------------------------------------------------------- + // [Construction / Destruction] + // -------------------------------------------------------------------------- + +#if !defined(ASMJIT_OS_WINDOWS) + VMemPrivate(); +#else + VMemPrivate(HANDLE hProcess); +#endif // ASMJIT_OS_WINDOWS + ~VMemPrivate(); + + // -------------------------------------------------------------------------- + // [Allocation] + // -------------------------------------------------------------------------- + + MemNode* createNode(size_t size, size_t density); + + void reset(bool keepVirtualMemory); + + void* allocPermanent(size_t vsize); + void* allocFreeable(size_t vsize); + Error release(void* address); + Error shrink(void* address, size_t used); + + // Helpers to avoid ifdefs in the code. + ASMJIT_INLINE uint8_t* allocVirtualMemory(size_t size, size_t* vsize) { +#if !defined(ASMJIT_OS_WINDOWS) + return (uint8_t*)VMemUtil::alloc(size, vsize, true); +#else + return (uint8_t*)VMemUtil::allocProcessMemory(_hProcess, size, vsize, true); +#endif + } + + ASMJIT_INLINE void freeVirtualMemory(void* vmem, size_t vsize) { +#if !defined(ASMJIT_OS_WINDOWS) + VMemUtil::release(vmem, vsize); +#else + VMemUtil::releaseProcessMemory(_hProcess, vmem, vsize); +#endif + } + + // -------------------------------------------------------------------------- + // [NodeList RB-Tree] + // -------------------------------------------------------------------------- + + bool checkTree(); + + void insertNode(MemNode* node); + MemNode* removeNode(MemNode* node); + MemNode* findPtr(uint8_t* mem); + + // -------------------------------------------------------------------------- + // [Members] + // -------------------------------------------------------------------------- + +#if defined(ASMJIT_OS_WINDOWS) + HANDLE _hProcess; // Process where to allocate memory. +#endif // ASMJIT_OS_WINDOWS + Lock _lock; // Lock for thread safety. + + size_t _newChunkSize; // Default node size. + size_t _newChunkDensity; // Default node density. + size_t _allocated; // How many bytes are allocated. + size_t _used; // How many bytes are used. + + // Memory nodes list. + MemNode* _first; + MemNode* _last; + MemNode* _optimal; + + // Memory nodes tree. + MemNode* _root; + + // Permanent memory. + PermanentNode* _permanent; + + // Whether to keep virtual memory after destroy. + bool _keepVirtualMemory; +}; + +// ============================================================================ +// [asmjit::VMemPrivate - Construction / Destruction] +// ============================================================================ + +#if !defined(ASMJIT_OS_WINDOWS) +VMemPrivate::VMemPrivate() : +#else +VMemPrivate::VMemPrivate(HANDLE hProcess) : + _hProcess(hProcess), +#endif + _newChunkSize(65536), + _newChunkDensity(64), + _allocated(0), + _used(0), + _root(NULL), + _first(NULL), + _last(NULL), + _optimal(NULL), + _permanent(NULL), + _keepVirtualMemory(false) {} + +VMemPrivate::~VMemPrivate() { + // Freeable memory cleanup - Also frees the virtual memory if configured to. + reset(_keepVirtualMemory); + + // Permanent memory cleanup - Never frees the virtual memory. + PermanentNode* node = _permanent; + while (node) { + PermanentNode* prev = node->prev; + ::free(node); + node = prev; + } +} + +// ============================================================================ +// [asmjit::VMemPrivate - Allocation] +// ============================================================================ + +// Allocate virtual memory node and MemNode structure. +// +// Returns MemNode* on success, otherwise NULL. +MemNode* VMemPrivate::createNode(size_t size, size_t density) { + size_t vsize; + uint8_t* vmem = allocVirtualMemory(size, &vsize); + + // Out of memory. + if (vmem == NULL) return NULL; + + size_t blocks = (vsize / density); + size_t bsize = (((blocks + 7) >> 3) + sizeof(size_t) - 1) & ~(size_t)(sizeof(size_t) - 1); + + MemNode* node = static_cast(::malloc(sizeof(MemNode))); + uint8_t* data = static_cast(::malloc(bsize * 2)); + + // Out of memory. + if (node == NULL || data == NULL) { + freeVirtualMemory(vmem, vsize); + if (node) ::free(node); + if (data) ::free(data); + return NULL; + } + + // Initialize RbNode data. + node->node[0] = NULL; + node->node[1] = NULL; + node->red = 1; + node->mem = vmem; + + // Initialize MemNode data. + node->prev = NULL; + node->next = NULL; + + node->size = vsize; + node->blocks = blocks; + node->density = density; + node->used = 0; + node->largestBlock = vsize; + + ::memset(data, 0, bsize * 2); + node->baUsed = reinterpret_cast(data); + node->baCont = reinterpret_cast(data + bsize); + + return node; +} + +void VMemPrivate::reset(bool keepVirtualMemory) { + MemNode* node = _first; + + while (node) { + MemNode* next = node->next; + + if (!keepVirtualMemory) + freeVirtualMemory(node->mem, node->size); + + ::free(node->baUsed); + ::free(node); + + node = next; + } + + _allocated = 0; + _used = 0; + + _root = NULL; + _first = NULL; + _last = NULL; + _optimal = NULL; +} + +void* VMemPrivate::allocPermanent(size_t vsize) { + static const size_t permanentAlignment = 32; + static const size_t permanentNodeSize = 32768; + + size_t over = vsize % permanentAlignment; + if (over) + over = permanentAlignment - over; + + size_t alignedSize = vsize + over; + AutoLock locked(_lock); + + PermanentNode* node = _permanent; + + // Try to find space in allocated chunks. + while (node && alignedSize > node->getAvailable()) + node = node->prev; + + // Or allocate new node. + if (node == NULL) { + size_t nodeSize = permanentNodeSize; + + if (vsize > nodeSize) + nodeSize = vsize; + + node = static_cast(::malloc(sizeof(PermanentNode))); + + // Out of memory. + if (node == NULL) + return NULL; + + node->mem = allocVirtualMemory(nodeSize, &node->size); + + // Out of memory. + if (node->mem == NULL) { + ::free(node); + return NULL; + } + + node->used = 0; + node->prev = _permanent; + _permanent = node; + } + + // Finally, copy function code to our space we reserved for. + uint8_t* result = node->mem + node->used; + + // Update Statistics. + node->used += alignedSize; + _used += alignedSize; + + // Code can be null to only reserve space for code. + return static_cast(result); +} + +void* VMemPrivate::allocFreeable(size_t vsize) { + size_t i; // Current index. + size_t need; // How many we need to be freed. + size_t minVSize; + + // Align to 32 bytes (our default alignment). + vsize = (vsize + 31) & ~(size_t)31; + if (vsize == 0) return NULL; + + AutoLock locked(_lock); + MemNode* node = _optimal; + + minVSize = _newChunkSize; + + // Try to find memory block in existing nodes. + while (node) { + // Skip this node? + if ((node->getAvailable() < vsize) || (node->largestBlock < vsize && node->largestBlock != 0)) { + MemNode* next = node->next; + if (node->getAvailable() < minVSize && node == _optimal && next) _optimal = next; + node = next; + continue; + } + + size_t* up = node->baUsed; // Current ubits address. + size_t ubits; // Current ubits[0] value. + size_t bit; // Current bit mask. + size_t blocks = node->blocks; // Count of blocks in node. + size_t cont = 0; // How many bits are currently freed in find loop. + size_t maxCont = 0; // Largest continuous block (bits count). + size_t j; + + need = M_DIV((vsize + node->density - 1), node->density); + i = 0; + + // Try to find node that is large enough. + while (i < blocks) { + ubits = *up++; + + // Fast skip used blocks. + if (ubits == ~(size_t)0) { + if (cont > maxCont) maxCont = cont; + cont = 0; + + i += kBitsPerEntity; + continue; + } + + size_t max = kBitsPerEntity; + if (i + max > blocks) + max = blocks - i; + + for (j = 0, bit = 1; j < max; bit <<= 1) { + j++; + if ((ubits & bit) == 0) { + if (++cont == need) { i += j; i -= cont; goto _Found; } + continue; + } + + if (cont > maxCont) maxCont = cont; + cont = 0; + } + + i += kBitsPerEntity; + } + + // Because we traversed entire node, we can set largest node size that + // will be used to cache next traversing.. + node->largestBlock = maxCont * node->density; + + node = node->next; + } + + // If we are here, we failed to find existing memory block and we must + // allocate new. + { + size_t chunkSize = _newChunkSize; + if (chunkSize < vsize) chunkSize = vsize; + + node = createNode(chunkSize, _newChunkDensity); + if (node == NULL) return NULL; + + // Update binary tree. + insertNode(node); + ASMJIT_ASSERT(checkTree()); + + // Alloc first node at start. + i = 0; + need = (vsize + node->density - 1) / node->density; + + // Update statistics. + _allocated += node->size; + } + +_Found: + // Update bits. + _SetBits(node->baUsed, i, need); + _SetBits(node->baCont, i, need - 1); + + // Update statistics. + { + size_t u = need * node->density; + node->used += u; + node->largestBlock = 0; + _used += u; + } + + // And return pointer to allocated memory. + uint8_t* result = node->mem + i * node->density; + ASMJIT_ASSERT(result >= node->mem && result <= node->mem + node->size - vsize); + return result; +} + +Error VMemPrivate::release(void* address) { + if (address == NULL) + return kErrorOk; + + AutoLock locked(_lock); + + MemNode* node = findPtr((uint8_t*)address); + if (node == NULL) + return kErrorInvalidArgument; + + size_t offset = (size_t)((uint8_t*)address - (uint8_t*)node->mem); + size_t bitpos = M_DIV(offset, node->density); + size_t i = (bitpos / kBitsPerEntity); + + size_t* up = node->baUsed + i; // Current ubits address. + size_t* cp = node->baCont + i; // Current cbits address. + size_t ubits = *up; // Current ubits[0] value. + size_t cbits = *cp; // Current cbits[0] value. + size_t bit = (size_t)1 << (bitpos % kBitsPerEntity); + + size_t cont = 0; + bool stop; + + for (;;) { + stop = (cbits & bit) == 0; + ubits &= ~bit; + cbits &= ~bit; + + bit <<= 1; + cont++; + + if (stop || bit == 0) { + *up = ubits; + *cp = cbits; + if (stop) + break; + + ubits = *++up; + cbits = *++cp; + bit = 1; + } + } + + // If the freed block is fully allocated node then it's needed to + // update 'optimal' pointer in memory manager. + if (node->used == node->size) { + MemNode* cur = _optimal; + + do { + cur = cur->prev; + if (cur == node) { + _optimal = node; + break; + } + } while (cur); + } + + // Statistics. + cont *= node->density; + if (node->largestBlock < cont) + node->largestBlock = cont; + + node->used -= cont; + _used -= cont; + + // If page is empty, we can free it. + if (node->used == 0) { + // Free memory associated with node (this memory is not accessed + // anymore so it's safe). + freeVirtualMemory(node->mem, node->size); + ::free(node->baUsed); + + node->baUsed = NULL; + node->baCont = NULL; + + // Statistics. + _allocated -= node->size; + + // Remove node. This function can return different node than + // passed into, but data is copied into previous node if needed. + ::free(removeNode(node)); + ASMJIT_ASSERT(checkTree()); + } + + return kErrorOk; +} + +Error VMemPrivate::shrink(void* address, size_t used) { + if (address == NULL) + return kErrorOk; + + if (used == 0) + return release(address); + + AutoLock locked(_lock); + + MemNode* node = findPtr((uint8_t*)address); + if (node == NULL) + return kErrorInvalidArgument; + + size_t offset = (size_t)((uint8_t*)address - (uint8_t*)node->mem); + size_t bitpos = M_DIV(offset, node->density); + size_t i = (bitpos / kBitsPerEntity); + + size_t* up = node->baUsed + i; // Current ubits address. + size_t* cp = node->baCont + i; // Current cbits address. + size_t ubits = *up; // Current ubits[0] value. + size_t cbits = *cp; // Current cbits[0] value. + size_t bit = (size_t)1 << (bitpos % kBitsPerEntity); + + size_t cont = 0; + size_t usedBlocks = (used + node->density - 1) / node->density; + + bool stop; + + // Find the first block we can mark as free. + for (;;) { + stop = (cbits & bit) == 0; + if (stop) + return kErrorOk; + + if (++cont == usedBlocks) + break; + + bit <<= 1; + if (bit == 0) { + ubits = *++up; + cbits = *++cp; + bit = 1; + } + } + + // Free the tail blocks. + cont = ~(size_t)0; + goto _EnterFreeLoop; + + for (;;) { + stop = (cbits & bit) == 0; + ubits &= ~bit; + +_EnterFreeLoop: + cbits &= ~bit; + + bit <<= 1; + cont++; + + if (stop || bit == 0) { + *up = ubits; + *cp = cbits; + if (stop) + break; + + ubits = *++up; + cbits = *++cp; + bit = 1; + } + } + + // Statistics. + cont *= node->density; + if (node->largestBlock < cont) + node->largestBlock = cont; + + node->used -= cont; + _used -= cont; + + return kErrorOk; +} + +// ============================================================================ +// [asmjit::VMemPrivate - NodeList RB-Tree] +// ============================================================================ + +static int rbAssert(RbNode* root) { + if (root == NULL) + return 1; + + RbNode* ln = root->node[0]; + RbNode* rn = root->node[1]; + + // Red violation. + ASMJIT_ASSERT( !(rbIsRed(root) && (rbIsRed(ln) || rbIsRed(rn))) ); + + int lh = rbAssert(ln); + int rh = rbAssert(rn); + + // Invalid btree. + ASMJIT_ASSERT(ln == NULL || ln->mem < root->mem); + ASMJIT_ASSERT(rn == NULL || rn->mem > root->mem); + + // Black violation. + ASMJIT_ASSERT( !(lh != 0 && rh != 0 && lh != rh) ); + + // Only count black links. + if (lh != 0 && rh != 0) + return rbIsRed(root) ? lh : lh + 1; + else + return 0; +} + +static ASMJIT_INLINE RbNode* rbRotateSingle(RbNode* root, int dir) { + RbNode* save = root->node[!dir]; + + root->node[!dir] = save->node[dir]; + save->node[dir] = root; + + root->red = 1; + save->red = 0; + + return save; +} + +static ASMJIT_INLINE RbNode* rbRotateDouble(RbNode* root, int dir) { + root->node[!dir] = rbRotateSingle(root->node[!dir], !dir); + return rbRotateSingle(root, dir); +} + +bool VMemPrivate::checkTree() { + return rbAssert(_root) > 0; +} + +void VMemPrivate::insertNode(MemNode* node) { + if (_root == NULL) { + // Empty tree case. + _root = node; + } + else { + // False tree root. + RbNode head = { 0 }; + + // Grandparent & parent. + RbNode* g = NULL; + RbNode* t = &head; + + // Iterator & parent. + RbNode* p = NULL; + RbNode* q = t->node[1] = _root; + + int dir = 0, last; + + // Search down the tree. + for (;;) { + if (q == NULL) { + // Insert new node at the bottom. + q = node; + p->node[dir] = node; + } + else if (rbIsRed(q->node[0]) && rbIsRed(q->node[1])) { + // Color flip. + q->red = 1; + q->node[0]->red = 0; + q->node[1]->red = 0; + } + + // Fix red violation. + if (rbIsRed(q) && rbIsRed(p)) { + int dir2 = t->node[1] == g; + t->node[dir2] = q == p->node[last] ? rbRotateSingle(g, !last) : rbRotateDouble(g, !last); + } + + // Stop if found. + if (q == node) + break; + + last = dir; + dir = q->mem < node->mem; + + // Update helpers. + if (g != NULL) + t = g; + + g = p; + p = q; + q = q->node[dir]; + } + + // Update root. + _root = static_cast(head.node[1]); + } + + // Make root black. + _root->red = 0; + + // Link with others. + node->prev = _last; + + if (_first == NULL) { + _first = node; + _last = node; + _optimal = node; + } + else { + node->prev = _last; + _last->next = node; + _last = node; + } +} + +MemNode* VMemPrivate::removeNode(MemNode* node) { + // False tree root. + RbNode head = { 0 }; + + // Helpers. + RbNode* q = &head; + RbNode* p = NULL; + RbNode* g = NULL; + + // Found item. + RbNode* f = NULL; + int dir = 1; + + // Set up. + q->node[1] = _root; + + // Search and push a red down. + while (q->node[dir] != NULL) { + int last = dir; + + // Update helpers. + g = p; + p = q; + q = q->node[dir]; + dir = q->mem < node->mem; + + // Save found node. + if (q == node) + f = q; + + // Push the red node down. + if (!rbIsRed(q) && !rbIsRed(q->node[dir])) { + if (rbIsRed(q->node[!dir])) { + p = p->node[last] = rbRotateSingle(q, dir); + } + else if (!rbIsRed(q->node[!dir])) { + RbNode* s = p->node[!last]; + + if (s != NULL) { + if (!rbIsRed(s->node[!last]) && !rbIsRed(s->node[last])) { + // Color flip. + p->red = 0; + s->red = 1; + q->red = 1; + } + else { + int dir2 = g->node[1] == p; + + if (rbIsRed(s->node[last])) + g->node[dir2] = rbRotateDouble(p, last); + else if (rbIsRed(s->node[!last])) + g->node[dir2] = rbRotateSingle(p, last); + + // Ensure correct coloring. + q->red = g->node[dir2]->red = 1; + g->node[dir2]->node[0]->red = 0; + g->node[dir2]->node[1]->red = 0; + } + } + } + } + } + + // Replace and remove. + ASMJIT_ASSERT(f != NULL); + ASMJIT_ASSERT(f != &head); + ASMJIT_ASSERT(q != &head); + + if (f != q) { + ASMJIT_ASSERT(f != &head); + static_cast(f)->fillData(static_cast(q)); + } + + p->node[p->node[1] == q] = q->node[q->node[0] == NULL]; + + // Update root and make it black. + _root = static_cast(head.node[1]); + if (_root != NULL) + _root->red = 0; + + // Unlink. + MemNode* next = static_cast(q)->next; + MemNode* prev = static_cast(q)->prev; + + if (prev) + prev->next = next; + else + _first = next; + + if (next) + next->prev = prev; + else + _last = prev; + + if (_optimal == q) + _optimal = prev ? prev : next; + + return static_cast(q); +} + +MemNode* VMemPrivate::findPtr(uint8_t* mem) { + MemNode* node = _root; + + while (node != NULL) { + uint8_t* nodeMem = node->mem; + + // Go left. + if (mem < nodeMem) { + node = static_cast(node->node[0]); + continue; + } + + // Go right. + uint8_t* nodeEnd = nodeMem + node->size; + if (mem >= nodeEnd) { + node = static_cast(node->node[1]); + continue; + } + + // Match. + break; + } + + return node; +} + +// ============================================================================ +// [asmjit::VMemMgr - Construction / Destruction] +// ============================================================================ + +#if !defined(ASMJIT_OS_WINDOWS) +VMemMgr::VMemMgr() { + VMemPrivate* d = new(std::nothrow) VMemPrivate(); + _d = static_cast(d); +} +#else +VMemMgr::VMemMgr() { + HANDLE hProcess = GetCurrentProcess(); + VMemPrivate* d = new(std::nothrow) VMemPrivate(hProcess); + _d = static_cast(d); +} + +VMemMgr::VMemMgr(HANDLE hProcess) { + VMemPrivate* d = new(std::nothrow) VMemPrivate(hProcess); + _d = static_cast(d); +} +#endif // ASMJIT_OS_WINDOWS + +VMemMgr::~VMemMgr() { + VMemPrivate* d = static_cast(_d); + delete d; +} + +// ============================================================================ +// [asmjit::VMemMgr - Reset] +// ============================================================================ + +void VMemMgr::reset() { + VMemPrivate* d = static_cast(_d); + return d->reset(false); +} + +// ============================================================================ +// [asmjit::VMemMgr - Accessors] +// ============================================================================ + +#if defined(ASMJIT_OS_WINDOWS) +HANDLE VMemMgr::getProcessHandle() const { + VMemPrivate* d = static_cast(_d); + return d->_hProcess; +} +#endif // ASMJIT_OS_WINDOWS + +size_t VMemMgr::getUsedBytes() const { + VMemPrivate* d = static_cast(_d); + return d->_used; +} + +size_t VMemMgr::getAllocatedBytes() const { + VMemPrivate* d = static_cast(_d); + return d->_allocated; +} + +bool VMemMgr::getKeepVirtualMemory() const { + VMemPrivate* d = static_cast(_d); + return d->_keepVirtualMemory; +} + +void VMemMgr::setKeepVirtualMemory(bool keepVirtualMemory) { + VMemPrivate* d = static_cast(_d); + d->_keepVirtualMemory = keepVirtualMemory; +} + +// ============================================================================ +// [asmjit::VMemMgr - Alloc / Release] +// ============================================================================ + +void* VMemMgr::alloc(size_t size, uint32_t type) { + VMemPrivate* d = static_cast(_d); + + if (type == kVMemAllocPermanent) + return d->allocPermanent(size); + else + return d->allocFreeable(size); +} + +Error VMemMgr::release(void* address) { + VMemPrivate* d = static_cast(_d); + return d->release(address); +} + +Error VMemMgr::shrink(void* address, size_t used) { + VMemPrivate* d = static_cast(_d); + return d->shrink(address, used); +} + +} // asmjit namespace diff --git a/src/asmjit/base/vmem.h b/src/asmjit/base/vmem.h index dc413f8..d012209 100644 --- a/src/asmjit/base/vmem.h +++ b/src/asmjit/base/vmem.h @@ -8,61 +8,170 @@ #ifndef _ASMJIT_BASE_VMEM_H #define _ASMJIT_BASE_VMEM_H +// [Dependencies] +#include "../base/defs.h" +#include "../base/error.h" + +// [Dependencies - Windows] +#if defined(ASMJIT_OS_WINDOWS) +# include +#endif // ASMJIT_OS_WINDOWS + // [Api-Begin] #include "../apibegin.h" namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_util //! @{ // ============================================================================ -// [asmjit::VMem] +// [asmjit::kVMemAlloc] // ============================================================================ -//! @brief Class that helps with allocating memory for executing code -//! generated by JIT compiler. +//! Type of virtual memory allocation, see `VMemMgr::alloc()`. +ASMJIT_ENUM(kVMemAlloc) { + //! Normal memory allocation, has to be freed by `VMemMgr::release()`. + kVMemAllocFreeable = 0, + //! Allocate permanent memory, can't be freed. + kVMemAllocPermanent = 1 +}; + +// ============================================================================ +// [asmjit::VMemUtil] +// ============================================================================ + +//! Virtual memory utilities. //! -//! There are defined functions that provides facility to allocate and free -//! memory where can be executed code. If processor and operating system -//! supports execution protection then you can't run code from normally -//! malloc()'ed memory. +//! Defines functions that provide facility to allocate and free memory that is +//! executable in a platform independent manner. If both the processor and host +//! operating system support data-execution-prevention then the only way how to +//! run machine code is to allocate it to a memory that has marked as executable. +//! VMemUtil is just unified interface to platform dependent APIs. //! -//! Functions are internally implemented by operating system dependent way. -//! VirtualAlloc() function is used for Windows operating system and mmap() -//! for posix ones. If you want to study or create your own functions, look -//! at VirtualAlloc() or mmap() documentation (depends on you target OS). -//! -//! Under posix operating systems is also useable mprotect() function, that -//! can enable execution protection to malloc()'ed memory block. -struct VMem { - //! @brief Allocate virtual memory. +//! `VirtualAlloc()` function is used on Windows operating system and `mmap()` +//! on POSIX. `VirtualAlloc()` and `mmap()` documentation provide a detailed +//! overview on how to use a platform specific APIs. +struct VMemUtil { + //! Get the alignment guaranteed by alloc(). + static ASMJIT_API size_t getAlignment(); + + //! Get size of the single page. + static ASMJIT_API size_t getPageSize(); + + //! Allocate virtual memory. //! //! Pages are readable/writeable, but they are not guaranteed to be //! executable unless 'canExecute' is true. Returns the address of //! allocated memory, or NULL on failure. static ASMJIT_API void* alloc(size_t length, size_t* allocated, bool canExecute); - //! @brief Free memory allocated by @c alloc() + //! Free memory allocated by `alloc()`. static ASMJIT_API void release(void* addr, size_t length); #if defined(ASMJIT_OS_WINDOWS) - //! @brief Allocate virtual memory of @a hProcess. + //! Allocate virtual memory of `hProcess`. //! //! @note This function is Windows specific. static ASMJIT_API void* allocProcessMemory(HANDLE hProcess, size_t length, size_t* allocated, bool canExecute); - //! @brief Free virtual memory of @a hProcess. + //! Free virtual memory of `hProcess`. //! //! @note This function is Windows specific. static ASMJIT_API void releaseProcessMemory(HANDLE hProcess, void* addr, size_t length); #endif // ASMJIT_OS_WINDOWS +}; - //! @brief Get the alignment guaranteed by alloc(). - static ASMJIT_API size_t getAlignment(); +// ============================================================================ +// [asmjit::VMemMgr] +// ============================================================================ - //! @brief Get size of the single page. - static ASMJIT_API size_t getPageSize(); +//! Reference implementation of memory manager that uses `VMemUtil` to allocate +//! chunks of virtual memory and bit arrays to manage it. +struct VMemMgr { + // -------------------------------------------------------------------------- + // [Construction / Destruction] + // -------------------------------------------------------------------------- + + //! Create a `VMemMgr` instance. + ASMJIT_API VMemMgr(); + +#if defined(ASMJIT_OS_WINDOWS) + //! Create a `VMemMgr` instance for `hProcess`. + //! + //! This is a specialized version of constructor available only for windows + //! and usable to alloc/free memory of a different process. + explicit ASMJIT_API VMemMgr(HANDLE hProcess); +#endif // ASMJIT_OS_WINDOWS + + //! Destroy the `VMemMgr` instance and free all blocks. + ASMJIT_API ~VMemMgr(); + + // -------------------------------------------------------------------------- + // [Reset] + // -------------------------------------------------------------------------- + + //! Free all allocated memory. + ASMJIT_API void reset(); + + // -------------------------------------------------------------------------- + // [Accessors] + // -------------------------------------------------------------------------- + +#if defined(ASMJIT_OS_WINDOWS) + //! Get the handle of the process memory manager is bound to. + ASMJIT_API HANDLE getProcessHandle() const; +#endif // ASMJIT_OS_WINDOWS + + //! Get how many bytes are currently used. + ASMJIT_API size_t getUsedBytes() const; + //! Get how many bytes are currently allocated. + ASMJIT_API size_t getAllocatedBytes() const; + + //! Get whether to keep allocated memory after the `VMemMgr` is destroyed. + //! + //! @sa `setKeepVirtualMemory()`. + ASMJIT_API bool getKeepVirtualMemory() const; + + //! Set whether to keep allocated memory after memory manager is + //! destroyed. + //! + //! This method is usable when patching code of remote process. You need to + //! allocate process memory, store generated assembler into it and patch the + //! method you want to redirect (into your code). This method affects only + //! VMemMgr destructor. After destruction all internal + //! structures are freed, only the process virtual memory remains. + //! + //! @note Memory allocated with kVMemAllocPermanent is always kept. + //! + //! @sa `getKeepVirtualMemory()`. + ASMJIT_API void setKeepVirtualMemory(bool keepVirtualMemory); + + // -------------------------------------------------------------------------- + // [Alloc / Release] + // -------------------------------------------------------------------------- + + //! Allocate a `size` bytes of virtual memory. + //! + //! Note that if you are implementing your own virtual memory manager then you + //! can quitly ignore type of allocation. This is mainly for AsmJit to memory + //! manager that allocated memory will be never freed. + ASMJIT_API void* alloc(size_t size, uint32_t type = kVMemAllocFreeable); + + //! Free previously allocated memory at a given `address`. + ASMJIT_API Error release(void* address); + + //! Free some tail memory. + ASMJIT_API Error shrink(void* address, size_t used); + + // -------------------------------------------------------------------------- + // [Members] + // -------------------------------------------------------------------------- + + //! @internal + //! + //! Pointer to private data hidden out of the public API. + void* _d; }; //! @} diff --git a/src/asmjit/base/zone.cpp b/src/asmjit/base/zone.cpp index 7d30dc5..84b4300 100644 --- a/src/asmjit/base/zone.cpp +++ b/src/asmjit/base/zone.cpp @@ -20,7 +20,7 @@ namespace asmjit { -//! @brief Zero width chunk used when Zone doesn't have any memory allocated. +//! Zero width chunk used when Zone doesn't have any memory allocated. static const Zone::Chunk Zone_zeroChunk = { NULL, 0, 0, { 0 } }; diff --git a/src/asmjit/base/zone.h b/src/asmjit/base/zone.h index 312836f..ba01a90 100644 --- a/src/asmjit/base/zone.h +++ b/src/asmjit/base/zone.h @@ -16,17 +16,17 @@ namespace asmjit { -//! @addtogroup asmjit_base +//! @addtogroup asmjit_base_util //! @{ // ============================================================================ // [asmjit::Zone] // ============================================================================ -//! @brief Fast incremental memory allocator. +//! Fast incremental memory allocator. //! //! Memory allocator designed to allocate small objects that will be invalidated -//! (free) all at once. +//! (freed) all at once. struct Zone { // -------------------------------------------------------------------------- // [Chunk] @@ -34,19 +34,19 @@ struct Zone { //! @internal //! - //! @brief One allocated chunk of memory. + //! One allocated chunk of memory. struct Chunk { - //! @brief Get count of remaining (unused) bytes in chunk. + //! Get count of remaining (unused) bytes in chunk. ASMJIT_INLINE size_t getRemainingSize() const { return size - pos; } - //! @brief Link to previous chunk. + //! Link to previous chunk. Chunk* prev; - //! @brief Position in this chunk. + //! Position in this chunk. size_t pos; - //! @brief Size of this chunk (in bytes). + //! Size of this chunk (in bytes). size_t size; - //! @brief Data. + //! Data. uint8_t data[sizeof(void*)]; }; @@ -54,25 +54,25 @@ struct Zone { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new instance of @c Zone allocator. + //! Create a new instance of `Zone` allocator. //! //! @param chunkSize Default size of the first chunk. ASMJIT_API Zone(size_t chunkSize); - //! @brief Destroy @ref Zone instance. + //! Destroy `Zone` instance. ASMJIT_API ~Zone(); // -------------------------------------------------------------------------- // [Clear / Reset] // -------------------------------------------------------------------------- - //! @brief Free all allocated memory except first block that remains for reuse. + //! Free all allocated memory except first block that remains for reuse. //! //! Note that this method will invalidate all instances using this memory //! allocated by this zone instance. ASMJIT_API void clear(); - //! @brief Free all allocated memory at once. + //! Free all allocated memory at once. //! //! Note that this method will invalidate all instances using this memory //! allocated by this zone instance. @@ -82,32 +82,30 @@ struct Zone { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get (default) chunk size. + //! Get (default) chunk size. ASMJIT_INLINE size_t getChunkSize() const { return _chunkSize; } // -------------------------------------------------------------------------- // [Alloc] // -------------------------------------------------------------------------- - //! @brief Allocate @c size bytes of memory. + //! Allocate `size` bytes of memory. //! - //! Pointer allocated by this way will be valid until @c Zone object is - //! destroyed. To create class by this way use placement @c new and @c delete + //! Pointer allocated by this way will be valid until `Zone` object is + //! destroyed. To create class by this way use placement `new` and `delete` //! operators: //! - //! @code + //! ~~~ //! // Example of simple class allocation. //! using namespace asmjit //! //! // Your class. - //! class Object - //! { + //! class Object { //! // members... //! }; //! //! // Your function - //! void f() - //! { + //! void f() { //! // Create zone object with chunk size of 65536 bytes. //! Zone zone(65536); //! @@ -120,9 +118,9 @@ struct Zone { //! obj->~Object(); //! //! // Zone destructor will free all memory allocated through it, you can - //! // call @c zone.reset() if you wan't to reuse current @ref Zone. + //! // call `zone.reset()` if you wan't to reuse current `Zone`. //! } - //! @endcode + //! ~~~ ASMJIT_INLINE void* alloc(size_t size) { Chunk* cur = _chunks; @@ -136,7 +134,7 @@ struct Zone { return (void*)p; } - //! @brief Like @ref alloc(), but returns T*. + //! Like `alloc()`, but the return is casted to `T*`. template ASMJIT_INLINE T* allocT(size_t size = sizeof(T)) { return static_cast(alloc(size)); @@ -145,7 +143,7 @@ struct Zone { //! @internal ASMJIT_API void* _alloc(size_t size); - //! @brief Allocate @c size bytes of zeroed memory. + //! Allocate `size` bytes of zeroed memory. ASMJIT_INLINE void* calloc(size_t size) { Chunk* cur = _chunks; @@ -163,22 +161,22 @@ struct Zone { //! @internal ASMJIT_API void* _calloc(size_t size); - //! @brief Helper to duplicate data. + //! Helper to duplicate data. ASMJIT_API void* dup(const void* data, size_t size); - //! @brief Helper to duplicate string. + //! Helper to duplicate string. ASMJIT_API char* sdup(const char* str); - //! @brief Helper to duplicate formatted string, maximum length is 256 bytes. + //! Helper to duplicate formatted string, maximum length is 256 bytes. ASMJIT_API char* sformat(const char* str, ...); // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Last allocated chunk of memory. + //! Last allocated chunk of memory. Chunk* _chunks; - //! @brief Default chunk size. + //! Default chunk size. size_t _chunkSize; }; diff --git a/src/asmjit/build.h b/src/asmjit/build.h index 03b904a..baf1916 100644 --- a/src/asmjit/build.h +++ b/src/asmjit/build.h @@ -31,6 +31,16 @@ // [Dependencies - C++] #include +// ============================================================================ +// [asmjit::build - Documentation] +// ============================================================================ + +#if defined(ASMJIT_DOCGEN) +# define ASMJIT_BUILD_X86 +# define ASMJIT_BUILD_X64 +# define ASMJIT_API +#endif // ASMJIT_DOCGEN + // ============================================================================ // [asmjit::build - OS] // ============================================================================ diff --git a/src/asmjit/contrib/winremoteruntime.cpp b/src/asmjit/contrib/winremoteruntime.cpp index 8be26ed..2cedd76 100644 --- a/src/asmjit/contrib/winremoteruntime.cpp +++ b/src/asmjit/contrib/winremoteruntime.cpp @@ -22,11 +22,10 @@ namespace contrib { // ============================================================================ WinRemoteRuntime::WinRemoteRuntime(HANDLE hProcess) : - _hProcess(hProcess), - _memoryManager(hProcess) { + _memMgr(hProcess) { // We are patching another process so enable keep-virtual-memory option. - _memoryManager.setKeepVirtualMemory(true); + _memMgr.setKeepVirtualMemory(true); } WinRemoteRuntime::~WinRemoteRuntime() {} @@ -53,7 +52,7 @@ uint32_t WinRemoteRuntime::add(void** dest, BaseAssembler* assembler) { } // Allocate a pernament remote process memory. - void* processMemPtr = _memoryManager.alloc(codeSize, kVirtualAllocPermanent); + void* processMemPtr = _memMgr.alloc(codeSize, kVMemAllocPermanent); if (processMemPtr == NULL) { ::free(codeData); @@ -64,7 +63,7 @@ uint32_t WinRemoteRuntime::add(void** dest, BaseAssembler* assembler) { // Relocate and write the code to the process memory. assembler->relocCode(codeData, (uintptr_t)processMemPtr); - ::WriteProcessMemory(_hProcess, processMemPtr, codeData, codeSize, NULL); + ::WriteProcessMemory(getProcessHandle(), processMemPtr, codeData, codeSize, NULL); ::free(codeData); *dest = processMemPtr; diff --git a/src/asmjit/contrib/winremoteruntime.h b/src/asmjit/contrib/winremoteruntime.h index ea41753..c68fdbb 100644 --- a/src/asmjit/contrib/winremoteruntime.h +++ b/src/asmjit/contrib/winremoteruntime.h @@ -21,28 +21,33 @@ namespace contrib { // [asmjit::contrib::WinRemoteRuntime] // ============================================================================ -//! @brief WinRemoteRuntime can be used to inject code to a remote process. -struct WinRemoteRuntime : public BaseRuntime { +//! WinRemoteRuntime can be used to inject code to a remote process. +struct WinRemoteRuntime : public Runtime { ASMJIT_NO_COPY(WinRemoteRuntime) // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a @c WinRemoteRuntime instance for a given @a hProcess. + + //! Create a `WinRemoteRuntime` instance for a given `hProcess`. ASMJIT_API WinRemoteRuntime(HANDLE hProcess); - //! @brief Destroy the @c WinRemoteRuntime instance. + //! Destroy the `WinRemoteRuntime` instance. ASMJIT_API virtual ~WinRemoteRuntime(); // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get the remote process handle. - ASMJIT_INLINE HANDLE getProcess() const { return _hProcess; } + //! Get the remote process handle. + ASMJIT_INLINE HANDLE getProcessHandle() const { + return _memMgr.getProcessHandle(); + } - //! @brief Get the virtual memory manager. - ASMJIT_INLINE VirtualMemoryManager* getMemoryManager() { return &_memoryManager; } + //! Get the remote memory manager. + ASMJIT_INLINE VMemMgr* getMemMgr() const { + return const_cast(&_memMgr); + } // -------------------------------------------------------------------------- // [Interface] @@ -54,11 +59,8 @@ struct WinRemoteRuntime : public BaseRuntime { // [Members] // -------------------------------------------------------------------------- - //! @brief Process. - HANDLE _hProcess; - - //! @brief Virtual memory manager. - VirtualMemoryManager _memoryManager; + //! Remove memory manager. + VMemMgr _memMgr; }; } // contrib namespace diff --git a/src/asmjit/x86.h b/src/asmjit/x86.h index dad668d..d2dd119 100644 --- a/src/asmjit/x86.h +++ b/src/asmjit/x86.h @@ -8,7 +8,114 @@ #ifndef _ASMJIT_X86_H #define _ASMJIT_X86_H +// ============================================================================ +// [asmjit_x86x64] +// ============================================================================ + +//! @defgroup asmjit_x86x64 X86/X64 +//! +//! @brief X86/X64 API + +// ============================================================================ +// [asmjit_x86x64_codegen] +// ============================================================================ + +//! @defgroup asmjit_x86x64_codegen Code Generation (X86/X64) +//! @ingroup asmjit_x86x64 +//! +//! @brief Low-level and high-level code generation. + +// ============================================================================ +// [asmjit_x86x64_cpu_info] +// ============================================================================ + +//! @defgroup asmjit_x86x64_cpu_info CPU Information (X86/X64) +//! @ingroup asmjit_x86x64 +//! +//! @brief CPU information specific to X86/X64 architecture. +//! +//! The CPUID instruction can be used to get an exhaustive information related +//! to the host X86/X64 processor. AsmJit contains utilities that can get the +//! most important information related to the features supported by the CPU +//! and the host operating system, in addition to host processor name and number +//! of cores. Class `CpuInfo` extends `BaseCpuInfo` and provides functionality +//! specific to X86 and X64. +//! +//! By default AsmJit queries the CPU information after the library is loaded +//! and the queried information is reused by all instances of `JitRuntime`. +//! The global instance of `CpuInfo` can't be changed, because it will affect +//! the code generation of all `Runtime`s. If there is a need to have a +//! specific CPU information which contains modified features or processor +//! vendor it's possible by creating a new instance of `CpuInfo` and setting +//! up its members. `CpuUtil::detect` can be used to detect CPU features into +//! an existing `CpuInfo` instance - it may become handly if only one property +//! has to be turned on/off. +//! +//! If the high-level interface `CpuInfo` offers is not enough there is also +//! `CpuUtil::callCpuId` helper that can be used to call CPUID instruction with +//! a given parameters and to consume the output. +//! +//! Cpu detection is important when generating a JIT code that may or may not +//! use certain CPU features. For example there used to be a SSE/SSE2 detection +//! in the past and today there is often AVX/AVX2 detection. +//! +//! The example below shows how to detect SSE2: +//! +//! ~~~ +//! using namespace asmjit; +//! using namespace asmjit::host; +//! +//! // Get `CpuInfo` global instance. +//! const CpuInfo* cpuInfo = CpuInfo::getHost(); +//! +//! if (cpuInfo->hasFeature(kCpuFeatureSse2)) { +//! // Processor has SSE2. +//! } +//! else if (cpuInfo->hasFeature(kCpuFeatureMmx)) { +//! // Processor doesn't have SSE2, but has MMX. +//! } +//! else { +//! // An archaic processor, it's a wonder AsmJit works here! +//! } +//! ~~~ +//! +//! The next example shows how to call CPUID directly: +//! +//! ~~~ +//! using namespace asmjit; +//! +//! // The result of CPUID call. +//! CpuId out; +//! +//! // Call CPUID, first two arguments are passed in EAX/ECX. +//! CpuUtil::callCpuId(0, 0, &out); +//! +//! // If EAX argument is 0, EBX, ECX and EDX registers are filled with a cpu vendor. +//! char cpuVendor[13]; +//! memcpy(cpuVendor, &out.ebx, 4); +//! memcpy(cpuVendor + 4, &out.edx, 4); +//! memcpy(cpuVendor + 8, &out.ecx, 4); +//! vendor[12] = '\0'; +//! +//! // Print a CPU vendor retrieved from CPUID. +//! ::printf("%s", cpuVendor); +//! ~~~ +//! +//! @sa @ref asmjit_base_cpu_info + +// ============================================================================ +// [asmjit_x86x64_constants] +// ============================================================================ + +//! @defgroup asmjit_x86x64_constants Constants (X86/X64) +//! @ingroup asmjit_x86x64 +//! +//! @brief Constants and definitions specific to X86/X64 architecture. + +// ============================================================================ // [Dependencies - AsmJit] +// ============================================================================ + #include "base.h" #include "x86/x86assembler.h" diff --git a/src/asmjit/x86/x86assembler.cpp b/src/asmjit/x86/x86assembler.cpp index 5474a5a..d55a1b4 100644 --- a/src/asmjit/x86/x86assembler.cpp +++ b/src/asmjit/x86/x86assembler.cpp @@ -14,9 +14,9 @@ // [Dependencies - AsmJit] #include "../base/intutil.h" #include "../base/logger.h" -#include "../base/memorymanager.h" #include "../base/runtime.h" #include "../base/string.h" +#include "../base/vmem.h" #include "../x86/x86assembler.h" #include "../x86/x86cpuinfo.h" #include "../x86/x86defs.h" @@ -60,7 +60,7 @@ enum kVexVVVV { //! @internal //! -//! @brief Instruction 2-byte/3-byte opcode prefix definition. +//! Instruction 2-byte/3-byte opcode prefix definition. struct OpCodeMM { uint8_t len; uint8_t data[3]; @@ -68,7 +68,7 @@ struct OpCodeMM { //! @internal //! -//! @brief Mandatory prefixes encoded in 'asmjit' opcode [66, F3, F2] and asmjit +//! Mandatory prefixes encoded in 'asmjit' opcode [66, F3, F2] and asmjit //! extensions static const uint8_t x86OpCodePP[8] = { 0x00, @@ -83,7 +83,7 @@ static const uint8_t x86OpCodePP[8] = { //! @internal //! -//! @brief Instruction 2-byte/3-byte opcode prefix data. +//! Instruction 2-byte/3-byte opcode prefix data. static const OpCodeMM x86OpCodeMM[] = { { 0, { 0x00, 0x00, 0 } }, { 1, { 0x0F, 0x00, 0 } }, @@ -111,7 +111,9 @@ static const uint8_t x86OpCodePopSeg[8] = { 0x00, 0x07, 0x00, 0x17, 0x1F, 0xA1, // [asmjit::X64TrampolineWriter] // ============================================================================ -//! @brief Trampoline writer. +//! @internal +//! +//! Trampoline writer. struct X64TrampolineWriter { // Size of trampoline enum { @@ -120,9 +122,8 @@ struct X64TrampolineWriter { kSizeTotal = kSizeJmp + kSizeAddr }; - // Write trampoline into code at address @a code that will jump to @a target. - static void writeTrampoline(uint8_t* code, uint64_t target) - { + // Write trampoline into code at address `code` that will jump to `target`. + static void writeTrampoline(uint8_t* code, uint64_t target) { code[0] = 0xFF; // Jmp OpCode. code[1] = 0x25; // ModM (RIP addressing). ((uint32_t*)(code + 2))[0] = 0; // Offset (zero). @@ -221,7 +222,7 @@ struct X64TrampolineWriter { // [asmjit::x86x64::Assembler - Construction / Destruction] // ============================================================================ -X86X64Assembler::X86X64Assembler(BaseRuntime* runtime) : BaseAssembler(runtime) {} +X86X64Assembler::X86X64Assembler(Runtime* runtime) : BaseAssembler(runtime) {} X86X64Assembler::~X86X64Assembler() {} // ============================================================================ @@ -887,12 +888,12 @@ static bool X86Assembler_dumpComment(StringBuilder& sb, size_t len, const uint8_ // [asmjit::x86x64::Assembler - Emit] // ============================================================================ -//! @brief Encode MODR/M. +//! Encode MODR/M. static ASMJIT_INLINE uint32_t x86EncodeMod(uint32_t m, uint32_t o, uint32_t rm) { return (m << 6) + (o << 3) + rm; } -//! @brief Encode SIB. +//! Encode SIB. static ASMJIT_INLINE uint32_t x86EncodeSib(uint32_t s, uint32_t i, uint32_t b) { return (s << 6) + (i << 3) + b; } @@ -928,7 +929,7 @@ static ASMJIT_INLINE Error X86X64Assembler_emit(X86X64Assembler* self, uint32_t // // AVX: // 0x0008 - AVX.W. - // 0xF000 - VVVV, zeros by default, see @ref kVexVVVV. + // 0xF000 - VVVV, zeros by default, see `kVexVVVV`. // uint32_t opX; @@ -3969,8 +3970,8 @@ _EmitXopM: // [Emit - Jump/Call to an Immediate] // -------------------------------------------------------------------------- - // Emit relative relocation to absolute pointer @a target. It's needed - // to add what instruction is emitting this, because in x64 mode the relative + // Emit relative relocation to absolute pointer `target`. It's needed to add + // what instruction is emitting this, because in x64 mode the relative // displacement can be impossible to calculate and in this case the trampoline // is used. _EmitJmpOrCallImm: @@ -4087,7 +4088,7 @@ _GrowBuffer: namespace asmjit { namespace x86 { -Assembler::Assembler(BaseRuntime* runtime) : X86X64Assembler(runtime) { +Assembler::Assembler(Runtime* runtime) : X86X64Assembler(runtime) { _arch = kArchX86; _regSize = 4; } @@ -4116,7 +4117,7 @@ Error Assembler::_emit(uint32_t code, const Operand& o0, const Operand& o1, cons namespace asmjit { namespace x64 { -Assembler::Assembler(BaseRuntime* runtime) : X86X64Assembler(runtime) { +Assembler::Assembler(Runtime* runtime) : X86X64Assembler(runtime) { _arch = kArchX64; _regSize = 8; } diff --git a/src/asmjit/x86/x86assembler.h b/src/asmjit/x86/x86assembler.h index 2e807ee..db5c3bd 100644 --- a/src/asmjit/x86/x86assembler.h +++ b/src/asmjit/x86/x86assembler.h @@ -18,9 +18,6 @@ namespace asmjit { namespace x86x64 { -//! @addtogroup asmjit_x86x64 -//! @{ - // ============================================================================ // [CodeGen-Begin] // ============================================================================ @@ -46,7 +43,7 @@ namespace x86x64 { return emit(_Code_, o0); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE Error _Inst_(int o0) { \ return emit(_Code_, o0); \ } @@ -57,7 +54,7 @@ namespace x86x64 { return emit(_Code_, o0); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE Error _Inst_(int o0) { \ ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0); \ @@ -115,7 +112,7 @@ namespace x86x64 { return emit(_Code_, o0, o1); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE Error _Inst_(const _Op0_& o0, int o1) { \ return emit(_Code_, o0, o1); \ } @@ -126,7 +123,7 @@ namespace x86x64 { return emit(_Code_, o0, o1); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE Error _Inst_(const _Op0_& o0, int o1) { \ ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0, o1); \ @@ -184,7 +181,7 @@ namespace x86x64 { return emit(_Code_, o0, o1, o2); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE Error _Inst_(const _Op0_& o0, const _Op1_& o1, int o2) { \ return emit(_Code_, o0, o1, o2); \ } @@ -195,7 +192,7 @@ namespace x86x64 { return emit(_Code_, o0, o1, o2); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE Error _Inst_(const _Op0_& o0, const _Op1_& o1, int o2) { \ ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0, o1, o2); \ @@ -218,7 +215,7 @@ namespace x86x64 { return emit(_Code_, o0, o1, o2, o3); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE Error _Inst_(const _Op0_& o0, const _Op1_& o1, const _Op2_& o2, int o3) { \ return emit(_Code_, o0, o1, o2, o3); \ } @@ -229,81 +226,84 @@ namespace x86x64 { return emit(_Code_, o0, o1, o2, o3); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE Error _Inst_(const _Op0_& o0, const _Op1_& o1, const _Op2_& o2, int o3) { \ ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0, o1, o2, o3); \ } #define ASMJIT_X86X64_EMIT_OPTIONS(_Class_) \ - /*! @brief Force short form of jmp/jcc instruction. */ \ + /*! Force short form of jmp/jcc instruction. */ \ ASMJIT_INLINE _Class_& short_() { \ _options |= kInstOptionShortForm; \ return *this; \ } \ \ - /*! @brief Force long form of jmp/jcc instruction. */ \ + /*! Force long form of jmp/jcc instruction. */ \ ASMJIT_INLINE _Class_& long_() { \ _options |= kInstOptionLongForm; \ return *this; \ } \ \ - /*! @brief Condition is likely to be taken (has only benefit on P4). */ \ + /*! Condition is likely to be taken (has only benefit on P4). */ \ ASMJIT_INLINE _Class_& taken() { \ _options |= kInstOptionTaken; \ return *this; \ } \ \ - /*! @brief Condition is unlikely to be taken (has only benefit on P4). */ \ + /*! Condition is unlikely to be taken (has only benefit on P4). */ \ ASMJIT_INLINE _Class_& notTaken() { \ _options |= kInstOptionNotTaken; \ return *this; \ } \ \ - /*! @brief Use LOCK prefix. */ \ + /*! Use LOCK prefix. */ \ ASMJIT_INLINE _Class_& lock() { \ _options |= kInstOptionLock; \ return *this; \ } \ \ - /*! @brief Force REX prefix. */ \ + /*! Force REX prefix. */ \ ASMJIT_INLINE _Class_& rex() { \ _options |= kInstOptionRex; \ return *this; \ } \ \ - /*! @brief Force 3-byte VEX prefix. */ \ + /*! Force 3-byte VEX prefix. */ \ ASMJIT_INLINE _Class_& vex3() { \ _options |= kInstOptionVex3; \ return *this; \ } +//! @addtogroup asmjit_x86x64_codegen +//! @{ + // ============================================================================ // [asmjit::x86x64::X86X64Assembler] // ============================================================================ -//! @brief X86/X64 assembler. +//! X86/X64 assembler. //! -//! @ref Assembler is the main class in AsmJit that can encode instructions -//! and their operands to a binary stream runnable by CPU. It creates internal -//! buffer where the encodes instructions are stored and it contains intrinsics -//! that can be used to emit the code in a convenent way. Code generation is in +//! Assembler is the main class in AsmJit that can encode instructions and their +//! operands to a binary stream runnable by CPU. It creates internal buffer +//! where the encodes instructions are stored and it contains intrinsics that +//! can be used to emit the code in a convenent way. Code generation is in //! general safe, because the intrinsics uses method overloading so even the //! code is emitted it can be checked by a C++ compiler. It's nearly impossible -//! to create invalid instruction (for example mov [eax], [eax], -//! because such overload doesn't exist. +//! to create invalid instruction, for example `mov [eax], [eax]`, because such +//! overload doesn't exist. //! //! Each call to an assembler intrinsic function emits instruction directly //! to the binary stream. There are also runtime checks that prevent invalid -//! code to be emitted. It will assert in debug mode and put the @ref Assembler +//! code to be emitted. It will assert in debug mode and put the `BaseAssembler` //! instance to an error state in production mode. //! //! @section AsmJit_Assembler_CodeGeneration Code Generation //! -//! To generate code is only needed to create instance of @c asmjit::Assembler +//! To generate code is only needed to create instance of `BaseAssembler` //! and to use intrinsics. See example how to do that: //! -//! @code +//! ~~~ //! // Use asmjit namespace. //! using namespace asmjit; //! using namespace asmjit::host; @@ -324,29 +324,30 @@ namespace x86x64 { //! //! // Return. //! a.ret(); -//! @endcode +//! ~~~ //! //! You can see that syntax is very close to Intel one. Only difference is that //! you are calling functions that emits the binary code for you. All registers -//! are in @c asmjit namespace, so it's very comfortable to use it (look at -//! first line). There is also used method @c asmjit::imm() to create an -//! immediate value. Use @c asmjit::imm_u() to create unsigned immediate value. +//! are in `asmjit` namespace, so it's very comfortable to use it (look at +//! first line). There is also used method `imm()` to create an immediate value. +//! Use `imm_u()` to create unsigned immediate value. //! -//! There is also possibility to use memory addresses and immediates. To build -//! memory address use @c ptr(), @c byte_ptr(), @c word_ptr(), @c dword_ptr() -//! or other friend methods. In most cases you needs only @c ptr() method, but -//! there are instructions where you must specify address size, +//! There is also possibility to use memory addresses and immediates. Use +//! `ptr()`, `byte_ptr()`, `word_ptr()`, `dword_ptr()` and similar functions to +//! build a memory address operand. In most cases `ptr()` is enough, because an +//! information related to the operand size is needed only in rare cases, that +//! is an instruction without having any register operands, such as `inc [mem]`. //! -//! for example (a is @c asmjit::Assembler instance): +//! for example, `a` is `x86::BaseAssembler` instance: //! -//! @code +//! ~~~ //! a.mov(ptr(eax), 0); // mov ptr [eax], 0 //! a.mov(ptr(eax), edx); // mov ptr [eax], edx -//! @endcode +//! ~~~ //! //! But it's also possible to create complex addresses: //! -//! @code +//! ~~~ //! // eax + ecx*x addresses //! a.mov(ptr(eax, ecx, 0), 0); // mov ptr [eax + ecx], 0 //! a.mov(ptr(eax, ecx, 1), 0); // mov ptr [eax + ecx * 2], 0 @@ -357,51 +358,50 @@ namespace x86x64 { //! a.mov(ptr(eax, ecx, 1, 8), 0); // mov ptr [eax + ecx * 2 + 8], 0 //! a.mov(ptr(eax, ecx, 2, 12), 0); // mov ptr [eax + ecx * 4 + 12], 0 //! a.mov(ptr(eax, ecx, 3, 16), 0); // mov ptr [eax + ecx * 8 + 16], 0 -//! @endcode +//! ~~~ //! -//! All addresses shown are using @c asmjit::ptr() to make memory operand. -//! Some assembler instructions (single operand ones) needs to have specified -//! memory operand size. For example a.inc(ptr(eax)) can't be -//! called. @c asmjit::Assembler::inc(), @c asmjit::Assembler::dec() and similar -//! instructions can't be encoded without specifying the operand size. See -//! next code how the assembler works: +//! All addresses shown are using `ptr()` to make memory operand. Some assembler +//! instructions (single operand ones) needs to have specified memory operand +//! size. For example `a.inc(ptr(eax))` can't be called, because the meaning is +//! ambiguous, see the code below. //! -//! @code -//! // [byte] address -//! a.inc(byte_ptr(eax)); // inc byte ptr [eax] -//! a.dec(byte_ptr(eax)); // dec byte ptr [eax] -//! // [word] address -//! a.inc(word_ptr(eax)); // inc word ptr [eax] -//! a.dec(word_ptr(eax)); // dec word ptr [eax] -//! // [dword] address -//! a.inc(dword_ptr(eax)); // inc dword ptr [eax] -//! a.dec(dword_ptr(eax)); // dec dword ptr [eax] -//! @endcode +//! ~~~ +//! // [byte] address. +//! a.inc(byte_ptr(eax)); // Inc byte ptr [eax]. +//! a.dec(byte_ptr(eax)); // Dec byte ptr [eax]. +//! // [word] address. +//! a.inc(word_ptr(eax)); // Inc word ptr [eax]. +//! a.dec(word_ptr(eax)); // Dec word ptr [eax]. +//! // [dword] address. +//! a.inc(dword_ptr(eax)); // Inc dword ptr [eax]. +//! a.dec(dword_ptr(eax)); // Dec dword ptr [eax]. +//! ~~~ //! //! @section AsmJit_Assembler_CallingJitCode Calling JIT Code //! //! While you are over from emitting instructions, you can make your function -//! using @c asmjit::Assembler::make() method. This method will use memory +//! by using `BaseAssembler::make()` method. This method will use memory //! manager to allocate virtual memory and relocates generated code to it. For //! memory allocation is used global memory manager by default and memory is //! freeable, but of course this default behavior can be overridden specifying //! your memory manager and allocation type. If you want to do with code //! something else you can always override make() method and do what you want. //! -//! You can get size of generated code by @c getCodeSize() or @c getOffset() -//! methods. These methods returns you code size (or more precisely current code -//! offset) in bytes. Use takeCode() to take internal buffer (all pointers in -//! @c asmjit::Assembler instance will be zeroed and current buffer returned) -//! to use it. If you don't take it, @c asmjit::Assembler destructor will -//! free it automatically. To alloc and run code manually don't use -//! @c malloc()'ed memory, but instead use @c asmjit::VMem::alloc() to get memory -//! for executing (specify @c canExecute to @c true) or @c asmjit::MemoryManager -//! that provides more effective and comfortable way to allocate virtual memory. +//! You can get size of generated code by `getCodeSize()` or `getOffset()` +//! methods. These methods returns you code size or more precisely the current +//! code offset in bytes. The `takeCode()` function can be used to take the +//! internal buffer and clear the code generator, but the buffer taken has to +//! be freed manually. //! -//! See next example how to allocate memory where you can execute code created -//! by @c asmjit::Assembler: +//! Machine code can be executed only in memory that is marked executable. This +//! mark is usually not set for memory returned by a C/C++ `malloc` function. +//! The `VMem::alloc()` function can be used allocate a memory where the code can +//! be executed or more preferably `VMemMgr` which has interface +//! similar to `malloc/free` and can allocate chunks of various sizes. //! -//! @code +//! The next example shows how to allocate memory where the code can be executed: +//! +//! ~~~ //! using namespace asmjit; //! //! JitRuntime runtime; @@ -419,26 +419,26 @@ namespace x86x64 { //! func(); //! //! // If you don't need your function again, free it. -//! runtime.free(func); -//! @endcode +//! runtime.release(func); +//! ~~~ //! -//! @c note This was very primitive example how to call generated code. -//! In production code you will never do alloc/free for one run, you will -//! probably store the allocated function and free it when the application -//! ends or when JIT objects does cleanup. +//! This was a very primitive showing how the generated code can be executed. +//! In production noone will probably generate a function that is only called +//! once and nobody will probably free the function right after it was executed. +//! The code just shows the proper way of code generation and cleanup. //! //! @section AsmJit_Assembler_Labels Labels //! //! While generating assembler code, you will usually need to create complex -//! code with labels. Labels are fully supported and you can call @c jmp or -//! @c je (and similar) instructions to initialized or yet uninitialized label. +//! code with labels. Labels are fully supported and you can call `jmp` or +//! `je` (and similar) instructions to initialized or yet uninitialized label. //! Each label expects to be bound into offset. To bind label to specific -//! offset, use @c bind() method. +//! offset, use `CodeGen::bind()` method. //! //! See next example that contains complete code that creates simple memory //! copy function (in DWord entities). //! -//! @code +//! ~~~ //! // Example: Usage of Label (32-bit code). //! // //! // Create simple DWord memory copy function: @@ -490,7 +490,7 @@ namespace x86x64 { //! //! // Return: STDCALL convention is to pop stack in called function. //! a.ret(arg_size); -//! @endcode +//! ~~~ //! //! If you need more abstraction for generating assembler code and you want //! to hide calling conventions between 32-bit and 64-bit operating systems, @@ -507,17 +507,16 @@ namespace x86x64 { //! //! Let's define function which can be used to generate some abstract code: //! -//! @code +//! ~~~ //! // Simple function that generates dword copy. -//! void genCopyDWord(BaseAssembler& a, const GpReg& dst, const GpReg& src, const GpReg& tmp) -//! { +//! void genCopyDWord(BaseAssembler& a, const GpReg& dst, const GpReg& src, const GpReg& tmp) { //! a.mov(tmp, dword_ptr(src)); //! a.mov(dword_ptr(dst), tmp); //! } -//! @endcode +//! ~~~ //! //! This function can be called like genCopyDWord(a, edi, esi, ebx) -//! or by using existing @ref GpReg instances. This abstraction allows to join +//! or by using existing `GpReg` instances. This abstraction allows to join //! more code sections together without rewriting each to use specific registers. //! You need to take care only about implicit registers which may be used by //! several instructions (like mul, imul, div, idiv, shifting, etc...). @@ -529,96 +528,95 @@ namespace x86x64 { //! get count of Gp or Xmm registers or @c kRegCountGp, @c kRegCountMm and @c //! kRegCountXmm constants individually. //! -//! To build register from index (value from 0 inclusive to kRegNumXXX -//! exclusive) use @ref gpd(), @ref gpq() or @ref gpz() functions. To create -//! a 8 or 16-bit register use @ref gpw(), @ref gpb_lo() or @ref gpb_hi(). -//! To create other registers there are similar methods like @ref mm(), @ref xmm() -//! and @ref fp(). +//! To build register from index (value from 0 inclusive to `kRegNum...` exclusive) +//! use `gpd()`, `gpq()` or `gpz()` functions. To create a 8 or 16-bit register use +//! `gpw()`, `gpb_lo()` or `gpb_hi()`. To create other registers there are similar +//! methods like `mm()`, `xmm()`, `ymm()` and `fp()`. //! -//! So our function call to genCopyDWord can be also used like this: +//! So our function call to `genCopyDWord` can be also used like this: //! -//! @code +//! ~~~ //! genCopyDWord(a, gpd(kRegIndexDi), gpd(kRegIndexSi), gpd(kRegIndexBx)); -//! @endcode +//! ~~~ //! -//! kRegIndexXXX are constants defined by @ref kRegIndex enum. You can use your +//! `kRegIndex...` are constants defined by `kRegIndex` enum. You can use your //! own register allocator (or register slot manager) to alloc / free registers -//! so kRegIndexXXX values can be replaced by your variables (0 to kRegNumXXX-1). +//! so `kRegIndex...` values can be replaced by your variables (`0` to +//! `kRegNum...-1`). //! -//! @sa @ref Compiler. +//! @sa `X86X64Compiler`. struct X86X64Assembler : public BaseAssembler { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - ASMJIT_API X86X64Assembler(BaseRuntime* runtime); + ASMJIT_API X86X64Assembler(Runtime* runtime); ASMJIT_API virtual ~X86X64Assembler(); // -------------------------------------------------------------------------- // [Label] // -------------------------------------------------------------------------- - //! @override. ASMJIT_API virtual void _bind(const Label& label); // -------------------------------------------------------------------------- // [Embed] // -------------------------------------------------------------------------- - //! @brief Add 8-bit integer data to the instuction stream. + //! Add 8-bit integer data to the instuction stream. ASMJIT_INLINE void db(uint8_t x) { embed(&x, 1); } - //! @brief Add 16-bit integer data to the instuction stream. + //! Add 16-bit integer data to the instuction stream. ASMJIT_INLINE void dw(uint16_t x) { embed(&x, 2); } - //! @brief Add 32-bit integer data to the instuction stream. + //! Add 32-bit integer data to the instuction stream. ASMJIT_INLINE void dd(uint32_t x) { embed(&x, 4); } - //! @brief Add 64-bit integer data to the instuction stream. + //! Add 64-bit integer data to the instuction stream. ASMJIT_INLINE void dq(uint64_t x) { embed(&x, 8); } - //! @brief Add 8-bit integer data to the instuction stream. + //! Add 8-bit integer data to the instuction stream. ASMJIT_INLINE void dint8(int8_t x) { embed(&x, sizeof(int8_t)); } - //! @brief Add 8-bit integer data to the instuction stream. + //! Add 8-bit integer data to the instuction stream. ASMJIT_INLINE void duint8(uint8_t x) { embed(&x, sizeof(uint8_t)); } - //! @brief Add 16-bit integer data to the instuction stream. + //! Add 16-bit integer data to the instuction stream. ASMJIT_INLINE void dint16(int16_t x) { embed(&x, sizeof(int16_t)); } - //! @brief Add 16-bit integer data to the instuction stream. + //! Add 16-bit integer data to the instuction stream. ASMJIT_INLINE void duint16(uint16_t x) { embed(&x, sizeof(uint16_t)); } - //! @brief Add 32-bit integer data to the instuction stream. + //! Add 32-bit integer data to the instuction stream. ASMJIT_INLINE void dint32(int32_t x) { embed(&x, sizeof(int32_t)); } - //! @brief Add 32-bit integer data to the instuction stream. + //! Add 32-bit integer data to the instuction stream. ASMJIT_INLINE void duint32(uint32_t x) { embed(&x, sizeof(uint32_t)); } - //! @brief Add 64-bit integer data to the instuction stream. + //! Add 64-bit integer data to the instuction stream. ASMJIT_INLINE void dint64(int64_t x) { embed(&x, sizeof(int64_t)); } - //! @brief Add 64-bit integer data to the instuction stream. + //! Add 64-bit integer data to the instuction stream. ASMJIT_INLINE void duint64(uint64_t x) { embed(&x, sizeof(uint64_t)); } - //! @brief Add float data to the instuction stream. + //! Add float data to the instuction stream. ASMJIT_INLINE void dfloat(float x) { embed(&x, sizeof(float)); } - //! @brief Add double data to the instuction stream. + //! Add double data to the instuction stream. ASMJIT_INLINE void ddouble(double x) { embed(&x, sizeof(double)); } - //! @brief Add pointer data to the instuction stream. + //! Add pointer data to the instuction stream. ASMJIT_INLINE void dptr(void* x) { embed(&x, sizeof(void*)); } - //! @brief Add Mm data to the instuction stream. + //! Add Mm data to the instuction stream. ASMJIT_INLINE void dmm(const MmData& x) { embed(&x, sizeof(MmData)); } - //! @brief Add Xmm data to the instuction stream. + //! Add Xmm data to the instuction stream. ASMJIT_INLINE void dxmm(const XmmData& x) { embed(&x, sizeof(XmmData)); } - //! @brief Add data in a given structure instance to the instuction stream. + //! Add data in a given structure instance to the instuction stream. template ASMJIT_INLINE void dstruct(const T& x) { embed(&x, static_cast(sizeof(T))); } - //! @brief Embed absolute label pointer (4 or 8 bytes). + //! Embed absolute label pointer (4 or 8 bytes). ASMJIT_API Error embedLabel(const Label& op); // -------------------------------------------------------------------------- // [Align] // -------------------------------------------------------------------------- - //! @brief Align target buffer to @a m bytes. + //! Align target buffer to `m` bytes. //! //! Typical usage of this is to align labels at start of the inner loops. //! @@ -635,7 +633,7 @@ struct X86X64Assembler : public BaseAssembler { // [Base Instructions] // -------------------------------------------------------------------------- - //! @brief Add with Carry. + //! Add with Carry. INST_2x(adc, kInstAdc, GpReg, GpReg) //! @overload INST_2x(adc, kInstAdc, GpReg, Mem) @@ -646,7 +644,7 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(adc, kInstAdc, Mem, Imm) - //! @brief Add. + //! Add. INST_2x(add, kInstAdd, GpReg, GpReg) //! @overload INST_2x(add, kInstAdd, GpReg, Mem) @@ -657,7 +655,7 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(add, kInstAdd, Mem, Imm) - //! @brief And. + //! And. INST_2x(and_, kInstAnd, GpReg, GpReg) //! @overload INST_2x(and_, kInstAnd, GpReg, Mem) @@ -668,20 +666,20 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(and_, kInstAnd, Mem, Imm) - //! @brief Bit scan forward. + //! Bit scan forward. INST_2x_(bsf, kInstBsf, GpReg, GpReg, !o0.isGpb()) //! @overload INST_2x_(bsf, kInstBsf, GpReg, Mem, !o0.isGpb()) - //! @brief Bit scan reverse. + //! Bit scan reverse. INST_2x_(bsr, kInstBsr, GpReg, GpReg, !o0.isGpb()) //! @overload INST_2x_(bsr, kInstBsr, GpReg, Mem, !o0.isGpb()) - //! @brief Byte swap (32-bit or 64-bit registers only) (i486). + //! Byte swap (32-bit or 64-bit registers only) (i486). INST_1x_(bswap, kInstBswap, GpReg, o0.getSize() >= 4) - //! @brief Bit test. + //! Bit test. INST_2x(bt, kInstBt, GpReg, GpReg) //! @overload INST_2i(bt, kInstBt, GpReg, Imm) @@ -690,7 +688,7 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(bt, kInstBt, Mem, Imm) - //! @brief Bit test and complement. + //! Bit test and complement. INST_2x(btc, kInstBtc, GpReg, GpReg) //! @overload INST_2i(btc, kInstBtc, GpReg, Imm) @@ -699,7 +697,7 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(btc, kInstBtc, Mem, Imm) - //! @brief Bit test and reset. + //! Bit test and reset. INST_2x(btr, kInstBtr, GpReg, GpReg) //! @overload INST_2i(btr, kInstBtr, GpReg, Imm) @@ -708,7 +706,7 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(btr, kInstBtr, Mem, Imm) - //! @brief Bit test and set. + //! Bit test and set. INST_2x(bts, kInstBts, GpReg, GpReg) //! @overload INST_2i(bts, kInstBts, GpReg, Imm) @@ -717,7 +715,7 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(bts, kInstBts, Mem, Imm) - //! @brief Call. + //! Call. INST_1x(call, kInstCall, GpReg) //! @overload INST_1x(call, kInstCall, Mem) @@ -728,28 +726,28 @@ struct X86X64Assembler : public BaseAssembler { //! @overload ASMJIT_INLINE Error call(void* dst) { return call(Imm((intptr_t)dst)); } - //! @brief Clear carry flag. + //! Clear carry flag. INST_0x(clc, kInstClc) - //! @brief Clear direction flag. + //! Clear direction flag. INST_0x(cld, kInstCld) - //! @brief Complement carry flag. + //! Complement carry flag. INST_0x(cmc, kInstCmc) - //! @brief Convert byte to word (AX <- Sign Extend AL). + //! Convert byte to word (AX <- Sign Extend AL). INST_0x(cbw, kInstCbw) - //! @brief Convert word to dword (DX:AX <- Sign Extend AX). + //! Convert word to dword (DX:AX <- Sign Extend AX). INST_0x(cwd, kInstCwd) - //! @brief Convert word to dword (EAX <- Sign Extend AX). + //! Convert word to dword (EAX <- Sign Extend AX). INST_0x(cwde, kInstCwde) - //! @brief Convert dword to qword (EDX:EAX <- Sign Extend EAX). + //! Convert dword to qword (EDX:EAX <- Sign Extend EAX). INST_0x(cdq, kInstCdq) - //! @brief Conditional move. + //! Conditional move. INST_2cc(cmov, kInstCmov, condToCmovcc, GpReg, GpReg) - //! @brief Conditional move. + //! Conditional move. INST_2cc(cmov, kInstCmov, condToCmovcc, GpReg, Mem) - //! @brief Compare two operands. + //! Compare two operands. INST_2x(cmp, kInstCmp, GpReg, GpReg) //! @overload INST_2x(cmp, kInstCmp, GpReg, Mem) @@ -760,71 +758,71 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(cmp, kInstCmp, Mem, Imm) - //! @brief Compare and exchange (i486). + //! Compare and exchange (i486). INST_2x(cmpxchg, kInstCmpxchg, GpReg, GpReg) //! @overload INST_2x(cmpxchg, kInstCmpxchg, Mem, GpReg) - //! @brief Compares the 64-bit value in EDX:EAX with the memory operand (Pentium). + //! Compares the 64-bit value in EDX:EAX with the memory operand (Pentium). INST_1x(cmpxchg8b, kInstCmpxchg8b, Mem) - //! @brief CPU identification (i486). + //! CPU identification (i486). INST_0x(cpuid, kInstCpuid) - //! @brief Accumulate crc32 value (polynomial 0x11EDC6F41) (SSE4.2). + //! Accumulate crc32 value (polynomial 0x11EDC6F41) (SSE4.2). INST_2x_(crc32, kInstCrc32, GpReg, GpReg, o0.isRegType(kRegTypeGpd) || o0.isRegType(kRegTypeGpq)) //! @overload INST_2x_(crc32, kInstCrc32, GpReg, Mem, o0.isRegType(kRegTypeGpd) || o0.isRegType(kRegTypeGpq)) - //! @brief Decrement by 1. + //! Decrement by 1. INST_1x(dec, kInstDec, GpReg) //! @overload INST_1x(dec, kInstDec, Mem) - //! @brief Unsigned divide (xDX:xAX <- xDX:xAX / o0). + //! Unsigned divide (xDX:xAX <- xDX:xAX / o0). INST_1x(div, kInstDiv, GpReg) //! @overload INST_1x(div, kInstDiv, Mem) - //! @brief Make stack frame for procedure parameters. + //! Make stack frame for procedure parameters. INST_2x(enter, kInstEnter, Imm, Imm) - //! @brief Signed divide (xDX:xAX <- xDX:xAX / op). + //! Signed divide (xDX:xAX <- xDX:xAX / op). INST_1x(idiv, kInstIdiv, GpReg) //! @overload INST_1x(idiv, kInstIdiv, Mem) - //! @brief Signed multiply (xDX:xAX <- xAX * o0). + //! Signed multiply (xDX:xAX <- xAX * o0). INST_1x(imul, kInstImul, GpReg) //! @overload INST_1x(imul, kInstImul, Mem) - //! @brief Signed multiply. + //! Signed multiply. INST_2x(imul, kInstImul, GpReg, GpReg) //! @overload INST_2x(imul, kInstImul, GpReg, Mem) //! @overload INST_2i(imul, kInstImul, GpReg, Imm) - //! @brief Signed multiply. + //! Signed multiply. INST_3i(imul, kInstImul, GpReg, GpReg, Imm) //! @overload INST_3i(imul, kInstImul, GpReg, Mem, Imm) - //! @brief Increment by 1. + //! Increment by 1. INST_1x(inc, kInstInc, GpReg) //! @overload INST_1x(inc, kInstInc, Mem) - //! @brief Interrupt. + //! Interrupt. INST_1i(int_, kInstInt, Imm) - //! @brief Interrupt 3 - trap to debugger. + //! Interrupt 3 - trap to debugger. ASMJIT_INLINE Error int3() { return int_(3); } - //! @brief Jump to label @a label if condition @a cc is met. + //! Jump to `label` if condition `cc` is met. INST_1cc(j, kInstJ, condToJcc, Label) - //! @brief Jump. + //! Jump. INST_1x(jmp, kInstJmp, GpReg) //! @overload INST_1x(jmp, kInstJmp, Mem) @@ -835,16 +833,16 @@ struct X86X64Assembler : public BaseAssembler { //! @overload ASMJIT_INLINE Error jmp(void* dst) { return jmp(Imm((intptr_t)dst)); } - //! @brief Load AH from flags. + //! Load AH from flags. INST_0x(lahf, kInstLahf) - //! @brief Load effective address + //! Load effective address INST_2x(lea, kInstLea, GpReg, Mem) - //! @brief High level procedure exit. + //! High level procedure exit. INST_0x(leave, kInstLeave) - //! @brief Move. + //! Move. INST_2x(mov, kInstMov, GpReg, GpReg) //! @overload INST_2x(mov, kInstMov, GpReg, Mem) @@ -855,16 +853,16 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(mov, kInstMov, Mem, Imm) - //! @brief Move from segment register. + //! Move from segment register. INST_2x(mov, kInstMov, GpReg, SegReg) //! @overload INST_2x(mov, kInstMov, Mem, SegReg) - //! @brief Move to segment register. + //! Move to segment register. INST_2x(mov, kInstMov, SegReg, GpReg) //! @overload INST_2x(mov, kInstMov, SegReg, Mem) - //! @brief Move (AL|AX|EAX|RAX <- absolute address in immediate). + //! Move (AL|AX|EAX|RAX <- absolute address in immediate). ASMJIT_INLINE Error mov_ptr(const GpReg& dst, void* src) { ASMJIT_ASSERT(dst.getRegIndex() == 0); @@ -872,7 +870,7 @@ struct X86X64Assembler : public BaseAssembler { return emit(kInstMovptr, dst, imm); } - //! @brief Move (absolute address in immediate <- AL|AX|EAX|RAX). + //! Move (absolute address in immediate <- AL|AX|EAX|RAX). ASMJIT_INLINE Error mov_ptr(void* dst, const GpReg& src) { ASMJIT_ASSERT(src.getRegIndex() == 0); @@ -880,40 +878,40 @@ struct X86X64Assembler : public BaseAssembler { return emit(kInstMovptr, imm, src); } - //! @brief Move data after dwapping bytes (SSE3 - Atom). + //! Move data after dwapping bytes (SSE3 - Atom). INST_2x_(movbe, kInstMovbe, GpReg, Mem, !o0.isGpb()); //! @overload INST_2x_(movbe, kInstMovbe, Mem, GpReg, !o1.isGpb()); - //! @brief Move with sign-extension. + //! Move with sign-extension. INST_2x(movsx, kInstMovsx, GpReg, GpReg) //! @overload INST_2x(movsx, kInstMovsx, GpReg, Mem) - //! @brief Move with zero-extension. + //! Move with zero-extension. INST_2x(movzx, kInstMovzx, GpReg, GpReg) //! @overload INST_2x(movzx, kInstMovzx, GpReg, Mem) - //! @brief Unsigned multiply (xDX:xAX <- xAX * o0). + //! Unsigned multiply (xDX:xAX <- xAX * o0). INST_1x(mul, kInstMul, GpReg) //! @overload INST_1x(mul, kInstMul, Mem) - //! @brief Two's complement negation. + //! Two's complement negation. INST_1x(neg, kInstNeg, GpReg) //! @overload INST_1x(neg, kInstNeg, Mem) - //! @brief No operation. + //! No operation. INST_0x(nop, kInstNop) - //! @brief One's complement negation. + //! One's complement negation. INST_1x(not_, kInstNot, GpReg) //! @overload INST_1x(not_, kInstNot, Mem) - //! @brief Or. + //! Or. INST_2x(or_, kInstOr, GpReg, GpReg) //! @overload INST_2x(or_, kInstOr, GpReg, Mem) @@ -924,143 +922,143 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(or_, kInstOr, Mem, Imm) - //! @brief Pop a value from the stack. + //! Pop a value from the stack. INST_1x_(pop, kInstPop, GpReg, o0.getSize() == 2 || o0.getSize() == _regSize) //! @overload INST_1x_(pop, kInstPop, Mem, o0.getSize() == 2 || o0.getSize() == _regSize) - //! @brief Pop a segment register from the stack. + //! Pop a segment register from the stack. //! //! @note There is no instruction to pop a cs segment register. INST_1x_(pop, kInstPop, SegReg, o0.getRegIndex() != kSegCs); - //! @brief Pop stack into EFLAGS register (32-bit or 64-bit). + //! Pop stack into EFLAGS register (32-bit or 64-bit). INST_0x(popf, kInstPopf) - //! @brief Return the count of number of bits set to 1 (SSE4.2). + //! Return the count of number of bits set to 1 (SSE4.2). INST_2x_(popcnt, kInstPopcnt, GpReg, GpReg, !o0.isGpb() && o0.getRegType() == o1.getRegType()) //! @overload INST_2x_(popcnt, kInstPopcnt, GpReg, Mem, !o0.isGpb()) - //! @brief Push word/dword/qword on the stack. + //! Push word/dword/qword on the stack. INST_1x_(push, kInstPush, GpReg, o0.getSize() == 2 || o0.getSize() == _regSize) - //! @brief Push word/dword/qword on the stack. + //! Push word/dword/qword on the stack. INST_1x_(push, kInstPush, Mem, o0.getSize() == 2 || o0.getSize() == _regSize) - //! @brief Push segment register on the stack. + //! Push segment register on the stack. INST_1x(push, kInstPush, SegReg) - //! @brief Push word/dword/qword on the stack. + //! Push word/dword/qword on the stack. INST_1i(push, kInstPush, Imm) - //! @brief Push EFLAGS register (32-bit or 64-bit) on the stack. + //! Push EFLAGS register (32-bit or 64-bit) on the stack. INST_0x(pushf, kInstPushf) - //! @brief Rotate bits left. + //! Rotate bits left. //! - //! @note @a o1 register can be only @c cl. + //! @note `o1` register can be only `cl`. INST_2x(rcl, kInstRcl, GpReg, GpReg) //! @overload INST_2x(rcl, kInstRcl, Mem, GpReg) - //! @brief Rotate bits left. + //! Rotate bits left. INST_2i(rcl, kInstRcl, GpReg, Imm) //! @overload INST_2i(rcl, kInstRcl, Mem, Imm) - //! @brief Rotate bits right. + //! Rotate bits right. //! - //! @note @a o1 register can be only @c cl. + //! @note `o1` register can be only `cl`. INST_2x(rcr, kInstRcr, GpReg, GpReg) //! @overload INST_2x(rcr, kInstRcr, Mem, GpReg) - //! @brief Rotate bits right. + //! Rotate bits right. INST_2i(rcr, kInstRcr, GpReg, Imm) //! @overload INST_2i(rcr, kInstRcr, Mem, Imm) - //! @brief Read time-stamp counter (Pentium). + //! Read time-stamp counter (Pentium). INST_0x(rdtsc, kInstRdtsc) - //! @brief Read time-stamp counter and processor id (Pentium). + //! Read time-stamp counter and processor id (Pentium). INST_0x(rdtscp, kInstRdtscp) - //! @brief Load ECX/RCX bytes from DS:[ESI/RSI] to AL. + //! Load ECX/RCX bytes from DS:[ESI/RSI] to AL. INST_0x(rep_lodsb, kInstRepLodsb) - //! @brief Load ECX/RCX dwords from DS:[ESI/RSI] to EAX. + //! Load ECX/RCX dwords from DS:[ESI/RSI] to EAX. INST_0x(rep_lodsd, kInstRepLodsd) - //! @brief Load ECX/RCX Words from DS:[ESI/RSI] to AX. + //! Load ECX/RCX Words from DS:[ESI/RSI] to AX. INST_0x(rep_lodsw, kInstRepLodsw) - //! @brief Move ECX/RCX bytes from DS:[ESI/RSI] to ES:[EDI/RDI]. + //! Move ECX/RCX bytes from DS:[ESI/RSI] to ES:[EDI/RDI]. INST_0x(rep_movsb, kInstRepMovsb) - //! @brief Move ECX/RCX dwords from DS:[ESI/RSI] to ES:[EDI/RDI]. + //! Move ECX/RCX dwords from DS:[ESI/RSI] to ES:[EDI/RDI]. INST_0x(rep_movsd, kInstRepMovsd) - //! @brief Move ECX/RCX words from DS:[ESI/RSI] to ES:[EDI/RDI]. + //! Move ECX/RCX words from DS:[ESI/RSI] to ES:[EDI/RDI]. INST_0x(rep_movsw, kInstRepMovsw) - //! @brief Fill ECX/RCX bytes at ES:[EDI/RDI] with AL. + //! Fill ECX/RCX bytes at ES:[EDI/RDI] with AL. INST_0x(rep_stosb, kInstRepStosb) - //! @brief Fill ECX/RCX dwords at ES:[EDI/RDI] with EAX. + //! Fill ECX/RCX dwords at ES:[EDI/RDI] with EAX. INST_0x(rep_stosd, kInstRepStosd) - //! @brief Fill ECX/RCX words at ES:[EDI/RDI] with AX. + //! Fill ECX/RCX words at ES:[EDI/RDI] with AX. INST_0x(rep_stosw, kInstRepStosw) - //! @brief Repeated find nonmatching bytes in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching bytes in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_0x(repe_cmpsb, kInstRepeCmpsb) - //! @brief Repeated find nonmatching dwords in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching dwords in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_0x(repe_cmpsd, kInstRepeCmpsd) - //! @brief Repeated find nonmatching words in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching words in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_0x(repe_cmpsw, kInstRepeCmpsw) - //! @brief Find non-AL byte starting at ES:[EDI/RDI]. + //! Find non-AL byte starting at ES:[EDI/RDI]. INST_0x(repe_scasb, kInstRepeScasb) - //! @brief Find non-EAX dword starting at ES:[EDI/RDI]. + //! Find non-EAX dword starting at ES:[EDI/RDI]. INST_0x(repe_scasd, kInstRepeScasd) - //! @brief Find non-AX word starting at ES:[EDI/RDI]. + //! Find non-AX word starting at ES:[EDI/RDI]. INST_0x(repe_scasw, kInstRepeScasw) - //! @brief Repeated find nonmatching bytes in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching bytes in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_0x(repne_cmpsb, kInstRepneCmpsb) - //! @brief Repeated find nonmatching dwords in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching dwords in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_0x(repne_cmpsd, kInstRepneCmpsd) - //! @brief Repeated find nonmatching words in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching words in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_0x(repne_cmpsw, kInstRepneCmpsw) - //! @brief Find AL, starting at ES:[EDI/RDI]. + //! Find AL, starting at ES:[EDI/RDI]. INST_0x(repne_scasb, kInstRepneScasb) - //! @brief Find EAX, starting at ES:[EDI/RDI]. + //! Find EAX, starting at ES:[EDI/RDI]. INST_0x(repne_scasd, kInstRepneScasd) - //! @brief Find AX, starting at ES:[EDI/RDI]. + //! Find AX, starting at ES:[EDI/RDI]. INST_0x(repne_scasw, kInstRepneScasw) - //! @brief Return. + //! Return. INST_0x(ret, kInstRet) //! @overload INST_1i(ret, kInstRet, Imm) - //! @brief Rotate bits left. + //! Rotate bits left. //! - //! @note @a o1 register can be only @c cl. + //! @note `o1` register can be only `cl`. INST_2x(rol, kInstRol, GpReg, GpReg) //! @overload INST_2x(rol, kInstRol, Mem, GpReg) - //! @brief Rotate bits left. + //! Rotate bits left. INST_2i(rol, kInstRol, GpReg, Imm) //! @overload INST_2i(rol, kInstRol, Mem, Imm) - //! @brief Rotate bits right. + //! Rotate bits right. //! - //! @note @a o1 register can be only @c cl. + //! @note `o1` register can be only `cl`. INST_2x(ror, kInstRor, GpReg, GpReg) //! @overload INST_2x(ror, kInstRor, Mem, GpReg) - //! @brief Rotate bits right. + //! Rotate bits right. INST_2i(ror, kInstRor, GpReg, Imm) //! @overload INST_2i(ror, kInstRor, Mem, Imm) - //! @brief Store AH into flags. + //! Store AH into flags. INST_0x(sahf, kInstSahf) - //! @brief Integer subtraction with borrow. + //! Integer subtraction with borrow. INST_2x(sbb, kInstSbb, GpReg, GpReg) //! @overload INST_2x(sbb, kInstSbb, GpReg, Mem) @@ -1071,83 +1069,83 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(sbb, kInstSbb, Mem, Imm) - //! @brief Shift bits left. + //! Shift bits left. //! - //! @note @a o1 register can be only @c cl. + //! @note `o1` register can be only `cl`. INST_2x(sal, kInstSal, GpReg, GpReg) //! @overload INST_2x(sal, kInstSal, Mem, GpReg) - //! @brief Shift bits left. + //! Shift bits left. INST_2i(sal, kInstSal, GpReg, Imm) //! @overload INST_2i(sal, kInstSal, Mem, Imm) - //! @brief Shift bits right. + //! Shift bits right. //! - //! @note @a o1 register can be only @c cl. + //! @note `o1` register can be only `cl`. INST_2x(sar, kInstSar, GpReg, GpReg) //! @overload INST_2x(sar, kInstSar, Mem, GpReg) - //! @brief Shift bits right. + //! Shift bits right. INST_2i(sar, kInstSar, GpReg, Imm) //! @overload INST_2i(sar, kInstSar, Mem, Imm) - //! @brief Set byte on condition. + //! Set byte on condition. INST_1cc(set, kInstSet, condToSetcc, GpReg) - //! @brief Set byte on condition. + //! Set byte on condition. INST_1cc(set, kInstSet, condToSetcc, Mem) - //! @brief Shift bits left. + //! Shift bits left. //! - //! @note @a o1 register can be only @c cl. + //! @note `o1` register can be only `cl`. INST_2x(shl, kInstShl, GpReg, GpReg) //! @overload INST_2x(shl, kInstShl, Mem, GpReg) - //! @brief Shift bits left. + //! Shift bits left. INST_2i(shl, kInstShl, GpReg, Imm) //! @overload INST_2i(shl, kInstShl, Mem, Imm) - //! @brief Shift bits right. + //! Shift bits right. //! - //! @note @a o1 register can be only @c cl. + //! @note `o1` register can be only `cl`. INST_2x(shr, kInstShr, GpReg, GpReg) //! @overload INST_2x(shr, kInstShr, Mem, GpReg) - //! @brief Shift bits right. + //! Shift bits right. INST_2i(shr, kInstShr, GpReg, Imm) //! @overload INST_2i(shr, kInstShr, Mem, Imm) - //! @brief Double precision shift left. + //! Double precision shift left. //! - //! @note @a o2 register can be only @c cl register. + //! @note `o2` register can be only `cl` register. INST_3x(shld, kInstShld, GpReg, GpReg, GpReg) //! @overload INST_3x(shld, kInstShld, Mem, GpReg, GpReg) - //! @brief Double precision shift left. + //! Double precision shift left. INST_3i(shld, kInstShld, GpReg, GpReg, Imm) //! @overload INST_3i(shld, kInstShld, Mem, GpReg, Imm) - //! @brief Double precision shift right. + //! Double precision shift right. //! - //! @note @a o2 register can be only @c cl register. + //! @note `o2` register can be only `cl` register. INST_3x(shrd, kInstShrd, GpReg, GpReg, GpReg) //! @overload INST_3x(shrd, kInstShrd, Mem, GpReg, GpReg) - //! @brief Double precision shift right. + //! Double precision shift right. INST_3i(shrd, kInstShrd, GpReg, GpReg, Imm) //! @overload INST_3i(shrd, kInstShrd, Mem, GpReg, Imm) - //! @brief Set carry flag to 1. + //! Set carry flag to 1. INST_0x(stc, kInstStc) - //! @brief Set direction flag to 1. + //! Set direction flag to 1. INST_0x(std, kInstStd) - //! @brief Subtract. + //! Subtract. INST_2x(sub, kInstSub, GpReg, GpReg) //! @overload INST_2x(sub, kInstSub, GpReg, Mem) @@ -1158,7 +1156,7 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(sub, kInstSub, Mem, Imm) - //! @brief Logical compare. + //! Logical compare. INST_2x(test, kInstTest, GpReg, GpReg) //! @overload INST_2i(test, kInstTest, GpReg, Imm) @@ -1167,22 +1165,22 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2i(test, kInstTest, Mem, Imm) - //! @brief Undefined instruction - Raise #UD exception. + //! Undefined instruction - Raise #UD exception. INST_0x(ud2, kInstUd2) - //! @brief Exchange and Add. + //! Exchange and Add. INST_2x(xadd, kInstXadd, GpReg, GpReg) //! @overload INST_2x(xadd, kInstXadd, Mem, GpReg) - //! @brief Exchange register/memory with register. + //! Exchange register/memory with register. INST_2x(xchg, kInstXchg, GpReg, GpReg) //! @overload INST_2x(xchg, kInstXchg, Mem, GpReg) //! @overload INST_2x(xchg, kInstXchg, GpReg, Mem) - //! @brief Xor. + //! Xor. INST_2x(xor_, kInstXor, GpReg, GpReg) //! @overload INST_2x(xor_, kInstXor, GpReg, Mem) @@ -1197,351 +1195,351 @@ struct X86X64Assembler : public BaseAssembler { // [Fpu] // -------------------------------------------------------------------------- - //! @brief Compute 2^x - 1 (FPU). + //! Compute 2^x - 1 (FPU). INST_0x(f2xm1, kInstF2xm1) - //! @brief Absolute value of fp0 (FPU). + //! Absolute value of fp0 (FPU). INST_0x(fabs, kInstFabs) - //! @brief Add @a o1 to @a o0 and store result in @a o0 (FPU). + //! Add `o1` to `o0` and store result in `o0` (FPU). //! //! @note One of dst or src must be fp0. INST_2x_(fadd, kInstFadd, FpReg, FpReg, o0.getRegIndex() == 0 || o1.getRegIndex() == 0) - //! @brief Add 4-byte or 8-byte FP @a o0 to fp0 and store result in fp0 (FPU). + //! Add 4-byte or 8-byte FP `o0` to fp0 and store result in fp0 (FPU). INST_1x(fadd, kInstFadd, Mem) - //! @brief Add fp0 to @a o0 and POP register stack (FPU). + //! Add fp0 to `o0` and POP register stack (FPU). INST_1x(faddp, kInstFaddp, FpReg) //! @overload. INST_0x(faddp, kInstFaddp) - //! @brief Load binary coded decimal (FPU). + //! Load binary coded decimal (FPU). INST_1x(fbld, kInstFbld, Mem) - //! @brief Store BCD integer and Pop (FPU). + //! Store BCD integer and Pop (FPU). INST_1x(fbstp, kInstFbstp, Mem) - //! @brief Change fp0 sign (FPU). + //! Change fp0 sign (FPU). INST_0x(fchs, kInstFchs) - //! @brief Clear exceptions (FPU). + //! Clear exceptions (FPU). INST_0x(fclex, kInstFclex) - //! @brief FP Conditional move (FPU). + //! FP Conditional move (FPU). INST_1x(fcmovb, kInstFcmovb, FpReg) - //! @brief FP Conditional move (FPU). + //! FP Conditional move (FPU). INST_1x(fcmovbe, kInstFcmovbe, FpReg) - //! @brief FP Conditional move (FPU). + //! FP Conditional move (FPU). INST_1x(fcmove, kInstFcmove, FpReg) - //! @brief FP Conditional move (FPU). + //! FP Conditional move (FPU). INST_1x(fcmovnb, kInstFcmovnb, FpReg) - //! @brief FP Conditional move (FPU). + //! FP Conditional move (FPU). INST_1x(fcmovnbe, kInstFcmovnbe, FpReg) - //! @brief FP Conditional move (FPU). + //! FP Conditional move (FPU). INST_1x(fcmovne, kInstFcmovne, FpReg) - //! @brief FP Conditional move (FPU). + //! FP Conditional move (FPU). INST_1x(fcmovnu, kInstFcmovnu, FpReg) - //! @brief FP Conditional move (FPU). + //! FP Conditional move (FPU). INST_1x(fcmovu, kInstFcmovu, FpReg) - //! @brief Compare fp0 with @a o0 (FPU). + //! Compare fp0 with `o0` (FPU). INST_1x(fcom, kInstFcom, FpReg) - //! @brief Compare fp0 with fp1 (FPU). + //! Compare fp0 with fp1 (FPU). INST_0x(fcom, kInstFcom) - //! @brief Compare fp0 with 4-byte or 8-byte FP at @a src (FPU). + //! Compare fp0 with 4-byte or 8-byte FP at `src` (FPU). INST_1x(fcom, kInstFcom, Mem) - //! @brief Compare fp0 with @a o0 and pop the stack (FPU). + //! Compare fp0 with `o0` and pop the stack (FPU). INST_1x(fcomp, kInstFcomp, FpReg) - //! @brief Compare fp0 with fp1 and pop the stack (FPU). + //! Compare fp0 with fp1 and pop the stack (FPU). INST_0x(fcomp, kInstFcomp) - //! @brief Compare fp0 with 4-byte or 8-byte FP at @a adr and pop the stack (FPU). + //! Compare fp0 with 4-byte or 8-byte FP at `adr` and pop the stack (FPU). INST_1x(fcomp, kInstFcomp, Mem) - //! @brief Compare fp0 with fp1 and pop register stack twice (FPU). + //! Compare fp0 with fp1 and pop register stack twice (FPU). INST_0x(fcompp, kInstFcompp) - //! @brief Compare fp0 and @a o0 and Set EFLAGS (FPU). + //! Compare fp0 and `o0` and Set EFLAGS (FPU). INST_1x(fcomi, kInstFcomi, FpReg) - //! @brief Compare fp0 and @a o0 and Set EFLAGS and pop the stack (FPU). + //! Compare fp0 and `o0` and Set EFLAGS and pop the stack (FPU). INST_1x(fcomip, kInstFcomip, FpReg) - //! @brief Calculate cosine of fp0 and store result in fp0 (FPU). + //! Calculate cosine of fp0 and store result in fp0 (FPU). INST_0x(fcos, kInstFcos) - //! @brief Decrement stack-top pointer (FPU). + //! Decrement stack-top pointer (FPU). INST_0x(fdecstp, kInstFdecstp) - //! @brief Divide @a o0 by @a o1 (FPU). + //! Divide `o0` by `o1` (FPU). //! - //! @note One of @a o0 or @a o1 register must be fp0. + //! @note One of `o0` or `o1` register must be fp0. INST_2x_(fdiv, kInstFdiv, FpReg, FpReg, o0.getRegIndex() == 0 || o1.getRegIndex() == 0) - //! @brief Divide fp0 by 32-bit or 64-bit FP value (FPU). + //! Divide fp0 by 32-bit or 64-bit FP value (FPU). INST_1x(fdiv, kInstFdiv, Mem) - //! @brief Divide @a o0 by fp0 (FPU). + //! Divide `o0` by fp0 (FPU). INST_1x(fdivp, kInstFdivp, FpReg) //! @overload. INST_0x(fdivp, kInstFdivp) - //! @brief Reverse divide @a o0 by @a o1 (FPU). + //! Reverse divide `o0` by `o1` (FPU). //! - //! @note One of @a o0 or @a src register must be fp0. + //! @note One of `o0` or `src` register must be fp0. INST_2x_(fdivr, kInstFdivr, FpReg, FpReg, o0.getRegIndex() == 0 || o1.getRegIndex() == 0) - //! @brief Reverse divide fp0 by 32-bit or 64-bit FP value (FPU). + //! Reverse divide fp0 by 32-bit or 64-bit FP value (FPU). INST_1x(fdivr, kInstFdivr, Mem) - //! @brief Reverse divide @a o0 by fp0 (FPU). + //! Reverse divide `o0` by fp0 (FPU). INST_1x(fdivrp, kInstFdivrp, FpReg) //! @overload. INST_0x(fdivrp, kInstFdivrp) - //! @brief Free FP register (FPU). + //! Free FP register (FPU). //! - //! Sets the tag in the FPU tag register associated with register @a o0 - //! to empty (11B). The contents of @a o0 and the FPU stack-top pointer + //! Sets the tag in the FPU tag register associated with register `o0` + //! to empty (11B). The contents of `o0` and the FPU stack-top pointer //! (TOP) are not affected. INST_1x(ffree, kInstFfree, FpReg) - //! @brief Add 16-bit or 32-bit integer to fp0 (FPU). + //! Add 16-bit or 32-bit integer to fp0 (FPU). INST_1x_(fiadd, kInstFiadd, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Compare fp0 with 16-bit or 32-bit Integer (FPU). + //! Compare fp0 with 16-bit or 32-bit Integer (FPU). INST_1x_(ficom, kInstFicom, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Compare fp0 with 16-bit or 32-bit Integer and pop the stack (FPU). + //! Compare fp0 with 16-bit or 32-bit Integer and pop the stack (FPU). INST_1x_(ficomp, kInstFicomp, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Divide fp0 by 32-bit or 16-bit integer (@a src) (FPU). + //! Divide fp0 by 32-bit or 16-bit integer (`src`) (FPU). INST_1x_(fidiv, kInstFidiv, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Reverse divide fp0 by 32-bit or 16-bit integer (@a src) (FPU). + //! Reverse divide fp0 by 32-bit or 16-bit integer (`src`) (FPU). INST_1x_(fidivr, kInstFidivr, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Load 16-bit, 32-bit or 64-bit Integer and push it to the stack (FPU). + //! Load 16-bit, 32-bit or 64-bit Integer and push it to the stack (FPU). INST_1x_(fild, kInstFild, Mem, o0.getSize() == 2 || o0.getSize() == 4 || o0.getSize() == 8) - //! @brief Multiply fp0 by 16-bit or 32-bit integer and store it to fp0 (FPU). + //! Multiply fp0 by 16-bit or 32-bit integer and store it to fp0 (FPU). INST_1x_(fimul, kInstFimul, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Increment stack-top pointer (FPU). + //! Increment stack-top pointer (FPU). INST_0x(fincstp, kInstFincstp) - //! @brief Initialize FPU (FPU). + //! Initialize FPU (FPU). INST_0x(finit, kInstFinit) - //! @brief Subtract 16-bit or 32-bit integer from fp0 and store result to fp0 (FPU). + //! Subtract 16-bit or 32-bit integer from fp0 and store result to fp0 (FPU). INST_1x_(fisub, kInstFisub, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Reverse subtract 16-bit or 32-bit integer from fp0 and store result to fp0 (FPU). + //! Reverse subtract 16-bit or 32-bit integer from fp0 and store result to fp0 (FPU). INST_1x_(fisubr, kInstFisubr, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Initialize FPU without checking for pending unmasked exceptions (FPU). + //! Initialize FPU without checking for pending unmasked exceptions (FPU). INST_0x(fninit, kInstFninit) - //! @brief Store fp0 as 16-bit or 32-bit Integer to @a o0 (FPU). + //! Store fp0 as 16-bit or 32-bit Integer to `o0` (FPU). INST_1x_(fist, kInstFist, Mem, o0.getSize() == 2 || o0.getSize() == 4) - //! @brief Store fp0 as 16-bit, 32-bit or 64-bit Integer to @a o0 and pop stack (FPU). + //! Store fp0 as 16-bit, 32-bit or 64-bit Integer to `o0` and pop stack (FPU). INST_1x_(fistp, kInstFistp, Mem, o0.getSize() == 2 || o0.getSize() == 4 || o0.getSize() == 8) - //! @brief Push 32-bit, 64-bit or 80-bit floating point value on the FPU register stack (FPU). + //! Push 32-bit, 64-bit or 80-bit floating point value on the FPU register stack (FPU). INST_1x_(fld, kInstFld, Mem, o0.getSize() == 4 || o0.getSize() == 8 || o0.getSize() == 10) - //! @brief Push @a o0 on the FPU register stack (FPU). + //! Push `o0` on the FPU register stack (FPU). INST_1x(fld, kInstFld, FpReg) - //! @brief Push +1.0 on the FPU register stack (FPU). + //! Push +1.0 on the FPU register stack (FPU). INST_0x(fld1, kInstFld1) - //! @brief Push log2(10) on the FPU register stack (FPU). + //! Push log2(10) on the FPU register stack (FPU). INST_0x(fldl2t, kInstFldl2t) - //! @brief Push log2(e) on the FPU register stack (FPU). + //! Push log2(e) on the FPU register stack (FPU). INST_0x(fldl2e, kInstFldl2e) - //! @brief Push pi on the FPU register stack (FPU). + //! Push pi on the FPU register stack (FPU). INST_0x(fldpi, kInstFldpi) - //! @brief Push log10(2) on the FPU register stack (FPU). + //! Push log10(2) on the FPU register stack (FPU). INST_0x(fldlg2, kInstFldlg2) - //! @brief Push ln(2) on the FPU register stack (FPU). + //! Push ln(2) on the FPU register stack (FPU). INST_0x(fldln2, kInstFldln2) - //! @brief Push +0.0 on the FPU register stack (FPU). + //! Push +0.0 on the FPU register stack (FPU). INST_0x(fldz, kInstFldz) - //! @brief Load x87 FPU control word (2 bytes) (FPU). + //! Load x87 FPU control word (2 bytes) (FPU). INST_1x(fldcw, kInstFldcw, Mem) - //! @brief Load x87 FPU environment (14 or 28 bytes) (FPU). + //! Load x87 FPU environment (14 or 28 bytes) (FPU). INST_1x(fldenv, kInstFldenv, Mem) - //! @brief Multiply @a o0 by @a o1 and store result in @a o0 (FPU). + //! Multiply `o0` by `o1` and store result in `o0` (FPU). //! //! @note One of dst or src must be fp0. INST_2x_(fmul, kInstFmul, FpReg, FpReg, o0.getRegIndex() == 0 || o1.getRegIndex() == 0) - //! @brief Multiply fp0 by 32-bit or 64-bit @a o0 and store result in fp0 (FPU). + //! Multiply fp0 by 32-bit or 64-bit `o0` and store result in fp0 (FPU). INST_1x(fmul, kInstFmul, Mem) - //! @brief Multiply fp0 by @a o0 and POP register stack (FPU). + //! Multiply fp0 by `o0` and POP register stack (FPU). INST_1x(fmulp, kInstFmulp, FpReg) //! @overload. INST_0x(fmulp, kInstFmulp) - //! @brief Clear exceptions (FPU). + //! Clear exceptions (FPU). INST_0x(fnclex, kInstFnclex) - //! @brief No operation (FPU). + //! No operation (FPU). INST_0x(fnop, kInstFnop) - //! @brief Save FPU state (FPU). + //! Save FPU state (FPU). INST_1x(fnsave, kInstFnsave, Mem) - //! @brief Store x87 FPU environment (FPU). + //! Store x87 FPU environment (FPU). INST_1x(fnstenv, kInstFnstenv, Mem) - //! @brief Store x87 FPU control word (FPU). + //! Store x87 FPU control word (FPU). INST_1x(fnstcw, kInstFnstcw, Mem) - //! @brief Store x87 FPU status word to @a o0 (AX) (FPU). + //! Store x87 FPU status word to `o0` (AX) (FPU). INST_1x_(fnstsw, kInstFnstsw, GpReg, o0.isRegCode(kRegTypeGpw, kRegIndexAx)) - //! @brief Store x87 FPU status word to @a o0 (2 bytes) (FPU). + //! Store x87 FPU status word to `o0` (2 bytes) (FPU). INST_1x(fnstsw, kInstFnstsw, Mem) - //! @brief Calculate arctan(fp1 / fp0) and pop the register stack (FPU). + //! Calculate arctan(fp1 / fp0) and pop the register stack (FPU). INST_0x(fpatan, kInstFpatan) - //! @brief Calculate fprem(fp0, fp1) and pop the register stack (FPU). + //! Calculate fprem(fp0, fp1) and pop the register stack (FPU). INST_0x(fprem, kInstFprem) - //! @brief Calculate IEEE fprem(fp0, fp1) and pop the register stack (FPU). + //! Calculate IEEE fprem(fp0, fp1) and pop the register stack (FPU). INST_0x(fprem1, kInstFprem1) - //! @brief Calculate arctan(fp0) and pop the register stack (FPU). + //! Calculate arctan(fp0) and pop the register stack (FPU). INST_0x(fptan, kInstFptan) - //! @brief Round fp0 to Integer (FPU). + //! Round fp0 to Integer (FPU). INST_0x(frndint, kInstFrndint) - //! @brief Restore FPU state from @a o0 (94 or 108 bytes) (FPU). + //! Restore FPU state from `o0` (94 or 108 bytes) (FPU). INST_1x(frstor, kInstFrstor, Mem) - //! @brief Save FPU state to @a o0 (FPU). + //! Save FPU state to `o0` (FPU). //! //! Store FPU state to 94 or 108-bytes after checking for //! pending unmasked FP exceptions. Then reinitialize //! the FPU. INST_1x(fsave, kInstFsave, Mem) - //! @brief Scale (FPU). + //! Scale (FPU). //! //! Scale fp0 by fp1. INST_0x(fscale, kInstFscale) - //! @brief Calculate sine of fp0 and store result in fp0 (FPU). + //! Calculate sine of fp0 and store result in fp0 (FPU). INST_0x(fsin, kInstFsin) - //! @brief Sine and cosine (FPU). + //! Sine and cosine (FPU). //! //! Compute the sine and cosine of fp0; replace fp0 with the sine //! and push the cosine on the register stack. INST_0x(fsincos, kInstFsincos) - //! @brief Square root (FPU). + //! Square root (FPU). //! //! Calculates square root of fp0 and stores the result in fp0. INST_0x(fsqrt, kInstFsqrt) - //! @brief Store floating point value (FPU). + //! Store floating point value (FPU). //! - //! Store fp0 as 32-bit or 64-bit floating point value to @a o0. + //! Store fp0 as 32-bit or 64-bit floating point value to `o0`. INST_1x_(fst, kInstFst, Mem, o0.getSize() == 4 || o0.getSize() == 8) - //! @brief Store floating point value to @a o0 (FPU). + //! Store floating point value to `o0` (FPU). INST_1x(fst, kInstFst, FpReg) - //! @brief Store floating point value and pop register stack (FPU). + //! Store floating point value and pop register stack (FPU). //! - //! Store fp0 as 32-bit or 64-bit floating point value to @a o0 + //! Store fp0 as 32-bit or 64-bit floating point value to `o0` //! and pop register stack. INST_1x_(fstp, kInstFstp, Mem, o0.getSize() == 4 || o0.getSize() == 8 || o0.getSize() == 10) - //! @brief Store floating point value and pop register stack (FPU). + //! Store floating point value and pop register stack (FPU). //! - //! Store fp0 to @a o0 and pop register stack. + //! Store fp0 to `o0` and pop register stack. INST_1x(fstp, kInstFstp, FpReg) - //! @brief Store x87 FPU control word (FPU). + //! Store x87 FPU control word (FPU). //! - //! Store FPU control word to @a o0 (2 bytes) after checking for pending + //! Store FPU control word to `o0` (2 bytes) after checking for pending //! unmasked floating-point exceptions. INST_1x(fstcw, kInstFstcw, Mem) - //! @brief Store x87 FPU environment (FPU). + //! Store x87 FPU environment (FPU). //! - //! Store FPU environment to @a o0 (14 or 28 bytes) after checking for + //! Store FPU environment to `o0` (14 or 28 bytes) after checking for //! pending unmasked floating-point exceptions. Then mask all floating //! point exceptions. INST_1x(fstenv, kInstFstenv, Mem) - //! @brief Store x87 FPU status word (AX) (FPU). + //! Store x87 FPU status word (AX) (FPU). INST_1x_(fstsw, kInstFstsw, GpReg, o0.isRegCode(kRegTypeGpw, kRegIndexAx)) - //! @brief Store x87 FPU status sord (2 bytes) (FPU). + //! Store x87 FPU status sord (2 bytes) (FPU). INST_1x(fstsw, kInstFstsw, Mem) - //! @brief Subtract @a o0 from @a o0 and store result in @a o0 (FPU). + //! Subtract `o0` from `o0` and store result in `o0` (FPU). //! //! @note One of dst or src must be fp0. INST_2x_(fsub, kInstFsub, FpReg, FpReg, o0.getRegIndex() == 0 || o1.getRegIndex() == 0) - //! @brief Subtract 32-bit or 64-bit @a o0 from fp0 and store result in fp0 (FPU). + //! Subtract 32-bit or 64-bit `o0` from fp0 and store result in fp0 (FPU). INST_1x_(fsub, kInstFsub, Mem, o0.getSize() == 4 || o0.getSize() == 8) - //! @brief Subtract fp0 from @a o0 and POP register stack (FPU). + //! Subtract fp0 from `o0` and POP register stack (FPU). INST_1x(fsubp, kInstFsubp, FpReg) //! @overload. INST_0x(fsubp, kInstFsubp) - //! @brief Reverse subtract @a o1 from @a o0 and store result in @a o0 (FPU). + //! Reverse subtract `o1` from `o0` and store result in `o0` (FPU). //! //! @note One of dst or src must be fp0. INST_2x_(fsubr, kInstFsubr, FpReg, FpReg, o0.getRegIndex() == 0 || o1.getRegIndex() == 0) - //! @brief Reverse subtract 32-bit or 64-bit @a o0 from fp0 and store result in fp0 (FPU). + //! Reverse subtract 32-bit or 64-bit `o0` from fp0 and store result in fp0 (FPU). INST_1x_(fsubr, kInstFsubr, Mem, o0.getSize() == 4 || o0.getSize() == 8) - //! @brief Reverse subtract fp0 from @a o0 and POP register stack (FPU). + //! Reverse subtract fp0 from `o0` and POP register stack (FPU). INST_1x(fsubrp, kInstFsubrp, FpReg) //! @overload. INST_0x(fsubrp, kInstFsubrp) - //! @brief Floating point test - Compare fp0 with 0.0. (FPU). + //! Floating point test - Compare fp0 with 0.0. (FPU). INST_0x(ftst, kInstFtst) - //! @brief Unordered compare fp0 with @a o0 (FPU). + //! Unordered compare fp0 with `o0` (FPU). INST_1x(fucom, kInstFucom, FpReg) - //! @brief Unordered compare fp0 with fp1 (FPU). + //! Unordered compare fp0 with fp1 (FPU). INST_0x(fucom, kInstFucom) - //! @brief Unordered compare fp0 and @a o0, check for ordered values and Set EFLAGS (FPU). + //! Unordered compare fp0 and `o0`, check for ordered values and Set EFLAGS (FPU). INST_1x(fucomi, kInstFucomi, FpReg) - //! @brief Unordered compare fp0 and @a o0, Check for ordered values and Set EFLAGS and pop the stack (FPU). + //! Unordered compare fp0 and `o0`, Check for ordered values and Set EFLAGS and pop the stack (FPU). INST_1x(fucomip, kInstFucomip, FpReg) - //! @brief Unordered compare fp0 with @a o0 and pop register stack (FPU). + //! Unordered compare fp0 with `o0` and pop register stack (FPU). INST_1x(fucomp, kInstFucomp, FpReg) - //! @brief Unordered compare fp0 with fp1 and pop register stack (FPU). + //! Unordered compare fp0 with fp1 and pop register stack (FPU). INST_0x(fucomp, kInstFucomp) - //! @brief Unordered compare fp0 with fp1 and pop register stack twice (FPU). + //! Unordered compare fp0 with fp1 and pop register stack twice (FPU). INST_0x(fucompp, kInstFucompp) INST_0x(fwait, kInstFwait) - //! @brief Examine fp0 (FPU). + //! Examine fp0 (FPU). INST_0x(fxam, kInstFxam) - //! @brief Exchange register contents (FPU). + //! Exchange register contents (FPU). //! - //! Exchange content of fp0 with @a o0. + //! Exchange content of fp0 with `o0`. INST_1x(fxch, kInstFxch, FpReg) - //! @brief Restore FP, MMX and streaming SIMD extension states (FPU, MMX, SSE). + //! Restore FP, MMX and streaming SIMD extension states (FPU, MMX, SSE). //! //! Load FP and MMX technology and Streaming SIMD Extension state from //! src (512 bytes). INST_1x(fxrstor, kInstFxrstor, Mem) - //! @brief Store FP, MMX and streaming SIMD extension states (FPU, MMX, SSE). + //! Store FP, MMX and streaming SIMD extension states (FPU, MMX, SSE). //! //! Store FP and MMX technology state and Streaming SIMD Extension state //! to dst (512 bytes). INST_1x(fxsave, kInstFxsave, Mem) - //! @brief Extract exponent and significand (FPU). + //! Extract exponent and significand (FPU). //! //! Separate value in fp0 into exponent and significand, store exponent //! in fp0 and push the significand on the register stack. INST_0x(fxtract, kInstFxtract) - //! @brief Compute y * log2(x). + //! Compute y * log2(x). //! //! Replace fp1 with (fp1 * log2(fp0)) and pop the register stack. INST_0x(fyl2x, kInstFyl2x) - //! @brief Compute y * log_2(x+1). + //! Compute y * log_2(x+1). //! //! Replace fp1 with (fp1 * (log2(fp0)+1)) and pop the register stack. INST_0x(fyl2xp1, kInstFyl2xp1) @@ -1550,7 +1548,7 @@ struct X86X64Assembler : public BaseAssembler { // [MMX] // -------------------------------------------------------------------------- - //! @brief Move dword (MMX). + //! Move DWORD (MMX). INST_2x(movd, kInstMovd, Mem, MmReg) //! @overload INST_2x(movd, kInstMovd, GpReg, MmReg) @@ -1559,490 +1557,488 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2x(movd, kInstMovd, MmReg, GpReg) - //! @brief Move qword (MMX). + //! Move QWORD (MMX). INST_2x(movq, kInstMovq, MmReg, MmReg) //! @overload INST_2x(movq, kInstMovq, Mem, MmReg) //! @overload INST_2x(movq, kInstMovq, MmReg, Mem) - //! @brief Pack with signed saturation (MMX). - INST_2x(packsswb, kInstPacksswb, MmReg, MmReg) - //! @overload - INST_2x(packsswb, kInstPacksswb, MmReg, Mem) - - //! @brief Pack with signed saturation (MMX). + //! Pack DWORDs to WORDs with signed saturation (MMX). INST_2x(packssdw, kInstPackssdw, MmReg, MmReg) //! @overload INST_2x(packssdw, kInstPackssdw, MmReg, Mem) - //! @brief Pack with unsigned saturation (MMX). + //! Pack WORDs to BYTEs with signed saturation (MMX). + INST_2x(packsswb, kInstPacksswb, MmReg, MmReg) + //! @overload + INST_2x(packsswb, kInstPacksswb, MmReg, Mem) + + //! Pack WORDs to BYTEs with unsigned saturation (MMX). INST_2x(packuswb, kInstPackuswb, MmReg, MmReg) //! @overload INST_2x(packuswb, kInstPackuswb, MmReg, Mem) - //! @brief Packed byte add (MMX). + //! Packed BYTE add (MMX). INST_2x(paddb, kInstPaddb, MmReg, MmReg) //! @overload INST_2x(paddb, kInstPaddb, MmReg, Mem) - //! @brief Packed word add (MMX). - INST_2x(paddw, kInstPaddw, MmReg, MmReg) - //! @overload - INST_2x(paddw, kInstPaddw, MmReg, Mem) - - //! @brief Packed dword add (MMX). + //! Packed DWORD add (MMX). INST_2x(paddd, kInstPaddd, MmReg, MmReg) //! @overload INST_2x(paddd, kInstPaddd, MmReg, Mem) - //! @brief Packed add with saturation (MMX). + //! Packed BYTE add with saturation (MMX). INST_2x(paddsb, kInstPaddsb, MmReg, MmReg) //! @overload INST_2x(paddsb, kInstPaddsb, MmReg, Mem) - //! @brief Packed add with saturation (MMX). + //! Packed WORD add with saturation (MMX). INST_2x(paddsw, kInstPaddsw, MmReg, MmReg) //! @overload INST_2x(paddsw, kInstPaddsw, MmReg, Mem) - //! @brief Packed add unsigned with saturation (MMX). + //! Packed BYTE add with unsigned saturation (MMX). INST_2x(paddusb, kInstPaddusb, MmReg, MmReg) //! @overload INST_2x(paddusb, kInstPaddusb, MmReg, Mem) - //! @brief Packed add unsigned with saturation (MMX). + //! Packed WORD add with unsigned saturation (MMX). INST_2x(paddusw, kInstPaddusw, MmReg, MmReg) //! @overload INST_2x(paddusw, kInstPaddusw, MmReg, Mem) - //! @brief And (MMX). + //! Packed WORD add (MMX). + INST_2x(paddw, kInstPaddw, MmReg, MmReg) + //! @overload + INST_2x(paddw, kInstPaddw, MmReg, Mem) + + //! Packed bitwise and (MMX). INST_2x(pand, kInstPand, MmReg, MmReg) //! @overload INST_2x(pand, kInstPand, MmReg, Mem) - //! @brief And-not (MMX). + //! Packed bitwise and-not (MMX). INST_2x(pandn, kInstPandn, MmReg, MmReg) //! @overload INST_2x(pandn, kInstPandn, MmReg, Mem) - //! @brief Packed compare bytes for equal (MMX). + //! Packed BYTEs compare for equality (MMX). INST_2x(pcmpeqb, kInstPcmpeqb, MmReg, MmReg) //! @overload INST_2x(pcmpeqb, kInstPcmpeqb, MmReg, Mem) - //! @brief Packed compare words for equal (MMX). - INST_2x(pcmpeqw, kInstPcmpeqw, MmReg, MmReg) - //! @overload - INST_2x(pcmpeqw, kInstPcmpeqw, MmReg, Mem) - - //! @brief Packed compare dwords for equal (MMX). + //! Packed DWORDs compare for equality (MMX). INST_2x(pcmpeqd, kInstPcmpeqd, MmReg, MmReg) //! @overload INST_2x(pcmpeqd, kInstPcmpeqd, MmReg, Mem) - //! @brief Packed compare bytes for greater than (MMX). + //! Packed WORDs compare for equality (MMX). + INST_2x(pcmpeqw, kInstPcmpeqw, MmReg, MmReg) + //! @overload + INST_2x(pcmpeqw, kInstPcmpeqw, MmReg, Mem) + + //! Packed BYTEs compare if greater than (MMX). INST_2x(pcmpgtb, kInstPcmpgtb, MmReg, MmReg) //! @overload INST_2x(pcmpgtb, kInstPcmpgtb, MmReg, Mem) - //! @brief Packed compare words for greater than (MMX). - INST_2x(pcmpgtw, kInstPcmpgtw, MmReg, MmReg) - //! @overload - INST_2x(pcmpgtw, kInstPcmpgtw, MmReg, Mem) - - //! @brief Packed compare dqords for greater than (MMX). + //! Packed DWORDs compare if greater than (MMX). INST_2x(pcmpgtd, kInstPcmpgtd, MmReg, MmReg) //! @overload INST_2x(pcmpgtd, kInstPcmpgtd, MmReg, Mem) - //! @brief Packed multiply high (MMX). + //! Packed WORDs compare if greater than (MMX). + INST_2x(pcmpgtw, kInstPcmpgtw, MmReg, MmReg) + //! @overload + INST_2x(pcmpgtw, kInstPcmpgtw, MmReg, Mem) + + //! Packed WORDs multiply high (MMX). INST_2x(pmulhw, kInstPmulhw, MmReg, MmReg) //! @overload INST_2x(pmulhw, kInstPmulhw, MmReg, Mem) - //! @brief Packed multiply low (MMX). + //! Packed WORDs multiply low (MMX). INST_2x(pmullw, kInstPmullw, MmReg, MmReg) //! @overload INST_2x(pmullw, kInstPmullw, MmReg, Mem) - //! @brief Or (MMX). + //! Pakced bitwise or (MMX). INST_2x(por, kInstPor, MmReg, MmReg) //! @overload INST_2x(por, kInstPor, MmReg, Mem) - //! @brief Packed multiply and add (MMX). + //! Packed WORD multiply and add to packed DWORD (MMX). INST_2x(pmaddwd, kInstPmaddwd, MmReg, MmReg) //! @overload INST_2x(pmaddwd, kInstPmaddwd, MmReg, Mem) - //! @brief Packed shift left logical (MMX). + //! Packed DWORD shift left logical (MMX). INST_2x(pslld, kInstPslld, MmReg, MmReg) //! @overload INST_2x(pslld, kInstPslld, MmReg, Mem) //! @overload INST_2i(pslld, kInstPslld, MmReg, Imm) - //! @brief Packed shift left logical (MMX). + //! Packed QWORD shift left logical (MMX). INST_2x(psllq, kInstPsllq, MmReg, MmReg) //! @overload INST_2x(psllq, kInstPsllq, MmReg, Mem) //! @overload INST_2i(psllq, kInstPsllq, MmReg, Imm) - //! @brief Packed shift left logical (MMX). + //! Packed WORD shift left logical (MMX). INST_2x(psllw, kInstPsllw, MmReg, MmReg) //! @overload INST_2x(psllw, kInstPsllw, MmReg, Mem) //! @overload INST_2i(psllw, kInstPsllw, MmReg, Imm) - //! @brief Packed shift right arithmetic (MMX). + //! Packed DWORD shift right arithmetic (MMX). INST_2x(psrad, kInstPsrad, MmReg, MmReg) //! @overload INST_2x(psrad, kInstPsrad, MmReg, Mem) //! @overload INST_2i(psrad, kInstPsrad, MmReg, Imm) - //! @brief Packed shift right arithmetic (MMX). + //! Packed WORD shift right arithmetic (MMX). INST_2x(psraw, kInstPsraw, MmReg, MmReg) //! @overload INST_2x(psraw, kInstPsraw, MmReg, Mem) //! @overload INST_2i(psraw, kInstPsraw, MmReg, Imm) - //! @brief Packed shift right logical (MMX). + //! Packed DWORD shift right logical (MMX). INST_2x(psrld, kInstPsrld, MmReg, MmReg) //! @overload INST_2x(psrld, kInstPsrld, MmReg, Mem) //! @overload INST_2i(psrld, kInstPsrld, MmReg, Imm) - //! @brief Packed shift right logical (MMX). + //! Packed QWORD shift right logical (MMX). INST_2x(psrlq, kInstPsrlq, MmReg, MmReg) //! @overload INST_2x(psrlq, kInstPsrlq, MmReg, Mem) //! @overload INST_2i(psrlq, kInstPsrlq, MmReg, Imm) - //! @brief Packed shift right logical (MMX). + //! Packed WORD shift right logical (MMX). INST_2x(psrlw, kInstPsrlw, MmReg, MmReg) //! @overload INST_2x(psrlw, kInstPsrlw, MmReg, Mem) //! @overload INST_2i(psrlw, kInstPsrlw, MmReg, Imm) - //! @brief Packed subtract (MMX). + //! Packed BYTE subtract (MMX). INST_2x(psubb, kInstPsubb, MmReg, MmReg) //! @overload INST_2x(psubb, kInstPsubb, MmReg, Mem) - //! @brief Packed subtract (MMX). - INST_2x(psubw, kInstPsubw, MmReg, MmReg) - //! @overload - INST_2x(psubw, kInstPsubw, MmReg, Mem) - - //! @brief Packed subtract (MMX). + //! Packed DWORD subtract (MMX). INST_2x(psubd, kInstPsubd, MmReg, MmReg) //! @overload INST_2x(psubd, kInstPsubd, MmReg, Mem) - //! @brief Packed subtract with saturation (MMX). + //! Packed BYTE subtract with saturation (MMX). INST_2x(psubsb, kInstPsubsb, MmReg, MmReg) //! @overload INST_2x(psubsb, kInstPsubsb, MmReg, Mem) - //! @brief Packed subtract with saturation (MMX). + //! Packed WORD subtract with saturation (MMX). INST_2x(psubsw, kInstPsubsw, MmReg, MmReg) //! @overload INST_2x(psubsw, kInstPsubsw, MmReg, Mem) - //! @brief Packed subtract with unsigned saturation (MMX). + //! Packed BYTE subtract with unsigned saturation (MMX). INST_2x(psubusb, kInstPsubusb, MmReg, MmReg) //! @overload INST_2x(psubusb, kInstPsubusb, MmReg, Mem) - //! @brief Packed subtract with unsigned saturation (MMX). + //! Packed WORD subtract with unsigned saturation (MMX). INST_2x(psubusw, kInstPsubusw, MmReg, MmReg) //! @overload INST_2x(psubusw, kInstPsubusw, MmReg, Mem) - //! @brief Unpack high packed data (MMX). + //! Packed WORD subtract (MMX). + INST_2x(psubw, kInstPsubw, MmReg, MmReg) + //! @overload + INST_2x(psubw, kInstPsubw, MmReg, Mem) + + //! Unpack high packed BYTEs to WORDs (MMX). INST_2x(punpckhbw, kInstPunpckhbw, MmReg, MmReg) //! @overload INST_2x(punpckhbw, kInstPunpckhbw, MmReg, Mem) - //! @brief Unpack high packed data (MMX). - INST_2x(punpckhwd, kInstPunpckhwd, MmReg, MmReg) - //! @overload - INST_2x(punpckhwd, kInstPunpckhwd, MmReg, Mem) - - //! @brief Unpack high packed data (MMX). + //! Unpack high packed DWORDs to QWORDs (MMX). INST_2x(punpckhdq, kInstPunpckhdq, MmReg, MmReg) //! @overload INST_2x(punpckhdq, kInstPunpckhdq, MmReg, Mem) - //! @brief Unpack high packed data (MMX). + //! Unpack high packed WORDs to DWORDs (MMX). + INST_2x(punpckhwd, kInstPunpckhwd, MmReg, MmReg) + //! @overload + INST_2x(punpckhwd, kInstPunpckhwd, MmReg, Mem) + + //! Unpack low packed BYTEs to WORDs (MMX). INST_2x(punpcklbw, kInstPunpcklbw, MmReg, MmReg) //! @overload INST_2x(punpcklbw, kInstPunpcklbw, MmReg, Mem) - //! @brief Unpack high packed data (MMX). - INST_2x(punpcklwd, kInstPunpcklwd, MmReg, MmReg) - //! @overload - INST_2x(punpcklwd, kInstPunpcklwd, MmReg, Mem) - - //! @brief Unpack high packed data (MMX). + //! Unpack low packed DWORDs to QWORDs (MMX). INST_2x(punpckldq, kInstPunpckldq, MmReg, MmReg) //! @overload INST_2x(punpckldq, kInstPunpckldq, MmReg, Mem) - //! @brief Xor (MMX). + //! Unpack low packed WORDs to DWORDs (MMX). + INST_2x(punpcklwd, kInstPunpcklwd, MmReg, MmReg) + //! @overload + INST_2x(punpcklwd, kInstPunpcklwd, MmReg, Mem) + + //! Packed bitwise xor (MMX). INST_2x(pxor, kInstPxor, MmReg, MmReg) //! @overload INST_2x(pxor, kInstPxor, MmReg, Mem) - //! @brief Empty MMX state. + //! Empty MMX state. INST_0x(emms, kInstEmms) // ------------------------------------------------------------------------- // [3dNow] // ------------------------------------------------------------------------- - //! @brief Packed SP-FP to integer convert (3dNow!). + //! Packed SP-FP to DWORD convert (3dNow!). INST_2x(pf2id, kInstPf2id, MmReg, MmReg) //! @overload INST_2x(pf2id, kInstPf2id, MmReg, Mem) - //! @brief Packed SP-FP to integer word convert (3dNow!). + //! Packed SP-FP to WORD convert (3dNow!). INST_2x(pf2iw, kInstPf2iw, MmReg, MmReg) //! @overload INST_2x(pf2iw, kInstPf2iw, MmReg, Mem) - //! @brief Packed SP-FP accumulate (3dNow!). + //! Packed SP-FP accumulate (3dNow!). INST_2x(pfacc, kInstPfacc, MmReg, MmReg) //! @overload INST_2x(pfacc, kInstPfacc, MmReg, Mem) - //! @brief Packed SP-FP addition (3dNow!). + //! Packed SP-FP addition (3dNow!). INST_2x(pfadd, kInstPfadd, MmReg, MmReg) //! @overload INST_2x(pfadd, kInstPfadd, MmReg, Mem) - //! @brief Packed SP-FP compare - dst == src (3dNow!). + //! Packed SP-FP compare - dst == src (3dNow!). INST_2x(pfcmpeq, kInstPfcmpeq, MmReg, MmReg) //! @overload INST_2x(pfcmpeq, kInstPfcmpeq, MmReg, Mem) - //! @brief Packed SP-FP compare - dst >= src (3dNow!). + //! Packed SP-FP compare - dst >= src (3dNow!). INST_2x(pfcmpge, kInstPfcmpge, MmReg, MmReg) //! @overload INST_2x(pfcmpge, kInstPfcmpge, MmReg, Mem) - //! @brief Packed SP-FP compare - dst > src (3dNow!). + //! Packed SP-FP compare - dst > src (3dNow!). INST_2x(pfcmpgt, kInstPfcmpgt, MmReg, MmReg) //! @overload INST_2x(pfcmpgt, kInstPfcmpgt, MmReg, Mem) - //! @brief Packed SP-FP maximum (3dNow!). + //! Packed SP-FP maximum (3dNow!). INST_2x(pfmax, kInstPfmax, MmReg, MmReg) //! @overload INST_2x(pfmax, kInstPfmax, MmReg, Mem) - //! @brief Packed SP-FP minimum (3dNow!). + //! Packed SP-FP minimum (3dNow!). INST_2x(pfmin, kInstPfmin, MmReg, MmReg) //! @overload INST_2x(pfmin, kInstPfmin, MmReg, Mem) - //! @brief Packed SP-FP multiply (3dNow!). + //! Packed SP-FP multiply (3dNow!). INST_2x(pfmul, kInstPfmul, MmReg, MmReg) //! @overload INST_2x(pfmul, kInstPfmul, MmReg, Mem) - //! @brief Packed SP-FP negative accumulate (3dNow!). + //! Packed SP-FP negative accumulate (3dNow!). INST_2x(pfnacc, kInstPfnacc, MmReg, MmReg) //! @overload INST_2x(pfnacc, kInstPfnacc, MmReg, Mem) - //! @brief Packed SP-FP mixed accumulate (3dNow!). + //! Packed SP-FP mixed accumulate (3dNow!). INST_2x(pfpnacc, kInstPfpnacc, MmReg, MmReg) //! @overload INST_2x(pfpnacc, kInstPfpnacc, MmReg, Mem) - //! @brief Packed SP-FP reciprocal Approximation (3dNow!). + //! Packed SP-FP reciprocal Approximation (3dNow!). INST_2x(pfrcp, kInstPfrcp, MmReg, MmReg) //! @overload INST_2x(pfrcp, kInstPfrcp, MmReg, Mem) - //! @brief Packed SP-FP reciprocal, first iteration step (3dNow!). + //! Packed SP-FP reciprocal, first iteration step (3dNow!). INST_2x(pfrcpit1, kInstPfrcpit1, MmReg, MmReg) //! @overload INST_2x(pfrcpit1, kInstPfrcpit1, MmReg, Mem) - //! @brief Packed SP-FP reciprocal, second iteration step (3dNow!). + //! Packed SP-FP reciprocal, second iteration step (3dNow!). INST_2x(pfrcpit2, kInstPfrcpit2, MmReg, MmReg) //! @overload INST_2x(pfrcpit2, kInstPfrcpit2, MmReg, Mem) - //! @brief Packed SP-FP reciprocal square root, first iteration step (3dNow!). + //! Packed SP-FP reciprocal square root, first iteration step (3dNow!). INST_2x(pfrsqit1, kInstPfrsqit1, MmReg, MmReg) //! @overload INST_2x(pfrsqit1, kInstPfrsqit1, MmReg, Mem) - //! @brief Packed SP-FP reciprocal square root approximation (3dNow!). + //! Packed SP-FP reciprocal square root approximation (3dNow!). INST_2x(pfrsqrt, kInstPfrsqrt, MmReg, MmReg) //! @overload INST_2x(pfrsqrt, kInstPfrsqrt, MmReg, Mem) - //! @brief Packed SP-FP subtract (3dNow!). + //! Packed SP-FP subtract (3dNow!). INST_2x(pfsub, kInstPfsub, MmReg, MmReg) //! @overload INST_2x(pfsub, kInstPfsub, MmReg, Mem) - //! @brief Packed SP-FP reverse subtract (3dNow!). + //! Packed SP-FP reverse subtract (3dNow!). INST_2x(pfsubr, kInstPfsubr, MmReg, MmReg) //! @overload INST_2x(pfsubr, kInstPfsubr, MmReg, Mem) - //! @brief Packed dwords to SP-FP (3dNow!). + //! Packed DWORDs to SP-FP (3dNow!). INST_2x(pi2fd, kInstPi2fd, MmReg, MmReg) //! @overload INST_2x(pi2fd, kInstPi2fd, MmReg, Mem) - //! @brief Packed words to SP-FP (3dNow!). + //! Packed WORDs to SP-FP (3dNow!). INST_2x(pi2fw, kInstPi2fw, MmReg, MmReg) //! @overload INST_2x(pi2fw, kInstPi2fw, MmReg, Mem) - //! @brief Packed swap dword (3dNow!) + //! Packed swap DWORDs (3dNow!) INST_2x(pswapd, kInstPswapd, MmReg, MmReg) //! @overload INST_2x(pswapd, kInstPswapd, MmReg, Mem) - //! @brief Prefetch (3dNow!). + //! Prefetch (3dNow!). INST_1x(prefetch3dnow, kInstPrefetch3dNow, Mem) - //! @brief Prefetch and set cache to modified (3dNow!). + //! Prefetch and set cache to modified (3dNow!). INST_1x(prefetchw3dnow, kInstPrefetchw3dNow, Mem) - //! @brief Faster EMMS (3dNow!). + //! Faster EMMS (3dNow!). INST_0x(femms, kInstFemms) // -------------------------------------------------------------------------- // [SSE] // -------------------------------------------------------------------------- - //! @brief Packed SP-FP add (SSE). + //! Packed SP-FP add (SSE). INST_2x(addps, kInstAddps, XmmReg, XmmReg) //! @overload INST_2x(addps, kInstAddps, XmmReg, Mem) - //! @brief Scalar SP-FP add (SSE). + //! Scalar SP-FP add (SSE). INST_2x(addss, kInstAddss, XmmReg, XmmReg) //! @overload INST_2x(addss, kInstAddss, XmmReg, Mem) - //! @brief And-not for SP-FP (SSE). + //! Packed SP-FP bitwise and-not (SSE). INST_2x(andnps, kInstAndnps, XmmReg, XmmReg) //! @overload INST_2x(andnps, kInstAndnps, XmmReg, Mem) - //! @brief And for SP-FP (SSE). + //! Packed SP-FP bitwise and (SSE). INST_2x(andps, kInstAndps, XmmReg, XmmReg) //! @overload INST_2x(andps, kInstAndps, XmmReg, Mem) - //! @brief Packed SP-FP compare (SSE). + //! Packed SP-FP compare (SSE). INST_3i(cmpps, kInstCmpps, XmmReg, XmmReg, Imm) //! @overload INST_3i(cmpps, kInstCmpps, XmmReg, Mem, Imm) - //! @brief Compare scalar SP-FP values (SSE). + //! Compare scalar SP-FP (SSE). INST_3i(cmpss, kInstCmpss, XmmReg, XmmReg, Imm) //! @overload INST_3i(cmpss, kInstCmpss, XmmReg, Mem, Imm) - //! @brief Scalar ordered SP-FP compare and set EFLAGS (SSE). + //! Scalar ordered SP-FP compare and set EFLAGS (SSE). INST_2x(comiss, kInstComiss, XmmReg, XmmReg) //! @overload INST_2x(comiss, kInstComiss, XmmReg, Mem) - //! @brief Packed signed INT32 to packed SP-FP conversion (SSE). + //! Packed signed INT32 to packed SP-FP conversion (SSE). INST_2x(cvtpi2ps, kInstCvtpi2ps, XmmReg, MmReg) //! @overload INST_2x(cvtpi2ps, kInstCvtpi2ps, XmmReg, Mem) - //! @brief Packed SP-FP to packed INT32 conversion (SSE). + //! Packed SP-FP to packed INT32 conversion (SSE). INST_2x(cvtps2pi, kInstCvtps2pi, MmReg, XmmReg) //! @overload INST_2x(cvtps2pi, kInstCvtps2pi, MmReg, Mem) - //! @brief Scalar signed INT32 to SP-FP conversion (SSE). + //! Convert scalar INT32 to SP-FP (SSE). INST_2x(cvtsi2ss, kInstCvtsi2ss, XmmReg, GpReg) //! @overload INST_2x(cvtsi2ss, kInstCvtsi2ss, XmmReg, Mem) - //! @brief Scalar SP-FP to signed INT32 conversion (SSE). + //! Convert scalar SP-FP to INT32 (SSE). INST_2x(cvtss2si, kInstCvtss2si, GpReg, XmmReg) //! @overload INST_2x(cvtss2si, kInstCvtss2si, GpReg, Mem) - //! @brief Packed SP-FP to packed INT32 conversion (truncate) (SSE). + //! Convert with truncation packed SP-FP to packed INT32 (SSE). INST_2x(cvttps2pi, kInstCvttps2pi, MmReg, XmmReg) //! @overload INST_2x(cvttps2pi, kInstCvttps2pi, MmReg, Mem) - //! @brief Scalar SP-FP to signed INT32 conversion (truncate) (SSE). + //! Convert with truncation scalar SP-FP to INT32 (SSE). INST_2x(cvttss2si, kInstCvttss2si, GpReg, XmmReg) //! @overload INST_2x(cvttss2si, kInstCvttss2si, GpReg, Mem) - //! @brief Packed SP-FP divide (SSE). + //! Packed SP-FP divide (SSE). INST_2x(divps, kInstDivps, XmmReg, XmmReg) //! @overload INST_2x(divps, kInstDivps, XmmReg, Mem) - //! @brief Scalar SP-FP divide (SSE). + //! Scalar SP-FP divide (SSE). INST_2x(divss, kInstDivss, XmmReg, XmmReg) //! @overload INST_2x(divss, kInstDivss, XmmReg, Mem) - //! @brief Load streaming SIMD extension control/status (SSE). + //! Load streaming SIMD extension control/status (SSE). INST_1x(ldmxcsr, kInstLdmxcsr, Mem) - //! @brief Byte mask write (SSE). - //! - //! @note The default memory location is specified by DS:EDI. + //! Byte mask write to DS:EDI/RDI (SSE). INST_2x(maskmovq, kInstMaskmovq, MmReg, MmReg) - //! @brief Packed SP-FP maximum (SSE). + //! Packed SP-FP maximum (SSE). INST_2x(maxps, kInstMaxps, XmmReg, XmmReg) //! @overload INST_2x(maxps, kInstMaxps, XmmReg, Mem) - //! @brief Scalar SP-FP maximum (SSE). + //! Scalar SP-FP maximum (SSE). INST_2x(maxss, kInstMaxss, XmmReg, XmmReg) //! @overload INST_2x(maxss, kInstMaxss, XmmReg, Mem) - //! @brief Packed SP-FP minimum (SSE). + //! Packed SP-FP minimum (SSE). INST_2x(minps, kInstMinps, XmmReg, XmmReg) //! @overload INST_2x(minps, kInstMinps, XmmReg, Mem) - //! @brief Scalar SP-FP minimum (SSE). + //! Scalar SP-FP minimum (SSE). INST_2x(minss, kInstMinss, XmmReg, XmmReg) //! @overload INST_2x(minss, kInstMinss, XmmReg, Mem) - //! @brief Move aligned packed SP-FP values (SSE). + //! Move aligned packed SP-FP (SSE). INST_2x(movaps, kInstMovaps, XmmReg, XmmReg) //! @overload INST_2x(movaps, kInstMovaps, XmmReg, Mem) - //! @brief Move aligned packed SP-FP values (SSE). + //! Move aligned packed SP-FP (SSE). INST_2x(movaps, kInstMovaps, Mem, XmmReg) - //! @brief Move dword. + //! Move DWORD. INST_2x(movd, kInstMovd, Mem, XmmReg) //! @overload INST_2x(movd, kInstMovd, GpReg, XmmReg) @@ -2051,195 +2047,195 @@ struct X86X64Assembler : public BaseAssembler { //! @overload INST_2x(movd, kInstMovd, XmmReg, GpReg) - //! @brief Move qword (SSE). + //! Move QWORD (SSE). INST_2x(movq, kInstMovq, XmmReg, XmmReg) //! @overload INST_2x(movq, kInstMovq, Mem, XmmReg) //! @overload INST_2x(movq, kInstMovq, XmmReg, Mem) - //! @brief Move 64 Bits non-temporal (SSE). + //! Move QWORD using NT hint (SSE). INST_2x(movntq, kInstMovntq, Mem, MmReg) - //! @brief High to low packed SP-FP (SSE). + //! Move high to low packed SP-FP (SSE). INST_2x(movhlps, kInstMovhlps, XmmReg, XmmReg) - //! @brief Move high packed SP-FP (SSE). + //! Move high packed SP-FP (SSE). INST_2x(movhps, kInstMovhps, XmmReg, Mem) - //! @brief Move high packed SP-FP (SSE). + //! Move high packed SP-FP (SSE). INST_2x(movhps, kInstMovhps, Mem, XmmReg) - //! @brief Move low to high packed SP-FP (SSE). + //! Move low to high packed SP-FP (SSE). INST_2x(movlhps, kInstMovlhps, XmmReg, XmmReg) - //! @brief Move low packed SP-FP (SSE). + //! Move low packed SP-FP (SSE). INST_2x(movlps, kInstMovlps, XmmReg, Mem) - //! @brief Move low packed SP-FP (SSE). + //! Move low packed SP-FP (SSE). INST_2x(movlps, kInstMovlps, Mem, XmmReg) - //! @brief Move aligned four packed SP-FP non-temporal (SSE). + //! Move aligned packed SP-FP using NT hint (SSE). INST_2x(movntps, kInstMovntps, Mem, XmmReg) - //! @brief Move scalar SP-FP (SSE). + //! Move scalar SP-FP (SSE). INST_2x(movss, kInstMovss, XmmReg, XmmReg) //! @overload INST_2x(movss, kInstMovss, XmmReg, Mem) //! @overload INST_2x(movss, kInstMovss, Mem, XmmReg) - //! @brief Move unaligned packed SP-FP values (SSE). + //! Move unaligned packed SP-FP (SSE). INST_2x(movups, kInstMovups, XmmReg, XmmReg) //! @overload INST_2x(movups, kInstMovups, XmmReg, Mem) //! @overload INST_2x(movups, kInstMovups, Mem, XmmReg) - //! @brief Packed SP-FP multiply (SSE). + //! Packed SP-FP multiply (SSE). INST_2x(mulps, kInstMulps, XmmReg, XmmReg) //! @overload INST_2x(mulps, kInstMulps, XmmReg, Mem) - //! @brief Scalar SP-FP multiply (SSE). + //! Scalar SP-FP multiply (SSE). INST_2x(mulss, kInstMulss, XmmReg, XmmReg) //! @overload INST_2x(mulss, kInstMulss, XmmReg, Mem) - //! @brief Or for SP-FP data (SSE). + //! Packed SP-FP bitwise or (SSE). INST_2x(orps, kInstOrps, XmmReg, XmmReg) //! @overload INST_2x(orps, kInstOrps, XmmReg, Mem) - //! @brief Packed average (SSE). + //! Packed BYTE average (SSE). INST_2x(pavgb, kInstPavgb, MmReg, MmReg) //! @overload INST_2x(pavgb, kInstPavgb, MmReg, Mem) - //! @brief Packed average (SSE). + //! Packed WORD average (SSE). INST_2x(pavgw, kInstPavgw, MmReg, MmReg) //! @overload INST_2x(pavgw, kInstPavgw, MmReg, Mem) - //! @brief Extract word (SSE). + //! Extract WORD based on selector (SSE). INST_3i(pextrw, kInstPextrw, GpReg, MmReg, Imm) - //! @brief Insert word (SSE). + //! Insert WORD based on selector (SSE). INST_3i(pinsrw, kInstPinsrw, MmReg, GpReg, Imm) //! @overload INST_3i(pinsrw, kInstPinsrw, MmReg, Mem, Imm) - //! @brief Packed signed integer word maximum (SSE). + //! Packed WORD maximum (SSE). INST_2x(pmaxsw, kInstPmaxsw, MmReg, MmReg) //! @overload INST_2x(pmaxsw, kInstPmaxsw, MmReg, Mem) - //! @brief Packed unsigned integer byte maximum (SSE). + //! Packed BYTE unsigned maximum (SSE). INST_2x(pmaxub, kInstPmaxub, MmReg, MmReg) //! @overload INST_2x(pmaxub, kInstPmaxub, MmReg, Mem) - //! @brief Packed signed integer word minimum (SSE). + //! Packed WORD minimum (SSE). INST_2x(pminsw, kInstPminsw, MmReg, MmReg) //! @overload INST_2x(pminsw, kInstPminsw, MmReg, Mem) - //! @brief Packed unsigned integer byte minimum (SSE). + //! Packed BYTE unsigned minimum (SSE). INST_2x(pminub, kInstPminub, MmReg, MmReg) //! @overload INST_2x(pminub, kInstPminub, MmReg, Mem) - //! @brief Move Byte mask to integer (SSE). + //! Move Byte mask to integer (SSE). INST_2x(pmovmskb, kInstPmovmskb, GpReg, MmReg) - //! @brief Packed multiply high unsigned (SSE). + //! Packed WORD unsigned multiply high (SSE). INST_2x(pmulhuw, kInstPmulhuw, MmReg, MmReg) //! @overload INST_2x(pmulhuw, kInstPmulhuw, MmReg, Mem) - //! @brief Packed sum of absolute differences (SSE). + //! Packed WORD sum of absolute differences (SSE). INST_2x(psadbw, kInstPsadbw, MmReg, MmReg) //! @overload INST_2x(psadbw, kInstPsadbw, MmReg, Mem) - //! @brief Packed shuffle Word (SSE). + //! Packed WORD shuffle (SSE). INST_3i(pshufw, kInstPshufw, MmReg, MmReg, Imm) //! @overload INST_3i(pshufw, kInstPshufw, MmReg, Mem, Imm) - //! @brief Packed SP-FP reciprocal (SSE). + //! Packed SP-FP reciprocal (SSE). INST_2x(rcpps, kInstRcpps, XmmReg, XmmReg) //! @overload INST_2x(rcpps, kInstRcpps, XmmReg, Mem) - //! @brief Scalar SP-FP reciprocal (SSE). + //! Scalar SP-FP reciprocal (SSE). INST_2x(rcpss, kInstRcpss, XmmReg, XmmReg) //! @overload INST_2x(rcpss, kInstRcpss, XmmReg, Mem) - //! @brief Prefetch (SSE). + //! Prefetch (SSE). INST_2i(prefetch, kInstPrefetch, Mem, Imm) - //! @brief Compute sum of absolute differences (SSE). + //! Packed WORD sum of absolute differences (SSE). INST_2x(psadbw, kInstPsadbw, XmmReg, XmmReg) //! @overload INST_2x(psadbw, kInstPsadbw, XmmReg, Mem) - //! @brief Packed SP-FP square root reciprocal (SSE). + //! Packed SP-FP square root reciprocal (SSE). INST_2x(rsqrtps, kInstRsqrtps, XmmReg, XmmReg) //! @overload INST_2x(rsqrtps, kInstRsqrtps, XmmReg, Mem) - //! @brief Scalar SP-FP square root reciprocal (SSE). + //! Scalar SP-FP square root reciprocal (SSE). INST_2x(rsqrtss, kInstRsqrtss, XmmReg, XmmReg) //! @overload INST_2x(rsqrtss, kInstRsqrtss, XmmReg, Mem) - //! @brief Store fence (SSE). + //! Store fence (SSE). INST_0x(sfence, kInstSfence) - //! @brief Shuffle SP-FP (SSE). + //! Shuffle SP-FP (SSE). INST_3i(shufps, kInstShufps, XmmReg, XmmReg, Imm) //! @overload INST_3i(shufps, kInstShufps, XmmReg, Mem, Imm) - //! @brief Packed SP-FP square root (SSE). + //! Packed SP-FP square root (SSE). INST_2x(sqrtps, kInstSqrtps, XmmReg, XmmReg) //! @overload INST_2x(sqrtps, kInstSqrtps, XmmReg, Mem) - //! @brief Scalar SP-FP square root (SSE). + //! Scalar SP-FP square root (SSE). INST_2x(sqrtss, kInstSqrtss, XmmReg, XmmReg) //! @overload INST_2x(sqrtss, kInstSqrtss, XmmReg, Mem) - //! @brief Store streaming SIMD extension control/status (SSE). + //! Store streaming SIMD extension control/status (SSE). INST_1x(stmxcsr, kInstStmxcsr, Mem) - //! @brief Packed SP-FP subtract (SSE). + //! Packed SP-FP subtract (SSE). INST_2x(subps, kInstSubps, XmmReg, XmmReg) //! @overload INST_2x(subps, kInstSubps, XmmReg, Mem) - //! @brief Scalar SP-FP subtract (SSE). + //! Scalar SP-FP subtract (SSE). INST_2x(subss, kInstSubss, XmmReg, XmmReg) //! @overload INST_2x(subss, kInstSubss, XmmReg, Mem) - //! @brief Unordered scalar SP-FP compare and set EFLAGS (SSE). + //! Unordered scalar SP-FP compare and set EFLAGS (SSE). INST_2x(ucomiss, kInstUcomiss, XmmReg, XmmReg) //! @overload INST_2x(ucomiss, kInstUcomiss, XmmReg, Mem) - //! @brief Unpack high packed SP-FP data (SSE). + //! Unpack high packed SP-FP data (SSE). INST_2x(unpckhps, kInstUnpckhps, XmmReg, XmmReg) //! @overload INST_2x(unpckhps, kInstUnpckhps, XmmReg, Mem) - //! @brief Unpack low packed SP-FP data (SSE). + //! Unpack low packed SP-FP data (SSE). INST_2x(unpcklps, kInstUnpcklps, XmmReg, XmmReg) //! @overload INST_2x(unpcklps, kInstUnpcklps, XmmReg, Mem) - //! @brief Xor for SP-FP data (SSE). + //! Packed SP-FP bitwise xor (SSE). INST_2x(xorps, kInstXorps, XmmReg, XmmReg) //! @overload INST_2x(xorps, kInstXorps, XmmReg, Mem) @@ -2248,633 +2244,631 @@ struct X86X64Assembler : public BaseAssembler { // [SSE2] // -------------------------------------------------------------------------- - //! @brief Packed DP-FP add (SSE2). + //! Packed DP-FP add (SSE2). INST_2x(addpd, kInstAddpd, XmmReg, XmmReg) //! @overload INST_2x(addpd, kInstAddpd, XmmReg, Mem) - //! @brief Scalar DP-FP add (SSE2). + //! Scalar DP-FP add (SSE2). INST_2x(addsd, kInstAddsd, XmmReg, XmmReg) //! @overload INST_2x(addsd, kInstAddsd, XmmReg, Mem) - //! @brief And-not for DP-FP (SSE2). + //! Packed DP-FP bitwise and-not (SSE2). INST_2x(andnpd, kInstAndnpd, XmmReg, XmmReg) //! @overload INST_2x(andnpd, kInstAndnpd, XmmReg, Mem) - //! @brief And for DP-FP (SSE2). + //! Packed DP-FP bitwise and (SSE2). INST_2x(andpd, kInstAndpd, XmmReg, XmmReg) //! @overload INST_2x(andpd, kInstAndpd, XmmReg, Mem) - //! @brief Flush cache line (SSE2). + //! Flush cache line (SSE2). INST_1x(clflush, kInstClflush, Mem) - //! @brief Packed DP-FP compare (SSE2). + //! Packed DP-FP compare (SSE2). INST_3i(cmppd, kInstCmppd, XmmReg, XmmReg, Imm) //! @overload INST_3i(cmppd, kInstCmppd, XmmReg, Mem, Imm) - //! @brief Compare scalar SP-FP values (SSE2). + //! Scalar SP-FP compare (SSE2). INST_3i(cmpsd, kInstCmpsd, XmmReg, XmmReg, Imm) //! @overload INST_3i(cmpsd, kInstCmpsd, XmmReg, Mem, Imm) - //! @brief Scalar ordered DP-FP compare and set EFLAGS (SSE2). + //! Scalar ordered DP-FP compare and set EFLAGS (SSE2). INST_2x(comisd, kInstComisd, XmmReg, XmmReg) //! @overload INST_2x(comisd, kInstComisd, XmmReg, Mem) - //! @brief Convert packed qword integers to packed DP-FP values (SSE2). + //! Convert packed QWORDs to packed DP-FP (SSE2). INST_2x(cvtdq2pd, kInstCvtdq2pd, XmmReg, XmmReg) //! @overload INST_2x(cvtdq2pd, kInstCvtdq2pd, XmmReg, Mem) - //! @brief Convert packed qword integers to packed SP-FP values (SSE2). + //! Convert packed QWORDs to packed SP-FP (SSE2). INST_2x(cvtdq2ps, kInstCvtdq2ps, XmmReg, XmmReg) //! @overload INST_2x(cvtdq2ps, kInstCvtdq2ps, XmmReg, Mem) - //! @brief Convert packed DP-FP values to packed qword integers (SSE2). + //! Convert packed DP-FP to packed QWORDs (SSE2). INST_2x(cvtpd2dq, kInstCvtpd2dq, XmmReg, XmmReg) //! @overload INST_2x(cvtpd2dq, kInstCvtpd2dq, XmmReg, Mem) - //! @brief Convert packed DP-FP values to packed qword integers (SSE2). + //! Convert packed DP-FP to packed QRODSs (SSE2). INST_2x(cvtpd2pi, kInstCvtpd2pi, MmReg, XmmReg) //! @overload INST_2x(cvtpd2pi, kInstCvtpd2pi, MmReg, Mem) - //! @brief Convert packed DP-FP values to packed SP-FP values (SSE2). + //! Convert packed DP-FP to packed SP-FP (SSE2). INST_2x(cvtpd2ps, kInstCvtpd2ps, XmmReg, XmmReg) //! @overload INST_2x(cvtpd2ps, kInstCvtpd2ps, XmmReg, Mem) - //! @brief Convert packed dword integers to packed DP-FP values (SSE2). + //! Convert packed DWORDs integers to packed DP-FP (SSE2). INST_2x(cvtpi2pd, kInstCvtpi2pd, XmmReg, MmReg) //! @overload INST_2x(cvtpi2pd, kInstCvtpi2pd, XmmReg, Mem) - //! @brief Convert packed SP-FP values to packed qword integers (SSE2). + //! Convert packed SP-FP to packed QWORDs (SSE2). INST_2x(cvtps2dq, kInstCvtps2dq, XmmReg, XmmReg) //! @overload INST_2x(cvtps2dq, kInstCvtps2dq, XmmReg, Mem) - //! @brief Convert packed SP-FP values to packed DP-FP values (SSE2). + //! Convert packed SP-FP to packed DP-FP (SSE2). INST_2x(cvtps2pd, kInstCvtps2pd, XmmReg, XmmReg) //! @overload INST_2x(cvtps2pd, kInstCvtps2pd, XmmReg, Mem) - //! @brief Convert scalar DP-FP value to dword integer (SSE2). + //! Convert scalar DP-FP to DWORD integer (SSE2). INST_2x(cvtsd2si, kInstCvtsd2si, GpReg, XmmReg) //! @overload INST_2x(cvtsd2si, kInstCvtsd2si, GpReg, Mem) - //! @brief Convert scalar DP-FP value to scalar SP-FP value (SSE2). + //! Convert scalar DP-FP to scalar SP-FP (SSE2). INST_2x(cvtsd2ss, kInstCvtsd2ss, XmmReg, XmmReg) //! @overload INST_2x(cvtsd2ss, kInstCvtsd2ss, XmmReg, Mem) - //! @brief Convert dword integer to scalar DP-FP value (SSE2). + //! Convert DWORD integer to scalar DP-FP (SSE2). INST_2x(cvtsi2sd, kInstCvtsi2sd, XmmReg, GpReg) //! @overload INST_2x(cvtsi2sd, kInstCvtsi2sd, XmmReg, Mem) - //! @brief Convert scalar SP-FP value to scalar DP-FP value (SSE2). + //! Convert scalar SP-FP to DP-FP (SSE2). INST_2x(cvtss2sd, kInstCvtss2sd, XmmReg, XmmReg) //! @overload INST_2x(cvtss2sd, kInstCvtss2sd, XmmReg, Mem) - //! @brief Convert with truncation packed DP-FP values to packed dword integers (SSE2). + //! Convert with truncation packed DP-FP to packed DWORDs (SSE2). INST_2x(cvttpd2pi, kInstCvttpd2pi, MmReg, XmmReg) //! @overload INST_2x(cvttpd2pi, kInstCvttpd2pi, MmReg, Mem) - //! @brief Convert with truncation packed DP-FP values to packed qword integers (SSE2). + //! Convert with truncation packed DP-FP to packed QWORDs (SSE2). INST_2x(cvttpd2dq, kInstCvttpd2dq, XmmReg, XmmReg) //! @overload INST_2x(cvttpd2dq, kInstCvttpd2dq, XmmReg, Mem) - //! @brief Convert with truncation packed SP-FP values to packed qword integers (SSE2). + //! Convert with truncation packed SP-FP to packed QWORDs (SSE2). INST_2x(cvttps2dq, kInstCvttps2dq, XmmReg, XmmReg) //! @overload INST_2x(cvttps2dq, kInstCvttps2dq, XmmReg, Mem) - //! @brief Convert with truncation scalar DP-FP value to signed dword integer (SSE2). + //! Convert with truncation scalar DP-FP to signed DWORDs (SSE2). INST_2x(cvttsd2si, kInstCvttsd2si, GpReg, XmmReg) //! @overload INST_2x(cvttsd2si, kInstCvttsd2si, GpReg, Mem) - //! @brief Packed DP-FP divide (SSE2). + //! Packed DP-FP divide (SSE2). INST_2x(divpd, kInstDivpd, XmmReg, XmmReg) //! @overload INST_2x(divpd, kInstDivpd, XmmReg, Mem) - //! @brief Scalar DP-FP divide (SSE2). + //! Scalar DP-FP divide (SSE2). INST_2x(divsd, kInstDivsd, XmmReg, XmmReg) //! @overload INST_2x(divsd, kInstDivsd, XmmReg, Mem) - //! @brief Load fence (SSE2). + //! Load fence (SSE2). INST_0x(lfence, kInstLfence) - //! @brief Store selected bytes of oword (SSE2). - //! - //! @note Target is DS:EDI. + //! Store selected bytes of OWORD to DS:EDI/RDI (SSE2). INST_2x(maskmovdqu, kInstMaskmovdqu, XmmReg, XmmReg) - //! @brief Return maximum packed DP-FP values (SSE2). + //! Packed DP-FP maximum (SSE2). INST_2x(maxpd, kInstMaxpd, XmmReg, XmmReg) //! @overload INST_2x(maxpd, kInstMaxpd, XmmReg, Mem) - //! @brief Return maximum scalar DP-FP value (SSE2). + //! Scalar DP-FP maximum (SSE2). INST_2x(maxsd, kInstMaxsd, XmmReg, XmmReg) //! @overload INST_2x(maxsd, kInstMaxsd, XmmReg, Mem) - //! @brief Memory fence (SSE2). + //! Memory fence (SSE2). INST_0x(mfence, kInstMfence) - //! @brief Return minimum packed DP-FP values (SSE2). + //! Packed DP-FP minimum (SSE2). INST_2x(minpd, kInstMinpd, XmmReg, XmmReg) //! @overload INST_2x(minpd, kInstMinpd, XmmReg, Mem) - //! @brief Return minimum scalar DP-FP value (SSE2). + //! Scalar DP-FP minimum (SSE2). INST_2x(minsd, kInstMinsd, XmmReg, XmmReg) //! @overload INST_2x(minsd, kInstMinsd, XmmReg, Mem) - //! @brief Move aligned oword (SSE2). + //! Move aligned OWORD (SSE2). INST_2x(movdqa, kInstMovdqa, XmmReg, XmmReg) //! @overload INST_2x(movdqa, kInstMovdqa, XmmReg, Mem) //! @overload INST_2x(movdqa, kInstMovdqa, Mem, XmmReg) - //! @brief Move unaligned oword (SSE2). + //! Move unaligned OWORD (SSE2). INST_2x(movdqu, kInstMovdqu, XmmReg, XmmReg) //! @overload INST_2x(movdqu, kInstMovdqu, XmmReg, Mem) //! @overload INST_2x(movdqu, kInstMovdqu, Mem, XmmReg) - //! @brief Extract packed SP-FP sign mask (SSE2). + //! Extract packed SP-FP sign mask (SSE2). INST_2x(movmskps, kInstMovmskps, GpReg, XmmReg) - //! @brief Extract packed DP-FP sign mask (SSE2). + //! Extract packed DP-FP sign mask (SSE2). INST_2x(movmskpd, kInstMovmskpd, GpReg, XmmReg) - //! @brief Move scalar DP-FP value (SSE2). + //! Move scalar DP-FP (SSE2). INST_2x(movsd, kInstMovsd, XmmReg, XmmReg) //! @overload INST_2x(movsd, kInstMovsd, XmmReg, Mem) //! @overload INST_2x(movsd, kInstMovsd, Mem, XmmReg) - //! @brief Move aligned packed DP-FP values (SSE2). + //! Move aligned packed DP-FP (SSE2). INST_2x(movapd, kInstMovapd, XmmReg, XmmReg) //! @overload INST_2x(movapd, kInstMovapd, XmmReg, Mem) //! @overload INST_2x(movapd, kInstMovapd, Mem, XmmReg) - //! @brief Move qword from Xmm to Mm register (SSE2). + //! Move QWORD from XMM to MM register (SSE2). INST_2x(movdq2q, kInstMovdq2q, MmReg, XmmReg) - //! @brief Move qword from Mm to Xmm register (SSE2). + //! Move QWORD from MM to XMM register (SSE2). INST_2x(movq2dq, kInstMovq2dq, XmmReg, MmReg) - //! @brief Move high packed DP-FP value (SSE2). + //! Move high packed DP-FP (SSE2). INST_2x(movhpd, kInstMovhpd, XmmReg, Mem) //! @overload INST_2x(movhpd, kInstMovhpd, Mem, XmmReg) - //! @brief Move low packed DP-FP value (SSE2). + //! Move low packed DP-FP (SSE2). INST_2x(movlpd, kInstMovlpd, XmmReg, Mem) //! @overload INST_2x(movlpd, kInstMovlpd, Mem, XmmReg) - //! @brief Store oword using non-temporal hint (SSE2). + //! Store OWORD using NT hint (SSE2). INST_2x(movntdq, kInstMovntdq, Mem, XmmReg) - //! @brief Store store dword using non-temporal hint (SSE2). + //! Store DWORD using NT hint (SSE2). INST_2x(movnti, kInstMovnti, Mem, GpReg) - //! @brief Store packed DP-FP values using non-temporal hint (SSE2). + //! Store packed DP-FP using NT hint (SSE2). INST_2x(movntpd, kInstMovntpd, Mem, XmmReg) - //! @brief Move unaligned packed DP-FP values (SSE2). + //! Move unaligned packed DP-FP (SSE2). INST_2x(movupd, kInstMovupd, XmmReg, XmmReg) //! @overload INST_2x(movupd, kInstMovupd, XmmReg, Mem) //! @overload INST_2x(movupd, kInstMovupd, Mem, XmmReg) - //! @brief Packed DP-FP multiply (SSE2). + //! Packed DP-FP multiply (SSE2). INST_2x(mulpd, kInstMulpd, XmmReg, XmmReg) //! @overload INST_2x(mulpd, kInstMulpd, XmmReg, Mem) - //! @brief Scalar DP-FP multiply (SSE2). + //! Scalar DP-FP multiply (SSE2). INST_2x(mulsd, kInstMulsd, XmmReg, XmmReg) //! @overload INST_2x(mulsd, kInstMulsd, XmmReg, Mem) - //! @brief Or for DP-FP Data (SSE2). + //! Packed DP-FP bitwise or (SSE2). INST_2x(orpd, kInstOrpd, XmmReg, XmmReg) //! @overload INST_2x(orpd, kInstOrpd, XmmReg, Mem) - //! @brief Pack with signed saturation (SSE2). + //! Pack WORDs to BYTEs with signed saturation (SSE2). INST_2x(packsswb, kInstPacksswb, XmmReg, XmmReg) //! @overload INST_2x(packsswb, kInstPacksswb, XmmReg, Mem) - //! @brief Pack with signed saturation (SSE2). + //! Pack DWORDs to WORDs with signed saturation (SSE2). INST_2x(packssdw, kInstPackssdw, XmmReg, XmmReg) //! @overload INST_2x(packssdw, kInstPackssdw, XmmReg, Mem) - //! @brief Pack with unsigned saturation (SSE2). + //! Pack WORDs to BYTEs with unsigned saturation (SSE2). INST_2x(packuswb, kInstPackuswb, XmmReg, XmmReg) //! @overload INST_2x(packuswb, kInstPackuswb, XmmReg, Mem) - //! @brief Packed byte Add (SSE2). + //! Packed BYTE Add (SSE2). INST_2x(paddb, kInstPaddb, XmmReg, XmmReg) //! @overload INST_2x(paddb, kInstPaddb, XmmReg, Mem) - //! @brief Packed word add (SSE2). + //! Packed WORD add (SSE2). INST_2x(paddw, kInstPaddw, XmmReg, XmmReg) //! @overload INST_2x(paddw, kInstPaddw, XmmReg, Mem) - //! @brief Packed dword add (SSE2). + //! Packed DWORD add (SSE2). INST_2x(paddd, kInstPaddd, XmmReg, XmmReg) //! @overload INST_2x(paddd, kInstPaddd, XmmReg, Mem) - //! @brief Packed qword add (SSE2). + //! Packed QWORD add (SSE2). INST_2x(paddq, kInstPaddq, MmReg, MmReg) //! @overload INST_2x(paddq, kInstPaddq, MmReg, Mem) - //! @brief Packed qword add (SSE2). + //! Packed QWORD add (SSE2). INST_2x(paddq, kInstPaddq, XmmReg, XmmReg) //! @overload INST_2x(paddq, kInstPaddq, XmmReg, Mem) - //! @brief Packed add with saturation (SSE2). + //! Packed BYTE add with saturation (SSE2). INST_2x(paddsb, kInstPaddsb, XmmReg, XmmReg) //! @overload INST_2x(paddsb, kInstPaddsb, XmmReg, Mem) - //! @brief Packed add with saturation (SSE2). + //! Packed WORD add with saturation (SSE2). INST_2x(paddsw, kInstPaddsw, XmmReg, XmmReg) //! @overload INST_2x(paddsw, kInstPaddsw, XmmReg, Mem) - //! @brief Packed add unsigned with saturation (SSE2). + //! Packed BYTE add with unsigned saturation (SSE2). INST_2x(paddusb, kInstPaddusb, XmmReg, XmmReg) //! @overload INST_2x(paddusb, kInstPaddusb, XmmReg, Mem) - //! @brief Packed add unsigned with saturation (SSE2). + //! Packed WORD add with unsigned saturation (SSE2). INST_2x(paddusw, kInstPaddusw, XmmReg, XmmReg) //! @overload INST_2x(paddusw, kInstPaddusw, XmmReg, Mem) - //! @brief And (SSE2). + //! Packed bitwise and (SSE2). INST_2x(pand, kInstPand, XmmReg, XmmReg) //! @overload INST_2x(pand, kInstPand, XmmReg, Mem) - //! @brief And-not (SSE2). + //! Packed bitwise and-not (SSE2). INST_2x(pandn, kInstPandn, XmmReg, XmmReg) //! @overload INST_2x(pandn, kInstPandn, XmmReg, Mem) - //! @brief Spin loop hint (SSE2). + //! Spin loop hint (SSE2). INST_0x(pause, kInstPause) - //! @brief Packed average (SSE2). + //! Packed BYTE average (SSE2). INST_2x(pavgb, kInstPavgb, XmmReg, XmmReg) //! @overload INST_2x(pavgb, kInstPavgb, XmmReg, Mem) - //! @brief Packed average (SSE2). + //! Packed WORD average (SSE2). INST_2x(pavgw, kInstPavgw, XmmReg, XmmReg) //! @overload INST_2x(pavgw, kInstPavgw, XmmReg, Mem) - //! @brief Packed compare bytes for equal (SSE2). + //! Packed BYTE compare for equality (SSE2). INST_2x(pcmpeqb, kInstPcmpeqb, XmmReg, XmmReg) //! @overload INST_2x(pcmpeqb, kInstPcmpeqb, XmmReg, Mem) - //! @brief Packed compare words for equal (SSE2). + //! Packed WORD compare for equality (SSE2). INST_2x(pcmpeqw, kInstPcmpeqw, XmmReg, XmmReg) //! @overload INST_2x(pcmpeqw, kInstPcmpeqw, XmmReg, Mem) - //! @brief Packed compare dwords for equal (SSE2). + //! Packed DWORD compare for equality (SSE2). INST_2x(pcmpeqd, kInstPcmpeqd, XmmReg, XmmReg) //! @overload INST_2x(pcmpeqd, kInstPcmpeqd, XmmReg, Mem) - //! @brief Packed compare bytes for greater than (SSE2). + //! Packed BYTE compare if greater than (SSE2). INST_2x(pcmpgtb, kInstPcmpgtb, XmmReg, XmmReg) //! @overload INST_2x(pcmpgtb, kInstPcmpgtb, XmmReg, Mem) - //! @brief Packed compare words for greater than (SSE2). + //! Packed WORD compare if greater than (SSE2). INST_2x(pcmpgtw, kInstPcmpgtw, XmmReg, XmmReg) //! @overload INST_2x(pcmpgtw, kInstPcmpgtw, XmmReg, Mem) - //! @brief Packed compare dwords for greater than (SSE2). + //! Packed DWORD compare if greater than (SSE2). INST_2x(pcmpgtd, kInstPcmpgtd, XmmReg, XmmReg) //! @overload INST_2x(pcmpgtd, kInstPcmpgtd, XmmReg, Mem) - //! @brief Extract word (SSE2). + //! Extract WORD based on selector (SSE2). INST_3i(pextrw, kInstPextrw, GpReg, XmmReg, Imm) - //! @brief Insert word (SSE2). + //! Insert WORD based on selector (SSE2). INST_3i(pinsrw, kInstPinsrw, XmmReg, GpReg, Imm) //! @overload INST_3i(pinsrw, kInstPinsrw, XmmReg, Mem, Imm) - //! @brief Packed signed integer word maximum (SSE2). + //! Packed WORD maximum (SSE2). INST_2x(pmaxsw, kInstPmaxsw, XmmReg, XmmReg) //! @overload INST_2x(pmaxsw, kInstPmaxsw, XmmReg, Mem) - //! @brief Packed unsigned integer byte maximum (SSE2). + //! Packed BYTE unsigned maximum (SSE2). INST_2x(pmaxub, kInstPmaxub, XmmReg, XmmReg) //! @overload INST_2x(pmaxub, kInstPmaxub, XmmReg, Mem) - //! @brief Packed signed integer word minimum (SSE2). + //! Packed WORD minimum (SSE2). INST_2x(pminsw, kInstPminsw, XmmReg, XmmReg) //! @overload INST_2x(pminsw, kInstPminsw, XmmReg, Mem) - //! @brief Packed unsigned integer byte minimum (SSE2). + //! Packed BYTE unsigned minimum (SSE2). INST_2x(pminub, kInstPminub, XmmReg, XmmReg) //! @overload INST_2x(pminub, kInstPminub, XmmReg, Mem) - //! @brief Move byte mask (SSE2). + //! Move byte mask (SSE2). INST_2x(pmovmskb, kInstPmovmskb, GpReg, XmmReg) - //! @brief Packed multiply high (SSE2). + //! Packed WORD multiply high (SSE2). INST_2x(pmulhw, kInstPmulhw, XmmReg, XmmReg) //! @overload INST_2x(pmulhw, kInstPmulhw, XmmReg, Mem) - //! @brief Packed multiply high unsigned (SSE2). + //! Packed WORD unsigned multiply high (SSE2). INST_2x(pmulhuw, kInstPmulhuw, XmmReg, XmmReg) //! @overload INST_2x(pmulhuw, kInstPmulhuw, XmmReg, Mem) - //! @brief Packed multiply low (SSE2). + //! Packed WORD multiply low (SSE2). INST_2x(pmullw, kInstPmullw, XmmReg, XmmReg) //! @overload INST_2x(pmullw, kInstPmullw, XmmReg, Mem) - //! @brief Packed multiply to qword (SSE2). + //! Packed DWORD multiply to QWORD (SSE2). INST_2x(pmuludq, kInstPmuludq, MmReg, MmReg) //! @overload INST_2x(pmuludq, kInstPmuludq, MmReg, Mem) - //! @brief Packed multiply to qword (SSE2). + //! Packed DWORD multiply to QWORD (SSE2). INST_2x(pmuludq, kInstPmuludq, XmmReg, XmmReg) //! @overload INST_2x(pmuludq, kInstPmuludq, XmmReg, Mem) - //! @brief Or (SSE2). + //! Packed bitwise or (SSE2). INST_2x(por, kInstPor, XmmReg, XmmReg) //! @overload INST_2x(por, kInstPor, XmmReg, Mem) - //! @brief Packed shift left logical (SSE2). + //! Packed DWORD shift left logical (SSE2). INST_2x(pslld, kInstPslld, XmmReg, XmmReg) //! @overload INST_2x(pslld, kInstPslld, XmmReg, Mem) //! @overload INST_2i(pslld, kInstPslld, XmmReg, Imm) - //! @brief Packed shift left logical (SSE2). + //! Packed QWORD shift left logical (SSE2). INST_2x(psllq, kInstPsllq, XmmReg, XmmReg) //! @overload INST_2x(psllq, kInstPsllq, XmmReg, Mem) //! @overload INST_2i(psllq, kInstPsllq, XmmReg, Imm) - //! @brief Packed shift left logical (SSE2). + //! Packed WORD shift left logical (SSE2). INST_2x(psllw, kInstPsllw, XmmReg, XmmReg) //! @overload INST_2x(psllw, kInstPsllw, XmmReg, Mem) //! @overload INST_2i(psllw, kInstPsllw, XmmReg, Imm) - //! @brief Packed shift left logical (SSE2). + //! Packed OWORD shift left logical (SSE2). INST_2i(pslldq, kInstPslldq, XmmReg, Imm) - //! @brief Packed shift right arithmetic (SSE2). + //! Packed DWORD shift right arithmetic (SSE2). INST_2x(psrad, kInstPsrad, XmmReg, XmmReg) //! @overload INST_2x(psrad, kInstPsrad, XmmReg, Mem) //! @overload INST_2i(psrad, kInstPsrad, XmmReg, Imm) - //! @brief Packed shift right arithmetic (SSE2). + //! Packed WORD shift right arithmetic (SSE2). INST_2x(psraw, kInstPsraw, XmmReg, XmmReg) //! @overload INST_2x(psraw, kInstPsraw, XmmReg, Mem) //! @overload INST_2i(psraw, kInstPsraw, XmmReg, Imm) - //! @brief Packed subtract (SSE2). + //! Packed BYTE subtract (SSE2). INST_2x(psubb, kInstPsubb, XmmReg, XmmReg) //! @overload INST_2x(psubb, kInstPsubb, XmmReg, Mem) - //! @brief Packed subtract (SSE2). - INST_2x(psubw, kInstPsubw, XmmReg, XmmReg) - //! @overload - INST_2x(psubw, kInstPsubw, XmmReg, Mem) - - //! @brief Packed subtract (SSE2). + //! Packed DWORD subtract (SSE2). INST_2x(psubd, kInstPsubd, XmmReg, XmmReg) //! @overload INST_2x(psubd, kInstPsubd, XmmReg, Mem) - //! @brief Packed subtract (SSE2). + //! Packed QWORD subtract (SSE2). INST_2x(psubq, kInstPsubq, MmReg, MmReg) //! @overload INST_2x(psubq, kInstPsubq, MmReg, Mem) - //! @brief Packed subtract (SSE2). + //! Packed QWORD subtract (SSE2). INST_2x(psubq, kInstPsubq, XmmReg, XmmReg) //! @overload INST_2x(psubq, kInstPsubq, XmmReg, Mem) - //! @brief Packed multiply and add (SSE2). + //! Packed WORD subtract (SSE2). + INST_2x(psubw, kInstPsubw, XmmReg, XmmReg) + //! @overload + INST_2x(psubw, kInstPsubw, XmmReg, Mem) + + //! Packed WORD to DWORD multiply and add (SSE2). INST_2x(pmaddwd, kInstPmaddwd, XmmReg, XmmReg) //! @overload INST_2x(pmaddwd, kInstPmaddwd, XmmReg, Mem) - //! @brief Shuffle packed dwords (SSE2). + //! Packed DWORD shuffle (SSE2). INST_3i(pshufd, kInstPshufd, XmmReg, XmmReg, Imm) //! @overload INST_3i(pshufd, kInstPshufd, XmmReg, Mem, Imm) - //! @brief Shuffle packed high words (SSE2). + //! Packed WORD shuffle high (SSE2). INST_3i(pshufhw, kInstPshufhw, XmmReg, XmmReg, Imm) //! @overload INST_3i(pshufhw, kInstPshufhw, XmmReg, Mem, Imm) - //! @brief Shuffle packed low Words (SSE2). + //! Packed WORD shuffle low (SSE2). INST_3i(pshuflw, kInstPshuflw, XmmReg, XmmReg, Imm) //! @overload INST_3i(pshuflw, kInstPshuflw, XmmReg, Mem, Imm) - //! @brief Packed shift right logical (SSE2). + //! Packed DWORD shift right logical (SSE2). INST_2x(psrld, kInstPsrld, XmmReg, XmmReg) //! @overload INST_2x(psrld, kInstPsrld, XmmReg, Mem) //! @overload INST_2i(psrld, kInstPsrld, XmmReg, Imm) - //! @brief Packed shift right logical (SSE2). + //! Packed QWORD shift right logical (SSE2). INST_2x(psrlq, kInstPsrlq, XmmReg, XmmReg) //! @overload INST_2x(psrlq, kInstPsrlq, XmmReg, Mem) //! @overload INST_2i(psrlq, kInstPsrlq, XmmReg, Imm) - //! @brief OWord shift right logical (SSE2). + //! Scalar OWORD shift right logical (SSE2). INST_2i(psrldq, kInstPsrldq, XmmReg, Imm) - //! @brief Packed shift right logical (SSE2). + //! Packed WORD shift right logical (SSE2). INST_2x(psrlw, kInstPsrlw, XmmReg, XmmReg) //! @overload INST_2x(psrlw, kInstPsrlw, XmmReg, Mem) //! @overload INST_2i(psrlw, kInstPsrlw, XmmReg, Imm) - //! @brief Packed subtract with saturation (SSE2). + //! Packed BYTE subtract with saturation (SSE2). INST_2x(psubsb, kInstPsubsb, XmmReg, XmmReg) //! @overload INST_2x(psubsb, kInstPsubsb, XmmReg, Mem) - //! @brief Packed subtract with saturation (SSE2). + //! Packed WORD subtract with saturation (SSE2). INST_2x(psubsw, kInstPsubsw, XmmReg, XmmReg) //! @overload INST_2x(psubsw, kInstPsubsw, XmmReg, Mem) - //! @brief Packed subtract with unsigned saturation (SSE2). + //! Packed BYTE subtract with unsigned saturation (SSE2). INST_2x(psubusb, kInstPsubusb, XmmReg, XmmReg) //! @overload INST_2x(psubusb, kInstPsubusb, XmmReg, Mem) - //! @brief Packed subtract with unsigned saturation (SSE2). + //! Packed WORD subtract with unsigned saturation (SSE2). INST_2x(psubusw, kInstPsubusw, XmmReg, XmmReg) //! @overload INST_2x(psubusw, kInstPsubusw, XmmReg, Mem) - //! @brief Unpack high data (SSE2). + //! Unpack high packed BYTEs to WORDs (SSE2). INST_2x(punpckhbw, kInstPunpckhbw, XmmReg, XmmReg) //! @overload INST_2x(punpckhbw, kInstPunpckhbw, XmmReg, Mem) - //! @brief Unpack high data (SSE2). - INST_2x(punpckhwd, kInstPunpckhwd, XmmReg, XmmReg) - //! @overload - INST_2x(punpckhwd, kInstPunpckhwd, XmmReg, Mem) - - //! @brief Unpack high data (SSE2). + //! Unpack high packed DWORDs to QWORDs (SSE2). INST_2x(punpckhdq, kInstPunpckhdq, XmmReg, XmmReg) //! @overload INST_2x(punpckhdq, kInstPunpckhdq, XmmReg, Mem) - //! @brief Unpack high data (SSE2). + //! Unpack high packed QWORDs to OWORD (SSE2). INST_2x(punpckhqdq, kInstPunpckhqdq, XmmReg, XmmReg) //! @overload INST_2x(punpckhqdq, kInstPunpckhqdq, XmmReg, Mem) - //! @brief Unpack low data (SSE2). + //! Unpack high packed WORDs to DWORDs (SSE2). + INST_2x(punpckhwd, kInstPunpckhwd, XmmReg, XmmReg) + //! @overload + INST_2x(punpckhwd, kInstPunpckhwd, XmmReg, Mem) + + //! Unpack low packed BYTEs to WORDs (SSE2). INST_2x(punpcklbw, kInstPunpcklbw, XmmReg, XmmReg) //! @overload INST_2x(punpcklbw, kInstPunpcklbw, XmmReg, Mem) - //! @brief Unpack low data (SSE2). - INST_2x(punpcklwd, kInstPunpcklwd, XmmReg, XmmReg) - //! @overload - INST_2x(punpcklwd, kInstPunpcklwd, XmmReg, Mem) - - //! @brief Unpack low data (SSE2). + //! Unpack low packed DWORDs to QWORDs (SSE2). INST_2x(punpckldq, kInstPunpckldq, XmmReg, XmmReg) //! @overload INST_2x(punpckldq, kInstPunpckldq, XmmReg, Mem) - //! @brief Unpack low data (SSE2). + //! Unpack low packed QWORDs to OWORD (SSE2). INST_2x(punpcklqdq, kInstPunpcklqdq, XmmReg, XmmReg) //! @overload INST_2x(punpcklqdq, kInstPunpcklqdq, XmmReg, Mem) - //! @brief Xor (SSE2). + //! Unpack low packed WORDs to DWORDs (SSE2). + INST_2x(punpcklwd, kInstPunpcklwd, XmmReg, XmmReg) + //! @overload + INST_2x(punpcklwd, kInstPunpcklwd, XmmReg, Mem) + + //! Packed bitwise xor (SSE2). INST_2x(pxor, kInstPxor, XmmReg, XmmReg) //! @overload INST_2x(pxor, kInstPxor, XmmReg, Mem) - //! @brief Shuffle DP-FP (SSE2). + //! Shuffle DP-FP (SSE2). INST_3i(shufpd, kInstShufpd, XmmReg, XmmReg, Imm) //! @overload INST_3i(shufpd, kInstShufpd, XmmReg, Mem, Imm) - //! @brief Compute square roots of packed DP-FP Values (SSE2). + //! Packed DP-FP square root (SSE2). INST_2x(sqrtpd, kInstSqrtpd, XmmReg, XmmReg) //! @overload INST_2x(sqrtpd, kInstSqrtpd, XmmReg, Mem) - //! @brief Compute square root of scalar DP-FP value (SSE2). + //! Scalar DP-FP square root (SSE2). INST_2x(sqrtsd, kInstSqrtsd, XmmReg, XmmReg) //! @overload INST_2x(sqrtsd, kInstSqrtsd, XmmReg, Mem) - //! @brief Packed DP-FP subtract (SSE2). + //! Packed DP-FP subtract (SSE2). INST_2x(subpd, kInstSubpd, XmmReg, XmmReg) //! @overload INST_2x(subpd, kInstSubpd, XmmReg, Mem) - //! @brief Scalar DP-FP subtract (SSE2). + //! Scalar DP-FP subtract (SSE2). INST_2x(subsd, kInstSubsd, XmmReg, XmmReg) //! @overload INST_2x(subsd, kInstSubsd, XmmReg, Mem) - //! @brief Scalar unordered DP-FP compare and set EFLAGS (SSE2). + //! Scalar DP-FP unordered compare and set EFLAGS (SSE2). INST_2x(ucomisd, kInstUcomisd, XmmReg, XmmReg) //! @overload INST_2x(ucomisd, kInstUcomisd, XmmReg, Mem) - //! @brief Unpack and interleave high packed DP-FP values (SSE2). + //! Unpack and interleave high packed DP-FP (SSE2). INST_2x(unpckhpd, kInstUnpckhpd, XmmReg, XmmReg) //! @overload INST_2x(unpckhpd, kInstUnpckhpd, XmmReg, Mem) - //! @brief Unpack and interleave low packed DP-FP values (SSE2). + //! Unpack and interleave low packed DP-FP (SSE2). INST_2x(unpcklpd, kInstUnpcklpd, XmmReg, XmmReg) //! @overload INST_2x(unpcklpd, kInstUnpcklpd, XmmReg, Mem) - //! @brief Xor for DP-FP data (SSE2). + //! Packed DP-FP bitwise xor (SSE2). INST_2x(xorpd, kInstXorpd, XmmReg, XmmReg) //! @overload INST_2x(xorpd, kInstXorpd, XmmReg, Mem) @@ -2883,223 +2877,223 @@ struct X86X64Assembler : public BaseAssembler { // [SSE3] // -------------------------------------------------------------------------- - //! @brief Packed DP-FP add/subtract (SSE3). + //! Packed DP-FP add/subtract (SSE3). INST_2x(addsubpd, kInstAddsubpd, XmmReg, XmmReg) //! @overload INST_2x(addsubpd, kInstAddsubpd, XmmReg, Mem) - //! @brief Packed SP-FP add/subtract (SSE3). + //! Packed SP-FP add/subtract (SSE3). INST_2x(addsubps, kInstAddsubps, XmmReg, XmmReg) //! @overload INST_2x(addsubps, kInstAddsubps, XmmReg, Mem) - //! @brief Store integer with truncation (SSE3). + //! Store integer with truncation (SSE3). INST_1x(fisttp, kInstFisttp, Mem) - //! @brief Packed DP-FP horizontal add (SSE3). + //! Packed DP-FP horizontal add (SSE3). INST_2x(haddpd, kInstHaddpd, XmmReg, XmmReg) //! @overload INST_2x(haddpd, kInstHaddpd, XmmReg, Mem) - //! @brief Packed SP-FP horizontal add (SSE3). + //! Packed SP-FP horizontal add (SSE3). INST_2x(haddps, kInstHaddps, XmmReg, XmmReg) //! @overload INST_2x(haddps, kInstHaddps, XmmReg, Mem) - //! @brief Packed DP-FP horizontal subtract (SSE3). + //! Packed DP-FP horizontal subtract (SSE3). INST_2x(hsubpd, kInstHsubpd, XmmReg, XmmReg) //! @overload INST_2x(hsubpd, kInstHsubpd, XmmReg, Mem) - //! @brief Packed SP-FP horizontal subtract (SSE3). + //! Packed SP-FP horizontal subtract (SSE3). INST_2x(hsubps, kInstHsubps, XmmReg, XmmReg) //! @overload INST_2x(hsubps, kInstHsubps, XmmReg, Mem) - //! @brief Load unaligned integer 128 bits (SSE3). + //! Load 128-bits unaligned (SSE3). INST_2x(lddqu, kInstLddqu, XmmReg, Mem) - //! @brief Setup monitor address (SSE3). + //! Setup monitor address (SSE3). INST_0x(monitor, kInstMonitor) - //! @brief Move one DP-FP and duplicate (SSE3). + //! Move one DP-FP and duplicate (SSE3). INST_2x(movddup, kInstMovddup, XmmReg, XmmReg) //! @overload INST_2x(movddup, kInstMovddup, XmmReg, Mem) - //! @brief Move packed SP-FP high and duplicate (SSE3). + //! Move packed SP-FP high and duplicate (SSE3). INST_2x(movshdup, kInstMovshdup, XmmReg, XmmReg) //! @overload INST_2x(movshdup, kInstMovshdup, XmmReg, Mem) - //! @brief Move packed SP-FP low and duplicate (SSE3). + //! Move packed SP-FP low and duplicate (SSE3). INST_2x(movsldup, kInstMovsldup, XmmReg, XmmReg) //! @overload INST_2x(movsldup, kInstMovsldup, XmmReg, Mem) - //! @brief Monitor wait (SSE3). + //! Monitor wait (SSE3). INST_0x(mwait, kInstMwait) // -------------------------------------------------------------------------- // [SSSE3] // -------------------------------------------------------------------------- - //! @brief Packed sign (SSSE3). + //! Packed BYTE sign (SSSE3). INST_2x(psignb, kInstPsignb, MmReg, MmReg) //! @overload INST_2x(psignb, kInstPsignb, MmReg, Mem) - //! @brief Packed sign (SSSE3). + //! Packed BYTE sign (SSSE3). INST_2x(psignb, kInstPsignb, XmmReg, XmmReg) //! @overload INST_2x(psignb, kInstPsignb, XmmReg, Mem) - //! @brief Packed sign (SSSE3). - INST_2x(psignw, kInstPsignw, MmReg, MmReg) - //! @overload - INST_2x(psignw, kInstPsignw, MmReg, Mem) - - //! @brief Packed sign (SSSE3). - INST_2x(psignw, kInstPsignw, XmmReg, XmmReg) - //! @overload - INST_2x(psignw, kInstPsignw, XmmReg, Mem) - - //! @brief Packed sign (SSSE3). + //! Packed DWORD sign (SSSE3). INST_2x(psignd, kInstPsignd, MmReg, MmReg) //! @overload INST_2x(psignd, kInstPsignd, MmReg, Mem) - //! @brief Packed sign (SSSE3). + //! Packed DWORD sign (SSSE3). INST_2x(psignd, kInstPsignd, XmmReg, XmmReg) //! @overload INST_2x(psignd, kInstPsignd, XmmReg, Mem) - //! @brief Packed horizontal add (SSSE3). - INST_2x(phaddw, kInstPhaddw, MmReg, MmReg) + //! Packed WORD sign (SSSE3). + INST_2x(psignw, kInstPsignw, MmReg, MmReg) //! @overload - INST_2x(phaddw, kInstPhaddw, MmReg, Mem) + INST_2x(psignw, kInstPsignw, MmReg, Mem) - //! @brief Packed horizontal add (SSSE3). - INST_2x(phaddw, kInstPhaddw, XmmReg, XmmReg) + //! Packed WORD sign (SSSE3). + INST_2x(psignw, kInstPsignw, XmmReg, XmmReg) //! @overload - INST_2x(phaddw, kInstPhaddw, XmmReg, Mem) + INST_2x(psignw, kInstPsignw, XmmReg, Mem) - //! @brief Packed horizontal add (SSSE3). + //! Packed DWORD horizontal add (SSSE3). INST_2x(phaddd, kInstPhaddd, MmReg, MmReg) //! @overload INST_2x(phaddd, kInstPhaddd, MmReg, Mem) - //! @brief Packed horizontal add (SSSE3). + //! Packed DWORD horizontal add (SSSE3). INST_2x(phaddd, kInstPhaddd, XmmReg, XmmReg) //! @overload INST_2x(phaddd, kInstPhaddd, XmmReg, Mem) - //! @brief Packed horizontal add and saturate (SSSE3). + //! Packed WORD horizontal add with saturation (SSSE3). INST_2x(phaddsw, kInstPhaddsw, MmReg, MmReg) //! @overload INST_2x(phaddsw, kInstPhaddsw, MmReg, Mem) - //! @brief Packed horizontal add and saturate (SSSE3). + //! Packed WORD horizontal add with saturation (SSSE3). INST_2x(phaddsw, kInstPhaddsw, XmmReg, XmmReg) //! @overload INST_2x(phaddsw, kInstPhaddsw, XmmReg, Mem) - //! @brief Packed horizontal subtract (SSSE3). - INST_2x(phsubw, kInstPhsubw, MmReg, MmReg) + //! Packed WORD horizontal add (SSSE3). + INST_2x(phaddw, kInstPhaddw, MmReg, MmReg) //! @overload - INST_2x(phsubw, kInstPhsubw, MmReg, Mem) + INST_2x(phaddw, kInstPhaddw, MmReg, Mem) - //! @brief Packed horizontal subtract (SSSE3). - INST_2x(phsubw, kInstPhsubw, XmmReg, XmmReg) + //! Packed WORD horizontal add (SSSE3). + INST_2x(phaddw, kInstPhaddw, XmmReg, XmmReg) //! @overload - INST_2x(phsubw, kInstPhsubw, XmmReg, Mem) + INST_2x(phaddw, kInstPhaddw, XmmReg, Mem) - //! @brief Packed horizontal subtract (SSSE3). + //! Packed DWORD horizontal subtract (SSSE3). INST_2x(phsubd, kInstPhsubd, MmReg, MmReg) //! @overload INST_2x(phsubd, kInstPhsubd, MmReg, Mem) - //! @brief Packed horizontal subtract (SSSE3). + //! Packed DWORD horizontal subtract (SSSE3). INST_2x(phsubd, kInstPhsubd, XmmReg, XmmReg) //! @overload INST_2x(phsubd, kInstPhsubd, XmmReg, Mem) - //! @brief Packed horizontal subtract and saturate (SSSE3). + //! Packed WORD horizontal subtract with saturation (SSSE3). INST_2x(phsubsw, kInstPhsubsw, MmReg, MmReg) //! @overload INST_2x(phsubsw, kInstPhsubsw, MmReg, Mem) - //! @brief Packed horizontal subtract and saturate (SSSE3). + //! Packed WORD horizontal subtract with saturation (SSSE3). INST_2x(phsubsw, kInstPhsubsw, XmmReg, XmmReg) //! @overload INST_2x(phsubsw, kInstPhsubsw, XmmReg, Mem) - //! @brief Multiply and add packed signed and unsigned bytes (SSSE3). + //! Packed WORD horizontal subtract (SSSE3). + INST_2x(phsubw, kInstPhsubw, MmReg, MmReg) + //! @overload + INST_2x(phsubw, kInstPhsubw, MmReg, Mem) + + //! Packed WORD horizontal subtract (SSSE3). + INST_2x(phsubw, kInstPhsubw, XmmReg, XmmReg) + //! @overload + INST_2x(phsubw, kInstPhsubw, XmmReg, Mem) + + //! Packed multiply and add signed and unsigned bytes (SSSE3). INST_2x(pmaddubsw, kInstPmaddubsw, MmReg, MmReg) //! @overload INST_2x(pmaddubsw, kInstPmaddubsw, MmReg, Mem) - //! @brief Multiply and add packed signed and unsigned bytes (SSSE3). + //! Packed multiply and add signed and unsigned bytes (SSSE3). INST_2x(pmaddubsw, kInstPmaddubsw, XmmReg, XmmReg) //! @overload INST_2x(pmaddubsw, kInstPmaddubsw, XmmReg, Mem) - //! @brief Packed absolute value (SSSE3). + //! Packed BYTE absolute value (SSSE3). INST_2x(pabsb, kInstPabsb, MmReg, MmReg) //! @overload INST_2x(pabsb, kInstPabsb, MmReg, Mem) - //! @brief Packed absolute value (SSSE3). + //! Packed BYTE absolute value (SSSE3). INST_2x(pabsb, kInstPabsb, XmmReg, XmmReg) //! @overload INST_2x(pabsb, kInstPabsb, XmmReg, Mem) - //! @brief Packed absolute value (SSSE3). - INST_2x(pabsw, kInstPabsw, MmReg, MmReg) - //! @overload - INST_2x(pabsw, kInstPabsw, MmReg, Mem) - - //! @brief Packed absolute value (SSSE3). - INST_2x(pabsw, kInstPabsw, XmmReg, XmmReg) - //! @overload - INST_2x(pabsw, kInstPabsw, XmmReg, Mem) - - //! @brief Packed absolute value (SSSE3). + //! Packed DWORD absolute value (SSSE3). INST_2x(pabsd, kInstPabsd, MmReg, MmReg) //! @overload INST_2x(pabsd, kInstPabsd, MmReg, Mem) - //! @brief Packed absolute value (SSSE3). + //! Packed DWORD absolute value (SSSE3). INST_2x(pabsd, kInstPabsd, XmmReg, XmmReg) //! @overload INST_2x(pabsd, kInstPabsd, XmmReg, Mem) - //! @brief Packed multiply high with round and scale (SSSE3). + //! Packed WORD absolute value (SSSE3). + INST_2x(pabsw, kInstPabsw, MmReg, MmReg) + //! @overload + INST_2x(pabsw, kInstPabsw, MmReg, Mem) + + //! Packed WORD absolute value (SSSE3). + INST_2x(pabsw, kInstPabsw, XmmReg, XmmReg) + //! @overload + INST_2x(pabsw, kInstPabsw, XmmReg, Mem) + + //! Packed WORD multiply high, round and scale (SSSE3). INST_2x(pmulhrsw, kInstPmulhrsw, MmReg, MmReg) //! @overload INST_2x(pmulhrsw, kInstPmulhrsw, MmReg, Mem) - //! @brief Packed multiply high with round and scale (SSSE3). + //! Packed WORD multiply high, round and scale (SSSE3). INST_2x(pmulhrsw, kInstPmulhrsw, XmmReg, XmmReg) //! @overload INST_2x(pmulhrsw, kInstPmulhrsw, XmmReg, Mem) - //! @brief Packed shuffle bytes (SSSE3). + //! Packed BYTE shuffle (SSSE3). INST_2x(pshufb, kInstPshufb, MmReg, MmReg) //! @overload INST_2x(pshufb, kInstPshufb, MmReg, Mem) - //! @brief Packed shuffle bytes (SSSE3). + //! Packed BYTE shuffle (SSSE3). INST_2x(pshufb, kInstPshufb, XmmReg, XmmReg) //! @overload INST_2x(pshufb, kInstPshufb, XmmReg, Mem) - //! @brief Packed shuffle bytes (SSSE3). + //! Packed align right (SSSE3). INST_3i(palignr, kInstPalignr, MmReg, MmReg, Imm) //! @overload INST_3i(palignr, kInstPalignr, MmReg, Mem, Imm) - //! @brief Packed shuffle bytes (SSSE3). + //! Packed align right (SSSE3). INST_3i(palignr, kInstPalignr, XmmReg, XmmReg, Imm) //! @overload INST_3i(palignr, kInstPalignr, XmmReg, Mem, Imm) @@ -3108,267 +3102,272 @@ struct X86X64Assembler : public BaseAssembler { // [SSE4.1] // -------------------------------------------------------------------------- - //! @brief Blend packed DP-FP values (SSE4.1). + //! Packed DP-FP blend (SSE4.1). INST_3i(blendpd, kInstBlendpd, XmmReg, XmmReg, Imm) //! @overload INST_3i(blendpd, kInstBlendpd, XmmReg, Mem, Imm) - //! @brief Blend packed SP-FP values (SSE4.1). + //! Packed SP-FP blend (SSE4.1). INST_3i(blendps, kInstBlendps, XmmReg, XmmReg, Imm) //! @overload INST_3i(blendps, kInstBlendps, XmmReg, Mem, Imm) - //! @brief Variable blend packed DP-FP values (SSE4.1). + //! Packed DP-FP variable blend (SSE4.1). INST_2x(blendvpd, kInstBlendvpd, XmmReg, XmmReg) //! @overload INST_2x(blendvpd, kInstBlendvpd, XmmReg, Mem) - //! @brief Variable blend packed SP-FP values (SSE4.1). + //! Packed SP-FP variable blend (SSE4.1). INST_2x(blendvps, kInstBlendvps, XmmReg, XmmReg) //! @overload INST_2x(blendvps, kInstBlendvps, XmmReg, Mem) - //! @brief Dot product of packed DP-FP values (SSE4.1). + //! Packed DP-FP dot product (SSE4.1). INST_3i(dppd, kInstDppd, XmmReg, XmmReg, Imm) //! @overload INST_3i(dppd, kInstDppd, XmmReg, Mem, Imm) - //! @brief Dot product of packed SP-FP values (SSE4.1). + //! Packed SP-FP dot product (SSE4.1). INST_3i(dpps, kInstDpps, XmmReg, XmmReg, Imm) //! @overload INST_3i(dpps, kInstDpps, XmmReg, Mem, Imm) - //! @brief Extract packed SP-FP value (SSE4.1). + //! Extract SP-FP based on selector (SSE4.1). INST_3i(extractps, kInstExtractps, GpReg, XmmReg, Imm) //! @overload INST_3i(extractps, kInstExtractps, Mem, XmmReg, Imm) - //! @brief Load oword non-temporal aligned hint (SSE4.1). + //! Insert SP-FP based on selector (SSE4.1). + INST_3i(insertps, kInstInsertps, XmmReg, XmmReg, Imm) + //! @overload + INST_3i(insertps, kInstInsertps, XmmReg, Mem, Imm) + + //! Load OWORD aligned using NT hint (SSE4.1). INST_2x(movntdqa, kInstMovntdqa, XmmReg, Mem) - //! @brief Compute multiple packed sums of absolute difference (SSE4.1). + //! Packed WORD sums of absolute difference (SSE4.1). INST_3i(mpsadbw, kInstMpsadbw, XmmReg, XmmReg, Imm) //! @overload INST_3i(mpsadbw, kInstMpsadbw, XmmReg, Mem, Imm) - //! @brief Pack with unsigned saturation (SSE4.1). + //! Pack DWORDs to WORDs with unsigned saturation (SSE4.1). INST_2x(packusdw, kInstPackusdw, XmmReg, XmmReg) //! @overload INST_2x(packusdw, kInstPackusdw, XmmReg, Mem) - //! @brief Variable blend packed bytes (SSE4.1). + //! Packed BYTE variable blend (SSE4.1). INST_2x(pblendvb, kInstPblendvb, XmmReg, XmmReg) //! @overload INST_2x(pblendvb, kInstPblendvb, XmmReg, Mem) - //! @brief Blend packed words (SSE4.1). + //! Packed WORD blend (SSE4.1). INST_3i(pblendw, kInstPblendw, XmmReg, XmmReg, Imm) //! @overload INST_3i(pblendw, kInstPblendw, XmmReg, Mem, Imm) - //! @brief Compare packed qword data for equal (SSE4.1). + //! Packed QWORD compare for equality (SSE4.1). INST_2x(pcmpeqq, kInstPcmpeqq, XmmReg, XmmReg) //! @overload INST_2x(pcmpeqq, kInstPcmpeqq, XmmReg, Mem) - //! @brief Extract byte (SSE4.1). + //! Extract BYTE based on selector (SSE4.1). INST_3i(pextrb, kInstPextrb, GpReg, XmmReg, Imm) //! @overload INST_3i(pextrb, kInstPextrb, Mem, XmmReg, Imm) - //! @brief Extract dword (SSE4.1). + //! Extract DWORD based on selector (SSE4.1). INST_3i(pextrd, kInstPextrd, GpReg, XmmReg, Imm) //! @overload INST_3i(pextrd, kInstPextrd, Mem, XmmReg, Imm) - //! @brief Extract qword (SSE4.1). + //! Extract QWORD based on selector (SSE4.1). INST_3i(pextrq, kInstPextrq, GpReg, XmmReg, Imm) //! @overload INST_3i(pextrq, kInstPextrq, Mem, XmmReg, Imm) - //! @brief Extract word (SSE4.1). + //! Extract WORD based on selector (SSE4.1). INST_3i(pextrw, kInstPextrw, Mem, XmmReg, Imm) - //! @brief Packed horizontal word minimum (SSE4.1). + //! Packed WORD horizontal minimum (SSE4.1). INST_2x(phminposuw, kInstPhminposuw, XmmReg, XmmReg) //! @overload INST_2x(phminposuw, kInstPhminposuw, XmmReg, Mem) - //! @brief Insert byte (SSE4.1). + //! Insert BYTE based on selector (SSE4.1). INST_3i(pinsrb, kInstPinsrb, XmmReg, GpReg, Imm) //! @overload INST_3i(pinsrb, kInstPinsrb, XmmReg, Mem, Imm) - //! @brief Insert dword (SSE4.1). + //! Insert DWORD based on selector (SSE4.1). INST_3i(pinsrd, kInstPinsrd, XmmReg, GpReg, Imm) //! @overload INST_3i(pinsrd, kInstPinsrd, XmmReg, Mem, Imm) - //! @brief Insert qword (SSE4.1). + //! Insert QWORD based on selector (SSE4.1). INST_3i(pinsrq, kInstPinsrq, XmmReg, GpReg, Imm) //! @overload INST_3i(pinsrq, kInstPinsrq, XmmReg, Mem, Imm) - //! @brief Maximum of packed word integers (SSE4.1). - INST_2x(pmaxuw, kInstPmaxuw, XmmReg, XmmReg) - //! @overload - INST_2x(pmaxuw, kInstPmaxuw, XmmReg, Mem) - - //! @brief Maximum of packed signed byte integers (SSE4.1). + //! Packed BYTE maximum (SSE4.1). INST_2x(pmaxsb, kInstPmaxsb, XmmReg, XmmReg) //! @overload INST_2x(pmaxsb, kInstPmaxsb, XmmReg, Mem) - //! @brief Maximum of packed signed dword integers (SSE4.1). + //! Packed DWORD maximum (SSE4.1). INST_2x(pmaxsd, kInstPmaxsd, XmmReg, XmmReg) //! @overload INST_2x(pmaxsd, kInstPmaxsd, XmmReg, Mem) - //! @brief Maximum of packed unsigned dword integers (SSE4.1). + //! Packed DWORD unsigned maximum (SSE4.1). INST_2x(pmaxud, kInstPmaxud, XmmReg, XmmReg) //! @overload INST_2x(pmaxud,kInstPmaxud , XmmReg, Mem) - //! @brief Minimum of packed signed byte integers (SSE4.1). + //! Packed WORD unsigned maximum (SSE4.1). + INST_2x(pmaxuw, kInstPmaxuw, XmmReg, XmmReg) + //! @overload + INST_2x(pmaxuw, kInstPmaxuw, XmmReg, Mem) + + //! Packed BYTE minimum (SSE4.1). INST_2x(pminsb, kInstPminsb, XmmReg, XmmReg) //! @overload INST_2x(pminsb, kInstPminsb, XmmReg, Mem) - //! @brief Minimum of packed word integers (SSE4.1). - INST_2x(pminuw, kInstPminuw, XmmReg, XmmReg) - //! @overload - INST_2x(pminuw, kInstPminuw, XmmReg, Mem) - - //! @brief Minimum of packed dword integers (SSE4.1). - INST_2x(pminud, kInstPminud, XmmReg, XmmReg) - //! @overload - INST_2x(pminud, kInstPminud, XmmReg, Mem) - - //! @brief Minimum of packed dword integers (SSE4.1). + //! Packed DWORD minimum (SSE4.1). INST_2x(pminsd, kInstPminsd, XmmReg, XmmReg) //! @overload INST_2x(pminsd, kInstPminsd, XmmReg, Mem) - //! @brief Packed move with sign extend (SSE4.1). - INST_2x(pmovsxbw, kInstPmovsxbw, XmmReg, XmmReg) + //! Packed WORD unsigned minimum (SSE4.1). + INST_2x(pminuw, kInstPminuw, XmmReg, XmmReg) //! @overload - INST_2x(pmovsxbw, kInstPmovsxbw, XmmReg, Mem) + INST_2x(pminuw, kInstPminuw, XmmReg, Mem) - //! @brief Packed move with sign extend (SSE4.1). + //! Packed DWORD unsigned minimum (SSE4.1). + INST_2x(pminud, kInstPminud, XmmReg, XmmReg) + //! @overload + INST_2x(pminud, kInstPminud, XmmReg, Mem) + + //! BYTE to DWORD with sign extend (SSE4.1). INST_2x(pmovsxbd, kInstPmovsxbd, XmmReg, XmmReg) //! @overload INST_2x(pmovsxbd, kInstPmovsxbd, XmmReg, Mem) - //! @brief Packed move with sign extend (SSE4.1). + //! Packed BYTE to QWORD with sign extend (SSE4.1). INST_2x(pmovsxbq, kInstPmovsxbq, XmmReg, XmmReg) //! @overload INST_2x(pmovsxbq, kInstPmovsxbq, XmmReg, Mem) - //! @brief Packed move with sign extend (SSE4.1). - INST_2x(pmovsxwd, kInstPmovsxwd, XmmReg, XmmReg) + //! Packed BYTE to WORD with sign extend (SSE4.1). + INST_2x(pmovsxbw, kInstPmovsxbw, XmmReg, XmmReg) //! @overload - INST_2x(pmovsxwd, kInstPmovsxwd, XmmReg, Mem) + INST_2x(pmovsxbw, kInstPmovsxbw, XmmReg, Mem) - //! @brief (SSE4.1). - INST_2x(pmovsxwq, kInstPmovsxwq, XmmReg, XmmReg) - //! @overload - INST_2x(pmovsxwq, kInstPmovsxwq, XmmReg, Mem) - - //! @brief (SSE4.1). + //! Packed DWORD to QWORD with sign extend (SSE4.1). INST_2x(pmovsxdq, kInstPmovsxdq, XmmReg, XmmReg) //! @overload INST_2x(pmovsxdq, kInstPmovsxdq, XmmReg, Mem) - //! @brief Packed move with zero extend (SSE4.1). - INST_2x(pmovzxbw, kInstPmovzxbw, XmmReg, XmmReg) + //! Packed WORD to DWORD with sign extend (SSE4.1). + INST_2x(pmovsxwd, kInstPmovsxwd, XmmReg, XmmReg) //! @overload - INST_2x(pmovzxbw, kInstPmovzxbw, XmmReg, Mem) + INST_2x(pmovsxwd, kInstPmovsxwd, XmmReg, Mem) - //! @brief Packed move with zero extend (SSE4.1). + //! Packed WORD to QWORD with sign extend (SSE4.1). + INST_2x(pmovsxwq, kInstPmovsxwq, XmmReg, XmmReg) + //! @overload + INST_2x(pmovsxwq, kInstPmovsxwq, XmmReg, Mem) + + //! BYTE to DWORD with zero extend (SSE4.1). INST_2x(pmovzxbd, kInstPmovzxbd, XmmReg, XmmReg) //! @overload INST_2x(pmovzxbd, kInstPmovzxbd, XmmReg, Mem) - //! @brief Packed move with zero extend (SSE4.1). + //! Packed BYTE to QWORD with zero extend (SSE4.1). INST_2x(pmovzxbq, kInstPmovzxbq, XmmReg, XmmReg) //! @overload INST_2x(pmovzxbq, kInstPmovzxbq, XmmReg, Mem) - //! @brief Packed move with zero extend (SSE4.1). - INST_2x(pmovzxwd, kInstPmovzxwd, XmmReg, XmmReg) + //! BYTE to WORD with zero extend (SSE4.1). + INST_2x(pmovzxbw, kInstPmovzxbw, XmmReg, XmmReg) //! @overload - INST_2x(pmovzxwd, kInstPmovzxwd, XmmReg, Mem) + INST_2x(pmovzxbw, kInstPmovzxbw, XmmReg, Mem) - //! @brief (SSE4.1). - INST_2x(pmovzxwq, kInstPmovzxwq, XmmReg, XmmReg) - //! @overload - INST_2x(pmovzxwq, kInstPmovzxwq, XmmReg, Mem) - - //! @brief (SSE4.1). + //! Packed DWORD to QWORD with zero extend (SSE4.1). INST_2x(pmovzxdq, kInstPmovzxdq, XmmReg, XmmReg) //! @overload INST_2x(pmovzxdq, kInstPmovzxdq, XmmReg, Mem) - //! @brief Multiply packed signed qword integers (SSE4.1). + //! Packed WORD to DWORD with zero extend (SSE4.1). + INST_2x(pmovzxwd, kInstPmovzxwd, XmmReg, XmmReg) + //! @overload + INST_2x(pmovzxwd, kInstPmovzxwd, XmmReg, Mem) + + //! Packed WORD to QWORD with zero extend (SSE4.1). + INST_2x(pmovzxwq, kInstPmovzxwq, XmmReg, XmmReg) + //! @overload + INST_2x(pmovzxwq, kInstPmovzxwq, XmmReg, Mem) + + //! Packed DWORD to QWORD multiply (SSE4.1). INST_2x(pmuldq, kInstPmuldq, XmmReg, XmmReg) //! @overload INST_2x(pmuldq, kInstPmuldq, XmmReg, Mem) - //! @brief Multiply packed signed integers and store low result (SSE4.1). + //! Packed DWORD multiply low (SSE4.1). INST_2x(pmulld, kInstPmulld, XmmReg, XmmReg) //! @overload INST_2x(pmulld, kInstPmulld, XmmReg, Mem) - //! @brief Logical compare (SSE4.1). + //! Logical compare (SSE4.1). INST_2x(ptest, kInstPtest, XmmReg, XmmReg) //! @overload INST_2x(ptest, kInstPtest, XmmReg, Mem) - //! @brief Round packed SP-FP values (SSE4.1). - INST_3i(roundps, kInstRoundps, XmmReg, XmmReg, Imm) - //! @overload - INST_3i(roundps, kInstRoundps, XmmReg, Mem, Imm) - - //! @brief Round scalar SP-FP values (SSE4.1). - INST_3i(roundss, kInstRoundss, XmmReg, XmmReg, Imm) - //! @overload - INST_3i(roundss, kInstRoundss, XmmReg, Mem, Imm) - - //! @brief Round packed DP-FP values (SSE4.1). + //! Packed DP-FP round (SSE4.1). INST_3i(roundpd, kInstRoundpd, XmmReg, XmmReg, Imm) //! @overload INST_3i(roundpd, kInstRoundpd, XmmReg, Mem, Imm) - //! @brief Round scalar DP-FP values (SSE4.1). + //! Packed SP-FP round (SSE4.1). + INST_3i(roundps, kInstRoundps, XmmReg, XmmReg, Imm) + //! @overload + INST_3i(roundps, kInstRoundps, XmmReg, Mem, Imm) + + //! Scalar DP-FP round (SSE4.1). INST_3i(roundsd, kInstRoundsd, XmmReg, XmmReg, Imm) //! @overload INST_3i(roundsd, kInstRoundsd, XmmReg, Mem, Imm) + //! Scalar SP-FP round (SSE4.1). + INST_3i(roundss, kInstRoundss, XmmReg, XmmReg, Imm) + //! @overload + INST_3i(roundss, kInstRoundss, XmmReg, Mem, Imm) + // -------------------------------------------------------------------------- // [SSE4.2] // -------------------------------------------------------------------------- - //! @brief Packed compare explicit length strings, return index (SSE4.2). + //! Packed compare explicit length strings, return index (SSE4.2). INST_3i(pcmpestri, kInstPcmpestri, XmmReg, XmmReg, Imm) //! @overload INST_3i(pcmpestri, kInstPcmpestri, XmmReg, Mem, Imm) - //! @brief Packed compare explicit length strings, return mask (SSE4.2). + //! Packed compare explicit length strings, return mask (SSE4.2). INST_3i(pcmpestrm, kInstPcmpestrm, XmmReg, XmmReg, Imm) //! @overload INST_3i(pcmpestrm, kInstPcmpestrm, XmmReg, Mem, Imm) - //! @brief Packed compare implicit length strings, return index (SSE4.2). + //! Packed compare implicit length strings, return index (SSE4.2). INST_3i(pcmpistri, kInstPcmpistri, XmmReg, XmmReg, Imm) //! @overload INST_3i(pcmpistri, kInstPcmpistri, XmmReg, Mem, Imm) - //! @brief Packed compare implicit length strings, return mask (SSE4.2). + //! Packed compare implicit length strings, return mask (SSE4.2). INST_3i(pcmpistrm, kInstPcmpistrm, XmmReg, XmmReg, Imm) //! @overload INST_3i(pcmpistrm, kInstPcmpistrm, XmmReg, Mem, Imm) - //! @brief Compare packed data for greater than (SSE4.2). + //! Packed QWORD compare if greater than (SSE4.2). INST_2x(pcmpgtq, kInstPcmpgtq, XmmReg, XmmReg) //! @overload INST_2x(pcmpgtq, kInstPcmpgtq, XmmReg, Mem) @@ -3377,32 +3376,32 @@ struct X86X64Assembler : public BaseAssembler { // [AESNI] // -------------------------------------------------------------------------- - //! @brief Perform a single round of the AES decryption flow. + //! Perform a single round of the AES decryption flow (AESNI). INST_2x(aesdec, kInstAesdec, XmmReg, XmmReg) //! @overload INST_2x(aesdec, kInstAesdec, XmmReg, Mem) - //! @brief Perform the last round of the AES decryption flow. + //! Perform the last round of the AES decryption flow (AESNI). INST_2x(aesdeclast, kInstAesdeclast, XmmReg, XmmReg) //! @overload INST_2x(aesdeclast, kInstAesdeclast, XmmReg, Mem) - //! @brief Perform a single round of the AES encryption flow. + //! Perform a single round of the AES encryption flow (AESNI). INST_2x(aesenc, kInstAesenc, XmmReg, XmmReg) //! @overload INST_2x(aesenc, kInstAesenc, XmmReg, Mem) - //! @brief Perform the last round of the AES encryption flow. + //! Perform the last round of the AES encryption flow (AESNI). INST_2x(aesenclast, kInstAesenclast, XmmReg, XmmReg) //! @overload INST_2x(aesenclast, kInstAesenclast, XmmReg, Mem) - //! @brief Perform the InvMixColumns transformation. + //! Perform the InvMixColumns transformation (AESNI). INST_2x(aesimc, kInstAesimc, XmmReg, XmmReg) //! @overload INST_2x(aesimc, kInstAesimc, XmmReg, Mem) - //! @brief Assist in expanding the AES cipher key. + //! Assist in expanding the AES cipher key (AESNI). INST_3i(aeskeygenassist, kInstAeskeygenassist, XmmReg, XmmReg, Imm) //! @overload INST_3i(aeskeygenassist, kInstAeskeygenassist, XmmReg, Mem, Imm) @@ -3411,7 +3410,7 @@ struct X86X64Assembler : public BaseAssembler { // [PCLMULQDQ] // -------------------------------------------------------------------------- - //! @brief Carry-less multiplication quadword. + //! Packed QWORD to OWORD carry-less multiply (PCLMULQDQ). INST_3i(pclmulqdq, kInstPclmulqdq, XmmReg, XmmReg, Imm) //! @overload INST_3i(pclmulqdq, kInstPclmulqdq, XmmReg, Mem, Imm) @@ -3420,941 +3419,1593 @@ struct X86X64Assembler : public BaseAssembler { // [AVX] // -------------------------------------------------------------------------- + //! Packed DP-FP add (AVX). INST_3x(vaddpd, kInstVaddpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vaddpd, kInstVaddpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vaddpd, kInstVaddpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vaddpd, kInstVaddpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP add (AVX). INST_3x(vaddps, kInstVaddps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vaddps, kInstVaddps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vaddps, kInstVaddps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vaddps, kInstVaddps, YmmReg, YmmReg, Mem) + //! Scalar DP-FP add (AVX) INST_3x(vaddsd, kInstVaddsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vaddsd, kInstVaddsd, XmmReg, XmmReg, Mem) + //! Scalar SP-FP add (AVX) INST_3x(vaddss, kInstVaddss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vaddss, kInstVaddss, XmmReg, XmmReg, Mem) + //! Packed DP-FP add/subtract (AVX). INST_3x(vaddsubpd, kInstVaddsubpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vaddsubpd, kInstVaddsubpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vaddsubpd, kInstVaddsubpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vaddsubpd, kInstVaddsubpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP add/subtract (AVX). INST_3x(vaddsubps, kInstVaddsubps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vaddsubps, kInstVaddsubps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vaddsubps, kInstVaddsubps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vaddsubps, kInstVaddsubps, YmmReg, YmmReg, Mem) + //! Packed DP-FP bitwise and (AVX). INST_3x(vandpd, kInstVandpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vandpd, kInstVandpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vandpd, kInstVandpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vandpd, kInstVandpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP bitwise and (AVX). INST_3x(vandps, kInstVandps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vandps, kInstVandps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vandps, kInstVandps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vandps, kInstVandps, YmmReg, YmmReg, Mem) + //! Packed DP-FP bitwise and-not (AVX). INST_3x(vandnpd, kInstVandnpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vandnpd, kInstVandnpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vandnpd, kInstVandnpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vandnpd, kInstVandnpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP bitwise and-not (AVX). INST_3x(vandnps, kInstVandnps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vandnps, kInstVandnps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vandnps, kInstVandnps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vandnps, kInstVandnps, YmmReg, YmmReg, Mem) + //! Packed DP-FP blend (AVX). INST_4i(vblendpd, kInstVblendpd, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vblendpd, kInstVblendpd, XmmReg, XmmReg, Mem, Imm) + //! @overload INST_4i(vblendpd, kInstVblendpd, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vblendpd, kInstVblendpd, YmmReg, YmmReg, Mem, Imm) + //! Packed SP-FP blend (AVX). INST_4i(vblendps, kInstVblendps, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vblendps, kInstVblendps, XmmReg, XmmReg, Mem, Imm) + //! @overload INST_4i(vblendps, kInstVblendps, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vblendps, kInstVblendps, YmmReg, YmmReg, Mem, Imm) + //! Packed DP-FP variable blend (AVX). INST_4x(vblendvpd, kInstVblendvpd, XmmReg, XmmReg, XmmReg, XmmReg) + //! @overload INST_4x(vblendvpd, kInstVblendvpd, XmmReg, XmmReg, Mem, XmmReg) + //! @overload INST_4x(vblendvpd, kInstVblendvpd, YmmReg, YmmReg, YmmReg, YmmReg) + //! @overload INST_4x(vblendvpd, kInstVblendvpd, YmmReg, YmmReg, Mem, YmmReg) + //! Packed SP-FP variable blend (AVX). INST_4x(vblendvps, kInstVblendvps, XmmReg, XmmReg, XmmReg, XmmReg) + //! @overload INST_4x(vblendvps, kInstVblendvps, XmmReg, XmmReg, Mem, XmmReg) + //! @overload INST_4x(vblendvps, kInstVblendvps, YmmReg, YmmReg, YmmReg, YmmReg) + //! @overload INST_4x(vblendvps, kInstVblendvps, YmmReg, YmmReg, Mem, YmmReg) + //! Broadcast 128-bits of FP data in `o1` to low and high 128-bits in `o0` (AVX). INST_2x(vbroadcastf128, kInstVbroadcastf128, YmmReg, Mem) - + //! Broadcast DP-FP element in `o1` to four locations in `o0` (AVX). INST_2x(vbroadcastsd, kInstVbroadcastsd, YmmReg, Mem) - + //! Broadcast SP-FP element in `o1` to four locations in `o0` (AVX). INST_2x(vbroadcastss, kInstVbroadcastss, XmmReg, Mem) + //! Broadcast SP-FP element in `o1` to eight locations in `o0` (AVX). INST_2x(vbroadcastss, kInstVbroadcastss, YmmReg, Mem) + //! Packed DP-FP compare (AVX). INST_4i(vcmppd, kInstVcmppd, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vcmppd, kInstVcmppd, XmmReg, XmmReg, Mem, Imm) + //! @overload INST_4i(vcmppd, kInstVcmppd, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vcmppd, kInstVcmppd, YmmReg, YmmReg, Mem, Imm) + //! Packed SP-FP compare (AVX). INST_4i(vcmpps, kInstVcmpps, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vcmpps, kInstVcmpps, XmmReg, XmmReg, Mem, Imm) + //! @overload INST_4i(vcmpps, kInstVcmpps, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vcmpps, kInstVcmpps, YmmReg, YmmReg, Mem, Imm) + //! Scalar DP-FP compare (AVX). INST_4i(vcmpsd, kInstVcmpsd, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vcmpsd, kInstVcmpsd, XmmReg, XmmReg, Mem, Imm) + //! Scalar SP-FP compare (AVX). INST_4i(vcmpss, kInstVcmpss, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vcmpss, kInstVcmpss, XmmReg, XmmReg, Mem, Imm) + //! Scalar DP-FP ordered compare and set EFLAGS (AVX). INST_2x(vcomisd, kInstVcomisd, XmmReg, XmmReg) + //! @overload INST_2x(vcomisd, kInstVcomisd, XmmReg, Mem) + //! Scalar SP-FP ordered compare and set EFLAGS (AVX). INST_2x(vcomiss, kInstVcomiss, XmmReg, XmmReg) + //! @overload INST_2x(vcomiss, kInstVcomiss, XmmReg, Mem) + //! Convert packed QWORDs to packed DP-FP (AVX). INST_2x(vcvtdq2pd, kInstVcvtdq2pd, XmmReg, XmmReg) + //! @overload INST_2x(vcvtdq2pd, kInstVcvtdq2pd, XmmReg, Mem) + //! @overload INST_2x(vcvtdq2pd, kInstVcvtdq2pd, YmmReg, XmmReg) + //! @overload INST_2x(vcvtdq2pd, kInstVcvtdq2pd, YmmReg, Mem) + //! Convert packed QWORDs to packed SP-FP (AVX). INST_2x(vcvtdq2ps, kInstVcvtdq2ps, XmmReg, XmmReg) + //! @overload INST_2x(vcvtdq2ps, kInstVcvtdq2ps, XmmReg, Mem) + //! @overload INST_2x(vcvtdq2ps, kInstVcvtdq2ps, YmmReg, YmmReg) + //! @overload INST_2x(vcvtdq2ps, kInstVcvtdq2ps, YmmReg, Mem) + //! Convert packed DP-FP to packed QWORDs (AVX). INST_2x(vcvtpd2dq, kInstVcvtpd2dq, XmmReg, XmmReg) + //! @overload INST_2x(vcvtpd2dq, kInstVcvtpd2dq, XmmReg, YmmReg) + //! @overload INST_2x(vcvtpd2dq, kInstVcvtpd2dq, XmmReg, Mem) + //! Convert packed DP-FP to packed SP-FP (AVX). INST_2x(vcvtpd2ps, kInstVcvtpd2ps, XmmReg, XmmReg) + //! @overload INST_2x(vcvtpd2ps, kInstVcvtpd2ps, XmmReg, YmmReg) + //! @overload INST_2x(vcvtpd2ps, kInstVcvtpd2ps, XmmReg, Mem) + //! Convert packed SP-FP to packed QWORDs (AVX). INST_2x(vcvtps2dq, kInstVcvtps2dq, XmmReg, XmmReg) + //! @overload INST_2x(vcvtps2dq, kInstVcvtps2dq, XmmReg, Mem) + //! @overload INST_2x(vcvtps2dq, kInstVcvtps2dq, YmmReg, YmmReg) + //! @overload INST_2x(vcvtps2dq, kInstVcvtps2dq, YmmReg, Mem) + //! Convert packed SP-FP to packed DP-FP (AVX). INST_2x(vcvtps2pd, kInstVcvtps2pd, XmmReg, XmmReg) + //! @overload INST_2x(vcvtps2pd, kInstVcvtps2pd, XmmReg, Mem) + //! @overload INST_2x(vcvtps2pd, kInstVcvtps2pd, YmmReg, XmmReg) + //! @overload INST_2x(vcvtps2pd, kInstVcvtps2pd, YmmReg, Mem) + //! Convert scalar DP-FP to DWORD (AVX). INST_2x(vcvtsd2si, kInstVcvtsd2si, GpReg, XmmReg) + //! @overload INST_2x(vcvtsd2si, kInstVcvtsd2si, GpReg, Mem) + //! Convert scalar DP-FP to scalar SP-FP (AVX). INST_3x(vcvtsd2ss, kInstVcvtsd2ss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vcvtsd2ss, kInstVcvtsd2ss, XmmReg, XmmReg, Mem) + //! Convert DWORD integer to scalar DP-FP (AVX). INST_3x(vcvtsi2sd, kInstVcvtsi2sd, XmmReg, XmmReg, GpReg) + //! @overload INST_3x(vcvtsi2sd, kInstVcvtsi2sd, XmmReg, XmmReg, Mem) + //! Convert scalar INT32 to SP-FP (AVX). INST_3x(vcvtsi2ss, kInstVcvtsi2ss, XmmReg, XmmReg, GpReg) + //! @overload INST_3x(vcvtsi2ss, kInstVcvtsi2ss, XmmReg, XmmReg, Mem) + //! Convert scalar SP-FP to DP-FP (AVX). INST_3x(vcvtss2sd, kInstVcvtss2sd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vcvtss2sd, kInstVcvtss2sd, XmmReg, XmmReg, Mem) + //! Convert scalar SP-FP to INT32 (AVX). INST_2x(vcvtss2si, kInstVcvtss2si, GpReg, XmmReg) + //! @overload INST_2x(vcvtss2si, kInstVcvtss2si, GpReg, Mem) + //! Convert with truncation packed DP-FP to packed QWORDs (AVX). INST_2x(vcvttpd2dq, kInstVcvttpd2dq, XmmReg, XmmReg) + //! @overload INST_2x(vcvttpd2dq, kInstVcvttpd2dq, XmmReg, YmmReg) + //! @overload INST_2x(vcvttpd2dq, kInstVcvttpd2dq, XmmReg, Mem) + //! Convert with truncation packed SP-FP to packed QWORDs (AVX). INST_2x(vcvttps2dq, kInstVcvttps2dq, XmmReg, XmmReg) + //! @overload INST_2x(vcvttps2dq, kInstVcvttps2dq, XmmReg, Mem) + //! @overload INST_2x(vcvttps2dq, kInstVcvttps2dq, YmmReg, YmmReg) + //! @overload INST_2x(vcvttps2dq, kInstVcvttps2dq, YmmReg, Mem) + //! Convert with truncation scalar DP-FP to DWORD (AVX). INST_2x(vcvttsd2si, kInstVcvttsd2si, GpReg, XmmReg) + //! @overload INST_2x(vcvttsd2si, kInstVcvttsd2si, GpReg, Mem) + //! Convert with truncation scalar SP-FP to INT32 (AVX). INST_2x(vcvttss2si, kInstVcvttss2si, GpReg, XmmReg) + //! @overload INST_2x(vcvttss2si, kInstVcvttss2si, GpReg, Mem) + //! Packed DP-FP divide (AVX). INST_3x(vdivpd, kInstVdivpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vdivpd, kInstVdivpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vdivpd, kInstVdivpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vdivpd, kInstVdivpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP divide (AVX). INST_3x(vdivps, kInstVdivps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vdivps, kInstVdivps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vdivps, kInstVdivps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vdivps, kInstVdivps, YmmReg, YmmReg, Mem) + //! Scalar DP-FP divide (AVX). INST_3x(vdivsd, kInstVdivsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vdivsd, kInstVdivsd, XmmReg, XmmReg, Mem) + //! Scalar SP-FP divide (AVX). INST_3x(vdivss, kInstVdivss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vdivss, kInstVdivss, XmmReg, XmmReg, Mem) + //! Packed DP-FP dot product (AVX). INST_4i(vdppd, kInstVdppd, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vdppd, kInstVdppd, XmmReg, XmmReg, Mem, Imm) + //! Packed SP-FP dot product (AVX). INST_4i(vdpps, kInstVdpps, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vdpps, kInstVdpps, XmmReg, XmmReg, Mem, Imm) + //! @overload INST_4i(vdpps, kInstVdpps, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vdpps, kInstVdpps, YmmReg, YmmReg, Mem, Imm) + //! Extract 128 bits of packed FP data from `o1` and store results in `o0` (AVX). INST_3i(vextractf128, kInstVextractf128, XmmReg, YmmReg, Imm) + //! @overload INST_3i(vextractf128, kInstVextractf128, Mem, YmmReg, Imm) + //! Extract SP-FP based on selector (AVX). INST_3i(vextractps, kInstVextractps, GpReg, XmmReg, Imm) + //! @overload INST_3i(vextractps, kInstVextractps, Mem, XmmReg, Imm) + //! Packed DP-FP horizontal add (AVX). INST_3x(vhaddpd, kInstVhaddpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vhaddpd, kInstVhaddpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vhaddpd, kInstVhaddpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vhaddpd, kInstVhaddpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP horizontal add (AVX). INST_3x(vhaddps, kInstVhaddps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vhaddps, kInstVhaddps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vhaddps, kInstVhaddps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vhaddps, kInstVhaddps, YmmReg, YmmReg, Mem) + //! Packed DP-FP horizontal subtract (AVX). INST_3x(vhsubpd, kInstVhsubpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vhsubpd, kInstVhsubpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vhsubpd, kInstVhsubpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vhsubpd, kInstVhsubpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP horizontal subtract (AVX). INST_3x(vhsubps, kInstVhsubps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vhsubps, kInstVhsubps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vhsubps, kInstVhsubps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vhsubps, kInstVhsubps, YmmReg, YmmReg, Mem) + //! Insert 128-bit of packed FP data based on selector (AVX). INST_4i(vinsertf128, kInstVinsertf128, YmmReg, YmmReg, XmmReg, Imm) + //! @overload INST_4i(vinsertf128, kInstVinsertf128, YmmReg, YmmReg, Mem, Imm) + //! Insert SP-FP based on selector (AVX). INST_4i(vinsertps, kInstVinsertps, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vinsertps, kInstVinsertps, XmmReg, XmmReg, Mem, Imm) + //! Load 128-bits unaligned (AVX). INST_2x(vlddqu, kInstVlddqu, XmmReg, Mem) + //! Load 256-bits unaligned (AVX). INST_2x(vlddqu, kInstVlddqu, YmmReg, Mem) + //! Load streaming SIMD extension control/status (AVX). INST_1x(vldmxcsr, kInstVldmxcsr, Mem) + //! Store selected bytes of OWORD to DS:EDI/RDI (AVX). INST_2x(vmaskmovdqu, kInstVmaskmovdqu, XmmReg, XmmReg) - INST_3x(vmaskmovps, kInstVmaskmovps, XmmReg, XmmReg, Mem) - INST_3x(vmaskmovps, kInstVmaskmovps, YmmReg, YmmReg, Mem) - + //! Conditionally load packed DP-FP from `o2` using mask in `o1 and store in `o0` (AVX). INST_3x(vmaskmovpd, kInstVmaskmovpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vmaskmovpd, kInstVmaskmovpd, YmmReg, YmmReg, Mem) - - INST_3x(vmaskmovps, kInstVmaskmovps, Mem, XmmReg, XmmReg) - INST_3x(vmaskmovps, kInstVmaskmovps, Mem, YmmReg, YmmReg) - + //! @overload INST_3x(vmaskmovpd, kInstVmaskmovpd, Mem, XmmReg, XmmReg) + //! @overload INST_3x(vmaskmovpd, kInstVmaskmovpd, Mem, YmmReg, YmmReg) + //! Conditionally load packed SP-FP from `o2` using mask in `o1 and store in `o0` (AVX). + INST_3x(vmaskmovps, kInstVmaskmovps, XmmReg, XmmReg, Mem) + //! @overload + INST_3x(vmaskmovps, kInstVmaskmovps, YmmReg, YmmReg, Mem) + //! @overload + INST_3x(vmaskmovps, kInstVmaskmovps, Mem, XmmReg, XmmReg) + //! @overload + INST_3x(vmaskmovps, kInstVmaskmovps, Mem, YmmReg, YmmReg) + + //! Packed DP-FP maximum (AVX). INST_3x(vmaxpd, kInstVmaxpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vmaxpd, kInstVmaxpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vmaxpd, kInstVmaxpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vmaxpd, kInstVmaxpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP maximum (AVX). INST_3x(vmaxps, kInstVmaxps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vmaxps, kInstVmaxps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vmaxps, kInstVmaxps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vmaxps, kInstVmaxps, YmmReg, YmmReg, Mem) + //! Scalar DP-FP maximum (AVX). INST_3x(vmaxsd, kInstVmaxsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vmaxsd, kInstVmaxsd, XmmReg, XmmReg, Mem) + //! Scalar SP-FP maximum (AVX). INST_3x(vmaxss, kInstVmaxss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vmaxss, kInstVmaxss, XmmReg, XmmReg, Mem) + //! Packed DP-FP minimum (AVX). INST_3x(vminpd, kInstVminpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vminpd, kInstVminpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vminpd, kInstVminpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vminpd, kInstVminpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP minimum (AVX). INST_3x(vminps, kInstVminps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vminps, kInstVminps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vminps, kInstVminps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vminps, kInstVminps, YmmReg, YmmReg, Mem) + //! Scalar DP-FP minimum (AVX). INST_3x(vminsd, kInstVminsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vminsd, kInstVminsd, XmmReg, XmmReg, Mem) + //! Scalar SP-FP minimum (AVX). INST_3x(vminss, kInstVminss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vminss, kInstVminss, XmmReg, XmmReg, Mem) + //! Move 128-bits of aligned packed DP-FP (AVX). INST_2x(vmovapd, kInstVmovapd, XmmReg, XmmReg) + //! @overload INST_2x(vmovapd, kInstVmovapd, XmmReg, Mem) + //! @overload INST_2x(vmovapd, kInstVmovapd, Mem, XmmReg) + //! Move 256-bits of aligned packed DP-FP (AVX). INST_2x(vmovapd, kInstVmovapd, YmmReg, YmmReg) + //! @overload INST_2x(vmovapd, kInstVmovapd, YmmReg, Mem) + //! @overload INST_2x(vmovapd, kInstVmovapd, Mem, YmmReg) + //! Move 128-bits of aligned packed SP-FP (AVX). INST_2x(vmovaps, kInstVmovaps, XmmReg, XmmReg) + //! @overload INST_2x(vmovaps, kInstVmovaps, XmmReg, Mem) + //! @overload INST_2x(vmovaps, kInstVmovaps, Mem, XmmReg) + //! Move 256-bits of aligned packed SP-FP (AVX). INST_2x(vmovaps, kInstVmovaps, YmmReg, YmmReg) + //! @overload INST_2x(vmovaps, kInstVmovaps, YmmReg, Mem) + //! @overload INST_2x(vmovaps, kInstVmovaps, Mem, YmmReg) + //! Move DWORD (AVX). INST_2x(vmovd, kInstVmovd, XmmReg, GpReg) + //! @overload INST_2x(vmovd, kInstVmovd, XmmReg, Mem) + //! @overload INST_2x(vmovd, kInstVmovd, GpReg, XmmReg) + //! @overload INST_2x(vmovd, kInstVmovd, Mem, XmmReg) + + //! Move QWORD (AVX). INST_2x(vmovq, kInstVmovq, XmmReg, XmmReg) + //! @overload INST_2x(vmovq, kInstVmovq, XmmReg, Mem) + //! @overload INST_2x(vmovq, kInstVmovq, Mem, XmmReg) + //! Move one DP-FP and duplicate (AVX). INST_2x(vmovddup, kInstVmovddup, XmmReg, XmmReg) + //! @overload INST_2x(vmovddup, kInstVmovddup, XmmReg, Mem) + //! @overload INST_2x(vmovddup, kInstVmovddup, YmmReg, YmmReg) + //! @overload INST_2x(vmovddup, kInstVmovddup, YmmReg, Mem) + //! Move 128-bits aligned (AVX). INST_2x(vmovdqa, kInstVmovdqa, XmmReg, XmmReg) + //! @overload INST_2x(vmovdqa, kInstVmovdqa, XmmReg, Mem) + //! @overload INST_2x(vmovdqa, kInstVmovdqa, Mem, XmmReg) + //! Move 256-bits aligned (AVX). INST_2x(vmovdqa, kInstVmovdqa, YmmReg, YmmReg) + //! @overload INST_2x(vmovdqa, kInstVmovdqa, YmmReg, Mem) + //! @overload INST_2x(vmovdqa, kInstVmovdqa, Mem, YmmReg) + //! Move 128-bits unaligned (AVX). INST_2x(vmovdqu, kInstVmovdqu, XmmReg, XmmReg) + //! @overload INST_2x(vmovdqu, kInstVmovdqu, XmmReg, Mem) + //! @overload INST_2x(vmovdqu, kInstVmovdqu, Mem, XmmReg) + //! Move 256-bits unaligned (AVX). INST_2x(vmovdqu, kInstVmovdqu, YmmReg, YmmReg) + //! @overload INST_2x(vmovdqu, kInstVmovdqu, YmmReg, Mem) + //! @overload INST_2x(vmovdqu, kInstVmovdqu, Mem, YmmReg) + //! High to low packed SP-FP (AVX). INST_3x(vmovhlps, kInstVmovhlps, XmmReg, XmmReg, XmmReg) + //! Move high packed DP-FP (AVX). INST_3x(vmovhpd, kInstVmovhpd, XmmReg, XmmReg, Mem) + //! @overload INST_2x(vmovhpd, kInstVmovhpd, Mem, XmmReg) + //! Move high packed SP-FP (AVX). INST_3x(vmovhps, kInstVmovhps, XmmReg, XmmReg, Mem) + //! @overload INST_2x(vmovhps, kInstVmovhps, Mem, XmmReg) + //! Move low to high packed SP-FP (AVX). INST_3x(vmovlhps, kInstVmovlhps, XmmReg, XmmReg, XmmReg) + //! Move low packed DP-FP (AVX). INST_3x(vmovlpd, kInstVmovlpd, XmmReg, XmmReg, Mem) + //! @overload INST_2x(vmovlpd, kInstVmovlpd, Mem, XmmReg) + //! Move low packed SP-FP (AVX). INST_3x(vmovlps, kInstVmovlps, XmmReg, XmmReg, Mem) + //! @overload INST_2x(vmovlps, kInstVmovlps, Mem, XmmReg) + //! Extract packed DP-FP sign mask (AVX). INST_2x(vmovmskpd, kInstVmovmskpd, GpReg, XmmReg) + //! @overload INST_2x(vmovmskpd, kInstVmovmskpd, GpReg, YmmReg) + //! Extract packed SP-FP sign mask (AVX). INST_2x(vmovmskps, kInstVmovmskps, GpReg, XmmReg) + //! @overload INST_2x(vmovmskps, kInstVmovmskps, GpReg, YmmReg) + //! Store 128-bits using NT hint (AVX). INST_2x(vmovntdq, kInstVmovntdq, Mem, XmmReg) + //! Store 256-bits using NT hint (AVX). INST_2x(vmovntdq, kInstVmovntdq, Mem, YmmReg) + //! Store 128-bits aligned using NT hint (AVX). INST_2x(vmovntdqa, kInstVmovntdqa, XmmReg, Mem) + //! Store packed DP-FP (128-bits) using NT hint (AVX). INST_2x(vmovntpd, kInstVmovntpd, Mem, XmmReg) + //! Store packed DP-FP (256-bits) using NT hint (AVX). INST_2x(vmovntpd, kInstVmovntpd, Mem, YmmReg) + //! Store packed SP-FP (128-bits) using NT hint (AVX). INST_2x(vmovntps, kInstVmovntps, Mem, XmmReg) + //! Store packed SP-FP (256-bits) using NT hint (AVX). INST_2x(vmovntps, kInstVmovntps, Mem, YmmReg) + //! Move scalar DP-FP (AVX). INST_3x(vmovsd, kInstVmovsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_2x(vmovsd, kInstVmovsd, XmmReg, Mem) + //! @overload INST_2x(vmovsd, kInstVmovsd, Mem, XmmReg) + //! Move packed SP-FP high and duplicate (AVX). INST_2x(vmovshdup, kInstVmovshdup, XmmReg, XmmReg) + //! @overload INST_2x(vmovshdup, kInstVmovshdup, XmmReg, Mem) + //! @overload INST_2x(vmovshdup, kInstVmovshdup, YmmReg, YmmReg) + //! @overload INST_2x(vmovshdup, kInstVmovshdup, YmmReg, Mem) + //! Move packed SP-FP low and duplicate (AVX). INST_2x(vmovsldup, kInstVmovsldup, XmmReg, XmmReg) + //! @overload INST_2x(vmovsldup, kInstVmovsldup, XmmReg, Mem) + //! @overload INST_2x(vmovsldup, kInstVmovsldup, YmmReg, YmmReg) + //! @overload INST_2x(vmovsldup, kInstVmovsldup, YmmReg, Mem) + //! Move scalar SP-FP (AVX). INST_3x(vmovss, kInstVmovss, XmmReg, XmmReg, XmmReg) + //! @overload INST_2x(vmovss, kInstVmovss, XmmReg, Mem) + //! @overload INST_2x(vmovss, kInstVmovss, Mem, XmmReg) + //! Move 128-bits of unaligned packed DP-FP (AVX). INST_2x(vmovupd, kInstVmovupd, XmmReg, XmmReg) + //! @overload INST_2x(vmovupd, kInstVmovupd, XmmReg, Mem) + //! @overload INST_2x(vmovupd, kInstVmovupd, Mem, XmmReg) + //! Move 256-bits of unaligned packed DP-FP (AVX). INST_2x(vmovupd, kInstVmovupd, YmmReg, YmmReg) + //! @overload INST_2x(vmovupd, kInstVmovupd, YmmReg, Mem) + //! @overload INST_2x(vmovupd, kInstVmovupd, Mem, YmmReg) + //! Move 128-bits of unaligned packed SP-FP (AVX). INST_2x(vmovups, kInstVmovups, XmmReg, XmmReg) + //! @overload INST_2x(vmovups, kInstVmovups, XmmReg, Mem) + //! @overload INST_2x(vmovups, kInstVmovups, Mem, XmmReg) + //! Move 256-bits of unaligned packed SP-FP (AVX). INST_2x(vmovups, kInstVmovups, YmmReg, YmmReg) + //! @overload INST_2x(vmovups, kInstVmovups, YmmReg, Mem) + //! @overload INST_2x(vmovups, kInstVmovups, Mem, YmmReg) + //! Packed WORD sums of absolute difference (AVX). INST_4i(vmpsadbw, kInstVmpsadbw, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vmpsadbw, kInstVmpsadbw, XmmReg, XmmReg, Mem, Imm) + //! Packed DP-FP multiply (AVX). INST_3x(vmulpd, kInstVmulpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vmulpd, kInstVmulpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vmulpd, kInstVmulpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vmulpd, kInstVmulpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP multiply (AVX). INST_3x(vmulps, kInstVmulps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vmulps, kInstVmulps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vmulps, kInstVmulps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vmulps, kInstVmulps, YmmReg, YmmReg, Mem) + //! Packed SP-FP multiply (AVX). INST_3x(vmulsd, kInstVmulsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vmulsd, kInstVmulsd, XmmReg, XmmReg, Mem) + //! Scalar SP-FP multiply (AVX). INST_3x(vmulss, kInstVmulss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vmulss, kInstVmulss, XmmReg, XmmReg, Mem) + //! Packed DP-FP bitwise or (AVX). INST_3x(vorpd, kInstVorpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vorpd, kInstVorpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vorpd, kInstVorpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vorpd, kInstVorpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP bitwise or (AVX). INST_3x(vorps, kInstVorps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vorps, kInstVorps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vorps, kInstVorps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vorps, kInstVorps, YmmReg, YmmReg, Mem) + //! Packed BYTE absolute value (AVX). INST_2x(vpabsb, kInstVpabsb, XmmReg, XmmReg) + //! @overload INST_2x(vpabsb, kInstVpabsb, XmmReg, Mem) + //! Packed DWORD absolute value (AVX). INST_2x(vpabsd, kInstVpabsd, XmmReg, XmmReg) + //! @overload INST_2x(vpabsd, kInstVpabsd, XmmReg, Mem) + //! Packed WORD absolute value (AVX). INST_2x(vpabsw, kInstVpabsw, XmmReg, XmmReg) + //! @overload INST_2x(vpabsw, kInstVpabsw, XmmReg, Mem) + //! Pack DWORDs to WORDs with signed saturation (AVX). INST_3x(vpackssdw, kInstVpackssdw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpackssdw, kInstVpackssdw, XmmReg, XmmReg, Mem) + //! Pack WORDs to BYTEs with signed saturation (AVX). INST_3x(vpacksswb, kInstVpacksswb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpacksswb, kInstVpacksswb, XmmReg, XmmReg, Mem) + //! Pack DWORDs to WORDs with unsigned saturation (AVX). INST_3x(vpackusdw, kInstVpackusdw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpackusdw, kInstVpackusdw, XmmReg, XmmReg, Mem) + //! Pack WORDs to BYTEs with unsigned saturation (AVX). INST_3x(vpackuswb, kInstVpackuswb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpackuswb, kInstVpackuswb, XmmReg, XmmReg, Mem) + //! Packed BYTE add (AVX). INST_3x(vpaddb, kInstVpaddb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpaddb, kInstVpaddb, XmmReg, XmmReg, Mem) + //! Packed DWORD add (AVX). INST_3x(vpaddd, kInstVpaddd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpaddd, kInstVpaddd, XmmReg, XmmReg, Mem) + //! Packed QWORD add (AVX). INST_3x(vpaddq, kInstVpaddq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpaddq, kInstVpaddq, XmmReg, XmmReg, Mem) + //! Packed WORD add (AVX). INST_3x(vpaddw, kInstVpaddw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpaddw, kInstVpaddw, XmmReg, XmmReg, Mem) + //! Packed BYTE add with saturation (AVX). INST_3x(vpaddsb, kInstVpaddsb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpaddsb, kInstVpaddsb, XmmReg, XmmReg, Mem) + //! Packed WORD add with saturation (AVX). INST_3x(vpaddsw, kInstVpaddsw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpaddsw, kInstVpaddsw, XmmReg, XmmReg, Mem) + //! Packed BYTE add with unsigned saturation (AVX). INST_3x(vpaddusb, kInstVpaddusb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpaddusb, kInstVpaddusb, XmmReg, XmmReg, Mem) + //! Packed WORD add with unsigned saturation (AVX). INST_3x(vpaddusw, kInstVpaddusw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpaddusw, kInstVpaddusw, XmmReg, XmmReg, Mem) + //! Packed align right (AVX). INST_4i(vpalignr, kInstVpalignr, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vpalignr, kInstVpalignr, XmmReg, XmmReg, Mem, Imm) + //! Packed bitwise and (AVX). INST_3x(vpand, kInstVpand, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpand, kInstVpand, XmmReg, XmmReg, Mem) + //! Packed bitwise and-not (AVX). INST_3x(vpandn, kInstVpandn, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpandn, kInstVpandn, XmmReg, XmmReg, Mem) + //! Packed BYTE average (AVX). INST_3x(vpavgb, kInstVpavgb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpavgb, kInstVpavgb, XmmReg, XmmReg, Mem) + //! Packed WORD average (AVX). INST_3x(vpavgw, kInstVpavgw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpavgw, kInstVpavgw, XmmReg, XmmReg, Mem) + //! Packed BYTE variable blend (AVX). INST_4x(vpblendvb, kInstVpblendvb, XmmReg, XmmReg, XmmReg, XmmReg) + //! @overload INST_4x(vpblendvb, kInstVpblendvb, XmmReg, XmmReg, Mem, XmmReg) + //! Packed WORD blend (AVX). INST_4i(vpblendw, kInstVpblendw, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vpblendw, kInstVpblendw, XmmReg, XmmReg, Mem, Imm) + //! Packed BYTEs compare for equality (AVX). INST_3x(vpcmpeqb, kInstVpcmpeqb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpcmpeqb, kInstVpcmpeqb, XmmReg, XmmReg, Mem) + //! Packed DWORDs compare for equality (AVX). INST_3x(vpcmpeqd, kInstVpcmpeqd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpcmpeqd, kInstVpcmpeqd, XmmReg, XmmReg, Mem) + //! Packed QWORDs compare for equality (AVX). INST_3x(vpcmpeqq, kInstVpcmpeqq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpcmpeqq, kInstVpcmpeqq, XmmReg, XmmReg, Mem) + //! Packed WORDs compare for equality (AVX). INST_3x(vpcmpeqw, kInstVpcmpeqw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpcmpeqw, kInstVpcmpeqw, XmmReg, XmmReg, Mem) + //! Packed BYTEs compare if greater than (AVX). INST_3x(vpcmpgtb, kInstVpcmpgtb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpcmpgtb, kInstVpcmpgtb, XmmReg, XmmReg, Mem) + //! Packed DWORDs compare if greater than (AVX). INST_3x(vpcmpgtd, kInstVpcmpgtd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpcmpgtd, kInstVpcmpgtd, XmmReg, XmmReg, Mem) + //! Packed QWORDs compare if greater than (AVX). INST_3x(vpcmpgtq, kInstVpcmpgtq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpcmpgtq, kInstVpcmpgtq, XmmReg, XmmReg, Mem) + //! Packed WORDs compare if greater than (AVX). INST_3x(vpcmpgtw, kInstVpcmpgtw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpcmpgtw, kInstVpcmpgtw, XmmReg, XmmReg, Mem) + //! Packed compare explicit length strings, return index (AVX). INST_3i(vpcmpestri, kInstVpcmpestri, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpcmpestri, kInstVpcmpestri, XmmReg, Mem, Imm) + //! Packed compare explicit length strings, return mask (AVX). INST_3i(vpcmpestrm, kInstVpcmpestrm, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpcmpestrm, kInstVpcmpestrm, XmmReg, Mem, Imm) + //! Packed compare implicit length strings, return index (AVX). INST_3i(vpcmpistri, kInstVpcmpistri, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpcmpistri, kInstVpcmpistri, XmmReg, Mem, Imm) + //! Packed compare implicit length strings, return mask (AVX). INST_3i(vpcmpistrm, kInstVpcmpistrm, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpcmpistrm, kInstVpcmpistrm, XmmReg, Mem, Imm) + //! Packed DP-FP permute (AVX). INST_3x(vpermilpd, kInstVpermilpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpermilpd, kInstVpermilpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vpermilpd, kInstVpermilpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpermilpd, kInstVpermilpd, YmmReg, YmmReg, Mem) + //! @overload INST_3i(vpermilpd, kInstVpermilpd, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpermilpd, kInstVpermilpd, XmmReg, Mem, Imm) + //! @overload INST_3i(vpermilpd, kInstVpermilpd, YmmReg, YmmReg, Imm) + //! @overload INST_3i(vpermilpd, kInstVpermilpd, YmmReg, Mem, Imm) + //! Packed SP-FP permute (AVX). INST_3x(vpermilps, kInstVpermilps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpermilps, kInstVpermilps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vpermilps, kInstVpermilps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpermilps, kInstVpermilps, YmmReg, YmmReg, Mem) + //! @overload INST_3i(vpermilps, kInstVpermilps, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpermilps, kInstVpermilps, XmmReg, Mem, Imm) + //! @overload INST_3i(vpermilps, kInstVpermilps, YmmReg, YmmReg, Imm) + //! @overload INST_3i(vpermilps, kInstVpermilps, YmmReg, Mem, Imm) + //! Packed 128-bit FP permute (AVX). INST_4i(vperm2f128, kInstVperm2f128, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vperm2f128, kInstVperm2f128, YmmReg, YmmReg, Mem, Imm) + //! Extract BYTE (AVX). INST_3i(vpextrb, kInstVpextrb, GpReg, XmmReg, Imm) + //! @overload INST_3i(vpextrb, kInstVpextrb, Mem, XmmReg, Imm) + //! Extract DWORD (AVX). INST_3i(vpextrd, kInstVpextrd, GpReg, XmmReg, Imm) + //! @overload INST_3i(vpextrd, kInstVpextrd, Mem, XmmReg, Imm) + //! Extract WORD (AVX). INST_3i(vpextrw, kInstVpextrw, GpReg, XmmReg, Imm) + //! @overload INST_3i(vpextrw, kInstVpextrw, Mem, XmmReg, Imm) + //! Packed DWORD horizontal add (AVX). INST_3x(vphaddd, kInstVphaddd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vphaddd, kInstVphaddd, XmmReg, XmmReg, Mem) + //! Packed WORD horizontal add with saturation (AVX). INST_3x(vphaddsw, kInstVphaddsw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vphaddsw, kInstVphaddsw, XmmReg, XmmReg, Mem) + //! Packed WORD horizontal add (AVX). INST_3x(vphaddw, kInstVphaddw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vphaddw, kInstVphaddw, XmmReg, XmmReg, Mem) + //! Packed WORD horizontal minimum (AVX). INST_2x(vphminposuw, kInstVphminposuw, XmmReg, XmmReg) + //! @overload INST_2x(vphminposuw, kInstVphminposuw, XmmReg, Mem) + //! Packed DWORD horizontal subtract (AVX). INST_3x(vphsubd, kInstVphsubd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vphsubd, kInstVphsubd, XmmReg, XmmReg, Mem) + //! Packed WORD horizontal subtract with saturation (AVX). INST_3x(vphsubsw, kInstVphsubsw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vphsubsw, kInstVphsubsw, XmmReg, XmmReg, Mem) + //! Packed WORD horizontal subtract (AVX). INST_3x(vphsubw, kInstVphsubw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vphsubw, kInstVphsubw, XmmReg, XmmReg, Mem) + //! Insert BYTE based on selector (AVX). INST_4i(vpinsrb, kInstVpinsrb, XmmReg, XmmReg, GpReg, Imm) + //! @overload INST_4i(vpinsrb, kInstVpinsrb, XmmReg, XmmReg, Mem, Imm) + //! Insert DWORD based on selector (AVX). INST_4i(vpinsrd, kInstVpinsrd, XmmReg, XmmReg, GpReg, Imm) + //! @overload INST_4i(vpinsrd, kInstVpinsrd, XmmReg, XmmReg, Mem, Imm) + //! Insert WORD based on selector (AVX). INST_4i(vpinsrw, kInstVpinsrw, XmmReg, XmmReg, GpReg, Imm) + //! @overload INST_4i(vpinsrw, kInstVpinsrw, XmmReg, XmmReg, Mem, Imm) + //! Packed multiply and add signed and unsigned bytes (AVX). INST_3x(vpmaddubsw, kInstVpmaddubsw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmaddubsw, kInstVpmaddubsw, XmmReg, XmmReg, Mem) + //! Packed WORD multiply and add to packed DWORD (AVX). INST_3x(vpmaddwd, kInstVpmaddwd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmaddwd, kInstVpmaddwd, XmmReg, XmmReg, Mem) + //! Packed BYTE maximum (AVX). INST_3x(vpmaxsb, kInstVpmaxsb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmaxsb, kInstVpmaxsb, XmmReg, XmmReg, Mem) + //! Packed DWORD maximum (AVX). INST_3x(vpmaxsd, kInstVpmaxsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmaxsd, kInstVpmaxsd, XmmReg, XmmReg, Mem) + //! Packed WORD maximum (AVX). INST_3x(vpmaxsw, kInstVpmaxsw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmaxsw, kInstVpmaxsw, XmmReg, XmmReg, Mem) + //! Packed BYTE unsigned maximum (AVX). INST_3x(vpmaxub, kInstVpmaxub, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmaxub, kInstVpmaxub, XmmReg, XmmReg, Mem) + //! Packed DWORD unsigned maximum (AVX). INST_3x(vpmaxud, kInstVpmaxud, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmaxud, kInstVpmaxud, XmmReg, XmmReg, Mem) + //! Packed WORD unsigned maximum (AVX). INST_3x(vpmaxuw, kInstVpmaxuw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmaxuw, kInstVpmaxuw, XmmReg, XmmReg, Mem) + //! Packed BYTE minimum (AVX). INST_3x(vpminsb, kInstVpminsb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpminsb, kInstVpminsb, XmmReg, XmmReg, Mem) + //! Packed DWORD minimum (AVX). INST_3x(vpminsd, kInstVpminsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpminsd, kInstVpminsd, XmmReg, XmmReg, Mem) + //! Packed WORD minimum (AVX). INST_3x(vpminsw, kInstVpminsw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpminsw, kInstVpminsw, XmmReg, XmmReg, Mem) + //! Packed BYTE unsigned minimum (AVX). INST_3x(vpminub, kInstVpminub, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpminub, kInstVpminub, XmmReg, XmmReg, Mem) + //! Packed DWORD unsigned minimum (AVX). INST_3x(vpminud, kInstVpminud, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpminud, kInstVpminud, XmmReg, XmmReg, Mem) + //! Packed WORD unsigned minimum (AVX). INST_3x(vpminuw, kInstVpminuw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpminuw, kInstVpminuw, XmmReg, XmmReg, Mem) + //! Move Byte mask to integer (AVX). INST_2x(vpmovmskb, kInstVpmovmskb, GpReg, XmmReg) + //! BYTE to DWORD with sign extend (AVX). INST_2x(vpmovsxbd, kInstVpmovsxbd, XmmReg, XmmReg) + //! @overload INST_2x(vpmovsxbd, kInstVpmovsxbd, XmmReg, Mem) + //! Packed BYTE to QWORD with sign extend (AVX). INST_2x(vpmovsxbq, kInstVpmovsxbq, XmmReg, XmmReg) + //! @overload INST_2x(vpmovsxbq, kInstVpmovsxbq, XmmReg, Mem) + //! Packed BYTE to WORD with sign extend (AVX). INST_2x(vpmovsxbw, kInstVpmovsxbw, XmmReg, XmmReg) + //! @overload INST_2x(vpmovsxbw, kInstVpmovsxbw, XmmReg, Mem) + //! Packed DWORD to QWORD with sign extend (AVX). INST_2x(vpmovsxdq, kInstVpmovsxdq, XmmReg, XmmReg) + //! @overload INST_2x(vpmovsxdq, kInstVpmovsxdq, XmmReg, Mem) + //! Packed WORD to DWORD with sign extend (AVX). INST_2x(vpmovsxwd, kInstVpmovsxwd, XmmReg, XmmReg) + //! @overload INST_2x(vpmovsxwd, kInstVpmovsxwd, XmmReg, Mem) + //! Packed WORD to QWORD with sign extend (AVX). INST_2x(vpmovsxwq, kInstVpmovsxwq, XmmReg, XmmReg) + //! @overload INST_2x(vpmovsxwq, kInstVpmovsxwq, XmmReg, Mem) + //! BYTE to DWORD with zero extend (AVX). INST_2x(vpmovzxbd, kInstVpmovzxbd, XmmReg, XmmReg) + //! @overload INST_2x(vpmovzxbd, kInstVpmovzxbd, XmmReg, Mem) + //! Packed BYTE to QWORD with zero extend (AVX). INST_2x(vpmovzxbq, kInstVpmovzxbq, XmmReg, XmmReg) + //! @overload INST_2x(vpmovzxbq, kInstVpmovzxbq, XmmReg, Mem) + //! BYTE to WORD with zero extend (AVX). INST_2x(vpmovzxbw, kInstVpmovzxbw, XmmReg, XmmReg) + //! @overload INST_2x(vpmovzxbw, kInstVpmovzxbw, XmmReg, Mem) + //! Packed DWORD to QWORD with zero extend (AVX). INST_2x(vpmovzxdq, kInstVpmovzxdq, XmmReg, XmmReg) + //! @overload INST_2x(vpmovzxdq, kInstVpmovzxdq, XmmReg, Mem) + //! Packed WORD to DWORD with zero extend (AVX). INST_2x(vpmovzxwd, kInstVpmovzxwd, XmmReg, XmmReg) + //! @overload INST_2x(vpmovzxwd, kInstVpmovzxwd, XmmReg, Mem) + //! Packed WORD to QWORD with zero extend (AVX). INST_2x(vpmovzxwq, kInstVpmovzxwq, XmmReg, XmmReg) + //! @overload INST_2x(vpmovzxwq, kInstVpmovzxwq, XmmReg, Mem) + //! Packed DWORD to QWORD multiply (AVX). INST_3x(vpmuldq, kInstVpmuldq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmuldq, kInstVpmuldq, XmmReg, XmmReg, Mem) + //! Packed WORD multiply high, round and scale (AVX). INST_3x(vpmulhrsw, kInstVpmulhrsw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmulhrsw, kInstVpmulhrsw, XmmReg, XmmReg, Mem) + //! Packed WORD unsigned multiply high (AVX). INST_3x(vpmulhuw, kInstVpmulhuw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmulhuw, kInstVpmulhuw, XmmReg, XmmReg, Mem) + //! Packed WORD multiply high (AVX). INST_3x(vpmulhw, kInstVpmulhw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmulhw, kInstVpmulhw, XmmReg, XmmReg, Mem) + //! Packed DWORD multiply low (AVX). INST_3x(vpmulld, kInstVpmulld, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmulld, kInstVpmulld, XmmReg, XmmReg, Mem) + //! Packed WORDs multiply low (AVX). INST_3x(vpmullw, kInstVpmullw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmullw, kInstVpmullw, XmmReg, XmmReg, Mem) + //! Packed DWORD multiply to QWORD (AVX). INST_3x(vpmuludq, kInstVpmuludq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpmuludq, kInstVpmuludq, XmmReg, XmmReg, Mem) + //! Packed bitwise or (AVX). INST_3x(vpor, kInstVpor, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpor, kInstVpor, XmmReg, XmmReg, Mem) + //! Packed WORD sum of absolute differences (AVX). INST_3x(vpsadbw, kInstVpsadbw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsadbw, kInstVpsadbw, XmmReg, XmmReg, Mem) + //! Packed BYTE shuffle (AVX). INST_3x(vpshufb, kInstVpshufb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpshufb, kInstVpshufb, XmmReg, XmmReg, Mem) + //! Packed DWORD shuffle (AVX). INST_3i(vpshufd, kInstVpshufd, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpshufd, kInstVpshufd, XmmReg, Mem, Imm) + //! Packed WORD shuffle high (AVX). INST_3i(vpshufhw, kInstVpshufhw, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpshufhw, kInstVpshufhw, XmmReg, Mem, Imm) + //! Packed WORD shuffle low (AVX). INST_3i(vpshuflw, kInstVpshuflw, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vpshuflw, kInstVpshuflw, XmmReg, Mem, Imm) + //! Packed BYTE sign (AVX). INST_3x(vpsignb, kInstVpsignb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsignb, kInstVpsignb, XmmReg, XmmReg, Mem) + //! Packed DWORD sign (AVX). INST_3x(vpsignd, kInstVpsignd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsignd, kInstVpsignd, XmmReg, XmmReg, Mem) + //! Packed WORD sign (AVX). INST_3x(vpsignw, kInstVpsignw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsignw, kInstVpsignw, XmmReg, XmmReg, Mem) + //! Packed DWORD shift left logical (AVX). INST_3x(vpslld, kInstVpslld, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpslld, kInstVpslld, XmmReg, XmmReg, Mem) + //! @overload INST_3i(vpslld, kInstVpslld, XmmReg, XmmReg, Imm) + //! Packed OWORD shift left logical (AVX). INST_3i(vpslldq, kInstVpslldq, XmmReg, XmmReg, Imm) + //! Packed QWORD shift left logical (AVX). INST_3x(vpsllq, kInstVpsllq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsllq, kInstVpsllq, XmmReg, XmmReg, Mem) + //! @overload INST_3i(vpsllq, kInstVpsllq, XmmReg, XmmReg, Imm) + //! Packed WORD shift left logical (AVX). INST_3x(vpsllw, kInstVpsllw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsllw, kInstVpsllw, XmmReg, XmmReg, Mem) + //! @overload INST_3i(vpsllw, kInstVpsllw, XmmReg, XmmReg, Imm) + //! Packed DWORD shift right arithmetic (AVX). INST_3x(vpsrad, kInstVpsrad, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsrad, kInstVpsrad, XmmReg, XmmReg, Mem) + //! @overload INST_3i(vpsrad, kInstVpsrad, XmmReg, XmmReg, Imm) + //! Packed WORD shift right arithmetic (AVX). INST_3x(vpsraw, kInstVpsraw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsraw, kInstVpsraw, XmmReg, XmmReg, Mem) + //! @overload INST_3i(vpsraw, kInstVpsraw, XmmReg, XmmReg, Imm) + //! Packed DWORD shift right logical (AVX). INST_3x(vpsrld, kInstVpsrld, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsrld, kInstVpsrld, XmmReg, XmmReg, Mem) + //! @overload INST_3i(vpsrld, kInstVpsrld, XmmReg, XmmReg, Imm) + //! Scalar OWORD shift right logical (AVX). INST_3i(vpsrldq, kInstVpsrldq, XmmReg, XmmReg, Imm) + //! Packed QWORD shift right logical (AVX). INST_3x(vpsrlq, kInstVpsrlq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsrlq, kInstVpsrlq, XmmReg, XmmReg, Mem) + //! @overload INST_3i(vpsrlq, kInstVpsrlq, XmmReg, XmmReg, Imm) + //! Packed WORD shift right logical (AVX). INST_3x(vpsrlw, kInstVpsrlw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsrlw, kInstVpsrlw, XmmReg, XmmReg, Mem) + //! @overload INST_3i(vpsrlw, kInstVpsrlw, XmmReg, XmmReg, Imm) + //! Packed BYTE subtract (AVX). INST_3x(vpsubb, kInstVpsubb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsubb, kInstVpsubb, XmmReg, XmmReg, Mem) + //! Packed DWORD subtract (AVX). INST_3x(vpsubd, kInstVpsubd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsubd, kInstVpsubd, XmmReg, XmmReg, Mem) + //! Packed QWORD subtract (AVX). INST_3x(vpsubq, kInstVpsubq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsubq, kInstVpsubq, XmmReg, XmmReg, Mem) + //! Packed WORD subtract (AVX). INST_3x(vpsubw, kInstVpsubw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsubw, kInstVpsubw, XmmReg, XmmReg, Mem) + //! Packed BYTE subtract with saturation (AVX). INST_3x(vpsubsb, kInstVpsubsb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsubsb, kInstVpsubsb, XmmReg, XmmReg, Mem) + //! Packed WORD subtract with saturation (AVX). INST_3x(vpsubsw, kInstVpsubsw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsubsw, kInstVpsubsw, XmmReg, XmmReg, Mem) + //! Packed BYTE subtract with unsigned saturation (AVX). INST_3x(vpsubusb, kInstVpsubusb, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsubusb, kInstVpsubusb, XmmReg, XmmReg, Mem) + //! Packed WORD subtract with unsigned saturation (AVX). INST_3x(vpsubusw, kInstVpsubusw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpsubusw, kInstVpsubusw, XmmReg, XmmReg, Mem) + //! Logical compare (AVX). INST_2x(vptest, kInstVptest, XmmReg, XmmReg) + //! @overload INST_2x(vptest, kInstVptest, XmmReg, Mem) + //! @overload INST_2x(vptest, kInstVptest, YmmReg, YmmReg) + //! @overload INST_2x(vptest, kInstVptest, YmmReg, Mem) + //! Unpack high packed BYTEs to WORDs (AVX). INST_3x(vpunpckhbw, kInstVpunpckhbw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpunpckhbw, kInstVpunpckhbw, XmmReg, XmmReg, Mem) + //! Unpack high packed DWORDs to QWORDs (AVX). INST_3x(vpunpckhdq, kInstVpunpckhdq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpunpckhdq, kInstVpunpckhdq, XmmReg, XmmReg, Mem) + //! Unpack high packed QWORDs to OWORD (AVX). INST_3x(vpunpckhqdq, kInstVpunpckhqdq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpunpckhqdq, kInstVpunpckhqdq, XmmReg, XmmReg, Mem) + //! Unpack high packed WORDs to DWORDs (AVX). INST_3x(vpunpckhwd, kInstVpunpckhwd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpunpckhwd, kInstVpunpckhwd, XmmReg, XmmReg, Mem) + //! Unpack low packed BYTEs to WORDs (AVX). INST_3x(vpunpcklbw, kInstVpunpcklbw, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpunpcklbw, kInstVpunpcklbw, XmmReg, XmmReg, Mem) + //! Unpack low packed DWORDs to QWORDs (AVX). INST_3x(vpunpckldq, kInstVpunpckldq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpunpckldq, kInstVpunpckldq, XmmReg, XmmReg, Mem) + //! Unpack low packed QWORDs to OWORD (AVX). INST_3x(vpunpcklqdq, kInstVpunpcklqdq, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpunpcklqdq, kInstVpunpcklqdq, XmmReg, XmmReg, Mem) + //! Unpack low packed WORDs to DWORDs (AVX). INST_3x(vpunpcklwd, kInstVpunpcklwd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpunpcklwd, kInstVpunpcklwd, XmmReg, XmmReg, Mem) + //! Packed bitwise xor (AVX). INST_3x(vpxor, kInstVpxor, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vpxor, kInstVpxor, XmmReg, XmmReg, Mem) + //! Packed SP-FP reciprocal (AVX). INST_2x(vrcpps, kInstVrcpps, XmmReg, XmmReg) + //! @overload INST_2x(vrcpps, kInstVrcpps, XmmReg, Mem) + //! @overload INST_2x(vrcpps, kInstVrcpps, YmmReg, YmmReg) + //! @overload INST_2x(vrcpps, kInstVrcpps, YmmReg, Mem) + //! Scalar SP-FP reciprocal (AVX). INST_3x(vrcpss, kInstVrcpss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vrcpss, kInstVrcpss, XmmReg, XmmReg, Mem) + //! Packed SP-FP square root reciprocal (AVX). INST_2x(vrsqrtps, kInstVrsqrtps, XmmReg, XmmReg) + //! @overload INST_2x(vrsqrtps, kInstVrsqrtps, XmmReg, Mem) + //! @overload INST_2x(vrsqrtps, kInstVrsqrtps, YmmReg, YmmReg) + //! @overload INST_2x(vrsqrtps, kInstVrsqrtps, YmmReg, Mem) + //! Scalar SP-FP square root reciprocal (AVX). INST_3x(vrsqrtss, kInstVrsqrtss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vrsqrtss, kInstVrsqrtss, XmmReg, XmmReg, Mem) + //! Packed DP-FP round (AVX). INST_3i(vroundpd, kInstVroundpd, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vroundpd, kInstVroundpd, XmmReg, Mem, Imm) + //! @overload INST_3i(vroundpd, kInstVroundpd, YmmReg, YmmReg, Imm) + //! @overload INST_3i(vroundpd, kInstVroundpd, YmmReg, Mem, Imm) + //! Packed SP-FP round (AVX). INST_3i(vroundps, kInstVroundps, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vroundps, kInstVroundps, XmmReg, Mem, Imm) + //! @overload INST_3i(vroundps, kInstVroundps, YmmReg, YmmReg, Imm) + //! @overload INST_3i(vroundps, kInstVroundps, YmmReg, Mem, Imm) + //! Scalar DP-FP round (AVX). INST_4i(vroundsd, kInstVroundsd, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vroundsd, kInstVroundsd, XmmReg, XmmReg, Mem, Imm) + //! Scalar SP-FP round (AVX). INST_4i(vroundss, kInstVroundss, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vroundss, kInstVroundss, XmmReg, XmmReg, Mem, Imm) + //! Shuffle DP-FP (AVX). INST_4i(vshufpd, kInstVshufpd, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vshufpd, kInstVshufpd, XmmReg, XmmReg, Mem, Imm) + //! @overload INST_4i(vshufpd, kInstVshufpd, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vshufpd, kInstVshufpd, YmmReg, YmmReg, Mem, Imm) + //! Shuffle SP-FP (AVX). INST_4i(vshufps, kInstVshufps, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vshufps, kInstVshufps, XmmReg, XmmReg, Mem, Imm) + //! @overload INST_4i(vshufps, kInstVshufps, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vshufps, kInstVshufps, YmmReg, YmmReg, Mem, Imm) + //! Packed DP-FP square root (AVX). INST_2x(vsqrtpd, kInstVsqrtpd, XmmReg, XmmReg) + //! @overload INST_2x(vsqrtpd, kInstVsqrtpd, XmmReg, Mem) + //! @overload INST_2x(vsqrtpd, kInstVsqrtpd, YmmReg, YmmReg) + //! @overload INST_2x(vsqrtpd, kInstVsqrtpd, YmmReg, Mem) + //! Packed SP-FP square root (AVX). INST_2x(vsqrtps, kInstVsqrtps, XmmReg, XmmReg) + //! @overload INST_2x(vsqrtps, kInstVsqrtps, XmmReg, Mem) + //! @overload INST_2x(vsqrtps, kInstVsqrtps, YmmReg, YmmReg) + //! @overload INST_2x(vsqrtps, kInstVsqrtps, YmmReg, Mem) + //! Scalar DP-FP square root (AVX). INST_3x(vsqrtsd, kInstVsqrtsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vsqrtsd, kInstVsqrtsd, XmmReg, XmmReg, Mem) + //! Scalar SP-FP square root (AVX). INST_3x(vsqrtss, kInstVsqrtss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vsqrtss, kInstVsqrtss, XmmReg, XmmReg, Mem) + //! Store streaming SIMD extension control/status (AVX). INST_1x(vstmxcsr, kInstVstmxcsr, Mem) + //! Packed DP-FP subtract (AVX). INST_3x(vsubpd, kInstVsubpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vsubpd, kInstVsubpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vsubpd, kInstVsubpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vsubpd, kInstVsubpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP subtract (AVX). INST_3x(vsubps, kInstVsubps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vsubps, kInstVsubps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vsubps, kInstVsubps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vsubps, kInstVsubps, YmmReg, YmmReg, Mem) + //! Scalar DP-FP subtract (AVX). INST_3x(vsubsd, kInstVsubsd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vsubsd, kInstVsubsd, XmmReg, XmmReg, Mem) + //! Scalar SP-FP subtract (AVX). INST_3x(vsubss, kInstVsubss, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vsubss, kInstVsubss, XmmReg, XmmReg, Mem) - INST_2x(vtestps, kInstVtestps, XmmReg, XmmReg) - INST_2x(vtestps, kInstVtestps, XmmReg, Mem) - INST_2x(vtestps, kInstVtestps, YmmReg, YmmReg) - INST_2x(vtestps, kInstVtestps, YmmReg, Mem) - + //! Logical compare DP-FP (AVX). INST_2x(vtestpd, kInstVtestpd, XmmReg, XmmReg) + //! @overload INST_2x(vtestpd, kInstVtestpd, XmmReg, Mem) + //! @overload INST_2x(vtestpd, kInstVtestpd, YmmReg, YmmReg) + //! @overload INST_2x(vtestpd, kInstVtestpd, YmmReg, Mem) + //! Logical compare SP-FP (AVX). + INST_2x(vtestps, kInstVtestps, XmmReg, XmmReg) + //! @overload + INST_2x(vtestps, kInstVtestps, XmmReg, Mem) + //! @overload + INST_2x(vtestps, kInstVtestps, YmmReg, YmmReg) + //! @overload + INST_2x(vtestps, kInstVtestps, YmmReg, Mem) + + //! Scalar DP-FP unordered compare and set EFLAGS (AVX). INST_2x(vucomisd, kInstVucomisd, XmmReg, XmmReg) + //! @overload INST_2x(vucomisd, kInstVucomisd, XmmReg, Mem) + //! Unordered scalar SP-FP compare and set EFLAGS (AVX). INST_2x(vucomiss, kInstVucomiss, XmmReg, XmmReg) + //! @overload INST_2x(vucomiss, kInstVucomiss, XmmReg, Mem) + //! Unpack and interleave high packed DP-FP (AVX). INST_3x(vunpckhpd, kInstVunpckhpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vunpckhpd, kInstVunpckhpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vunpckhpd, kInstVunpckhpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vunpckhpd, kInstVunpckhpd, YmmReg, YmmReg, Mem) + //! Unpack high packed SP-FP data (AVX). INST_3x(vunpckhps, kInstVunpckhps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vunpckhps, kInstVunpckhps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vunpckhps, kInstVunpckhps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vunpckhps, kInstVunpckhps, YmmReg, YmmReg, Mem) + //! Unpack and interleave low packed DP-FP (AVX). INST_3x(vunpcklpd, kInstVunpcklpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vunpcklpd, kInstVunpcklpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vunpcklpd, kInstVunpcklpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vunpcklpd, kInstVunpcklpd, YmmReg, YmmReg, Mem) + //! Unpack low packed SP-FP data (AVX). INST_3x(vunpcklps, kInstVunpcklps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vunpcklps, kInstVunpcklps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vunpcklps, kInstVunpcklps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vunpcklps, kInstVunpcklps, YmmReg, YmmReg, Mem) + //! Packed DP-FP bitwise xor (AVX). INST_3x(vxorpd, kInstVxorpd, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vxorpd, kInstVxorpd, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vxorpd, kInstVxorpd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vxorpd, kInstVxorpd, YmmReg, YmmReg, Mem) + //! Packed SP-FP bitwise xor (AVX). INST_3x(vxorps, kInstVxorps, XmmReg, XmmReg, XmmReg) + //! @overload INST_3x(vxorps, kInstVxorps, XmmReg, XmmReg, Mem) + //! @overload INST_3x(vxorps, kInstVxorps, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vxorps, kInstVxorps, YmmReg, YmmReg, Mem) + //! Zero all YMM registers. INST_0x(vzeroall, kInstVzeroall) + //! Zero upper 128-bits of all YMM registers. INST_0x(vzeroupper, kInstVzeroupper) // -------------------------------------------------------------------------- // [AVX+AESNI] // -------------------------------------------------------------------------- - //! @brief Perform a single round of the AES decryption flow (AVX+AESNI). + //! Perform a single round of the AES decryption flow (AVX+AESNI). INST_3x(vaesdec, kInstVaesdec, XmmReg, XmmReg, XmmReg) //! @overload INST_3x(vaesdec, kInstVaesdec, XmmReg, XmmReg, Mem) - //! @brief Perform the last round of the AES decryption flow (AVX+AESNI). + //! Perform the last round of the AES decryption flow (AVX+AESNI). INST_3x(vaesdeclast, kInstVaesdeclast, XmmReg, XmmReg, XmmReg) //! @overload INST_3x(vaesdeclast, kInstVaesdeclast, XmmReg, XmmReg, Mem) - //! @brief Perform a single round of the AES encryption flow (AVX+AESNI). + //! Perform a single round of the AES encryption flow (AVX+AESNI). INST_3x(vaesenc, kInstVaesenc, XmmReg, XmmReg, XmmReg) //! @overload INST_3x(vaesenc, kInstVaesenc, XmmReg, XmmReg, Mem) - //! @brief Perform the last round of the AES encryption flow (AVX+AESNI). + //! Perform the last round of the AES encryption flow (AVX+AESNI). INST_3x(vaesenclast, kInstVaesenclast, XmmReg, XmmReg, XmmReg) //! @overload INST_3x(vaesenclast, kInstVaesenclast, XmmReg, XmmReg, Mem) - //! @brief Perform the InvMixColumns transformation (AVX+AESNI). + //! Perform the InvMixColumns transformation (AVX+AESNI). INST_2x(vaesimc, kInstVaesimc, XmmReg, XmmReg) //! @overload INST_2x(vaesimc, kInstVaesimc, XmmReg, Mem) - //! @brief Assist in expanding the AES cipher key (AVX+AESNI). + //! Assist in expanding the AES cipher key (AVX+AESNI). INST_3i(vaeskeygenassist, kInstVaeskeygenassist, XmmReg, XmmReg, Imm) //! @overload INST_3i(vaeskeygenassist, kInstVaeskeygenassist, XmmReg, Mem, Imm) @@ -4363,170 +5014,278 @@ struct X86X64Assembler : public BaseAssembler { // [AVX+PCLMULQDQ] // -------------------------------------------------------------------------- + //! Carry-less multiplication QWORD (AVX+PCLMULQDQ). INST_4i(vpclmulqdq, kInstVpclmulqdq, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vpclmulqdq, kInstVpclmulqdq, XmmReg, XmmReg, Mem, Imm) // -------------------------------------------------------------------------- // [AVX2] // -------------------------------------------------------------------------- + //! Broadcast low 128-bit element in `o1` to `o0` (AVX2). INST_2x(vbroadcasti128, kInstVbroadcasti128, YmmReg, Mem) - + //! Broadcast low DP-FP element in `o1` to `o0` (AVX2). INST_2x(vbroadcastsd, kInstVbroadcastsd, YmmReg, XmmReg) - + //! Broadcast low SP-FP element in `o1` to `o0` (AVX2). INST_2x(vbroadcastss, kInstVbroadcastss, XmmReg, XmmReg) + //! @overload INST_2x(vbroadcastss, kInstVbroadcastss, YmmReg, XmmReg) + //! Extract 128-bit element from `o1` to `o0` based on selector (AVX2). INST_3i(vextracti128, kInstVextracti128, XmmReg, YmmReg, Imm) + //! @overload INST_3i(vextracti128, kInstVextracti128, Mem, YmmReg, Imm) + //! Gather DP-FP from DWORD indicies specified in `o1`s VSIB (AVX2). INST_3x(vgatherdpd, kInstVgatherdpd, XmmReg, Mem, XmmReg) + //! @overload INST_3x(vgatherdpd, kInstVgatherdpd, YmmReg, Mem, YmmReg) + //! Gather SP-FP from DWORD indicies specified in `o1`s VSIB (AVX2). INST_3x(vgatherdps, kInstVgatherdps, XmmReg, Mem, XmmReg) + //! @overload INST_3x(vgatherdps, kInstVgatherdps, YmmReg, Mem, YmmReg) + //! Gather DP-FP from QWORD indicies specified in `o1`s VSIB (AVX2). INST_3x(vgatherqpd, kInstVgatherqpd, XmmReg, Mem, XmmReg) + //! @overload INST_3x(vgatherqpd, kInstVgatherqpd, YmmReg, Mem, YmmReg) + //! Gather SP-FP from QWORD indicies specified in `o1`s VSIB (AVX2). INST_3x(vgatherqps, kInstVgatherqps, XmmReg, Mem, XmmReg) + //! Insert 128-bit of packed data based on selector (AVX2). INST_4i(vinserti128, kInstVinserti128, YmmReg, YmmReg, XmmReg, Imm) + //! @overload INST_4i(vinserti128, kInstVinserti128, YmmReg, YmmReg, Mem, Imm) + //! Load 256-bits aligned using NT hint (AVX2). INST_2x(vmovntdqa, kInstVmovntdqa, YmmReg, Mem) + //! Packed WORD sums of absolute difference (AVX2). INST_4i(vmpsadbw, kInstVmpsadbw, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vmpsadbw, kInstVmpsadbw, YmmReg, YmmReg, Mem, Imm) + //! Packed BYTE absolute value (AVX2). INST_2x(vpabsb, kInstVpabsb, YmmReg, YmmReg) + //! @overload INST_2x(vpabsb, kInstVpabsb, YmmReg, Mem) + //! Packed DWORD absolute value (AVX2). INST_2x(vpabsd, kInstVpabsd, YmmReg, YmmReg) + //! @overload INST_2x(vpabsd, kInstVpabsd, YmmReg, Mem) + //! Packed WORD absolute value (AVX2). INST_2x(vpabsw, kInstVpabsw, YmmReg, YmmReg) + //! @overload INST_2x(vpabsw, kInstVpabsw, YmmReg, Mem) + //! Pack DWORDs to WORDs with signed saturation (AVX2). INST_3x(vpackssdw, kInstVpackssdw, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpackssdw, kInstVpackssdw, YmmReg, YmmReg, Mem) + //! Pack WORDs to BYTEs with signed saturation (AVX2). INST_3x(vpacksswb, kInstVpacksswb, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpacksswb, kInstVpacksswb, YmmReg, YmmReg, Mem) + //! Pack DWORDs to WORDs with unsigned saturation (AVX2). INST_3x(vpackusdw, kInstVpackusdw, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpackusdw, kInstVpackusdw, YmmReg, YmmReg, Mem) + //! Pack WORDs to BYTEs with unsigned saturation (AVX2). INST_3x(vpackuswb, kInstVpackuswb, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpackuswb, kInstVpackuswb, YmmReg, YmmReg, Mem) + //! Packed BYTE add (AVX2). INST_3x(vpaddb, kInstVpaddb, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpaddb, kInstVpaddb, YmmReg, YmmReg, Mem) + //! Packed DWORD add (AVX2). INST_3x(vpaddd, kInstVpaddd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpaddd, kInstVpaddd, YmmReg, YmmReg, Mem) + //! Packed QDWORD add (AVX2). INST_3x(vpaddq, kInstVpaddq, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpaddq, kInstVpaddq, YmmReg, YmmReg, Mem) + //! Packed WORD add (AVX2). INST_3x(vpaddw, kInstVpaddw, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpaddw, kInstVpaddw, YmmReg, YmmReg, Mem) + //! Packed BYTE add with saturation (AVX2). INST_3x(vpaddsb, kInstVpaddsb, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpaddsb, kInstVpaddsb, YmmReg, YmmReg, Mem) + //! Packed WORD add with saturation (AVX2). INST_3x(vpaddsw, kInstVpaddsw, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpaddsw, kInstVpaddsw, YmmReg, YmmReg, Mem) + //! Packed BYTE add with unsigned saturation (AVX2). INST_3x(vpaddusb, kInstVpaddusb, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpaddusb, kInstVpaddusb, YmmReg, YmmReg, Mem) + //! Packed WORD add with unsigned saturation (AVX2). INST_3x(vpaddusw, kInstVpaddusw, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpaddusw, kInstVpaddusw, YmmReg, YmmReg, Mem) + //! Packed align right (AVX2). INST_4i(vpalignr, kInstVpalignr, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vpalignr, kInstVpalignr, YmmReg, YmmReg, Mem, Imm) + //! Packed bitwise and (AVX2). INST_3x(vpand, kInstVpand, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpand, kInstVpand, YmmReg, YmmReg, Mem) + //! Packed bitwise and-not (AVX2). INST_3x(vpandn, kInstVpandn, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpandn, kInstVpandn, YmmReg, YmmReg, Mem) + //! Packed BYTE average (AVX2). INST_3x(vpavgb, kInstVpavgb, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpavgb, kInstVpavgb, YmmReg, YmmReg, Mem) + //! Packed WORD average (AVX2). INST_3x(vpavgw, kInstVpavgw, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpavgw, kInstVpavgw, YmmReg, YmmReg, Mem) + //! Packed DWORD blend (AVX2). INST_4i(vpblendd, kInstVpblendd, XmmReg, XmmReg, XmmReg, Imm) + //! @overload INST_4i(vpblendd, kInstVpblendd, XmmReg, XmmReg, Mem, Imm) + //! @overload INST_4i(vpblendd, kInstVpblendd, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vpblendd, kInstVpblendd, YmmReg, YmmReg, Mem, Imm) + //! Packed DWORD variable blend (AVX2). INST_4x(vpblendvb, kInstVpblendvb, YmmReg, YmmReg, YmmReg, YmmReg) + //! @overload INST_4x(vpblendvb, kInstVpblendvb, YmmReg, YmmReg, Mem, YmmReg) + //! Packed WORD blend (AVX2). INST_4i(vpblendw, kInstVpblendw, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vpblendw, kInstVpblendw, YmmReg, YmmReg, Mem, Imm) + //! Broadcast BYTE from `o1` to 128-bits in `o0` (AVX2). INST_2x(vpbroadcastb, kInstVpbroadcastb, XmmReg, XmmReg) + //! @overload INST_2x(vpbroadcastb, kInstVpbroadcastb, XmmReg, Mem) + //! Broadcast BYTE from `o1` to 256-bits in `o0` (AVX2). INST_2x(vpbroadcastb, kInstVpbroadcastb, YmmReg, XmmReg) + //! @overload INST_2x(vpbroadcastb, kInstVpbroadcastb, YmmReg, Mem) + //! Broadcast DWORD from `o1` to 128-bits in `o0` (AVX2). INST_2x(vpbroadcastd, kInstVpbroadcastd, XmmReg, XmmReg) + //! @overload INST_2x(vpbroadcastd, kInstVpbroadcastd, XmmReg, Mem) + //! Broadcast DWORD from `o1` to 256-bits in `o0` (AVX2). INST_2x(vpbroadcastd, kInstVpbroadcastd, YmmReg, XmmReg) + //! @overload INST_2x(vpbroadcastd, kInstVpbroadcastd, YmmReg, Mem) + //! Broadcast QWORD from `o1` to 128-bits in `o0` (AVX2). INST_2x(vpbroadcastq, kInstVpbroadcastq, XmmReg, XmmReg) + //! @overload INST_2x(vpbroadcastq, kInstVpbroadcastq, XmmReg, Mem) + //! Broadcast QWORD from `o1` to 256-bits in `o0` (AVX2). INST_2x(vpbroadcastq, kInstVpbroadcastq, YmmReg, XmmReg) + //! @overload INST_2x(vpbroadcastq, kInstVpbroadcastq, YmmReg, Mem) + //! Broadcast WORD from `o1` to 128-bits in `o0` (AVX2). INST_2x(vpbroadcastw, kInstVpbroadcastw, XmmReg, XmmReg) + //! @overload INST_2x(vpbroadcastw, kInstVpbroadcastw, XmmReg, Mem) + //! Broadcast WORD from `o1` to 256-bits in `o0` (AVX2). INST_2x(vpbroadcastw, kInstVpbroadcastw, YmmReg, XmmReg) + //! @overload INST_2x(vpbroadcastw, kInstVpbroadcastw, YmmReg, Mem) + //! Packed BYTEs compare for equality (AVX2). INST_3x(vpcmpeqb, kInstVpcmpeqb, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpcmpeqb, kInstVpcmpeqb, YmmReg, YmmReg, Mem) + //! Packed DWORDs compare for equality (AVX2). INST_3x(vpcmpeqd, kInstVpcmpeqd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpcmpeqd, kInstVpcmpeqd, YmmReg, YmmReg, Mem) + //! Packed QWORDs compare for equality (AVX2). INST_3x(vpcmpeqq, kInstVpcmpeqq, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpcmpeqq, kInstVpcmpeqq, YmmReg, YmmReg, Mem) + //! Packed WORDs compare for equality (AVX2). INST_3x(vpcmpeqw, kInstVpcmpeqw, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpcmpeqw, kInstVpcmpeqw, YmmReg, YmmReg, Mem) + //! Packed BYTEs compare if greater than (AVX2). INST_3x(vpcmpgtb, kInstVpcmpgtb, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpcmpgtb, kInstVpcmpgtb, YmmReg, YmmReg, Mem) + //! Packed DWORDs compare if greater than (AVX2). INST_3x(vpcmpgtd, kInstVpcmpgtd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpcmpgtd, kInstVpcmpgtd, YmmReg, YmmReg, Mem) + //! Packed QWORDs compare if greater than (AVX2). INST_3x(vpcmpgtq, kInstVpcmpgtq, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpcmpgtq, kInstVpcmpgtq, YmmReg, YmmReg, Mem) + //! Packed WORDs compare if greater than (AVX2). INST_3x(vpcmpgtw, kInstVpcmpgtw, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpcmpgtw, kInstVpcmpgtw, YmmReg, YmmReg, Mem) + //! Packed OWORD permute (AVX2). INST_4i(vperm2i128, kInstVperm2i128, YmmReg, YmmReg, YmmReg, Imm) + //! @overload INST_4i(vperm2i128, kInstVperm2i128, YmmReg, YmmReg, Mem, Imm) + //! Packed DWORD permute (AVX2). INST_3x(vpermd, kInstVpermd, YmmReg, YmmReg, YmmReg) + //! @overload INST_3x(vpermd, kInstVpermd, YmmReg, YmmReg, Mem) - INST_3x(vpermps, kInstVpermps, YmmReg, YmmReg, YmmReg) - INST_3x(vpermps, kInstVpermps, YmmReg, YmmReg, Mem) - + //! Packed DP-FP permute (AVX2). INST_3i(vpermpd, kInstVpermpd, YmmReg, YmmReg, Imm) + //! @overload INST_3i(vpermpd, kInstVpermpd, YmmReg, Mem, Imm) + //! Packed SP-FP permute (AVX2). + INST_3x(vpermps, kInstVpermps, YmmReg, YmmReg, YmmReg) + //! @overload + INST_3x(vpermps, kInstVpermps, YmmReg, YmmReg, Mem) + + //! Packed QWORD permute (AVX2). INST_3i(vpermq, kInstVpermq, YmmReg, YmmReg, Imm) + //! @overload INST_3i(vpermq, kInstVpermq, YmmReg, Mem, Imm) INST_3x(vpgatherdd, kInstVpgatherdd, XmmReg, Mem, XmmReg) @@ -4540,95 +5299,107 @@ struct X86X64Assembler : public BaseAssembler { INST_3x(vpgatherqq, kInstVpgatherqq, XmmReg, Mem, XmmReg) INST_3x(vpgatherqq, kInstVpgatherqq, YmmReg, Mem, YmmReg) - INST_2x(vpmovmskb, kInstVpmovmskb, GpReg, YmmReg) - - INST_2x(vpmovsxbd, kInstVpmovsxbd, YmmReg, Mem) - INST_2x(vpmovsxbd, kInstVpmovsxbd, YmmReg, XmmReg) - - INST_2x(vpmovsxbq, kInstVpmovsxbq, YmmReg, Mem) - INST_2x(vpmovsxbq, kInstVpmovsxbq, YmmReg, XmmReg) - - INST_2x(vpmovsxbw, kInstVpmovsxbw, YmmReg, Mem) - INST_2x(vpmovsxbw, kInstVpmovsxbw, YmmReg, XmmReg) - - INST_2x(vpmovsxdq, kInstVpmovsxdq, YmmReg, Mem) - INST_2x(vpmovsxdq, kInstVpmovsxdq, YmmReg, XmmReg) - - INST_2x(vpmovsxwd, kInstVpmovsxwd, YmmReg, Mem) - INST_2x(vpmovsxwd, kInstVpmovsxwd, YmmReg, XmmReg) - - INST_2x(vpmovsxwq, kInstVpmovsxwq, YmmReg, Mem) - INST_2x(vpmovsxwq, kInstVpmovsxwq, YmmReg, XmmReg) - - INST_2x(vpmovzxbd, kInstVpmovzxbd, YmmReg, Mem) - INST_2x(vpmovzxbd, kInstVpmovzxbd, YmmReg, XmmReg) - - INST_2x(vpmovzxbq, kInstVpmovzxbq, YmmReg, Mem) - INST_2x(vpmovzxbq, kInstVpmovzxbq, YmmReg, XmmReg) - - INST_2x(vpmovzxbw, kInstVpmovzxbw, YmmReg, Mem) - INST_2x(vpmovzxbw, kInstVpmovzxbw, YmmReg, XmmReg) - - INST_2x(vpmovzxdq, kInstVpmovzxdq, YmmReg, Mem) - INST_2x(vpmovzxdq, kInstVpmovzxdq, YmmReg, XmmReg) - - INST_2x(vpmovzxwd, kInstVpmovzxwd, YmmReg, Mem) - INST_2x(vpmovzxwd, kInstVpmovzxwd, YmmReg, XmmReg) - - INST_2x(vpmovzxwq, kInstVpmovzxwq, YmmReg, Mem) - INST_2x(vpmovzxwq, kInstVpmovzxwq, YmmReg, XmmReg) - - INST_3i(vpshufd, kInstVpshufd, YmmReg, Mem, Imm) - INST_3i(vpshufd, kInstVpshufd, YmmReg, YmmReg, Imm) - - INST_3i(vpshufhw, kInstVpshufhw, YmmReg, Mem, Imm) - INST_3i(vpshufhw, kInstVpshufhw, YmmReg, YmmReg, Imm) - - INST_3i(vpshuflw, kInstVpshuflw, YmmReg, Mem, Imm) - INST_3i(vpshuflw, kInstVpshuflw, YmmReg, YmmReg, Imm) - - INST_3i(vpslld, kInstVpslld, YmmReg, YmmReg, Imm) - - INST_3i(vpslldq, kInstVpslldq, YmmReg, YmmReg, Imm) - - INST_3i(vpsllq, kInstVpsllq, YmmReg, YmmReg, Imm) - - INST_3i(vpsllw, kInstVpsllw, YmmReg, YmmReg, Imm) - - INST_3i(vpsrad, kInstVpsrad, YmmReg, YmmReg, Imm) - - INST_3i(vpsraw, kInstVpsraw, YmmReg, YmmReg, Imm) - - INST_3i(vpsrld, kInstVpsrld, YmmReg, YmmReg, Imm) - - INST_3i(vpsrldq, kInstVpsrldq, YmmReg, YmmReg, Imm) - - INST_3i(vpsrlq, kInstVpsrlq, YmmReg, YmmReg, Imm) - - INST_3i(vpsrlw, kInstVpsrlw, YmmReg, YmmReg, Imm) - + //! Packed DWORD horizontal add (AVX2). INST_3x(vphaddd, kInstVphaddd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vphaddd, kInstVphaddd, YmmReg, YmmReg, YmmReg) + //! Packed WORD horizontal add with saturation (AVX2). INST_3x(vphaddsw, kInstVphaddsw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vphaddsw, kInstVphaddsw, YmmReg, YmmReg, YmmReg) + //! Packed WORD horizontal add (AVX2). INST_3x(vphaddw, kInstVphaddw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vphaddw, kInstVphaddw, YmmReg, YmmReg, YmmReg) + //! Packed DWORD horizontal subtract (AVX2). INST_3x(vphsubd, kInstVphsubd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vphsubd, kInstVphsubd, YmmReg, YmmReg, YmmReg) + //! Packed WORD horizontal subtract with saturation (AVX2). INST_3x(vphsubsw, kInstVphsubsw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vphsubsw, kInstVphsubsw, YmmReg, YmmReg, YmmReg) + //! Packed WORD horizontal subtract (AVX2). INST_3x(vphsubw, kInstVphsubw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vphsubw, kInstVphsubw, YmmReg, YmmReg, YmmReg) + //! Move Byte mask to integer (AVX2). + INST_2x(vpmovmskb, kInstVpmovmskb, GpReg, YmmReg) + + //! BYTE to DWORD with sign extend (AVX). + INST_2x(vpmovsxbd, kInstVpmovsxbd, YmmReg, Mem) + //! @overload + INST_2x(vpmovsxbd, kInstVpmovsxbd, YmmReg, XmmReg) + + //! Packed BYTE to QWORD with sign extend (AVX2). + INST_2x(vpmovsxbq, kInstVpmovsxbq, YmmReg, Mem) + //! @overload + INST_2x(vpmovsxbq, kInstVpmovsxbq, YmmReg, XmmReg) + + //! Packed BYTE to WORD with sign extend (AVX2). + INST_2x(vpmovsxbw, kInstVpmovsxbw, YmmReg, Mem) + //! @overload + INST_2x(vpmovsxbw, kInstVpmovsxbw, YmmReg, XmmReg) + + //! Packed DWORD to QWORD with sign extend (AVX2). + INST_2x(vpmovsxdq, kInstVpmovsxdq, YmmReg, Mem) + //! @overload + INST_2x(vpmovsxdq, kInstVpmovsxdq, YmmReg, XmmReg) + + //! Packed WORD to DWORD with sign extend (AVX2). + INST_2x(vpmovsxwd, kInstVpmovsxwd, YmmReg, Mem) + //! @overload + INST_2x(vpmovsxwd, kInstVpmovsxwd, YmmReg, XmmReg) + + //! Packed WORD to QWORD with sign extend (AVX2). + INST_2x(vpmovsxwq, kInstVpmovsxwq, YmmReg, Mem) + //! @overload + INST_2x(vpmovsxwq, kInstVpmovsxwq, YmmReg, XmmReg) + + //! BYTE to DWORD with zero extend (AVX2). + INST_2x(vpmovzxbd, kInstVpmovzxbd, YmmReg, Mem) + //! @overload + INST_2x(vpmovzxbd, kInstVpmovzxbd, YmmReg, XmmReg) + + //! Packed BYTE to QWORD with zero extend (AVX2). + INST_2x(vpmovzxbq, kInstVpmovzxbq, YmmReg, Mem) + //! @overload + INST_2x(vpmovzxbq, kInstVpmovzxbq, YmmReg, XmmReg) + + //! BYTE to WORD with zero extend (AVX2). + INST_2x(vpmovzxbw, kInstVpmovzxbw, YmmReg, Mem) + //! @overload + INST_2x(vpmovzxbw, kInstVpmovzxbw, YmmReg, XmmReg) + + //! Packed DWORD to QWORD with zero extend (AVX2). + INST_2x(vpmovzxdq, kInstVpmovzxdq, YmmReg, Mem) + //! @overload + INST_2x(vpmovzxdq, kInstVpmovzxdq, YmmReg, XmmReg) + + //! Packed WORD to DWORD with zero extend (AVX2). + INST_2x(vpmovzxwd, kInstVpmovzxwd, YmmReg, Mem) + //! @overload + INST_2x(vpmovzxwd, kInstVpmovzxwd, YmmReg, XmmReg) + + //! Packed WORD to QWORD with zero extend (AVX2). + INST_2x(vpmovzxwq, kInstVpmovzxwq, YmmReg, Mem) + //! @overload + INST_2x(vpmovzxwq, kInstVpmovzxwq, YmmReg, XmmReg) + + //! Packed multiply and add signed and unsigned bytes (AVX2). INST_3x(vpmaddubsw, kInstVpmaddubsw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmaddubsw, kInstVpmaddubsw, YmmReg, YmmReg, YmmReg) + //! Packed WORD multiply and add to packed DWORD (AVX2). INST_3x(vpmaddwd, kInstVpmaddwd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmaddwd, kInstVpmaddwd, YmmReg, YmmReg, YmmReg) INST_3x(vpmaskmovd, kInstVpmaskmovd, Mem, XmmReg, XmmReg) @@ -4641,86 +5412,162 @@ struct X86X64Assembler : public BaseAssembler { INST_3x(vpmaskmovq, kInstVpmaskmovq, XmmReg, XmmReg, Mem) INST_3x(vpmaskmovq, kInstVpmaskmovq, YmmReg, YmmReg, Mem) + //! Packed BYTE maximum (AVX2). INST_3x(vpmaxsb, kInstVpmaxsb, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmaxsb, kInstVpmaxsb, YmmReg, YmmReg, YmmReg) + //! Packed DWORD maximum (AVX2). INST_3x(vpmaxsd, kInstVpmaxsd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmaxsd, kInstVpmaxsd, YmmReg, YmmReg, YmmReg) + //! Packed WORD maximum (AVX2). INST_3x(vpmaxsw, kInstVpmaxsw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmaxsw, kInstVpmaxsw, YmmReg, YmmReg, YmmReg) + //! Packed BYTE unsigned maximum (AVX2). INST_3x(vpmaxub, kInstVpmaxub, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmaxub, kInstVpmaxub, YmmReg, YmmReg, YmmReg) + //! Packed DWORD unsigned maximum (AVX2). INST_3x(vpmaxud, kInstVpmaxud, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmaxud, kInstVpmaxud, YmmReg, YmmReg, YmmReg) + //! Packed WORD unsigned maximum (AVX2). INST_3x(vpmaxuw, kInstVpmaxuw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmaxuw, kInstVpmaxuw, YmmReg, YmmReg, YmmReg) + //! Packed BYTE minimum (AVX2). INST_3x(vpminsb, kInstVpminsb, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpminsb, kInstVpminsb, YmmReg, YmmReg, YmmReg) + //! Packed DWORD minimum (AVX2). INST_3x(vpminsd, kInstVpminsd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpminsd, kInstVpminsd, YmmReg, YmmReg, YmmReg) + //! Packed WORD minimum (AVX2). INST_3x(vpminsw, kInstVpminsw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpminsw, kInstVpminsw, YmmReg, YmmReg, YmmReg) + //! Packed BYTE unsigned minimum (AVX2). INST_3x(vpminub, kInstVpminub, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpminub, kInstVpminub, YmmReg, YmmReg, YmmReg) + //! Packed DWORD unsigned minimum (AVX2). INST_3x(vpminud, kInstVpminud, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpminud, kInstVpminud, YmmReg, YmmReg, YmmReg) + //! Packed WORD unsigned minimum (AVX2). INST_3x(vpminuw, kInstVpminuw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpminuw, kInstVpminuw, YmmReg, YmmReg, YmmReg) + //! Packed DWORD to QWORD multiply (AVX2). INST_3x(vpmuldq, kInstVpmuldq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmuldq, kInstVpmuldq, YmmReg, YmmReg, YmmReg) + //! Packed WORD multiply high, round and scale (AVX2). INST_3x(vpmulhrsw, kInstVpmulhrsw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmulhrsw, kInstVpmulhrsw, YmmReg, YmmReg, YmmReg) + //! Packed WORD unsigned multiply high (AVX2). INST_3x(vpmulhuw, kInstVpmulhuw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmulhuw, kInstVpmulhuw, YmmReg, YmmReg, YmmReg) + //! Packed WORD multiply high (AVX2). INST_3x(vpmulhw, kInstVpmulhw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmulhw, kInstVpmulhw, YmmReg, YmmReg, YmmReg) + //! Packed DWORD multiply low (AVX2). INST_3x(vpmulld, kInstVpmulld, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmulld, kInstVpmulld, YmmReg, YmmReg, YmmReg) + //! Packed WORDs multiply low (AVX2). INST_3x(vpmullw, kInstVpmullw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmullw, kInstVpmullw, YmmReg, YmmReg, YmmReg) + //! Packed DWORD multiply to QWORD (AVX2). INST_3x(vpmuludq, kInstVpmuludq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpmuludq, kInstVpmuludq, YmmReg, YmmReg, YmmReg) + //! Packed bitwise or (AVX2). INST_3x(vpor, kInstVpor, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpor, kInstVpor, YmmReg, YmmReg, YmmReg) + //! Packed WORD sum of absolute differences (AVX2). INST_3x(vpsadbw, kInstVpsadbw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsadbw, kInstVpsadbw, YmmReg, YmmReg, YmmReg) + //! Packed BYTE shuffle (AVX2). INST_3x(vpshufb, kInstVpshufb, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpshufb, kInstVpshufb, YmmReg, YmmReg, YmmReg) + //! Packed DWORD shuffle (AVX2). + INST_3i(vpshufd, kInstVpshufd, YmmReg, Mem, Imm) + //! @overload + INST_3i(vpshufd, kInstVpshufd, YmmReg, YmmReg, Imm) + + //! Packed WORD shuffle high (AVX2). + INST_3i(vpshufhw, kInstVpshufhw, YmmReg, Mem, Imm) + //! @overload + INST_3i(vpshufhw, kInstVpshufhw, YmmReg, YmmReg, Imm) + + //! Packed WORD shuffle low (AVX2). + INST_3i(vpshuflw, kInstVpshuflw, YmmReg, Mem, Imm) + //! @overload + INST_3i(vpshuflw, kInstVpshuflw, YmmReg, YmmReg, Imm) + + //! Packed BYTE sign (AVX2). INST_3x(vpsignb, kInstVpsignb, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsignb, kInstVpsignb, YmmReg, YmmReg, YmmReg) + //! Packed DWORD sign (AVX2). INST_3x(vpsignd, kInstVpsignd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsignd, kInstVpsignd, YmmReg, YmmReg, YmmReg) + //! Packed WORD sign (AVX2). INST_3x(vpsignw, kInstVpsignw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsignw, kInstVpsignw, YmmReg, YmmReg, YmmReg) + //! Packed DWORD shift left logical (AVX2). INST_3x(vpslld, kInstVpslld, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpslld, kInstVpslld, YmmReg, YmmReg, XmmReg) + //! @overload + INST_3i(vpslld, kInstVpslld, YmmReg, YmmReg, Imm) + //! Packed OWORD shift left logical (AVX2). + INST_3i(vpslldq, kInstVpslldq, YmmReg, YmmReg, Imm) + + //! Packed QWORD shift left logical (AVX2). INST_3x(vpsllq, kInstVpsllq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsllq, kInstVpsllq, YmmReg, YmmReg, XmmReg) + //! @overload + INST_3i(vpsllq, kInstVpsllq, YmmReg, YmmReg, Imm) INST_3x(vpsllvd, kInstVpsllvd, XmmReg, XmmReg, Mem) INST_3x(vpsllvd, kInstVpsllvd, XmmReg, XmmReg, XmmReg) @@ -4732,26 +5579,49 @@ struct X86X64Assembler : public BaseAssembler { INST_3x(vpsllvq, kInstVpsllvq, YmmReg, YmmReg, Mem) INST_3x(vpsllvq, kInstVpsllvq, YmmReg, YmmReg, YmmReg) + //! Packed WORD shift left logical (AVX2). INST_3x(vpsllw, kInstVpsllw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsllw, kInstVpsllw, YmmReg, YmmReg, XmmReg) + //! Packed WORD shift left logical (AVX2). + INST_3i(vpsllw, kInstVpsllw, YmmReg, YmmReg, Imm) + //! Packed DWORD shift right arithmetic (AVX2). INST_3x(vpsrad, kInstVpsrad, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsrad, kInstVpsrad, YmmReg, YmmReg, XmmReg) + //! @overload + INST_3i(vpsrad, kInstVpsrad, YmmReg, YmmReg, Imm) INST_3x(vpsravd, kInstVpsravd, XmmReg, XmmReg, Mem) INST_3x(vpsravd, kInstVpsravd, XmmReg, XmmReg, XmmReg) INST_3x(vpsravd, kInstVpsravd, YmmReg, YmmReg, Mem) INST_3x(vpsravd, kInstVpsravd, YmmReg, YmmReg, YmmReg) + //! Packed WORD shift right arithmetic (AVX2). INST_3x(vpsraw, kInstVpsraw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsraw, kInstVpsraw, YmmReg, YmmReg, XmmReg) + //! @overload + INST_3i(vpsraw, kInstVpsraw, YmmReg, YmmReg, Imm) + //! Packed DWORD shift right logical (AVX2). INST_3x(vpsrld, kInstVpsrld, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsrld, kInstVpsrld, YmmReg, YmmReg, XmmReg) + //! @overload + INST_3i(vpsrld, kInstVpsrld, YmmReg, YmmReg, Imm) + //! Scalar OWORD shift right logical (AVX2). + INST_3i(vpsrldq, kInstVpsrldq, YmmReg, YmmReg, Imm) + + //! Packed QWORD shift right logical (AVX2). INST_3x(vpsrlq, kInstVpsrlq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsrlq, kInstVpsrlq, YmmReg, YmmReg, XmmReg) - + //! @overload + INST_3i(vpsrlq, kInstVpsrlq, YmmReg, YmmReg, Imm) + INST_3x(vpsrlvd, kInstVpsrlvd, XmmReg, XmmReg, Mem) INST_3x(vpsrlvd, kInstVpsrlvd, XmmReg, XmmReg, XmmReg) INST_3x(vpsrlvd, kInstVpsrlvd, YmmReg, YmmReg, Mem) @@ -4762,58 +5632,95 @@ struct X86X64Assembler : public BaseAssembler { INST_3x(vpsrlvq, kInstVpsrlvq, YmmReg, YmmReg, Mem) INST_3x(vpsrlvq, kInstVpsrlvq, YmmReg, YmmReg, YmmReg) + //! Packed WORD shift right logical (AVX2). INST_3x(vpsrlw, kInstVpsrlw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsrlw, kInstVpsrlw, YmmReg, YmmReg, XmmReg) + //! @overload + INST_3i(vpsrlw, kInstVpsrlw, YmmReg, YmmReg, Imm) + //! Packed BYTE subtract (AVX2). INST_3x(vpsubb, kInstVpsubb, YmmReg, YmmReg, Mem) INST_3x(vpsubb, kInstVpsubb, YmmReg, YmmReg, YmmReg) + //! Packed DWORD subtract (AVX2). INST_3x(vpsubd, kInstVpsubd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsubd, kInstVpsubd, YmmReg, YmmReg, YmmReg) + //! Packed QWORD subtract (AVX2). INST_3x(vpsubq, kInstVpsubq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsubq, kInstVpsubq, YmmReg, YmmReg, YmmReg) + //! Packed BYTE subtract with saturation (AVX2). INST_3x(vpsubsb, kInstVpsubsb, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsubsb, kInstVpsubsb, YmmReg, YmmReg, YmmReg) + //! Packed WORD subtract with saturation (AVX2). INST_3x(vpsubsw, kInstVpsubsw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsubsw, kInstVpsubsw, YmmReg, YmmReg, YmmReg) + //! Packed BYTE subtract with unsigned saturation (AVX2). INST_3x(vpsubusb, kInstVpsubusb, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsubusb, kInstVpsubusb, YmmReg, YmmReg, YmmReg) + //! Packed WORD subtract with unsigned saturation (AVX2). INST_3x(vpsubusw, kInstVpsubusw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsubusw, kInstVpsubusw, YmmReg, YmmReg, YmmReg) + //! Packed WORD subtract (AVX2). INST_3x(vpsubw, kInstVpsubw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpsubw, kInstVpsubw, YmmReg, YmmReg, YmmReg) + //! Unpack high packed BYTEs to WORDs (AVX2). INST_3x(vpunpckhbw, kInstVpunpckhbw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpunpckhbw, kInstVpunpckhbw, YmmReg, YmmReg, YmmReg) + //! Unpack high packed DWORDs to QWORDs (AVX2). INST_3x(vpunpckhdq, kInstVpunpckhdq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpunpckhdq, kInstVpunpckhdq, YmmReg, YmmReg, YmmReg) + //! Unpack high packed QWORDs to OWORD (AVX2). INST_3x(vpunpckhqdq, kInstVpunpckhqdq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpunpckhqdq, kInstVpunpckhqdq, YmmReg, YmmReg, YmmReg) + //! Unpack high packed WORDs to DWORDs (AVX2). INST_3x(vpunpckhwd, kInstVpunpckhwd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpunpckhwd, kInstVpunpckhwd, YmmReg, YmmReg, YmmReg) + //! Unpack low packed BYTEs to WORDs (AVX2). INST_3x(vpunpcklbw, kInstVpunpcklbw, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpunpcklbw, kInstVpunpcklbw, YmmReg, YmmReg, YmmReg) + //! Unpack low packed DWORDs to QWORDs (AVX2). INST_3x(vpunpckldq, kInstVpunpckldq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpunpckldq, kInstVpunpckldq, YmmReg, YmmReg, YmmReg) + //! Unpack low packed QWORDs to OWORD (AVX2). INST_3x(vpunpcklqdq, kInstVpunpcklqdq, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpunpcklqdq, kInstVpunpcklqdq, YmmReg, YmmReg, YmmReg) + //! Unpack low packed WORDs to DWORDs (AVX2). INST_3x(vpunpcklwd, kInstVpunpcklwd, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpunpcklwd, kInstVpunpcklwd, YmmReg, YmmReg, YmmReg) + //! Packed bitwise xor (AVX2). INST_3x(vpxor, kInstVpxor, YmmReg, YmmReg, Mem) + //! @overload INST_3x(vpxor, kInstVpxor, YmmReg, YmmReg, YmmReg) // -------------------------------------------------------------------------- @@ -5376,77 +6283,120 @@ struct X86X64Assembler : public BaseAssembler { // [BMI] // -------------------------------------------------------------------------- + //! Bitwise and-not (BMI). INST_3x(andn, kInstAndn, GpReg, GpReg, GpReg) + //! @overload INST_3x(andn, kInstAndn, GpReg, GpReg, Mem) + //! Bit field extract (BMI). INST_3x(bextr, kInstBextr, GpReg, GpReg, GpReg) + //! @overload INST_3x(bextr, kInstBextr, GpReg, Mem, GpReg) + //! Extract lower set isolated bit (BMI). INST_2x(blsi, kInstBlsi, GpReg, GpReg) + //! @overload INST_2x(blsi, kInstBlsi, GpReg, Mem) + //! Get mask up to lowest set bit (BMI). INST_2x(blsmsk, kInstBlsmsk, GpReg, GpReg) + //! @overload INST_2x(blsmsk, kInstBlsmsk, GpReg, Mem) + //! Reset lowest set bit (BMI). INST_2x(blsr, kInstBlsr, GpReg, GpReg) + //! @overload INST_2x(blsr, kInstBlsr, GpReg, Mem) + //! Count the number of trailing zero bits (BMI). INST_2x(tzcnt, kInstTzcnt, GpReg, GpReg) + //! @overload INST_2x(tzcnt, kInstTzcnt, GpReg, Mem) // -------------------------------------------------------------------------- // [LZCNT] // -------------------------------------------------------------------------- + //! Count the number of leading zero bits (LZCNT). INST_2x(lzcnt, kInstLzcnt, GpReg, GpReg) + //! @overload INST_2x(lzcnt, kInstLzcnt, GpReg, Mem) // -------------------------------------------------------------------------- // [BMI2] // -------------------------------------------------------------------------- + //! Zero high bits starting with specified bit position (BMI2). INST_3x(bzhi, kInstBzhi, GpReg, GpReg, GpReg) + //! @overload INST_3x(bzhi, kInstBzhi, GpReg, Mem, GpReg) + //! Unsigned multiply without affecting flags (BMI2). INST_3x(mulx, kInstMulx, GpReg, GpReg, GpReg) + //! @overload INST_3x(mulx, kInstMulx, GpReg, GpReg, Mem) + //! Parallel bits deposit (BMI2). INST_3x(pdep, kInstPdep, GpReg, GpReg, GpReg) + //! @overload INST_3x(pdep, kInstPdep, GpReg, GpReg, Mem) + //! Parallel bits extract (BMI2). INST_3x(pext, kInstPext, GpReg, GpReg, GpReg) + //! @overload INST_3x(pext, kInstPext, GpReg, GpReg, Mem) + //! Rotate right without affecting flags (BMI2). INST_3i(rorx, kInstRorx, GpReg, GpReg, Imm) + //! @overload INST_3i(rorx, kInstRorx, GpReg, Mem, Imm) + //! Shift arithmetic right without affecting flags (BMI2). INST_3x(sarx, kInstSarx, GpReg, GpReg, GpReg) + //! @overload INST_3x(sarx, kInstSarx, GpReg, Mem, GpReg) + //! Shift logical left without affecting flags (BMI2). INST_3x(shlx, kInstShlx, GpReg, GpReg, GpReg) + //! @overload INST_3x(shlx, kInstShlx, GpReg, Mem, GpReg) + //! Shift logical right without affecting flags (BMI2). INST_3x(shrx, kInstShrx, GpReg, GpReg, GpReg) + //! @overload INST_3x(shrx, kInstShrx, GpReg, Mem, GpReg) // -------------------------------------------------------------------------- // [RDRAND] // -------------------------------------------------------------------------- + //! Store a random number in destination register. + //! + //! Please do not use this instruction in cryptographic software. The result + //! doesn't necessarily have to be random which may cause a major security + //! issue in the software that relies on it. INST_1x(rdrand, kInstRdrand, GpReg) // -------------------------------------------------------------------------- // [F16C] // -------------------------------------------------------------------------- + //! Convert packed HP-FP to SP-FP. INST_2x(vcvtph2ps, kInstVcvtph2ps, XmmReg, XmmReg) + //! @overload INST_2x(vcvtph2ps, kInstVcvtph2ps, XmmReg, Mem) + //! @overload INST_2x(vcvtph2ps, kInstVcvtph2ps, YmmReg, XmmReg) + //! @overload INST_2x(vcvtph2ps, kInstVcvtph2ps, YmmReg, Mem) + //! Convert packed SP-FP to HP-FP. INST_3i(vcvtps2ph, kInstVcvtps2ph, XmmReg, XmmReg, Imm) + //! @overload INST_3i(vcvtps2ph, kInstVcvtps2ph, Mem, XmmReg, Imm) + //! @overload INST_3i(vcvtps2ph, kInstVcvtps2ph, XmmReg, YmmReg, Imm) + //! @overload INST_3i(vcvtps2ph, kInstVcvtps2ph, Mem, YmmReg, Imm) }; @@ -5467,7 +6417,7 @@ namespace x86 { //! @addtogroup asmjit_x86x64 //! @{ -//! @brief X86-only assembler. +//! X86-only assembler. struct Assembler : public X86X64Assembler { ASMJIT_NO_COPY(Assembler) @@ -5475,7 +6425,7 @@ struct Assembler : public X86X64Assembler { // [Construction / Destruction] // -------------------------------------------------------------------------- - ASMJIT_API Assembler(BaseRuntime* runtime); + ASMJIT_API Assembler(Runtime* runtime); ASMJIT_API virtual ~Assembler(); // -------------------------------------------------------------------------- @@ -5500,14 +6450,14 @@ struct Assembler : public X86X64Assembler { // [X86-Only Instructions] // -------------------------------------------------------------------------- - //! @brief Decimal adjust AL after addition (32-bit). + //! Decimal adjust AL after addition (32-bit). INST_0x(daa, kInstDaa) - //! @brief Decimal adjust AL after subtraction (32-bit). + //! Decimal adjust AL after subtraction (32-bit). INST_0x(das, kInstDas) - //! @brief Pop all Gp registers - EDI|ESI|EBP|Ign|EBX|EDX|ECX|EAX. + //! Pop all Gp registers - EDI|ESI|EBP|Ign|EBX|EDX|ECX|EAX. INST_0x(popa, kInstPopa) - //! @brief Push all Gp registers - EAX|ECX|EDX|EBX|ESP|EBP|ESI|EDI. + //! Push all Gp registers - EAX|ECX|EDX|EBX|ESP|EBP|ESI|EDI. INST_0x(pusha, kInstPusha) }; @@ -5530,7 +6480,7 @@ namespace x64 { //! @addtogroup asmjit_x86x64 //! @{ -//! @brief X64-only assembler. +//! X64-only assembler. struct Assembler : public X86X64Assembler { ASMJIT_NO_COPY(Assembler) @@ -5538,7 +6488,7 @@ struct Assembler : public X86X64Assembler { // [Construction / Destruction] // -------------------------------------------------------------------------- - ASMJIT_API Assembler(BaseRuntime* runtime); + ASMJIT_API Assembler(Runtime* runtime); ASMJIT_API virtual ~Assembler(); // -------------------------------------------------------------------------- @@ -5563,34 +6513,34 @@ struct Assembler : public X86X64Assembler { // [X64-Only Instructions] // -------------------------------------------------------------------------- - //! @brief Convert dword to qword (RAX <- Sign Extend EAX). + //! Convert dword to qword (RAX <- Sign Extend EAX). INST_0x(cdqe, kInstCdqe) - //! @brief Convert qword to oword (RDX:RAX <- Sign Extend RAX). + //! Convert qword to oword (RDX:RAX <- Sign Extend RAX). INST_0x(cqo, kInstCqo) - //! @brief Compares the 128-bit value in RDX:RAX with the memory operand (64-bit). + //! Compares the 128-bit value in RDX:RAX with the memory operand (64-bit). INST_1x(cmpxchg16b, kInstCmpxchg16b, Mem) - //! @brief Move dword to qword with sign-extension. + //! Move dword to qword with sign-extension. INST_2x(movsxd, kInstMovsxd, GpReg, GpReg) //! @overload INST_2x(movsxd, kInstMovsxd, GpReg, Mem) - //! @brief Load ECX/RCX QWORDs from DS:[ESI/RSI] to RAX. + //! Load ECX/RCX QWORDs from DS:[ESI/RSI] to RAX. INST_0x(rep_lodsq, kInstRepLodsq) - //! @brief Move ECX/RCX QWORDs from DS:[ESI/RSI] to ES:[EDI/RDI]. + //! Move ECX/RCX QWORDs from DS:[ESI/RSI] to ES:[EDI/RDI]. INST_0x(rep_movsq, kInstRepMovsq) - //! @brief Fill ECX/RCX QWORDs at ES:[EDI/RDI] with RAX. + //! Fill ECX/RCX QWORDs at ES:[EDI/RDI] with RAX. INST_0x(rep_stosq, kInstRepStosq) - //! @brief Repeated find nonmatching QWORDs in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching QWORDs in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_0x(repe_cmpsq, kInstRepeCmpsq) - //! @brief Find non-rax QWORD starting at ES:[EDI/RDI]. + //! Find non-rax QWORD starting at ES:[EDI/RDI]. INST_0x(repe_scasq, kInstRepeScasq) - //! @brief Repeated find nonmatching QWORDs in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching QWORDs in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_0x(repne_cmpsq, kInstRepneCmpsq) - //! @brief Find RAX, starting at ES:[EDI/RDI]. + //! Find RAX, starting at ES:[EDI/RDI]. INST_0x(repne_scasq, kInstRepneScasq) using X86X64Assembler::movq; diff --git a/src/asmjit/x86/x86compiler.cpp b/src/asmjit/x86/x86compiler.cpp index 3c6ab72..e560819 100644 --- a/src/asmjit/x86/x86compiler.cpp +++ b/src/asmjit/x86/x86compiler.cpp @@ -96,14 +96,14 @@ static Error X86X64Compiler_emitConstPool(X86X64Compiler* self, // [asmjit::x86x64::X86X64Compiler - Construction / Destruction] // ============================================================================ -X86X64Compiler::X86X64Compiler(BaseRuntime* runtime) : BaseCompiler(runtime) {} +X86X64Compiler::X86X64Compiler(Runtime* runtime) : BaseCompiler(runtime) {} X86X64Compiler::~X86X64Compiler() {} // ============================================================================ // [asmjit::x86x64::X86X64Compiler - Inst] // ============================================================================ -//! @brief Get compiler instruction item size without operands assigned. +//! Get compiler instruction item size without operands assigned. static ASMJIT_INLINE size_t X86X64Compiler_getInstSize(uint32_t code) { return (IntUtil::inInterval(code, _kInstJbegin, _kInstJend)) ? sizeof(JumpNode) : sizeof(InstNode); } @@ -600,7 +600,7 @@ _OnError: template static ASMJIT_INLINE void* X86X64Compiler_make(X86X64Compiler* self) { Assembler assembler(self->_runtime); - BaseLogger* logger = self->_logger; + Logger* logger = self->_logger; if (logger) { assembler.setLogger(logger); @@ -699,7 +699,7 @@ _Error: namespace asmjit { namespace x86 { -Compiler::Compiler(BaseRuntime* runtime) : X86X64Compiler(runtime) { +Compiler::Compiler(Runtime* runtime) : X86X64Compiler(runtime) { _arch = kArchX86; _regSize = 4; _targetVarMapping = _varMapping; @@ -721,7 +721,7 @@ Compiler::~Compiler() {} namespace asmjit { namespace x64 { -Compiler::Compiler(BaseRuntime* runtime) : X86X64Compiler(runtime) { +Compiler::Compiler(Runtime* runtime) : X86X64Compiler(runtime) { _arch = kArchX64; _regSize = 8; _targetVarMapping = _varMapping; diff --git a/src/asmjit/x86/x86compiler.h b/src/asmjit/x86/x86compiler.h index 4796656..750a1d7 100644 --- a/src/asmjit/x86/x86compiler.h +++ b/src/asmjit/x86/x86compiler.h @@ -21,9 +21,6 @@ namespace asmjit { namespace x86x64 { -//! @addtogroup asmjit_x86x64 -//! @{ - // ============================================================================ // [CodeGen-Begin] // ============================================================================ @@ -48,7 +45,7 @@ namespace x86x64 { ASMJIT_INLINE InstNode* _Inst_(const _Op0_& o0) { \ return emit(_Code_, o0); \ } \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE InstNode* _Inst_(int o0) { \ return emit(_Code_, o0); \ } @@ -58,7 +55,7 @@ namespace x86x64 { ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0); \ } \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE InstNode* _Inst_(int o0) { \ ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0); \ @@ -115,7 +112,7 @@ namespace x86x64 { ASMJIT_INLINE InstNode* _Inst_(const _Op0_& o0, const _Op1_& o1) { \ return emit(_Code_, o0, o1); \ } \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE InstNode* _Inst_(const _Op0_& o0, int o1) { \ return emit(_Code_, o0, o1); \ } @@ -125,7 +122,7 @@ namespace x86x64 { ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0, o1); \ } \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE InstNode* _Inst_(const _Op0_& o0, int o1) { \ ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0, o1); \ @@ -183,7 +180,7 @@ namespace x86x64 { return emit(_Code_, o0, o1, o2); \ } \ \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE InstNode* _Inst_(const _Op0_& o0, const _Op1_& o1, int o2) { \ return emit(_Code_, o0, o1, o2); \ } @@ -193,12 +190,15 @@ namespace x86x64 { ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0, o1, o2); \ } \ - /* @overload */ \ + /*! @overload */ \ ASMJIT_INLINE InstNode* _Inst_(const _Op0_& o0, const _Op1_& o1, int o2) { \ ASMJIT_ASSERT(_Cond_); \ return emit(_Code_, o0, o1, o2); \ } +//! @addtogroup asmjit_x86x64_codegen +//! @{ + // ============================================================================ // [Forward Declarations] // ============================================================================ @@ -211,7 +211,7 @@ struct VarState; // [asmjit::x86x64::kVarAttr] // ============================================================================ -//! @brief X86/X64 VarAttr flags. +//! X86/X64 VarAttr flags. ASMJIT_ENUM(kVarAttr) { kVarAttrGpbLo = 0x10000000, kVarAttrGpbHi = 0x20000000 @@ -226,38 +226,38 @@ struct VarInst : public BaseVarInst { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get variable-attributes list as VarAttr data. + //! Get variable-attributes list as VarAttr data. ASMJIT_INLINE VarAttr* getVaList() const { return const_cast(_list); } - //! @brief Get variable-attributes list as VarAttr data (by class). + //! Get variable-attributes list as VarAttr data (by class). ASMJIT_INLINE VarAttr* getVaListByClass(uint32_t c) const { return const_cast(_list) + _start.get(c); } - //! @brief Get position of variables (by class). + //! Get position of variables (by class). ASMJIT_INLINE uint32_t getVaStart(uint32_t c) const { return _start.get(c); } - //! @brief Get count of variables (all). + //! Get count of variables (all). ASMJIT_INLINE uint32_t getVaCount() const { return _vaCount; } - //! @brief Get count of variables (by class). + //! Get count of variables (by class). ASMJIT_INLINE uint32_t getVaCountByClass(uint32_t c) const { return _count.get(c); } - //! @brief Get VarAttr at @a index. + //! Get VarAttr at `index`. ASMJIT_INLINE VarAttr* getVa(uint32_t index) const { ASMJIT_ASSERT(index < _vaCount); return getVaList() + index; } - //! @brief Get VarAttr of @a c class at @a index. + //! Get VarAttr of `c` class at `index`. ASMJIT_INLINE VarAttr* getVaByClass(uint32_t c, uint32_t index) const { ASMJIT_ASSERT(index < _count._regs[c]); return getVaListByClass(c) + index; @@ -267,7 +267,7 @@ struct VarInst : public BaseVarInst { // [Utils] // -------------------------------------------------------------------------- - //! @brief Find VarAttr. + //! Find VarAttr. ASMJIT_INLINE VarAttr* findVa(VarData* vd) const { VarAttr* list = getVaList(); uint32_t count = getVaCount(); @@ -279,7 +279,7 @@ struct VarInst : public BaseVarInst { return NULL; } - //! @brief Find VarAttr (by class). + //! Find VarAttr (by class). ASMJIT_INLINE VarAttr* findVaByClass(uint32_t c, VarData* vd) const { VarAttr* list = getVaListByClass(c); uint32_t count = getVaCountByClass(c); @@ -295,10 +295,10 @@ struct VarInst : public BaseVarInst { // [Members] // -------------------------------------------------------------------------- - //! @brief Variables count. + //! Variables count. uint32_t _vaCount; - //! @brief Special registers on input. + //! Special registers on input. //! //! Special register(s) restricted to one or more physical register. If there //! is more than one special register it means that we have to duplicate the @@ -307,22 +307,22 @@ struct VarInst : public BaseVarInst { //! allocation finishes and marks all duplicates as non-assigned. RegMask _inRegs; - //! @brief Special registers on output. + //! Special registers on output. //! //! Special register(s) used on output. Each variable can have only one //! special register on the output, 'VarInst' contains all registers from //! all 'VarAttr's. RegMask _outRegs; - //! @brief Clobbered registers (by a function call). + //! Clobbered registers (by a function call). RegMask _clobberedRegs; - //! @brief Start indexes of variables per register class. + //! Start indexes of variables per register class. RegCount _start; - //! @brief Count of variables per register class. + //! Count of variables per register class. RegCount _count; - //! @brief VarAttr list. + //! VarAttr list. VarAttr _list[1]; }; @@ -330,7 +330,7 @@ struct VarInst : public BaseVarInst { // [asmjit::x86x64::StateCell] // ============================================================================ -//! @brief X86/X64 state-cell. +//! X86/X64 state-cell. union StateCell { // -------------------------------------------------------------------------- // [Accessors] @@ -361,25 +361,25 @@ union StateCell { // [asmjit::x86x64::VarState] // ============================================================================ -//! @brief X86/X64 state. +//! X86/X64 state. struct VarState : BaseVarState { enum { - //! @brief Base index for Gp registers. + //! Base index for Gp registers. kGpIndex = 0, - //! @brief Count of Gp registers. + //! Count of Gp registers. kGpCount = 16, - //! @brief Base index for Mm registers. + //! Base index for Mm registers. kMmIndex = kGpIndex + kGpCount, - //! @brief Count of Mm registers. + //! Count of Mm registers. kMmCount = 8, - //! @brief Base index for Xmm registers. + //! Base index for Xmm registers. kXmmIndex = kMmIndex + kMmCount, - //! @brief Count of Xmm registers. + //! Count of Xmm registers. kXmmCount = 16, - //! @brief Count of all registers in @ref VarState. + //! Count of all registers in `VarState`. kAllCount = kXmmIndex + kXmmCount }; @@ -417,25 +417,25 @@ struct VarState : BaseVarState { // -------------------------------------------------------------------------- union { - //! @brief List of all allocated variables in one array. + //! List of all allocated variables in one array. VarData* _list[kAllCount]; struct { - //! @brief Allocated Gp registers. + //! Allocated Gp registers. VarData* _listGp[kGpCount]; - //! @brief Allocated Mm registers. + //! Allocated Mm registers. VarData* _listMm[kMmCount]; - //! @brief Allocated Xmm registers. + //! Allocated Xmm registers. VarData* _listXmm[kXmmCount]; }; }; - //! @brief Occupied registers (mask). + //! Occupied registers (mask). RegMask _occupied; - //! @brief Modified registers (mask). + //! Modified registers (mask). RegMask _modified; - //! @brief Variables data (count of variables is stored in @ref Context). + //! Variables data, the length is stored in `X86X64Context`. StateCell _cells[1]; }; @@ -443,7 +443,7 @@ struct VarState : BaseVarState { // [asmjit::X86X64FuncNode] // ============================================================================ -//! @brief X86/X64 function node. +//! X86/X64 function node. struct X86X64FuncNode : public FuncNode { ASMJIT_NO_COPY(X86X64FuncNode) @@ -451,7 +451,7 @@ struct X86X64FuncNode : public FuncNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref X86X64FuncNode instance. + //! Create a new `X86X64FuncNode` instance. ASMJIT_INLINE X86X64FuncNode(BaseCompiler* compiler) : FuncNode(compiler) { _decl = &_x86Decl; _saveRestoreRegs.reset(); @@ -472,62 +472,62 @@ struct X86X64FuncNode : public FuncNode { _stackFrameCopyGpIndex[5] = kInvalidReg; } - //! @brief Destroy the @ref X86X64FuncNode instance. + //! Destroy the `X86X64FuncNode` instance. ASMJIT_INLINE ~X86X64FuncNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get function declaration as @ref X86X64FuncDecl. + //! Get function declaration as `X86X64FuncDecl`. ASMJIT_INLINE X86X64FuncDecl* getDecl() const { return const_cast(&_x86Decl); } - //! @brief Get argument. + //! Get argument. ASMJIT_INLINE VarData* getArg(uint32_t i) const { ASMJIT_ASSERT(i < _x86Decl.getArgCount()); return static_cast(_argList[i]); } - //! @brief Get registers which have to be saved in prolog/epilog. + //! Get registers which have to be saved in prolog/epilog. ASMJIT_INLINE uint32_t getSaveRestoreRegs(uint32_t c) { return _saveRestoreRegs.get(c); } - //! @brief Get stack size needed to align stack back to the nature alignment. + //! Get stack size needed to align stack back to the nature alignment. ASMJIT_INLINE uint32_t getAlignStackSize() const { return _alignStackSize; } - //! @brief Set stack size needed to align stack back to the nature alignment. + //! Set stack size needed to align stack back to the nature alignment. ASMJIT_INLINE void setAlignStackSize(uint32_t s) { _alignStackSize = s; } - //! @brief Get aligned stack size used by variables and memory allocated on the stack. + //! Get aligned stack size used by variables and memory allocated on the stack. ASMJIT_INLINE uint32_t getAlignedMemStackSize() const { return _alignedMemStackSize; } - //! @brief Get stack size used by push/pop sequences in prolog/epilog. + //! Get stack size used by push/pop sequences in prolog/epilog. ASMJIT_INLINE uint32_t getPushPopStackSize() const { return _pushPopStackSize; } - //! @brief Set stack size used by push/pop sequences in prolog/epilog. + //! Set stack size used by push/pop sequences in prolog/epilog. ASMJIT_INLINE void setPushPopStackSize(uint32_t s) { _pushPopStackSize = s; } - //! @brief Get stack size used by mov sequences in prolog/epilog. + //! Get stack size used by mov sequences in prolog/epilog. ASMJIT_INLINE uint32_t getMoveStackSize() const { return _moveStackSize; } - //! @brief Set stack size used by mov sequences in prolog/epilog. + //! Set stack size used by mov sequences in prolog/epilog. ASMJIT_INLINE void setMoveStackSize(uint32_t s) { _moveStackSize = s; } - //! @brief Get extra stack size. + //! Get extra stack size. ASMJIT_INLINE uint32_t getExtraStackSize() const { return _extraStackSize; } - //! @brief Set extra stack size. + //! Set extra stack size. ASMJIT_INLINE void setExtraStackSize(uint32_t s) { _extraStackSize = s; } - //! @brief Get whether the function has stack frame register. + //! Get whether the function has stack frame register. //! //! @note Stack frame register can be used for both - aligning purposes or //! generating standard prolog/epilog sequence. //! //! @note Used only when stack is misaligned. ASMJIT_INLINE bool hasStackFrameReg() const { return _stackFrameRegIndex != kInvalidReg; } - //! @brief Get stack frame register index. + //! Get stack frame register index. //! //! @note Used only when stack is misaligned. ASMJIT_INLINE uint32_t getStackFrameRegIndex() const { return _stackFrameRegIndex; } - //! @brief Get whether the stack frame register is preserved. + //! Get whether the stack frame register is preserved. //! //! @note Used only when stack is misaligned. ASMJIT_INLINE bool isStackFrameRegPreserved() const { return static_cast(_isStackFrameRegPreserved); } @@ -536,30 +536,30 @@ struct X86X64FuncNode : public FuncNode { // [Members] // -------------------------------------------------------------------------- - //! @brief X86 function decl. + //! X86 function decl. X86X64FuncDecl _x86Decl; - //! @brief Registers which must be saved/restored in prolog/epilog. + //! Registers which must be saved/restored in prolog/epilog. RegMask _saveRestoreRegs; - //! @brief Stack size needed to align function back to the nature alignment. + //! Stack size needed to align function back to the nature alignment. uint32_t _alignStackSize; - //! @brief Like @ref _memStackSize, but aligned. + //! Like `_memStackSize`, but aligned. uint32_t _alignedMemStackSize; - //! @brief Stack required for push/pop in prolog/epilog (X86/X64 specific). + //! Stack required for push/pop in prolog/epilog (X86/X64 specific). uint32_t _pushPopStackSize; - //! @brief Stack required for movs in prolog/epilog (X86/X64 specific). + //! Stack required for movs in prolog/epilog (X86/X64 specific). uint32_t _moveStackSize; - //! @brief Stack required to put extra data (for example function arguments + //! Stack required to put extra data (for example function arguments //! when manually aligning to requested alignment). uint32_t _extraStackSize; - //! @brief Stack frame register. + //! Stack frame register. uint8_t _stackFrameRegIndex; - //! @brief Whether the stack frame register is preserved. + //! Whether the stack frame register is preserved. uint8_t _isStackFrameRegPreserved; - //! @brief Gp registers indexes that can be used to copy function arguments + //! Gp registers indexes that can be used to copy function arguments //! to a new location in case we are doing manual stack alignment. uint8_t _stackFrameCopyGpIndex[6]; }; @@ -568,7 +568,7 @@ struct X86X64FuncNode : public FuncNode { // [asmjit::X86X64CallNode] // ============================================================================ -//! @brief X86/X64 function-call node. +//! X86/X64 function-call node. struct X86X64CallNode : public CallNode { ASMJIT_NO_COPY(X86X64CallNode) @@ -576,20 +576,20 @@ struct X86X64CallNode : public CallNode { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref X86X64CallNode instance. + //! Create a new `X86X64CallNode` instance. ASMJIT_INLINE X86X64CallNode(BaseCompiler* compiler, const Operand& target) : CallNode(compiler, target) { _decl = &_x86Decl; _usedArgs.reset(); } - //! @brief Destroy the @ref X86X64CallNode instance. + //! Destroy the `X86X64CallNode` instance. ASMJIT_INLINE ~X86X64CallNode() {} // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get function prototype. + //! Get function prototype. ASMJIT_INLINE X86X64FuncDecl* getDecl() const { return const_cast(&_x86Decl); } @@ -598,32 +598,32 @@ struct X86X64CallNode : public CallNode { // [Prototype] // -------------------------------------------------------------------------- - //! @brief Set function prototype. + //! Set function prototype. ASMJIT_API Error setPrototype(uint32_t conv, const FuncPrototype& p); // -------------------------------------------------------------------------- // [Arg / Ret] // -------------------------------------------------------------------------- - //! @brief Set argument at @a i to @a op. + //! Set argument at `i` to `op`. ASMJIT_API bool _setArg(uint32_t i, const Operand& op); - //! @brief Set return at @a i to @a op. + //! Set return at `i` to `op`. ASMJIT_API bool _setRet(uint32_t i, const Operand& op); - //! @brief Set argument at @a i to @a var. + //! Set argument at `i` to `var`. ASMJIT_INLINE bool setArg(uint32_t i, const BaseVar& var) { return _setArg(i, var); } - //! @brief Set argument at @a i to @a imm. + //! Set argument at `i` to `imm`. ASMJIT_INLINE bool setArg(uint32_t i, const Imm& imm) { return _setArg(i, imm); } - //! @brief Set return at @a i to @a var. + //! Set return at `i` to `var`. ASMJIT_INLINE bool setRet(uint32_t i, const BaseVar& var) { return _setRet(i, var); } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief X86 declaration. + //! X86 declaration. X86X64FuncDecl _x86Decl; - //! @brief Mask of all registers actually used to pass function arguments. + //! Mask of all registers actually used to pass function arguments. //! //! @note This bit-mask is not the same as @c X86X64Func::_passed. It contains //! only registers actually used to do the call while X86X64Func::_passed @@ -635,7 +635,7 @@ struct X86X64CallNode : public CallNode { // [asmjit::x86x64::X86X64Compiler] // ============================================================================ -//! @brief X86/X64 compiler. +//! X86/X64 compiler. //! //! This class is used to store instruction stream and allows to modify //! it on the fly. It uses different concept than @c asmjit::Assembler class @@ -644,15 +644,9 @@ struct X86X64CallNode : public CallNode { //! array instead. This allows to modify instruction stream later and for //! example to reorder instructions to make better performance. //! -//! @ref asmjit::X86X64Compiler moves code generation to a higher level. Higher -//! level constructs allows to write more abstract and extensible code that -//! is not possible with pure @c asmjit::Assembler class. Because -//! @c asmjit::Compiler needs to create many objects and lifetime of these -//! objects is small (same as @c asmjit::Compiler lifetime itself) it uses -//! very fast memory management model. This model allows to create object -//! instances in nearly zero time (compared to @c malloc() or @c new() -//! operators) so overhead by creating machine code by @c asmjit::Compiler -//! is minimized. +//! `X86X64Compiler` moves code generation to a higher level. Higher level +//! constructs allows to write more abstract and extensible code that is not +//! possible with pure `X86X64Assembler`. //! //! @section asmjit_compiler_introduction The Story //! @@ -740,7 +734,7 @@ struct X86X64CallNode : public CallNode { //! Comparison of generating machine code through @c Assembler and directly //! by @c Compiler: //! -//! @code +//! ~~~ //! // Assembler instance is low level code generation class that emits //! // machine code. //! Assembler a; @@ -757,11 +751,11 @@ struct X86X64CallNode : public CallNode { //! //! // Your function //! void* fn = a.make(); -//! @endcode +//! ~~~ //! //! Example how to generate machine code using only @c Compiler (preferred): //! -//! @code +//! ~~~ //! // Compiler instance is enough. //! Compiler c; //! @@ -769,7 +763,7 @@ struct X86X64CallNode : public CallNode { //! //! // Your function //! void* fn = c.make(); -//! @endcode +//! ~~~ //! //! You can see that there is @c asmjit::Compiler::serialize() function that //! emits instructions into @c asmjit::Assembler(). This layered architecture @@ -778,24 +772,21 @@ struct X86X64CallNode : public CallNode { //! method that can create your function using @c asmjit::Assembler, but //! internally (this is preferred bahavior when using @c asmjit::Compiler). //! -//! The @c make() method allocates memory using @ref BaseRuntime instance passed +//! The @c make() method allocates memory using `Runtime` instance passed //! into the @c Compiler constructor. If code generator is used to create JIT -//! function then virtual memory allocated by @c MemoryManager is used. To get -//! global memory manager use @c MemoryManager::getGlobal(). +//! function then virtual memory allocated by `VMemMgr` is used. //! -//! @code -//! // Compiler instance is enough. -//! Compiler c; +//! ~~~ +//! JitRuntime runtime; +//! Compiler c(&runtime); //! //! // ... put your code using Compiler instance ... //! //! // Your function //! void* fn = c.make(); //! -//! // Free it if you don't want it anymore -//! // (using global memory manager instance) -//! MemoryManager::getGlobal()->free(fn); -//! @endcode +//! runtime.release(fn); +//! ~~~ //! //! @section asmjit_compiler_Functions Functions //! @@ -815,7 +806,7 @@ struct X86X64CallNode : public CallNode { //! variable size is 64-bit). To override this behavior the variable type //! must be specified. //! -//! @code +//! ~~~ //! // Compiler and function declaration - void f(int*); //! Compiler c; //! GpVar a0(c, kVarTypeIntPtr); @@ -844,7 +835,7 @@ struct X86X64CallNode : public CallNode { //! // Make the function. //! typedef void (*MyFunc)(int*); //! MyFunc func = asmjit_cast(c.make()); -//! @endcode +//! ~~~ //! //! This code snipped needs to be explained. You can see that there are more //! variable types that can be used by @c Compiler. Most useful variables can @@ -853,44 +844,44 @@ struct X86X64CallNode : public CallNode { //! //! X86/X64 variable types: //! -//! - @c kVarTypeInt8 - Signed 8-bit integer, mapped to Gpd register (eax, ebx, ...). -//! - @c kVarTypeUInt8 - Unsigned 8-bit integer, mapped to Gpd register (eax, ebx, ...). +//! - `kVarTypeInt8` - Signed 8-bit integer, mapped to Gpd register (eax, ebx, ...). +//! - `kVarTypeUInt8` - Unsigned 8-bit integer, mapped to Gpd register (eax, ebx, ...). //! -//! - @c kVarTypeInt16 - Signed 16-bit integer, mapped to Gpd register (eax, ebx, ...). -//! - @c kVarTypeUInt16 - Unsigned 16-bit integer, mapped to Gpd register (eax, ebx, ...). +//! - `kVarTypeInt16` - Signed 16-bit integer, mapped to Gpd register (eax, ebx, ...). +//! - `kVarTypeUInt16` - Unsigned 16-bit integer, mapped to Gpd register (eax, ebx, ...). //! -//! - @c kVarTypeInt32 - Signed 32-bit integer, mapped to Gpd register (eax, ebx, ...). -//! - @c kVarTypeUInt32 - Unsigned 32-bit integer, mapped to Gpd register (eax, ebx, ...). +//! - `kVarTypeInt32` - Signed 32-bit integer, mapped to Gpd register (eax, ebx, ...). +//! - `kVarTypeUInt32` - Unsigned 32-bit integer, mapped to Gpd register (eax, ebx, ...). //! -//! - @c kVarTypeInt64 - Signed 64-bit integer, mapped to Gpq register (rax, rbx, ...). -//! - @c kVarTypeUInt64 - Unsigned 64-bit integer, mapped to Gpq register (rax, rbx, ...). +//! - `kVarTypeInt64` - Signed 64-bit integer, mapped to Gpq register (rax, rbx, ...). +//! - `kVarTypeUInt64` - Unsigned 64-bit integer, mapped to Gpq register (rax, rbx, ...). //! -//! - @c kVarTypeIntPtr - intptr_t, mapped to Gpd/Gpq register; depends on target, not host! -//! - @c kVarTypeUIntPtr - uintptr_t, mapped to Gpd/Gpq register; depends on target, not host! +//! - `kVarTypeIntPtr` - intptr_t, mapped to Gpd/Gpq register; depends on target, not host! +//! - `kVarTypeUIntPtr` - uintptr_t, mapped to Gpd/Gpq register; depends on target, not host! //! -//! - @c kVarTypeFp32 - 32-bit floating point register (fp0, fp1, ...). -//! - @c kVarTypeFp64 - 64-bit floating point register (fp0, fp1, ...). +//! - `kVarTypeFp32` - 32-bit floating point register (fp0, fp1, ...). +//! - `kVarTypeFp64` - 64-bit floating point register (fp0, fp1, ...). //! -//! - @c kVarTypeMm - 64-bit Mm register (mm0, mm1, ...). +//! - `kVarTypeMm` - 64-bit Mm register (mm0, mm1, ...). //! -//! - @c kVarTypeXmm - 128-bit SSE register. -//! - @c kVarTypeXmmSs - 128-bit SSE register that contains a scalar 32-bit SP-FP value. -//! - @c kVarTypeXmmSd - 128-bit SSE register that contains a scalar 64-bit DP-FP value. -//! - @c kVarTypeXmmPs - 128-bit SSE register that contains 4 packed 32-bit SP-FP values. -//! - @c kVarTypeXmmPd - 128-bit SSE register that contains 2 packed 64-bit DP-FP values. +//! - `kVarTypeXmm` - 128-bit SSE register. +//! - `kVarTypeXmmSs` - 128-bit SSE register that contains a scalar 32-bit SP-FP value. +//! - `kVarTypeXmmSd` - 128-bit SSE register that contains a scalar 64-bit DP-FP value. +//! - `kVarTypeXmmPs` - 128-bit SSE register that contains 4 packed 32-bit SP-FP values. +//! - `kVarTypeXmmPd` - 128-bit SSE register that contains 2 packed 64-bit DP-FP values. //! -//! - @c kVarTypeYmm - 256-bit AVX register. -//! - @c kVarTypeYmmPs - 256-bit AVX register that contains 4 packed 32-bit SP-FP values. -//! - @c kVarTypeYmmPd - 256-bit AVX register that contains 2 packed 64-bit DP-FP values. +//! - `kVarTypeYmm` - 256-bit AVX register. +//! - `kVarTypeYmmPs` - 256-bit AVX register that contains 4 packed 32-bit SP-FP values. +//! - `kVarTypeYmmPd` - 256-bit AVX register that contains 2 packed 64-bit DP-FP values. //! //! Variable states: //! -//! - @c kVarStateUnused - State that is assigned to newly created -//! variables or to not used variables (dereferenced to zero). -//! - @c kVarStateReg - State that means that variable is currently -//! allocated in register. -//! - @c kVarStateMem - State that means that variable is currently -//! only in memory location. +//! - `kVarStateUnused - State that is assigned to newly created variables or +//! to not used variables (dereferenced to zero). +//! - `kVarStateReg - State that means that variable is currently allocated in +//! register. +//! - `kVarStateMem - State that means that variable is currently only in +//! memory location. //! //! When you create new variable, initial state is always @c kVarStateUnused, //! allocating it to register or spilling to memory changes this state to @@ -901,15 +892,15 @@ struct X86X64CallNode : public CallNode { //! //! Explicit variable allocating / spilling methods: //! -//! - @c Compiler::alloc() - Explicit method to alloc variable into -//! register. You can use this before loops or code blocks. +//! - `BaseCompiler::alloc()` - Explicit method to alloc variable into register. +//! It can be used to force allocation a variable before a loop for example. //! -//! - @c Compiler::spill() - Explicit method to spill variable. If variable -//! is in register and you call this method, it's moved to its home memory -//! location. If variable is not in register no operation is performed. +//! - `BaseCompiler::spill()` - Explicit method to spill variable. If variable +//! is in register and you call this method, it's moved to its home memory +//! location. If variable is not in register no operation is performed. //! -//! - @c Compiler::unuse() - Unuse variable (you can use this to end the -//! variable scope or sub-scope). +//! - `BaseCompiler::unuse()` - Unuse variable (you can use this to end the +//! variable scope or sub-scope). //! //! Please see AsmJit tutorials (testcompiler.cpp and testvariables.cpp) for //! more complete examples. @@ -952,7 +943,7 @@ struct X86X64CallNode : public CallNode { //! Next example is the situation where the extended code block is used to //! do state-change: //! -//! @code +//! ~~~ //! Compiler c; //! //! c.addFunc(kFuncConvHost, FuncBuilder0()); @@ -1006,7 +997,7 @@ struct X86X64CallNode : public CallNode { //! // var1 - register. //! //! c.endFunc(); -//! @endcode +//! ~~~ //! //! The output: //! @@ -1043,7 +1034,7 @@ struct X86X64CallNode : public CallNode { //! will be taken). To demonstrate the possibility to embed state-switch before //! jump we use slightly modified code: //! -//! @code +//! ~~~ //! Compiler c; //! //! c.addFunc(kFuncConvHost, FuncBuilder0()); @@ -1086,11 +1077,11 @@ struct X86X64CallNode : public CallNode { //! c.je(L0); //! //! c.endFunc(); -//! @endcode +//! ~~~ //! //! The output: //! -//! @verbatim +//! ~~~ //! xor ecx, ecx ; xor var_0, var_0 //! xor edx, edx ; xor var_1, var_1 //! mov [esp - 24], ecx ; spill var_0 @@ -1108,7 +1099,7 @@ struct X86X64CallNode : public CallNode { //! //! je short L2 //! ret -//! @endverbatim +//! ~~~ //! //! Please notice where the state-switch section is located. The @c Compiler //! decided that jump is likely to be taken so the state change is embedded @@ -1153,7 +1144,7 @@ struct X86X64CallNode : public CallNode { //! //! Example of code generating by standard type-safe API: //! -//! @code +//! ~~~ //! Compiler c; //! //! GpVar var0(c, kVarTypeInt32); @@ -1164,11 +1155,11 @@ struct X86X64CallNode : public CallNode { //! c.mov(var0, 0); //! c.add(var0, var1); //! c.sub(var0, var1); -//! @endcode +//! ~~~ //! //! The code above can be rewritten as: //! -//! @code +//! ~~~ //! Compiler c; //! //! GpVar var0(c, kVarTypeInt32); @@ -1179,7 +1170,7 @@ struct X86X64CallNode : public CallNode { //! c.emit(kInstMov, var0, 0); //! c.emit(kInstAdd, var0, var1); //! c.emit(kInstSub, var0, var1); -//! @endcode +//! ~~~ //! //! The advantage of first snippet is very friendly API and type-safe control //! that is controlled by the C++ compiler. The advantage of second snippet is @@ -1189,18 +1180,17 @@ struct X86X64CallNode : public CallNode { //! //! Use case: //! -//! @code -//! bool emitArithmetic(Compiler& c, XmmVar& var0, XmmVar& var1, const char* op) -//! { +//! ~~~ +//! bool emitArithmetic(Compiler& c, XmmVar& var0, XmmVar& var1, const char* op) { //! uint32_t code = kInstNone; //! //! if (strcmp(op, "ADD") == 0) //! code = kInstAddss; -//! else if (strcmp(op, "SUBTRACT") == 0) +//! else if (::strcmp(op, "SUBTRACT") == 0) //! code = kInstSubss; -//! else if (strcmp(op, "MULTIPLY") == 0) +//! else if (::strcmp(op, "MULTIPLY") == 0) //! code = kInstMulss; -//! else if (strcmp(op, "DIVIDE") == 0) +//! else if (::strcmp(op, "DIVIDE") == 0) //! code = kInstDivss; //! else //! // Invalid parameter? @@ -1208,7 +1198,7 @@ struct X86X64CallNode : public CallNode { //! //! c.emit(code, var0, var1); //! } -//! @endcode +//! ~~~ //! //! Other use cases are waiting for you! Be sure that instruction you are //! emitting is correct and encodable, because if not, Assembler will set @@ -1220,16 +1210,16 @@ struct X86X64Compiler : public BaseCompiler { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a @ref X86X64Compiler instance. - ASMJIT_API X86X64Compiler(BaseRuntime* runtime); - //! @brief Destroy the @ref X86X64Compiler instance. + //! Create a `X86X64Compiler` instance. + ASMJIT_API X86X64Compiler(Runtime* runtime); + //! Destroy the `X86X64Compiler` instance. ASMJIT_API ~X86X64Compiler(); // -------------------------------------------------------------------------- // [Inst / Emit] // -------------------------------------------------------------------------- - //! @brief Create a new @ref InstNode. + //! Create a new `InstNode`. ASMJIT_API InstNode* newInst(uint32_t code); //! @overload ASMJIT_API InstNode* newInst(uint32_t code, const Operand& o0); @@ -1242,7 +1232,7 @@ struct X86X64Compiler : public BaseCompiler { //! @overload ASMJIT_API InstNode* newInst(uint32_t code, const Operand& o0, const Operand& o1, const Operand& o2, const Operand& o3, const Operand& o4); - //! @brief Add a new @ref InstNode. + //! Add a new `InstNode`. ASMJIT_API InstNode* emit(uint32_t code); //! @overload ASMJIT_API InstNode* emit(uint32_t code, const Operand& o0); @@ -1266,17 +1256,17 @@ struct X86X64Compiler : public BaseCompiler { // [Func] // -------------------------------------------------------------------------- - //! @brief Create a new @ref X86X64FuncNode. + //! Create a new `X86X64FuncNode`. ASMJIT_API X86X64FuncNode* newFunc(uint32_t conv, const FuncPrototype& p); - //! @brief Add a new function. + //! Add a new function. //! - //! @param cconv Calling convention to use (see @c kFuncConv enum) + //! @param conv Calling convention to use (see @c kFuncConv enum) //! @param params Function arguments prototype. //! //! This method is usually used as a first step when generating functions - //! by @c Compiler. First parameter @a cconv specifies function calling - //! convention to use. Second parameter @a params specifies function + //! by @c Compiler. First parameter `cconv` specifies function calling + //! convention to use. Second parameter `params` specifies function //! arguments. To create function arguments are used templates //! @c FuncBuilder0<...>, @c FuncBuilder1<...>, @c FuncBuilder2<...>, //! etc... @@ -1285,7 +1275,7 @@ struct X86X64Compiler : public BaseCompiler { //! based on real C++ types. See next example how to generate function with //! two 32-bit integer arguments. //! - //! @code + //! ~~~ //! // Building function using asmjit::Compiler example. //! //! // Compiler instance @@ -1300,14 +1290,14 @@ struct X86X64Compiler : public BaseCompiler { //! //! // End of function (also emits function @c Epilog) //! c.endFunc(); - //! @endcode + //! ~~~ //! //! You can see that building functions is really easy. Previous code snipped //! will generate code for function with two 32-bit integer arguments. You //! can access arguments by @c asmjit::Function::argument() method. Arguments //! are indexed from 0 (like everything in C). //! - //! @code + //! ~~~ //! // Accessing function arguments through asmjit::Function example. //! //! // Compiler instance @@ -1330,7 +1320,7 @@ struct X86X64Compiler : public BaseCompiler { //! //! // End of function - emits function epilog and return instruction. //! c.endFunc(); - //! @endcode + //! ~~~ //! //! Arguments are like variables. How to manipulate with variables is //! documented in @c asmjit::Compiler, variables section. @@ -1342,10 +1332,10 @@ struct X86X64Compiler : public BaseCompiler { //! @sa @c FuncBuilder0, @c FuncBuilder1, @c FuncBuilder2, ... ASMJIT_API X86X64FuncNode* addFunc(uint32_t conv, const FuncPrototype& p); - //! @brief End of current function. + //! End of current function. ASMJIT_API EndNode* endFunc(); - //! @brief Get current function as @ref X86X64FuncNode. + //! Get current function as `X86X64FuncNode`. //! //! This method can be called within @c addFunc() and @c endFunc() //! block to get current function you are working with. It's recommended @@ -1358,31 +1348,30 @@ struct X86X64Compiler : public BaseCompiler { // [Ret] // -------------------------------------------------------------------------- - //! @brief Create a new @ref RetNode. + //! Create a new `RetNode`. ASMJIT_API RetNode* newRet(const Operand& o0, const Operand& o1); - //! @brief Add a new @ref RetNode. + //! Add a new `RetNode`. ASMJIT_API RetNode* addRet(const Operand& o0, const Operand& o1); // -------------------------------------------------------------------------- // [Call] // -------------------------------------------------------------------------- - //! @brief Create a new @ref X86X64CallNode. + //! Create a new `X86X64CallNode`. ASMJIT_API X86X64CallNode* newCall(const Operand& o0, uint32_t conv, const FuncPrototype& p); - //! @brief Add a new @ref X86X64CallNode. + //! Add a new `X86X64CallNode`. ASMJIT_API X86X64CallNode* addCall(const Operand& o0, uint32_t conv, const FuncPrototype& p); // -------------------------------------------------------------------------- // [Vars] // -------------------------------------------------------------------------- - //! @brief Set function argument to @a var. + //! Set function argument to `var`. ASMJIT_API Error setArg(uint32_t argIndex, BaseVar& var); - //! @overridden ASMJIT_API virtual Error _newVar(BaseVar* var, uint32_t type, const char* name); - //! @brief Create a new Gp variable. + //! Create a new Gp variable. ASMJIT_INLINE GpVar newGpVar(uint32_t vType = kVarTypeIntPtr, const char* name = NULL) { ASMJIT_ASSERT(vType < kVarTypeCount); ASMJIT_ASSERT(IntUtil::inInterval(vType, _kVarTypeIntStart, _kVarTypeIntEnd)); @@ -1392,7 +1381,7 @@ struct X86X64Compiler : public BaseCompiler { return var; } - //! @brief Create a new Mm variable. + //! Create a new Mm variable. ASMJIT_INLINE MmVar newMmVar(uint32_t vType = kVarTypeMm, const char* name = NULL) { ASMJIT_ASSERT(vType < kVarTypeCount); ASMJIT_ASSERT(IntUtil::inInterval(vType, _kVarTypeMmStart, _kVarTypeMmEnd)); @@ -1402,7 +1391,7 @@ struct X86X64Compiler : public BaseCompiler { return var; } - //! @brief Create a new Xmm variable. + //! Create a new Xmm variable. ASMJIT_INLINE XmmVar newXmmVar(uint32_t vType = kVarTypeXmm, const char* name = NULL) { ASMJIT_ASSERT(vType < kVarTypeCount); ASMJIT_ASSERT(IntUtil::inInterval(vType, _kVarTypeXmmStart, _kVarTypeXmmEnd)); @@ -1412,7 +1401,7 @@ struct X86X64Compiler : public BaseCompiler { return var; } - //! @brief Create a new Ymm variable. + //! Create a new Ymm variable. ASMJIT_INLINE YmmVar newYmmVar(uint32_t vType = kVarTypeYmm, const char* name = NULL) { ASMJIT_ASSERT(vType < kVarTypeCount); ASMJIT_ASSERT(IntUtil::inInterval(vType, _kVarTypeYmmStart, _kVarTypeYmmEnd)); @@ -1422,10 +1411,10 @@ struct X86X64Compiler : public BaseCompiler { return var; } - //! @brief Get memory home of variable @a var. + //! Get memory home of variable `var`. ASMJIT_API void getMemoryHome(BaseVar& var, GpVar* home, int* displacement = NULL); - //! @brief Set memory home of variable @a var. + //! Set memory home of variable `var`. //! //! Default memory home location is on stack (ESP/RSP), but when needed the //! bebahior can be changed by this method. @@ -1433,7 +1422,7 @@ struct X86X64Compiler : public BaseCompiler { //! It is an error to chaining memory home locations. For example the given //! code is invalid: //! - //! @code + //! ~~~ //! Compiler c; //! //! ... @@ -1446,17 +1435,16 @@ struct X86X64Compiler : public BaseCompiler { //! c.setMemoryHome(v1, v0, 0); // Allowed, [v0+0] is memory home for v1. //! c.setMemoryHome(v2, v0, 4); // Allowed, [v0+4] is memory home for v2. //! c.setMemoryHome(v3, v2); // CHAINING, NOT ALLOWED! - //! @endcode + //! ~~~ ASMJIT_API void setMemoryHome(BaseVar& var, const GpVar& home, int displacement = 0); // -------------------------------------------------------------------------- // [Stack] // -------------------------------------------------------------------------- - //! @overridden ASMJIT_API virtual Error _newStack(BaseMem* mem, uint32_t size, uint32_t alignment, const char* name); - //! @brief Create a new memory chunk allocated on the current function's stack. + //! Create a new memory chunk allocated on the current function's stack. ASMJIT_INLINE Mem newStack(uint32_t size, uint32_t alignment, const char* name = NULL) { Mem m(NoInit); _newStack(&m, size, alignment, name); @@ -1467,10 +1455,9 @@ struct X86X64Compiler : public BaseCompiler { // [Const] // -------------------------------------------------------------------------- - //! @overridden ASMJIT_API virtual Error _newConst(BaseMem* mem, uint32_t scope, const void* data, size_t size); - //! @brief Put data to a constant-pool and get a memory reference to it. + //! Put data to a constant-pool and get a memory reference to it. ASMJIT_INLINE Mem newConst(uint32_t scope, const void* data, size_t size) { Mem m(NoInit); _newConst(&m, scope, data, size); @@ -1500,49 +1487,49 @@ struct X86X64Compiler : public BaseCompiler { // [Embed] // -------------------------------------------------------------------------- - //! @brief Add 8-bit integer data to the instuction stream. + //! Add 8-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* db(uint8_t x) { return embed(&x, 1); } - //! @brief Add 16-bit integer data to the instuction stream. + //! Add 16-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* dw(uint16_t x) { return embed(&x, 2); } - //! @brief Add 32-bit integer data to the instuction stream. + //! Add 32-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* dd(uint32_t x) { return embed(&x, 4); } - //! @brief Add 64-bit integer data to the instuction stream. + //! Add 64-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* dq(uint64_t x) { return embed(&x, 8); } - //! @brief Add 8-bit integer data to the instuction stream. + //! Add 8-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* dint8(int8_t x) { return embed(&x, static_cast(sizeof(int8_t))); } - //! @brief Add 8-bit integer data to the instuction stream. + //! Add 8-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* duint8(uint8_t x) { return embed(&x, static_cast(sizeof(uint8_t))); } - //! @brief Add 16-bit integer data to the instuction stream. + //! Add 16-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* dint16(int16_t x) { return embed(&x, static_cast(sizeof(int16_t))); } - //! @brief Add 16-bit integer data to the instuction stream. + //! Add 16-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* duint16(uint16_t x) { return embed(&x, static_cast(sizeof(uint16_t))); } - //! @brief Add 32-bit integer data to the instuction stream. + //! Add 32-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* dint32(int32_t x) { return embed(&x, static_cast(sizeof(int32_t))); } - //! @brief Add 32-bit integer data to the instuction stream. + //! Add 32-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* duint32(uint32_t x) { return embed(&x, static_cast(sizeof(uint32_t))); } - //! @brief Add 64-bit integer data to the instuction stream. + //! Add 64-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* dint64(int64_t x) { return embed(&x, static_cast(sizeof(int64_t))); } - //! @brief Add 64-bit integer data to the instuction stream. + //! Add 64-bit integer data to the instuction stream. ASMJIT_INLINE EmbedNode* duint64(uint64_t x) { return embed(&x, static_cast(sizeof(uint64_t))); } - //! @brief Add float data to the instuction stream. + //! Add float data to the instuction stream. ASMJIT_INLINE EmbedNode* dfloat(float x) { return embed(&x, static_cast(sizeof(float))); } - //! @brief Add double data to the instuction stream. + //! Add double data to the instuction stream. ASMJIT_INLINE EmbedNode* ddouble(double x) { return embed(&x, static_cast(sizeof(double))); } - //! @brief Add pointer data to the instuction stream. + //! Add pointer data to the instuction stream. ASMJIT_INLINE EmbedNode* dptr(void* x) { return embed(&x, static_cast(sizeof(void*))); } - //! @brief Add Mm data to the instuction stream. + //! Add Mm data to the instuction stream. ASMJIT_INLINE EmbedNode* dmm(const MmData& x) { return embed(&x, static_cast(sizeof(MmData))); } - //! @brief Add Xmm data to the instuction stream. + //! Add Xmm data to the instuction stream. ASMJIT_INLINE EmbedNode* dxmm(const XmmData& x) { return embed(&x, static_cast(sizeof(XmmData))); } - //! @brief Add data in a given structure instance to the instuction stream. + //! Add data in a given structure instance to the instuction stream. template ASMJIT_INLINE EmbedNode* dstruct(const T& x) { return embed(&x, static_cast(sizeof(T))); } @@ -1550,14 +1537,12 @@ struct X86X64Compiler : public BaseCompiler { // [Make] // -------------------------------------------------------------------------- - //! @overridden ASMJIT_API virtual void* make(); // ------------------------------------------------------------------------- // [Serialize] // ------------------------------------------------------------------------- - //! @overridden ASMJIT_API virtual Error serialize(BaseAssembler& assembler); // ------------------------------------------------------------------------- @@ -1570,7 +1555,7 @@ struct X86X64Compiler : public BaseCompiler { // [X86 Instructions] // -------------------------------------------------------------------------- - //! @brief Add with carry. + //! Add with carry. INST_2x(adc, kInstAdc, GpVar, GpVar) //! @overload INST_2x(adc, kInstAdc, GpVar, Mem) @@ -1581,7 +1566,7 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(adc, kInstAdc, Mem, Imm) - //! @brief Add. + //! Add. INST_2x(add, kInstAdd, GpVar, GpVar) //! @overload INST_2x(add, kInstAdd, GpVar, Mem) @@ -1592,7 +1577,7 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(add, kInstAdd, Mem, Imm) - //! @brief And. + //! And. INST_2x(and_, kInstAnd, GpVar, GpVar) //! @overload INST_2x(and_, kInstAnd, GpVar, Mem) @@ -1603,20 +1588,20 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(and_, kInstAnd, Mem, Imm) - //! @brief Bit scan forward. + //! Bit scan forward. INST_2x_(bsf, kInstBsf, GpVar, GpVar, !o0.isGpb()) //! @overload INST_2x_(bsf, kInstBsf, GpVar, Mem, !o0.isGpb()) - //! @brief Bit scan reverse. + //! Bit scan reverse. INST_2x_(bsr, kInstBsr, GpVar, GpVar, !o0.isGpb()) //! @overload INST_2x_(bsr, kInstBsr, GpVar, Mem, !o0.isGpb()) - //! @brief Byte swap (32-bit or 64-bit registers only) (i486). + //! Byte swap (32-bit or 64-bit registers only) (i486). INST_1x_(bswap, kInstBswap, GpVar, o0.getSize() >= 4) - //! @brief Bit test. + //! Bit test. INST_2x(bt, kInstBt, GpVar, GpVar) //! @overload INST_2i(bt, kInstBt, GpVar, Imm) @@ -1625,7 +1610,7 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(bt, kInstBt, Mem, Imm) - //! @brief Bit test and complement. + //! Bit test and complement. INST_2x(btc, kInstBtc, GpVar, GpVar) //! @overload INST_2i(btc, kInstBtc, GpVar, Imm) @@ -1634,7 +1619,7 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(btc, kInstBtc, Mem, Imm) - //! @brief Bit test and reset. + //! Bit test and reset. INST_2x(btr, kInstBtr, GpVar, GpVar) //! @overload INST_2i(btr, kInstBtr, GpVar, Imm) @@ -1643,7 +1628,7 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(btr, kInstBtr, Mem, Imm) - //! @brief Bit test and set. + //! Bit test and set. INST_2x(bts, kInstBts, GpVar, GpVar) //! @overload INST_2i(bts, kInstBts, GpVar, Imm) @@ -1652,7 +1637,7 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(bts, kInstBts, Mem, Imm) - //! @brief Call. + //! Call. ASMJIT_INLINE X86X64CallNode* call(const GpVar& dst, uint32_t conv, const FuncPrototype& p) { return addCall(dst, conv, p); } @@ -1674,28 +1659,28 @@ struct X86X64Compiler : public BaseCompiler { return addCall(label, conv, p); } - //! @brief Clear carry flag + //! Clear carry flag INST_0x(clc, kInstClc) - //! @brief Clear direction flag + //! Clear direction flag INST_0x(cld, kInstCld) - //! @brief Complement carry Flag. + //! Complement carry Flag. INST_0x(cmc, kInstCmc) - //! @brief Convert byte to word (AX <- Sign Extend AL). + //! Convert byte to word (AX <- Sign Extend AL). INST_1x(cbw, kInstCbw, GpVar /* al */) - //! @brief Convert word to dword (DX:AX <- Sign Extend AX). + //! Convert word to dword (DX:AX <- Sign Extend AX). INST_2x(cwd, kInstCwd, GpVar /* dx */, GpVar /* ax */) - //! @brief Convert word to dword (EAX <- Sign Extend AX). + //! Convert word to dword (EAX <- Sign Extend AX). INST_1x(cwde, kInstCwde, GpVar /* eax */) - //! @brief Convert dword to qword (EDX:EAX <- Sign Extend EAX). + //! Convert dword to qword (EDX:EAX <- Sign Extend EAX). INST_2x(cdq, kInstCdq, GpVar /* edx */, GpVar /* eax */) - //! @brief Conditional move. + //! Conditional move. INST_2cc(cmov, kInstCmov, condToCmovcc, GpVar, GpVar) - //! @brief Conditional move. + //! Conditional move. INST_2cc(cmov, kInstCmov, condToCmovcc, GpVar, Mem) - //! @brief Compare two operands. + //! Compare two operands. INST_2x(cmp, kInstCmp, GpVar, GpVar) //! @overload INST_2x(cmp, kInstCmp, GpVar, Mem) @@ -1706,12 +1691,12 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(cmp, kInstCmp, Mem, Imm) - //! @brief Compare and exchange (i486). + //! Compare and exchange (i486). INST_3x(cmpxchg, kInstCmpxchg, GpVar /* eax */, GpVar, GpVar) //! @overload INST_3x(cmpxchg, kInstCmpxchg, GpVar /* eax */, Mem, GpVar) - //! @brief Compares the 64-bit value in EDX:EAX with the memory operand (Pentium). + //! Compares the 64-bit value in EDX:EAX with the memory operand (Pentium). ASMJIT_INLINE InstNode* cmpxchg8b( const GpVar& cmp_edx, const GpVar& cmp_eax, const GpVar& cmp_ecx, const GpVar& cmp_ebx, @@ -1720,7 +1705,7 @@ struct X86X64Compiler : public BaseCompiler { return emit(kInstCmpxchg8b, cmp_edx, cmp_eax, cmp_ecx, cmp_ebx, dst); } - //! @brief CPU identification (i486). + //! CPU identification (i486). ASMJIT_INLINE InstNode* cpuid( const GpVar& inout_eax, const GpVar& out_ebx, @@ -1735,63 +1720,63 @@ struct X86X64Compiler : public BaseCompiler { return emit(kInstCpuid, inout_eax, out_ebx, out_ecx, out_edx); } - //! @brief Accumulate crc32 value (polynomial 0x11EDC6F41) (SSE4.2). + //! Accumulate crc32 value (polynomial 0x11EDC6F41) (SSE4.2). INST_2x_(crc32, kInstCrc32, GpVar, GpVar, o0.isRegType(kRegTypeGpd) || o0.isRegType(kRegTypeGpq)) //! @overload INST_2x_(crc32, kInstCrc32, GpVar, Mem, o0.isRegType(kRegTypeGpd) || o0.isRegType(kRegTypeGpq)) - //! @brief Decrement by 1. + //! Decrement by 1. INST_1x(dec, kInstDec, GpVar) //! @overload INST_1x(dec, kInstDec, Mem) - //! @brief Unsigned divide (o0:o1 <- o0:o1 / o2). + //! Unsigned divide (o0:o1 <- o0:o1 / o2). //! - //! Remainder is stored in @a o0, quotient is stored in @a o1. + //! Remainder is stored in `o0`, quotient is stored in `o1`. INST_3x_(div, kInstDiv, GpVar, GpVar, GpVar, o0.getId() != o1.getId()) //! @overload INST_3x_(div, kInstDiv, GpVar, GpVar, Mem, o0.getId() != o1.getId()) - //! @brief Signed divide (o0:o1 <- o0:o1 / o2). + //! Signed divide (o0:o1 <- o0:o1 / o2). //! - //! Remainder is stored in @a o0, quotient is stored in @a o1. + //! Remainder is stored in `o0`, quotient is stored in `o1`. INST_3x_(idiv, kInstIdiv, GpVar, GpVar, GpVar, o0.getId() != o1.getId()) //! @overload INST_3x_(idiv, kInstIdiv, GpVar, GpVar, Mem, o0.getId() != o1.getId()) - //! @brief Signed multiply (o0:o1 <- o1 * o2). + //! Signed multiply (o0:o1 <- o1 * o2). //! - //! Hi value is stored in @a o0, lo value is stored in @a o1. + //! Hi value is stored in `o0`, lo value is stored in `o1`. INST_3x_(imul, kInstImul, GpVar, GpVar, GpVar, o0.getId() != o1.getId()) //! @overload INST_3x_(imul, kInstImul, GpVar, GpVar, Mem, o0.getId() != o1.getId()) - //! @brief Signed multiply. + //! Signed multiply. INST_2x(imul, kInstImul, GpVar, GpVar) //! @overload INST_2x(imul, kInstImul, GpVar, Mem) //! @overload INST_2i(imul, kInstImul, GpVar, Imm) - //! @brief Signed multiply. + //! Signed multiply. INST_3i(imul, kInstImul, GpVar, GpVar, Imm) //! @overload INST_3i(imul, kInstImul, GpVar, Mem, Imm) - //! @brief Increment by 1. + //! Increment by 1. INST_1x(inc, kInstInc, GpVar) //! @overload INST_1x(inc, kInstInc, Mem) - //! @brief Interrupt. + //! Interrupt. INST_1i(int_, kInstInt, Imm) - //! @brief Interrupt 3 - trap to debugger. + //! Interrupt 3 - trap to debugger. ASMJIT_INLINE InstNode* int3() { return int_(3); } - //! @brief Jump to label @a label if condition @a cc is met. + //! Jump to label `label` if condition `cc` is met. INST_1cc(j, kInstJ, condToJcc, Label) - //! @brief Jump. + //! Jump. INST_1x(jmp, kInstJmp, GpVar) //! @overload INST_1x(jmp, kInstJmp, Mem) @@ -1802,13 +1787,13 @@ struct X86X64Compiler : public BaseCompiler { //! @overload ASMJIT_INLINE InstNode* jmp(void* dst) { return jmp(Imm((intptr_t)dst)); } - //! @brief Load AH from flags. + //! Load AH from flags. INST_1x(lahf, kInstLahf, GpVar) - //! @brief Load effective address + //! Load effective address INST_2x(lea, kInstLea, GpVar, Mem) - //! @brief Move. + //! Move. INST_2x(mov, kInstMov, GpVar, GpVar) //! @overload INST_2x(mov, kInstMov, GpVar, Mem) @@ -1819,60 +1804,60 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(mov, kInstMov, Mem, Imm) - //! @brief Move from segment register. + //! Move from segment register. INST_2x(mov, kInstMov, GpVar, SegReg) //! @overload INST_2x(mov, kInstMov, Mem, SegReg) - //! @brief Move to segment register. + //! Move to segment register. INST_2x(mov, kInstMov, SegReg, GpVar) //! @overload INST_2x(mov, kInstMov, SegReg, Mem) - //! @brief Move (AL|AX|EAX|RAX <- absolute address in immediate). + //! Move (AL|AX|EAX|RAX <- absolute address in immediate). ASMJIT_INLINE InstNode* mov_ptr(const GpVar& dst, void* src) { Imm imm(static_cast((intptr_t)src)); return emit(kInstMovptr, dst, imm); } - //! @brief Move (absolute address in immediate <- AL|AX|EAX|RAX). + //! Move (absolute address in immediate <- AL|AX|EAX|RAX). ASMJIT_INLINE InstNode* mov_ptr(void* dst, const GpVar& src) { Imm imm(static_cast((intptr_t)dst)); return emit(kInstMovptr, imm, src); } - //! @brief Move data after swapping bytes (SSE3 - Atom). + //! Move data after swapping bytes (SSE3 - Atom). INST_2x_(movbe, kInstMovbe, GpVar, Mem, !o0.isGpb()); //! @overload INST_2x_(movbe, kInstMovbe, Mem, GpVar, !o1.isGpb()); - //! @brief Move with sign-extension. + //! Move with sign-extension. INST_2x(movsx, kInstMovsx, GpVar, GpVar) //! @overload INST_2x(movsx, kInstMovsx, GpVar, Mem) - //! @brief Move with zero-extension. + //! Move with zero-extension. INST_2x(movzx, kInstMovzx, GpVar, GpVar) //! @overload INST_2x(movzx, kInstMovzx, GpVar, Mem) - //! @brief Unsigned multiply (o0:o1 <- o1 * o2). + //! Unsigned multiply (o0:o1 <- o1 * o2). INST_3x_(mul, kInstMul, GpVar, GpVar, GpVar, o0.getId() != o1.getId()) //! @overload INST_3x_(mul, kInstMul, GpVar, GpVar, Mem, o0.getId() != o1.getId()) - //! @brief Two's complement negation. + //! Two's complement negation. INST_1x(neg, kInstNeg, GpVar) //! @overload INST_1x(neg, kInstNeg, Mem) - //! @brief No operation. + //! No operation. INST_0x(nop, kInstNop) - //! @brief One's complement negation. + //! One's complement negation. INST_1x(not_, kInstNot, GpVar) //! @overload INST_1x(not_, kInstNot, Mem) - //! @brief Or. + //! Or. INST_2x(or_, kInstOr, GpVar, GpVar) //! @overload INST_2x(or_, kInstOr, GpVar, Mem) @@ -1883,104 +1868,104 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(or_, kInstOr, Mem, Imm) - //! @brief Pop a value from the stack. + //! Pop a value from the stack. INST_1x_(pop, kInstPop, GpVar, o0.getSize() == 2 || o0.getSize() == _regSize) //! @overload INST_1x_(pop, kInstPop, Mem, o0.getSize() == 2 || o0.getSize() == _regSize) - //! @brief Pop stack into EFLAGS Register (32-bit or 64-bit). + //! Pop stack into EFLAGS Register (32-bit or 64-bit). INST_0x(popf, kInstPopf) - //! @brief Return the count of number of bits set to 1 (SSE4.2). + //! Return the count of number of bits set to 1 (SSE4.2). INST_2x_(popcnt, kInstPopcnt, GpVar, GpVar, !o0.isGpb() && o0.getSize() == o1.getSize()) //! @overload INST_2x_(popcnt, kInstPopcnt, GpVar, Mem, !o0.isGpb()) - //! @brief Push word/dword/qword on the stack. + //! Push word/dword/qword on the stack. INST_1x_(push, kInstPush, GpVar, o0.getSize() == 2 || o0.getSize() == _regSize) - //! @brief Push word/dword/qword on the stack. + //! Push word/dword/qword on the stack. INST_1x_(push, kInstPush, Mem,o0.getSize() == 2 || o0.getSize() == _regSize) - //! @brief Push segment register on the stack. + //! Push segment register on the stack. INST_1x(push, kInstPush, SegReg) - //! @brief Push word/dword/qword on the stack. + //! Push word/dword/qword on the stack. INST_1i(push, kInstPush, Imm) - //! @brief Push EFLAGS register (32-bit or 64-bit) on the stack. + //! Push EFLAGS register (32-bit or 64-bit) on the stack. INST_0x(pushf, kInstPushf) - //! @brief Rotate bits left. + //! Rotate bits left. INST_2x(rcl, kInstRcl, GpVar, GpVar) //! @overload INST_2x(rcl, kInstRcl, Mem, GpVar) - //! @brief Rotate bits left. + //! Rotate bits left. INST_2i(rcl, kInstRcl, GpVar, Imm) //! @overload INST_2i(rcl, kInstRcl, Mem, Imm) - //! @brief Rotate bits right. + //! Rotate bits right. INST_2x(rcr, kInstRcr, GpVar, GpVar) //! @overload INST_2x(rcr, kInstRcr, Mem, GpVar) - //! @brief Rotate bits right. + //! Rotate bits right. INST_2i(rcr, kInstRcr, GpVar, Imm) //! @overload INST_2i(rcr, kInstRcr, Mem, Imm) - //! @brief Read time-stamp counter (Pentium). + //! Read time-stamp counter (Pentium). INST_2x_(rdtsc, kInstRdtsc, GpVar, GpVar, o0.getId() != o1.getId()) - //! @brief Read time-stamp counter and processor id (Pentium). + //! Read time-stamp counter and processor id (Pentium). INST_3x_(rdtscp, kInstRdtscp, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Load ECX/RCX bytes from DS:[ESI/RSI] to AL. + //! Load ECX/RCX bytes from DS:[ESI/RSI] to AL. INST_3x_(rep_lodsb, kInstRepLodsb, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Load ECX/RCX dwords from DS:[ESI/RSI] to AL. + //! Load ECX/RCX dwords from DS:[ESI/RSI] to AL. INST_3x_(rep_lodsd, kInstRepLodsd, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Load ECX/RCX words from DS:[ESI/RSI] to AX. + //! Load ECX/RCX words from DS:[ESI/RSI] to AX. INST_3x_(rep_lodsw, kInstRepLodsw, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Move ECX/RCX bytes from DS:[ESI/RSI] to ES:[EDI/RDI]. + //! Move ECX/RCX bytes from DS:[ESI/RSI] to ES:[EDI/RDI]. INST_3x_(rep_movsb, kInstRepMovsb, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Move ECX/RCX dwords from DS:[ESI/RSI] to ES:[EDI/RDI]. + //! Move ECX/RCX dwords from DS:[ESI/RSI] to ES:[EDI/RDI]. INST_3x_(rep_movsd, kInstRepMovsd, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Move ECX/RCX dwords from DS:[ESI/RSI] to ES:[EDI/RDI]. + //! Move ECX/RCX dwords from DS:[ESI/RSI] to ES:[EDI/RDI]. INST_3x_(rep_movsw, kInstRepMovsw, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Fill ECX/RCX bytes at ES:[EDI/RDI] with AL. + //! Fill ECX/RCX bytes at ES:[EDI/RDI] with AL. INST_3x_(rep_stosb, kInstRepStosb, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Fill ECX/RCX dwords at ES:[EDI/RDI] with EAX. + //! Fill ECX/RCX dwords at ES:[EDI/RDI] with EAX. INST_3x_(rep_stosd, kInstRepStosd, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Fill ECX/RCX words at ES:[EDI/RDI] with AX. + //! Fill ECX/RCX words at ES:[EDI/RDI] with AX. INST_3x_(rep_stosw, kInstRepStosw, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Repeated find nonmatching bytes in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching bytes in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_3x_(repe_cmpsb, kInstRepeCmpsb, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Repeated find nonmatching dwords in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching dwords in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_3x_(repe_cmpsd, kInstRepeCmpsd, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Repeated find nonmatching words in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching words in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_3x_(repe_cmpsw, kInstRepeCmpsw, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find non-AL byte starting at ES:[EDI/RDI]. + //! Find non-AL byte starting at ES:[EDI/RDI]. INST_3x_(repe_scasb, kInstRepeScasb, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find non-EAX dword starting at ES:[EDI/RDI]. + //! Find non-EAX dword starting at ES:[EDI/RDI]. INST_3x_(repe_scasd, kInstRepeScasd, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find non-AX word starting at ES:[EDI/RDI]. + //! Find non-AX word starting at ES:[EDI/RDI]. INST_3x_(repe_scasw, kInstRepeScasw, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find matching bytes in [RDI] and [RSI]. + //! Find matching bytes in [RDI] and [RSI]. INST_3x_(repne_cmpsb, kInstRepneCmpsb, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find matching dwords in [RDI] and [RSI]. + //! Find matching dwords in [RDI] and [RSI]. INST_3x_(repne_cmpsd, kInstRepneCmpsd, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find matching words in [RDI] and [RSI]. + //! Find matching words in [RDI] and [RSI]. INST_3x_(repne_cmpsw, kInstRepneCmpsw, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find AL, starting at ES:[EDI/RDI]. + //! Find AL, starting at ES:[EDI/RDI]. INST_3x_(repne_scasb, kInstRepneScasb, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find EAX, starting at ES:[EDI/RDI]. + //! Find EAX, starting at ES:[EDI/RDI]. INST_3x_(repne_scasd, kInstRepneScasd, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find AX, starting at ES:[EDI/RDI]. + //! Find AX, starting at ES:[EDI/RDI]. INST_3x_(repne_scasw, kInstRepneScasw, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Return. + //! Return. ASMJIT_INLINE RetNode* ret() { return addRet(noOperand, noOperand); } //! @overload ASMJIT_INLINE RetNode* ret(const GpVar& o0) { return addRet(o0, noOperand); } @@ -1991,28 +1976,28 @@ struct X86X64Compiler : public BaseCompiler { //! @overload ASMJIT_INLINE RetNode* ret(const XmmVar& o0, const XmmVar& o1) { return addRet(o0, o1); } - //! @brief Rotate bits left. + //! Rotate bits left. INST_2x(rol, kInstRol, GpVar, GpVar) //! @overload INST_2x(rol, kInstRol, Mem, GpVar) - //! @brief Rotate bits left. + //! Rotate bits left. INST_2i(rol, kInstRol, GpVar, Imm) //! @overload INST_2i(rol, kInstRol, Mem, Imm) - //! @brief Rotate bits right. + //! Rotate bits right. INST_2x(ror, kInstRor, GpVar, GpVar) //! @overload INST_2x(ror, kInstRor, Mem, GpVar) - //! @brief Rotate bits right. + //! Rotate bits right. INST_2i(ror, kInstRor, GpVar, Imm) //! @overload INST_2i(ror, kInstRor, Mem, Imm) - //! @brief Store @a var (allocated in AH/AX/EAX/RAX) into Flags. + //! Store `a` (allocated in AH/AX/EAX/RAX) into Flags. INST_1x(sahf, kInstSahf, GpVar) - //! @brief Integer subtraction with borrow. + //! Integer subtraction with borrow. INST_2x(sbb, kInstSbb, GpVar, GpVar) //! @overload INST_2x(sbb, kInstSbb, GpVar, Mem) @@ -2023,71 +2008,71 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(sbb, kInstSbb, Mem, Imm) - //! @brief Shift bits left. + //! Shift bits left. INST_2x(sal, kInstSal, GpVar, GpVar) //! @overload INST_2x(sal, kInstSal, Mem, GpVar) - //! @brief Shift bits left. + //! Shift bits left. INST_2i(sal, kInstSal, GpVar, Imm) //! @overload INST_2i(sal, kInstSal, Mem, Imm) - //! @brief Shift bits right. + //! Shift bits right. INST_2x(sar, kInstSar, GpVar, GpVar) //! @overload INST_2x(sar, kInstSar, Mem, GpVar) - //! @brief Shift bits right. + //! Shift bits right. INST_2i(sar, kInstSar, GpVar, Imm) //! @overload INST_2i(sar, kInstSar, Mem, Imm) - //! @brief Set byte on condition. + //! Set byte on condition. INST_1cc(set, kInstSet, condToSetcc, GpVar) - //! @brief Set byte on condition. + //! Set byte on condition. INST_1cc(set, kInstSet, condToSetcc, Mem) - //! @brief Shift bits left. + //! Shift bits left. INST_2x(shl, kInstShl, GpVar, GpVar) //! @overload INST_2x(shl, kInstShl, Mem, GpVar) - //! @brief Shift bits left. + //! Shift bits left. INST_2i(shl, kInstShl, GpVar, Imm) //! @overload INST_2i(shl, kInstShl, Mem, Imm) - //! @brief Shift bits right. + //! Shift bits right. INST_2x(shr, kInstShr, GpVar, GpVar) //! @overload INST_2x(shr, kInstShr, Mem, GpVar) - //! @brief Shift bits right. + //! Shift bits right. INST_2i(shr, kInstShr, GpVar, Imm) //! @overload INST_2i(shr, kInstShr, Mem, Imm) - //! @brief Double precision shift left. + //! Double precision shift left. INST_3x(shld, kInstShld, GpVar, GpVar, GpVar) //! @overload INST_3x(shld, kInstShld, Mem, GpVar, GpVar) - //! @brief Double precision shift left. + //! Double precision shift left. INST_3i(shld, kInstShld, GpVar, GpVar, Imm) //! @overload INST_3i(shld, kInstShld, Mem, GpVar, Imm) - //! @brief Double precision shift right. + //! Double precision shift right. INST_3x(shrd, kInstShrd, GpVar, GpVar, GpVar) //! @overload INST_3x(shrd, kInstShrd, Mem, GpVar, GpVar) - //! @brief Double precision shift right. + //! Double precision shift right. INST_3i(shrd, kInstShrd, GpVar, GpVar, Imm) //! @overload INST_3i(shrd, kInstShrd, Mem, GpVar, Imm) - //! @brief Set carry flag to 1. + //! Set carry flag to 1. INST_0x(stc, kInstStc) - //! @brief Set direction flag to 1. + //! Set direction flag to 1. INST_0x(std, kInstStd) - //! @brief Subtract. + //! Subtract. INST_2x(sub, kInstSub, GpVar, GpVar) //! @overload INST_2x(sub, kInstSub, GpVar, Mem) @@ -2098,7 +2083,7 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(sub, kInstSub, Mem, Imm) - //! @brief Logical compare. + //! Logical compare. INST_2x(test, kInstTest, GpVar, GpVar) //! @overload INST_2i(test, kInstTest, GpVar, Imm) @@ -2107,22 +2092,22 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2i(test, kInstTest, Mem, Imm) - //! @brief Undefined instruction - Raise #UD exception. + //! Undefined instruction - Raise #UD exception. INST_0x(ud2, kInstUd2) - //! @brief Exchange and add. + //! Exchange and add. INST_2x(xadd, kInstXadd, GpVar, GpVar) //! @overload INST_2x(xadd, kInstXadd, Mem, GpVar) - //! @brief Exchange register/memory with register. + //! Exchange register/memory with register. INST_2x(xchg, kInstXchg, GpVar, GpVar) //! @overload INST_2x(xchg, kInstXchg, Mem, GpVar) //! @overload INST_2x(xchg, kInstXchg, GpVar, Mem) - //! @brief Xor. + //! Xor. INST_2x(xor_, kInstXor, GpVar, GpVar) //! @overload INST_2x(xor_, kInstXor, GpVar, Mem) @@ -2137,7 +2122,7 @@ struct X86X64Compiler : public BaseCompiler { // [MMX] // -------------------------------------------------------------------------- - //! @brief Move dword (MMX). + //! Move DWORD (MMX). INST_2x(movd, kInstMovd, Mem, MmVar) //! @overload INST_2x(movd, kInstMovd, GpVar, MmVar) @@ -2146,490 +2131,488 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2x(movd, kInstMovd, MmVar, GpVar) - //! @brief Move qword (MMX). + //! Move QWORD (MMX). INST_2x(movq, kInstMovq, MmVar, MmVar) //! @overload INST_2x(movq, kInstMovq, Mem, MmVar) //! @overload INST_2x(movq, kInstMovq, MmVar, Mem) - //! @brief Pack with signed saturation (MMX). - INST_2x(packsswb, kInstPacksswb, MmVar, MmVar) - //! @overload - INST_2x(packsswb, kInstPacksswb, MmVar, Mem) - - //! @brief Pack with signed saturation (MMX). + //! Pack DWORDs to WORDs with signed saturation (MMX). INST_2x(packssdw, kInstPackssdw, MmVar, MmVar) //! @overload INST_2x(packssdw, kInstPackssdw, MmVar, Mem) - //! @brief Pack with unsigned saturation (MMX). + //! Pack WORDs to BYTEs with signed saturation (MMX). + INST_2x(packsswb, kInstPacksswb, MmVar, MmVar) + //! @overload + INST_2x(packsswb, kInstPacksswb, MmVar, Mem) + + //! Pack WORDs to BYTEs with unsigned saturation (MMX). INST_2x(packuswb, kInstPackuswb, MmVar, MmVar) //! @overload INST_2x(packuswb, kInstPackuswb, MmVar, Mem) - //! @brief Packed byte add (MMX). + //! Packed BYTE add (MMX). INST_2x(paddb, kInstPaddb, MmVar, MmVar) //! @overload INST_2x(paddb, kInstPaddb, MmVar, Mem) - //! @brief Packed word add (MMX). - INST_2x(paddw, kInstPaddw, MmVar, MmVar) - //! @overload - INST_2x(paddw, kInstPaddw, MmVar, Mem) - - //! @brief Packed dword add (MMX). + //! Packed DWORD add (MMX). INST_2x(paddd, kInstPaddd, MmVar, MmVar) //! @overload INST_2x(paddd, kInstPaddd, MmVar, Mem) - //! @brief Packed add with saturation (MMX). + //! Packed BYTE add with saturation (MMX). INST_2x(paddsb, kInstPaddsb, MmVar, MmVar) //! @overload INST_2x(paddsb, kInstPaddsb, MmVar, Mem) - //! @brief Packed add with saturation (MMX). + //! Packed WORD add with saturation (MMX). INST_2x(paddsw, kInstPaddsw, MmVar, MmVar) //! @overload INST_2x(paddsw, kInstPaddsw, MmVar, Mem) - //! @brief Packed add unsigned with saturation (MMX). + //! Packed BYTE add with unsigned saturation (MMX). INST_2x(paddusb, kInstPaddusb, MmVar, MmVar) //! @overload INST_2x(paddusb, kInstPaddusb, MmVar, Mem) - //! @brief Packed add unsigned with saturation (MMX). + //! Packed WORD add with unsigned saturation (MMX). INST_2x(paddusw, kInstPaddusw, MmVar, MmVar) //! @overload INST_2x(paddusw, kInstPaddusw, MmVar, Mem) - //! @brief And (MMX). + //! Packed WORD add (MMX). + INST_2x(paddw, kInstPaddw, MmVar, MmVar) + //! @overload + INST_2x(paddw, kInstPaddw, MmVar, Mem) + + //! Packed and (MMX). INST_2x(pand, kInstPand, MmVar, MmVar) //! @overload INST_2x(pand, kInstPand, MmVar, Mem) - //! @brief And-not (MMX). + //! Packed and-not (MMX). INST_2x(pandn, kInstPandn, MmVar, MmVar) //! @overload INST_2x(pandn, kInstPandn, MmVar, Mem) - //! @brief Packed compare bytes for equal (MMX). + //! Packed BYTEs compare for equality (MMX). INST_2x(pcmpeqb, kInstPcmpeqb, MmVar, MmVar) //! @overload INST_2x(pcmpeqb, kInstPcmpeqb, MmVar, Mem) - //! @brief Packed compare words for equal (MMX). - INST_2x(pcmpeqw, kInstPcmpeqw, MmVar, MmVar) - //! @overload - INST_2x(pcmpeqw, kInstPcmpeqw, MmVar, Mem) - - //! @brief Packed compare dwords for equal (MMX). + //! Packed DWORDs compare for equality (MMX). INST_2x(pcmpeqd, kInstPcmpeqd, MmVar, MmVar) //! @overload INST_2x(pcmpeqd, kInstPcmpeqd, MmVar, Mem) - //! @brief Packed compare bytes for greater than (MMX). + //! Packed WORDs compare for equality (MMX). + INST_2x(pcmpeqw, kInstPcmpeqw, MmVar, MmVar) + //! @overload + INST_2x(pcmpeqw, kInstPcmpeqw, MmVar, Mem) + + //! Packed BYTEs compare if greater than (MMX). INST_2x(pcmpgtb, kInstPcmpgtb, MmVar, MmVar) //! @overload INST_2x(pcmpgtb, kInstPcmpgtb, MmVar, Mem) - //! @brief Packed compare words for greater than (MMX). - INST_2x(pcmpgtw, kInstPcmpgtw, MmVar, MmVar) - //! @overload - INST_2x(pcmpgtw, kInstPcmpgtw, MmVar, Mem) - - //! @brief Packed compare dwords for greater than (MMX). + //! Packed DWORDs compare if greater than (MMX). INST_2x(pcmpgtd, kInstPcmpgtd, MmVar, MmVar) //! @overload INST_2x(pcmpgtd, kInstPcmpgtd, MmVar, Mem) - //! @brief Packed multiply high (MMX). + //! Packed WORDs compare if greater than (MMX). + INST_2x(pcmpgtw, kInstPcmpgtw, MmVar, MmVar) + //! @overload + INST_2x(pcmpgtw, kInstPcmpgtw, MmVar, Mem) + + //! Packed WORD multiply high (MMX). INST_2x(pmulhw, kInstPmulhw, MmVar, MmVar) //! @overload INST_2x(pmulhw, kInstPmulhw, MmVar, Mem) - //! @brief Packed multiply low (MMX). + //! Packed WORD multiply low (MMX). INST_2x(pmullw, kInstPmullw, MmVar, MmVar) //! @overload INST_2x(pmullw, kInstPmullw, MmVar, Mem) - //! @brief Bitwise logical or (MMX). + //! Packed bitwise or (MMX). INST_2x(por, kInstPor, MmVar, MmVar) //! @overload INST_2x(por, kInstPor, MmVar, Mem) - //! @brief Packed multiply and add (MMX). + //! Packed WORD multiply and add to packed DWORD (MMX). INST_2x(pmaddwd, kInstPmaddwd, MmVar, MmVar) //! @overload INST_2x(pmaddwd, kInstPmaddwd, MmVar, Mem) - //! @brief Packed shift left logical (MMX). + //! Packed DWORD shift left logical (MMX). INST_2x(pslld, kInstPslld, MmVar, MmVar) //! @overload INST_2x(pslld, kInstPslld, MmVar, Mem) //! @overload INST_2i(pslld, kInstPslld, MmVar, Imm) - //! @brief Packed shift left logical (MMX). + //! Packed QWORD shift left logical (MMX). INST_2x(psllq, kInstPsllq, MmVar, MmVar) //! @overload INST_2x(psllq, kInstPsllq, MmVar, Mem) //! @overload INST_2i(psllq, kInstPsllq, MmVar, Imm) - //! @brief Packed shift left logical (MMX). + //! Packed WORD shift left logical (MMX). INST_2x(psllw, kInstPsllw, MmVar, MmVar) //! @overload INST_2x(psllw, kInstPsllw, MmVar, Mem) //! @overload INST_2i(psllw, kInstPsllw, MmVar, Imm) - //! @brief Packed shift right arithmetic (MMX). + //! Packed DWORD shift right arithmetic (MMX). INST_2x(psrad, kInstPsrad, MmVar, MmVar) //! @overload INST_2x(psrad, kInstPsrad, MmVar, Mem) //! @overload INST_2i(psrad, kInstPsrad, MmVar, Imm) - //! @brief Packed shift right arithmetic (MMX). + //! Packed WORD shift right arithmetic (MMX). INST_2x(psraw, kInstPsraw, MmVar, MmVar) //! @overload INST_2x(psraw, kInstPsraw, MmVar, Mem) //! @overload INST_2i(psraw, kInstPsraw, MmVar, Imm) - //! @brief Packed shift right logical (MMX). + //! Packed DWORD shift right logical (MMX). INST_2x(psrld, kInstPsrld, MmVar, MmVar) //! @overload INST_2x(psrld, kInstPsrld, MmVar, Mem) //! @overload INST_2i(psrld, kInstPsrld, MmVar, Imm) - //! @brief Packed shift right logical (MMX). + //! Packed QWORD shift right logical (MMX). INST_2x(psrlq, kInstPsrlq, MmVar, MmVar) //! @overload INST_2x(psrlq, kInstPsrlq, MmVar, Mem) //! @overload INST_2i(psrlq, kInstPsrlq, MmVar, Imm) - //! @brief Packed shift right logical (MMX). + //! Packed WORD shift right logical (MMX). INST_2x(psrlw, kInstPsrlw, MmVar, MmVar) //! @overload INST_2x(psrlw, kInstPsrlw, MmVar, Mem) //! @overload INST_2i(psrlw, kInstPsrlw, MmVar, Imm) - //! @brief Packed subtract (MMX). + //! Packed BYTE subtract (MMX). INST_2x(psubb, kInstPsubb, MmVar, MmVar) //! @overload INST_2x(psubb, kInstPsubb, MmVar, Mem) - //! @brief Packed subtract (MMX). - INST_2x(psubw, kInstPsubw, MmVar, MmVar) - //! @overload - INST_2x(psubw, kInstPsubw, MmVar, Mem) - - //! @brief Packed subtract (MMX). + //! Packed DWORD subtract (MMX). INST_2x(psubd, kInstPsubd, MmVar, MmVar) //! @overload INST_2x(psubd, kInstPsubd, MmVar, Mem) - //! @brief Packed subtract with saturation (MMX). + //! Packed BYTE subtract with saturation (MMX). INST_2x(psubsb, kInstPsubsb, MmVar, MmVar) //! @overload INST_2x(psubsb, kInstPsubsb, MmVar, Mem) - //! @brief Packed subtract with saturation (MMX). + //! Packed WORD subtract with saturation (MMX). INST_2x(psubsw, kInstPsubsw, MmVar, MmVar) //! @overload INST_2x(psubsw, kInstPsubsw, MmVar, Mem) - //! @brief Packed subtract with unsigned saturation (MMX). + //! Packed BYTE subtract with unsigned saturation (MMX). INST_2x(psubusb, kInstPsubusb, MmVar, MmVar) //! @overload INST_2x(psubusb, kInstPsubusb, MmVar, Mem) - //! @brief Packed subtract with unsigned saturation (MMX). + //! Packed WORD subtract with unsigned saturation (MMX). INST_2x(psubusw, kInstPsubusw, MmVar, MmVar) //! @overload INST_2x(psubusw, kInstPsubusw, MmVar, Mem) - //! @brief Unpack high packed data (MMX). + //! Packed WORD subtract (MMX). + INST_2x(psubw, kInstPsubw, MmVar, MmVar) + //! @overload + INST_2x(psubw, kInstPsubw, MmVar, Mem) + + //! Unpack high packed BYTEs to WORDs (MMX). INST_2x(punpckhbw, kInstPunpckhbw, MmVar, MmVar) //! @overload INST_2x(punpckhbw, kInstPunpckhbw, MmVar, Mem) - //! @brief Unpack high packed data (MMX). - INST_2x(punpckhwd, kInstPunpckhwd, MmVar, MmVar) - //! @overload - INST_2x(punpckhwd, kInstPunpckhwd, MmVar, Mem) - - //! @brief Unpack high packed data (MMX). + //! Unpack high packed DWORDs to QWORDs (MMX). INST_2x(punpckhdq, kInstPunpckhdq, MmVar, MmVar) //! @overload INST_2x(punpckhdq, kInstPunpckhdq, MmVar, Mem) - //! @brief Unpack high packed data (MMX). + //! Unpack high packed WORDs to DWORDs (MMX). + INST_2x(punpckhwd, kInstPunpckhwd, MmVar, MmVar) + //! @overload + INST_2x(punpckhwd, kInstPunpckhwd, MmVar, Mem) + + //! Unpack low packed BYTEs to WORDs (MMX). INST_2x(punpcklbw, kInstPunpcklbw, MmVar, MmVar) //! @overload INST_2x(punpcklbw, kInstPunpcklbw, MmVar, Mem) - //! @brief Unpack high packed data (MMX). - INST_2x(punpcklwd, kInstPunpcklwd, MmVar, MmVar) - //! @overload - INST_2x(punpcklwd, kInstPunpcklwd, MmVar, Mem) - - //! @brief Unpack high packed data (MMX). + //! Unpack low packed DWORDs to QWORDs (MMX). INST_2x(punpckldq, kInstPunpckldq, MmVar, MmVar) //! @overload INST_2x(punpckldq, kInstPunpckldq, MmVar, Mem) - //! @brief Xor (MMX). + //! Unpack low packed WORDs to DWORDs (MMX). + INST_2x(punpcklwd, kInstPunpcklwd, MmVar, MmVar) + //! @overload + INST_2x(punpcklwd, kInstPunpcklwd, MmVar, Mem) + + //! Packed bitwise xor (MMX). INST_2x(pxor, kInstPxor, MmVar, MmVar) //! @overload INST_2x(pxor, kInstPxor, MmVar, Mem) - //! @brief Empty MMX state. + //! Empty MMX state. INST_0x(emms, kInstEmms) // -------------------------------------------------------------------------- // [3dNow] // -------------------------------------------------------------------------- - //! @brief Packed SP-FP to integer convert (3dNow!). + //! Packed SP-FP to DWORD convert (3dNow!). INST_2x(pf2id, kInstPf2id, MmVar, MmVar) //! @overload INST_2x(pf2id, kInstPf2id, MmVar, Mem) - //! @brief Packed SP-FP to integer word convert (3dNow!). + //! Packed SP-FP to WORD convert (3dNow!). INST_2x(pf2iw, kInstPf2iw, MmVar, MmVar) //! @overload INST_2x(pf2iw, kInstPf2iw, MmVar, Mem) - //! @brief Packed SP-FP accumulate (3dNow!). + //! Packed SP-FP accumulate (3dNow!). INST_2x(pfacc, kInstPfacc, MmVar, MmVar) //! @overload INST_2x(pfacc, kInstPfacc, MmVar, Mem) - //! @brief Packed SP-FP addition (3dNow!). + //! Packed SP-FP addition (3dNow!). INST_2x(pfadd, kInstPfadd, MmVar, MmVar) //! @overload INST_2x(pfadd, kInstPfadd, MmVar, Mem) - //! @brief Packed SP-FP compare - dst == src (3dNow!). + //! Packed SP-FP compare - dst == src (3dNow!). INST_2x(pfcmpeq, kInstPfcmpeq, MmVar, MmVar) //! @overload INST_2x(pfcmpeq, kInstPfcmpeq, MmVar, Mem) - //! @brief Packed SP-FP compare - dst >= src (3dNow!). + //! Packed SP-FP compare - dst >= src (3dNow!). INST_2x(pfcmpge, kInstPfcmpge, MmVar, MmVar) //! @overload INST_2x(pfcmpge, kInstPfcmpge, MmVar, Mem) - //! @brief Packed SP-FP compare - dst > src (3dNow!). + //! Packed SP-FP compare - dst > src (3dNow!). INST_2x(pfcmpgt, kInstPfcmpgt, MmVar, MmVar) //! @overload INST_2x(pfcmpgt, kInstPfcmpgt, MmVar, Mem) - //! @brief Packed SP-FP maximum (3dNow!). + //! Packed SP-FP maximum (3dNow!). INST_2x(pfmax, kInstPfmax, MmVar, MmVar) //! @overload INST_2x(pfmax, kInstPfmax, MmVar, Mem) - //! @brief Packed SP-FP minimum (3dNow!). + //! Packed SP-FP minimum (3dNow!). INST_2x(pfmin, kInstPfmin, MmVar, MmVar) //! @overload INST_2x(pfmin, kInstPfmin, MmVar, Mem) - //! @brief Packed SP-FP multiply (3dNow!). + //! Packed SP-FP multiply (3dNow!). INST_2x(pfmul, kInstPfmul, MmVar, MmVar) //! @overload INST_2x(pfmul, kInstPfmul, MmVar, Mem) - //! @brief Packed SP-FP negative accumulate (3dNow!). + //! Packed SP-FP negative accumulate (3dNow!). INST_2x(pfnacc, kInstPfnacc, MmVar, MmVar) //! @overload INST_2x(pfnacc, kInstPfnacc, MmVar, Mem) - //! @brief Packed SP-FP mixed accumulate (3dNow!). + //! Packed SP-FP mixed accumulate (3dNow!). INST_2x(pfpnacc, kInstPfpnacc, MmVar, MmVar) //! @overload INST_2x(pfpnacc, kInstPfpnacc, MmVar, Mem) - //! @brief Packed SP-FP reciprocal approximation (3dNow!). + //! Packed SP-FP reciprocal approximation (3dNow!). INST_2x(pfrcp, kInstPfrcp, MmVar, MmVar) //! @overload INST_2x(pfrcp, kInstPfrcp, MmVar, Mem) - //! @brief Packed SP-FP reciprocal, first iteration step (3dNow!). + //! Packed SP-FP reciprocal, first iteration step (3dNow!). INST_2x(pfrcpit1, kInstPfrcpit1, MmVar, MmVar) //! @overload INST_2x(pfrcpit1, kInstPfrcpit1, MmVar, Mem) - //! @brief Packed SP-FP reciprocal, second iteration step (3dNow!). + //! Packed SP-FP reciprocal, second iteration step (3dNow!). INST_2x(pfrcpit2, kInstPfrcpit2, MmVar, MmVar) //! @overload INST_2x(pfrcpit2, kInstPfrcpit2, MmVar, Mem) - //! @brief Packed SP-FP reciprocal square root, first iteration step (3dNow!). + //! Packed SP-FP reciprocal square root, first iteration step (3dNow!). INST_2x(pfrsqit1, kInstPfrsqit1, MmVar, MmVar) //! @overload INST_2x(pfrsqit1, kInstPfrsqit1, MmVar, Mem) - //! @brief Packed SP-FP reciprocal square root approximation (3dNow!). + //! Packed SP-FP reciprocal square root approximation (3dNow!). INST_2x(pfrsqrt, kInstPfrsqrt, MmVar, MmVar) //! @overload INST_2x(pfrsqrt, kInstPfrsqrt, MmVar, Mem) - //! @brief Packed SP-FP subtract (3dNow!). + //! Packed SP-FP subtract (3dNow!). INST_2x(pfsub, kInstPfsub, MmVar, MmVar) //! @overload INST_2x(pfsub, kInstPfsub, MmVar, Mem) - //! @brief Packed SP-FP reverse subtract (3dNow!). + //! Packed SP-FP reverse subtract (3dNow!). INST_2x(pfsubr, kInstPfsubr, MmVar, MmVar) //! @overload INST_2x(pfsubr, kInstPfsubr, MmVar, Mem) - //! @brief Packed dwords to SP-FP (3dNow!). + //! Packed DWORDs to SP-FP (3dNow!). INST_2x(pi2fd, kInstPi2fd, MmVar, MmVar) //! @overload INST_2x(pi2fd, kInstPi2fd, MmVar, Mem) - //! @brief Packed words to SP-FP (3dNow!). + //! Packed WORDs to SP-FP (3dNow!). INST_2x(pi2fw, kInstPi2fw, MmVar, MmVar) //! @overload INST_2x(pi2fw, kInstPi2fw, MmVar, Mem) - //! @brief Packed swap dword (3dNow!) + //! Packed swap DWORDs (3dNow!) INST_2x(pswapd, kInstPswapd, MmVar, MmVar) //! @overload INST_2x(pswapd, kInstPswapd, MmVar, Mem) - //! @brief Prefetch (3dNow!). + //! Prefetch (3dNow!). INST_1x(prefetch_3dnow, kInstPrefetch3dNow, Mem) - //! @brief Prefetch and set cache to modified (3dNow!). + //! Prefetch and set cache to modified (3dNow!). INST_1x(prefetchw_3dnow, kInstPrefetchw3dNow, Mem) - //! @brief Faster EMMS (3dNow!). + //! Faster EMMS (3dNow!). INST_0x(femms, kInstFemms) // -------------------------------------------------------------------------- // [SSE] // -------------------------------------------------------------------------- - //! @brief Packed SP-FP add (SSE). + //! Packed SP-FP add (SSE). INST_2x(addps, kInstAddps, XmmVar, XmmVar) //! @overload INST_2x(addps, kInstAddps, XmmVar, Mem) - //! @brief Scalar SP-FP add (SSE). + //! Scalar SP-FP add (SSE). INST_2x(addss, kInstAddss, XmmVar, XmmVar) //! @overload INST_2x(addss, kInstAddss, XmmVar, Mem) - //! @brief And-not For SP-FP (SSE). + //! Packed SP-FP bitwise and-not (SSE). INST_2x(andnps, kInstAndnps, XmmVar, XmmVar) //! @overload INST_2x(andnps, kInstAndnps, XmmVar, Mem) - //! @brief And for SP-FP (SSE). + //! Packed SP-FP bitwise and (SSE). INST_2x(andps, kInstAndps, XmmVar, XmmVar) //! @overload INST_2x(andps, kInstAndps, XmmVar, Mem) - //! @brief Packed SP-FP compare (SSE). + //! Packed SP-FP compare (SSE). INST_3i(cmpps, kInstCmpps, XmmVar, XmmVar, Imm) //! @overload INST_3i(cmpps, kInstCmpps, XmmVar, Mem, Imm) - //! @brief Compare scalar SP-FP Values (SSE). + //! Compare scalar SP-FP Values (SSE). INST_3i(cmpss, kInstCmpss, XmmVar, XmmVar, Imm) //! @overload INST_3i(cmpss, kInstCmpss, XmmVar, Mem, Imm) - //! @brief Scalar ordered SP-FP compare and set EFLAGS (SSE). + //! Scalar ordered SP-FP compare and set EFLAGS (SSE). INST_2x(comiss, kInstComiss, XmmVar, XmmVar) //! @overload INST_2x(comiss, kInstComiss, XmmVar, Mem) - //! @brief Packed signed INT32 to packed SP-FP conversion (SSE). + //! Packed signed INT32 to packed SP-FP conversion (SSE). INST_2x(cvtpi2ps, kInstCvtpi2ps, XmmVar, MmVar) //! @overload INST_2x(cvtpi2ps, kInstCvtpi2ps, XmmVar, Mem) - //! @brief Packed SP-FP to packed INT32 conversion (SSE). + //! Packed SP-FP to packed INT32 conversion (SSE). INST_2x(cvtps2pi, kInstCvtps2pi, MmVar, XmmVar) //! @overload INST_2x(cvtps2pi, kInstCvtps2pi, MmVar, Mem) - //! @brief Scalar signed INT32 to SP-FP conversion (SSE). + //! Convert scalar INT32 to SP-FP (SSE). INST_2x(cvtsi2ss, kInstCvtsi2ss, XmmVar, GpVar) //! @overload INST_2x(cvtsi2ss, kInstCvtsi2ss, XmmVar, Mem) - //! @brief Scalar SP-FP to Signed INT32 conversion (SSE). + //! Convert scalar SP-FP to INT32 (SSE). INST_2x(cvtss2si, kInstCvtss2si, GpVar, XmmVar) //! @overload INST_2x(cvtss2si, kInstCvtss2si, GpVar, Mem) - //! @brief Packed SP-FP to packed INT32 conversion (truncate) (SSE). + //! Convert with truncation packed SP-FP to packed INT32 (SSE). INST_2x(cvttps2pi, kInstCvttps2pi, MmVar, XmmVar) //! @overload INST_2x(cvttps2pi, kInstCvttps2pi, MmVar, Mem) - //! @brief Scalar SP-FP to signed INT32 conversion (truncate) (SSE). + //! Convert with truncation scalar SP-FP to INT32 (SSE). INST_2x(cvttss2si, kInstCvttss2si, GpVar, XmmVar) //! @overload INST_2x(cvttss2si, kInstCvttss2si, GpVar, Mem) - //! @brief Packed SP-FP divide (SSE). + //! Packed SP-FP divide (SSE). INST_2x(divps, kInstDivps, XmmVar, XmmVar) //! @overload INST_2x(divps, kInstDivps, XmmVar, Mem) - //! @brief Scalar SP-FP divide (SSE). + //! Scalar SP-FP divide (SSE). INST_2x(divss, kInstDivss, XmmVar, XmmVar) //! @overload INST_2x(divss, kInstDivss, XmmVar, Mem) - //! @brief Load streaming SIMD extension control/status (SSE). + //! Load streaming SIMD extension control/status (SSE). INST_1x(ldmxcsr, kInstLdmxcsr, Mem) - //! @brief Byte mask write (SSE). - //! - //! @note The default memory location is specified by DS:EDI. + //! Byte mask write (SSE). INST_2x(maskmovq, kInstMaskmovq, MmVar, MmVar) - //! @brief Packed SP-FP maximum (SSE). + //! Packed SP-FP maximum (SSE). INST_2x(maxps, kInstMaxps, XmmVar, XmmVar) //! @overload INST_2x(maxps, kInstMaxps, XmmVar, Mem) - //! @brief Scalar SP-FP maximum (SSE). + //! Scalar SP-FP maximum (SSE). INST_2x(maxss, kInstMaxss, XmmVar, XmmVar) //! @overload INST_2x(maxss, kInstMaxss, XmmVar, Mem) - //! @brief Packed SP-FP minimum (SSE). + //! Packed SP-FP minimum (SSE). INST_2x(minps, kInstMinps, XmmVar, XmmVar) //! @overload INST_2x(minps, kInstMinps, XmmVar, Mem) - //! @brief Scalar SP-FP minimum (SSE). + //! Scalar SP-FP minimum (SSE). INST_2x(minss, kInstMinss, XmmVar, XmmVar) //! @overload INST_2x(minss, kInstMinss, XmmVar, Mem) - //! @brief Move aligned packed SP-FP values (SSE). + //! Move aligned packed SP-FP (SSE). INST_2x(movaps, kInstMovaps, XmmVar, XmmVar) //! @overload INST_2x(movaps, kInstMovaps, XmmVar, Mem) - //! @brief Move aligned packed SP-FP values (SSE). + //! Move aligned packed SP-FP (SSE). INST_2x(movaps, kInstMovaps, Mem, XmmVar) - //! @brief Move dword. + //! Move DWORD. INST_2x(movd, kInstMovd, Mem, XmmVar) //! @overload INST_2x(movd, kInstMovd, GpVar, XmmVar) @@ -2638,826 +2621,828 @@ struct X86X64Compiler : public BaseCompiler { //! @overload INST_2x(movd, kInstMovd, XmmVar, GpVar) - //! @brief Move qword (SSE). + //! Move QWORD (SSE). INST_2x(movq, kInstMovq, XmmVar, XmmVar) //! @overload INST_2x(movq, kInstMovq, Mem, XmmVar) //! @overload INST_2x(movq, kInstMovq, XmmVar, Mem) - //! @brief Move 64 bits non-temporal (SSE). + //! Move QWORD using NT hint (SSE). INST_2x(movntq, kInstMovntq, Mem, MmVar) - //! @brief High to low packed SP-FP (SSE). + //! Move high to low packed SP-FP (SSE). INST_2x(movhlps, kInstMovhlps, XmmVar, XmmVar) - //! @brief Move high packed SP-FP (SSE). + //! Move high packed SP-FP (SSE). INST_2x(movhps, kInstMovhps, XmmVar, Mem) - //! @brief Move high packed SP-FP (SSE). + //! Move high packed SP-FP (SSE). INST_2x(movhps, kInstMovhps, Mem, XmmVar) - //! @brief Move low to high packed SP-FP (SSE). + //! Move low to high packed SP-FP (SSE). INST_2x(movlhps, kInstMovlhps, XmmVar, XmmVar) - //! @brief Move low packed SP-FP (SSE). + //! Move low packed SP-FP (SSE). INST_2x(movlps, kInstMovlps, XmmVar, Mem) - //! @brief Move low packed SP-FP (SSE). + //! Move low packed SP-FP (SSE). INST_2x(movlps, kInstMovlps, Mem, XmmVar) - //! @brief Move aligned four packed SP-FP non-temporal (SSE). + //! Move aligned packed SP-FP using NT hint (SSE). INST_2x(movntps, kInstMovntps, Mem, XmmVar) - //! @brief Move scalar SP-FP (SSE). + //! Move scalar SP-FP (SSE). INST_2x(movss, kInstMovss, XmmVar, XmmVar) //! @overload INST_2x(movss, kInstMovss, XmmVar, Mem) //! @overload INST_2x(movss, kInstMovss, Mem, XmmVar) - //! @brief Move unaligned packed SP-FP values (SSE). + //! Move unaligned packed SP-FP (SSE). INST_2x(movups, kInstMovups, XmmVar, XmmVar) //! @overload INST_2x(movups, kInstMovups, XmmVar, Mem) //! @overload INST_2x(movups, kInstMovups, Mem, XmmVar) - //! @brief Packed SP-FP multiply (SSE). + //! Packed SP-FP multiply (SSE). INST_2x(mulps, kInstMulps, XmmVar, XmmVar) //! @overload INST_2x(mulps, kInstMulps, XmmVar, Mem) - //! @brief Scalar SP-FP multiply (SSE). + //! Scalar SP-FP multiply (SSE). INST_2x(mulss, kInstMulss, XmmVar, XmmVar) //! @overload INST_2x(mulss, kInstMulss, XmmVar, Mem) - //! @brief Or for SP-FP data (SSE). + //! Packed SP-FP bitwise or (SSE). INST_2x(orps, kInstOrps, XmmVar, XmmVar) //! @overload INST_2x(orps, kInstOrps, XmmVar, Mem) - //! @brief Packed average (SSE). + //! Packed BYTE average (SSE). INST_2x(pavgb, kInstPavgb, MmVar, MmVar) //! @overload INST_2x(pavgb, kInstPavgb, MmVar, Mem) - //! @brief Packed average (SSE). + //! Packed WORD average (SSE). INST_2x(pavgw, kInstPavgw, MmVar, MmVar) //! @overload INST_2x(pavgw, kInstPavgw, MmVar, Mem) - //! @brief Extract word (SSE). + //! Extract WORD based on selector (SSE). INST_3i(pextrw, kInstPextrw, GpVar, MmVar, Imm) - //! @brief Insert word (SSE). + //! Insert WORD based on selector (SSE). INST_3i(pinsrw, kInstPinsrw, MmVar, GpVar, Imm) //! @overload INST_3i(pinsrw, kInstPinsrw, MmVar, Mem, Imm) - //! @brief Packed signed integer word maximum (SSE). + //! Packed WORD maximum (SSE). INST_2x(pmaxsw, kInstPmaxsw, MmVar, MmVar) //! @overload INST_2x(pmaxsw, kInstPmaxsw, MmVar, Mem) - //! @brief Packed unsigned integer byte maximum (SSE). + //! Packed BYTE unsigned maximum (SSE). INST_2x(pmaxub, kInstPmaxub, MmVar, MmVar) //! @overload INST_2x(pmaxub, kInstPmaxub, MmVar, Mem) - //! @brief Packed signed integer word minimum (SSE). + //! Packed WORD minimum (SSE). INST_2x(pminsw, kInstPminsw, MmVar, MmVar) //! @overload INST_2x(pminsw, kInstPminsw, MmVar, Mem) - //! @brief Packed unsigned integer byte minimum (SSE). + //! Packed BYTE unsigned minimum (SSE). INST_2x(pminub, kInstPminub, MmVar, MmVar) //! @overload INST_2x(pminub, kInstPminub, MmVar, Mem) - //! @brief Move byte mask to integer (SSE). + //! Move byte mask to integer (SSE). INST_2x(pmovmskb, kInstPmovmskb, GpVar, MmVar) - //! @brief Packed multiply high unsigned (SSE). + //! Packed WORD unsigned multiply high (SSE). INST_2x(pmulhuw, kInstPmulhuw, MmVar, MmVar) //! @overload INST_2x(pmulhuw, kInstPmulhuw, MmVar, Mem) - //! @brief Packed sum of absolute differences (SSE). + //! Packed WORD sum of absolute differences (SSE). INST_2x(psadbw, kInstPsadbw, MmVar, MmVar) //! @overload INST_2x(psadbw, kInstPsadbw, MmVar, Mem) - //! @brief Packed shuffle word (SSE). + //! Packed WORD shuffle (SSE). INST_3i(pshufw, kInstPshufw, MmVar, MmVar, Imm) //! @overload INST_3i(pshufw, kInstPshufw, MmVar, Mem, Imm) - //! @brief Packed SP-FP reciprocal (SSE). + //! Packed SP-FP reciprocal (SSE). INST_2x(rcpps, kInstRcpps, XmmVar, XmmVar) //! @overload INST_2x(rcpps, kInstRcpps, XmmVar, Mem) - //! @brief Scalar SP-FP reciprocal (SSE). + //! Scalar SP-FP reciprocal (SSE). INST_2x(rcpss, kInstRcpss, XmmVar, XmmVar) //! @overload INST_2x(rcpss, kInstRcpss, XmmVar, Mem) - //! @brief Prefetch (SSE). + //! Prefetch (SSE). INST_2i(prefetch, kInstPrefetch, Mem, Imm) - //! @brief Compute sum of absolute differences (SSE). + //! Packed WORD sum of absolute differences (SSE). INST_2x(psadbw, kInstPsadbw, XmmVar, XmmVar) //! @overload INST_2x(psadbw, kInstPsadbw, XmmVar, Mem) - //! @brief Packed SP-FP Square root reciprocal (SSE). + //! Packed SP-FP Square root reciprocal (SSE). INST_2x(rsqrtps, kInstRsqrtps, XmmVar, XmmVar) //! @overload INST_2x(rsqrtps, kInstRsqrtps, XmmVar, Mem) - //! @brief Scalar SP-FP Square root reciprocal (SSE). + //! Scalar SP-FP Square root reciprocal (SSE). INST_2x(rsqrtss, kInstRsqrtss, XmmVar, XmmVar) //! @overload INST_2x(rsqrtss, kInstRsqrtss, XmmVar, Mem) - //! @brief Store fence (SSE). + //! Store fence (SSE). INST_0x(sfence, kInstSfence) - //! @brief Shuffle SP-FP (SSE). + //! Shuffle SP-FP (SSE). INST_3i(shufps, kInstShufps, XmmVar, XmmVar, Imm) //! @overload INST_3i(shufps, kInstShufps, XmmVar, Mem, Imm) - //! @brief Packed SP-FP square root (SSE). + //! Packed SP-FP square root (SSE). INST_2x(sqrtps, kInstSqrtps, XmmVar, XmmVar) //! @overload INST_2x(sqrtps, kInstSqrtps, XmmVar, Mem) - //! @brief Scalar SP-FP square root (SSE). + //! Scalar SP-FP square root (SSE). INST_2x(sqrtss, kInstSqrtss, XmmVar, XmmVar) //! @overload INST_2x(sqrtss, kInstSqrtss, XmmVar, Mem) - //! @brief Store streaming SIMD extension control/status (SSE). + //! Store streaming SIMD extension control/status (SSE). INST_1x(stmxcsr, kInstStmxcsr, Mem) - //! @brief Packed SP-FP subtract (SSE). + //! Packed SP-FP subtract (SSE). INST_2x(subps, kInstSubps, XmmVar, XmmVar) //! @overload INST_2x(subps, kInstSubps, XmmVar, Mem) - //! @brief Scalar SP-FP subtract (SSE). + //! Scalar SP-FP subtract (SSE). INST_2x(subss, kInstSubss, XmmVar, XmmVar) //! @overload INST_2x(subss, kInstSubss, XmmVar, Mem) - //! @brief Unordered scalar SP-FP compare and set EFLAGS (SSE). + //! Unordered scalar SP-FP compare and set EFLAGS (SSE). INST_2x(ucomiss, kInstUcomiss, XmmVar, XmmVar) //! @overload INST_2x(ucomiss, kInstUcomiss, XmmVar, Mem) - //! @brief Unpack high packed SP-FP data (SSE). + //! Unpack high packed SP-FP data (SSE). INST_2x(unpckhps, kInstUnpckhps, XmmVar, XmmVar) //! @overload INST_2x(unpckhps, kInstUnpckhps, XmmVar, Mem) - //! @brief Unpack low packed SP-FP data (SSE). + //! Unpack low packed SP-FP data (SSE). INST_2x(unpcklps, kInstUnpcklps, XmmVar, XmmVar) //! @overload INST_2x(unpcklps, kInstUnpcklps, XmmVar, Mem) - //! @brief Xor for SP-FP data (SSE). + //! Packed SP-FP bitwise xor (SSE). INST_2x(xorps, kInstXorps, XmmVar, XmmVar) //! @overload INST_2x(xorps, kInstXorps, XmmVar, Mem) - //! @brief Packed DP-FP add (SSE2). + // -------------------------------------------------------------------------- + // [SSE2] + // -------------------------------------------------------------------------- + + //! Packed DP-FP add (SSE2). INST_2x(addpd, kInstAddpd, XmmVar, XmmVar) //! @overload INST_2x(addpd, kInstAddpd, XmmVar, Mem) - //! @brief Scalar DP-FP add (SSE2). + //! Scalar DP-FP add (SSE2). INST_2x(addsd, kInstAddsd, XmmVar, XmmVar) //! @overload INST_2x(addsd, kInstAddsd, XmmVar, Mem) - //! @brief And-not for DP-FP (SSE2). + //! Packed DP-FP bitwise and-not (SSE2). INST_2x(andnpd, kInstAndnpd, XmmVar, XmmVar) //! @overload INST_2x(andnpd, kInstAndnpd, XmmVar, Mem) - //! @brief And for DP-FP (SSE2). + //! Packed DP-FP bitwise and (SSE2). INST_2x(andpd, kInstAndpd, XmmVar, XmmVar) //! @overload INST_2x(andpd, kInstAndpd, XmmVar, Mem) - //! @brief Flush cache line (SSE2). + //! Flush cache line (SSE2). INST_1x(clflush, kInstClflush, Mem) - //! @brief Packed DP-FP compare (SSE2). + //! Packed DP-FP compare (SSE2). INST_3i(cmppd, kInstCmppd, XmmVar, XmmVar, Imm) //! @overload INST_3i(cmppd, kInstCmppd, XmmVar, Mem, Imm) - //! @brief Compare scalar SP-FP values (SSE2). + //! Scalar SP-FP compare (SSE2). INST_3i(cmpsd, kInstCmpsd, XmmVar, XmmVar, Imm) //! @overload INST_3i(cmpsd, kInstCmpsd, XmmVar, Mem, Imm) - //! @brief Scalar ordered DP-FP compare and set EFLAGS (SSE2). + //! Scalar ordered DP-FP compare and set EFLAGS (SSE2). INST_2x(comisd, kInstComisd, XmmVar, XmmVar) //! @overload INST_2x(comisd, kInstComisd, XmmVar, Mem) - //! @brief Convert packed Dword integers to packed DP-FP values (SSE2). + //! Convert packed DWORD integers to packed DP-FP (SSE2). INST_2x(cvtdq2pd, kInstCvtdq2pd, XmmVar, XmmVar) //! @overload INST_2x(cvtdq2pd, kInstCvtdq2pd, XmmVar, Mem) - //! @brief Convert packed Dword integers to packed SP-FP values (SSE2). + //! Convert packed DWORD integers to packed SP-FP (SSE2). INST_2x(cvtdq2ps, kInstCvtdq2ps, XmmVar, XmmVar) //! @overload INST_2x(cvtdq2ps, kInstCvtdq2ps, XmmVar, Mem) - //! @brief Convert packed DP-FP values to packed dword integers (SSE2). + //! Convert packed DP-FP to packed DWORDs (SSE2). INST_2x(cvtpd2dq, kInstCvtpd2dq, XmmVar, XmmVar) //! @overload INST_2x(cvtpd2dq, kInstCvtpd2dq, XmmVar, Mem) - //! @brief Convert packed DP-FP values to packed dword integers (SSE2). + //! Convert packed DP-FP to packed DWORDs (SSE2). INST_2x(cvtpd2pi, kInstCvtpd2pi, MmVar, XmmVar) //! @overload INST_2x(cvtpd2pi, kInstCvtpd2pi, MmVar, Mem) - //! @brief Convert packed DP-FP values to packed SP-FP values (SSE2). + //! Convert packed DP-FP to packed SP-FP (SSE2). INST_2x(cvtpd2ps, kInstCvtpd2ps, XmmVar, XmmVar) //! @overload INST_2x(cvtpd2ps, kInstCvtpd2ps, XmmVar, Mem) - //! @brief Convert packed dword integers to packed DP-FP values (SSE2). + //! Convert packed DWORDs to packed DP-FP (SSE2). INST_2x(cvtpi2pd, kInstCvtpi2pd, XmmVar, MmVar) //! @overload INST_2x(cvtpi2pd, kInstCvtpi2pd, XmmVar, Mem) - //! @brief Convert packed SP-FP values to packed dword integers (SSE2). + //! Convert packed SP-FP to packed DWORDs (SSE2). INST_2x(cvtps2dq, kInstCvtps2dq, XmmVar, XmmVar) //! @overload INST_2x(cvtps2dq, kInstCvtps2dq, XmmVar, Mem) - //! @brief Convert packed SP-FP values to packed DP-FP values (SSE2). + //! Convert packed SP-FP to packed DP-FP (SSE2). INST_2x(cvtps2pd, kInstCvtps2pd, XmmVar, XmmVar) //! @overload INST_2x(cvtps2pd, kInstCvtps2pd, XmmVar, Mem) - //! @brief Convert scalar DP-FP value to dword Integer (SSE2). + //! Convert scalar DP-FP to DWORD (SSE2). INST_2x(cvtsd2si, kInstCvtsd2si, GpVar, XmmVar) //! @overload INST_2x(cvtsd2si, kInstCvtsd2si, GpVar, Mem) - //! @brief Convert scalar DP-FP value to scalar SP-FP value (SSE2). + //! Convert scalar DP-FP to scalar SP-FP (SSE2). INST_2x(cvtsd2ss, kInstCvtsd2ss, XmmVar, XmmVar) //! @overload INST_2x(cvtsd2ss, kInstCvtsd2ss, XmmVar, Mem) - //! @brief Convert dword integer to scalar DP-FP value (SSE2). + //! Convert DWORD to scalar DP-FP (SSE2). INST_2x(cvtsi2sd, kInstCvtsi2sd, XmmVar, GpVar) //! @overload INST_2x(cvtsi2sd, kInstCvtsi2sd, XmmVar, Mem) - //! @brief Convert scalar SP-FP value to scalar DP-FP value (SSE2). + //! Convert scalar SP-FP to DP-FP (SSE2). INST_2x(cvtss2sd, kInstCvtss2sd, XmmVar, XmmVar) //! @overload INST_2x(cvtss2sd, kInstCvtss2sd, XmmVar, Mem) - //! @brief Convert with truncation packed DP-FP values to packed dword Integers (SSE2). + //! Convert with truncation packed DP-FP to packed DWORDs (SSE2). INST_2x(cvttpd2pi, kInstCvttpd2pi, MmVar, XmmVar) //! @overload INST_2x(cvttpd2pi, kInstCvttpd2pi, MmVar, Mem) - //! @brief Convert with truncation packed DP-FP values to packed qword Integers (SSE2). + //! Convert with truncation packed DP-FP to packed QWORDs (SSE2). INST_2x(cvttpd2dq, kInstCvttpd2dq, XmmVar, XmmVar) //! @overload INST_2x(cvttpd2dq, kInstCvttpd2dq, XmmVar, Mem) - //! @brief Convert with truncation packed SP-FP values to packed qword Integers (SSE2). + //! Convert with truncation packed SP-FP to packed QWORDs (SSE2). INST_2x(cvttps2dq, kInstCvttps2dq, XmmVar, XmmVar) //! @overload INST_2x(cvttps2dq, kInstCvttps2dq, XmmVar, Mem) - //! @brief Convert with truncation scalar DP-FP value to signed dword Integer (SSE2). + //! Convert with truncation scalar DP-FP to DWORD (SSE2). INST_2x(cvttsd2si, kInstCvttsd2si, GpVar, XmmVar) //! @overload INST_2x(cvttsd2si, kInstCvttsd2si, GpVar, Mem) - //! @brief Packed DP-FP divide (SSE2). + //! Packed DP-FP divide (SSE2). INST_2x(divpd, kInstDivpd, XmmVar, XmmVar) //! @overload INST_2x(divpd, kInstDivpd, XmmVar, Mem) - //! @brief Scalar DP-FP divide (SSE2). + //! Scalar DP-FP divide (SSE2). INST_2x(divsd, kInstDivsd, XmmVar, XmmVar) //! @overload INST_2x(divsd, kInstDivsd, XmmVar, Mem) - //! @brief Load fence (SSE2). + //! Load fence (SSE2). INST_0x(lfence, kInstLfence) - //! @brief Store selected bytes of oword (SSE2). - //! - //! @note Target is DS:EDI. + //! Store selected bytes of OWORD (SSE2). INST_2x(maskmovdqu, kInstMaskmovdqu, XmmVar, XmmVar) - //! @brief Return maximum packed DP-FP values (SSE2). + //! Packed DP-FP maximum (SSE2). INST_2x(maxpd, kInstMaxpd, XmmVar, XmmVar) //! @overload INST_2x(maxpd, kInstMaxpd, XmmVar, Mem) - //! @brief Return maximum scalar DP-FP value (SSE2). + //! Scalar DP-FP maximum (SSE2). INST_2x(maxsd, kInstMaxsd, XmmVar, XmmVar) //! @overload INST_2x(maxsd, kInstMaxsd, XmmVar, Mem) - //! @brief Memory fence (SSE2). + //! Memory fence (SSE2). INST_0x(mfence, kInstMfence) - //! @brief Return minimum packed DP-FP Values (SSE2). + //! Packed DP-FP minimum (SSE2). INST_2x(minpd, kInstMinpd, XmmVar, XmmVar) //! @overload INST_2x(minpd, kInstMinpd, XmmVar, Mem) - //! @brief Return minimum scalar DP-FP value (SSE2). + //! Scalar DP-FP minimum (SSE2). INST_2x(minsd, kInstMinsd, XmmVar, XmmVar) //! @overload INST_2x(minsd, kInstMinsd, XmmVar, Mem) - //! @brief Move aligned oword (SSE2). + //! Move aligned OWORD (SSE2). INST_2x(movdqa, kInstMovdqa, XmmVar, XmmVar) //! @overload INST_2x(movdqa, kInstMovdqa, XmmVar, Mem) //! @overload INST_2x(movdqa, kInstMovdqa, Mem, XmmVar) - //! @brief Move unaligned oword (SSE2). + //! Move unaligned OWORD (SSE2). INST_2x(movdqu, kInstMovdqu, XmmVar, XmmVar) //! @overload INST_2x(movdqu, kInstMovdqu, XmmVar, Mem) //! @overload INST_2x(movdqu, kInstMovdqu, Mem, XmmVar) - //! @brief Extract packed SP-FP sign mask (SSE2). + //! Extract packed SP-FP sign mask (SSE2). INST_2x(movmskps, kInstMovmskps, GpVar, XmmVar) - //! @brief Extract packed DP-FP sign mask (SSE2). + //! Extract packed DP-FP sign mask (SSE2). INST_2x(movmskpd, kInstMovmskpd, GpVar, XmmVar) - //! @brief Move scalar DP-FP value (SSE2). + //! Move scalar DP-FP (SSE2). INST_2x(movsd, kInstMovsd, XmmVar, XmmVar) //! @overload INST_2x(movsd, kInstMovsd, XmmVar, Mem) //! @overload INST_2x(movsd, kInstMovsd, Mem, XmmVar) - //! @brief Move aligned packed DP-FP values (SSE2). + //! Move aligned packed DP-FP (SSE2). INST_2x(movapd, kInstMovapd, XmmVar, XmmVar) //! @overload INST_2x(movapd, kInstMovapd, XmmVar, Mem) //! @overload INST_2x(movapd, kInstMovapd, Mem, XmmVar) - //! @brief Move qword from Xmm to Mm register (SSE2). + //! Move QWORD from XMM to MM register (SSE2). INST_2x(movdq2q, kInstMovdq2q, MmVar, XmmVar) - //! @brief Move qword from Mm to Xmm register (SSE2). + //! Move QWORD from MM to XMM register (SSE2). INST_2x(movq2dq, kInstMovq2dq, XmmVar, MmVar) - //! @brief Move high packed DP-FP value (SSE2). + //! Move high packed DP-FP (SSE2). INST_2x(movhpd, kInstMovhpd, XmmVar, Mem) //! @overload INST_2x(movhpd, kInstMovhpd, Mem, XmmVar) - //! @brief Move low packed DP-FP value (SSE2). + //! Move low packed DP-FP (SSE2). INST_2x(movlpd, kInstMovlpd, XmmVar, Mem) //! @overload INST_2x(movlpd, kInstMovlpd, Mem, XmmVar) - //! @brief Store oword using non-temporal hint (SSE2). + //! Store OWORD using NT hint (SSE2). INST_2x(movntdq, kInstMovntdq, Mem, XmmVar) - //! @brief Store dword using non-temporal hint (SSE2). + //! Store DWORD using NT hint (SSE2). INST_2x(movnti, kInstMovnti, Mem, GpVar) - //! @brief Store packed DP-FP values using non-temporal hint (SSE2). + //! Store packed DP-FP using NT hint (SSE2). INST_2x(movntpd, kInstMovntpd, Mem, XmmVar) - //! @brief Move unaligned packed DP-FP values (SSE2). + //! Move unaligned packed DP-FP (SSE2). INST_2x(movupd, kInstMovupd, XmmVar, XmmVar) //! @overload INST_2x(movupd, kInstMovupd, XmmVar, Mem) //! @overload INST_2x(movupd, kInstMovupd, Mem, XmmVar) - //! @brief Packed DP-FP multiply (SSE2). + //! Packed DP-FP multiply (SSE2). INST_2x(mulpd, kInstMulpd, XmmVar, XmmVar) //! @overload INST_2x(mulpd, kInstMulpd, XmmVar, Mem) - //! @brief Scalar DP-FP multiply (SSE2). + //! Scalar DP-FP multiply (SSE2). INST_2x(mulsd, kInstMulsd, XmmVar, XmmVar) //! @overload INST_2x(mulsd, kInstMulsd, XmmVar, Mem) - //! @brief Or for DP-FP data (SSE2). + //! Packed DP-FP bitwise or (SSE2). INST_2x(orpd, kInstOrpd, XmmVar, XmmVar) //! @overload INST_2x(orpd, kInstOrpd, XmmVar, Mem) - //! @brief Pack with signed saturation (SSE2). + //! Pack WORDs to BYTEs with signed saturation (SSE2). INST_2x(packsswb, kInstPacksswb, XmmVar, XmmVar) //! @overload INST_2x(packsswb, kInstPacksswb, XmmVar, Mem) - //! @brief Pack with signed saturation (SSE2). + //! Pack DWORDs to WORDs with signed saturation (SSE2). INST_2x(packssdw, kInstPackssdw, XmmVar, XmmVar) //! @overload INST_2x(packssdw, kInstPackssdw, XmmVar, Mem) - //! @brief Pack with unsigned saturation (SSE2). + //! Pack WORDs to BYTEs with unsigned saturation (SSE2). INST_2x(packuswb, kInstPackuswb, XmmVar, XmmVar) //! @overload INST_2x(packuswb, kInstPackuswb, XmmVar, Mem) - //! @brief Packed byte add (SSE2). + //! Packed BYTE add (SSE2). INST_2x(paddb, kInstPaddb, XmmVar, XmmVar) //! @overload INST_2x(paddb, kInstPaddb, XmmVar, Mem) - //! @brief Packed word add (SSE2). + //! Packed WORD add (SSE2). INST_2x(paddw, kInstPaddw, XmmVar, XmmVar) //! @overload INST_2x(paddw, kInstPaddw, XmmVar, Mem) - //! @brief Packed dword add (SSE2). + //! Packed DWORD add (SSE2). INST_2x(paddd, kInstPaddd, XmmVar, XmmVar) //! @overload INST_2x(paddd, kInstPaddd, XmmVar, Mem) - //! @brief Packed qword add (SSE2). + //! Packed QWORD add (SSE2). INST_2x(paddq, kInstPaddq, MmVar, MmVar) //! @overload INST_2x(paddq, kInstPaddq, MmVar, Mem) - //! @brief Packed qword add (SSE2). + //! Packed QWORD add (SSE2). INST_2x(paddq, kInstPaddq, XmmVar, XmmVar) //! @overload INST_2x(paddq, kInstPaddq, XmmVar, Mem) - //! @brief Packed add with saturation (SSE2). + //! Packed BYTE add with saturation (SSE2). INST_2x(paddsb, kInstPaddsb, XmmVar, XmmVar) //! @overload INST_2x(paddsb, kInstPaddsb, XmmVar, Mem) - //! @brief Packed add with saturation (SSE2). + //! Packed WORD add with saturation (SSE2). INST_2x(paddsw, kInstPaddsw, XmmVar, XmmVar) //! @overload INST_2x(paddsw, kInstPaddsw, XmmVar, Mem) - //! @brief Packed add unsigned with saturation (SSE2). + //! Packed BYTE add with unsigned saturation (SSE2). INST_2x(paddusb, kInstPaddusb, XmmVar, XmmVar) //! @overload INST_2x(paddusb, kInstPaddusb, XmmVar, Mem) - //! @brief Packed add unsigned with saturation (SSE2). + //! Packed WORD add with unsigned saturation (SSE2). INST_2x(paddusw, kInstPaddusw, XmmVar, XmmVar) //! @overload INST_2x(paddusw, kInstPaddusw, XmmVar, Mem) - //! @brief And (SSE2). + //! Packed bitwise and (SSE2). INST_2x(pand, kInstPand, XmmVar, XmmVar) //! @overload INST_2x(pand, kInstPand, XmmVar, Mem) - //! @brief And-not (SSE2). + //! Packed bitwise and-not (SSE2). INST_2x(pandn, kInstPandn, XmmVar, XmmVar) //! @overload INST_2x(pandn, kInstPandn, XmmVar, Mem) - //! @brief Spin loop hint (SSE2). + //! Spin loop hint (SSE2). INST_0x(pause, kInstPause) - //! @brief Packed average (SSE2). + //! Packed BYTE average (SSE2). INST_2x(pavgb, kInstPavgb, XmmVar, XmmVar) //! @overload INST_2x(pavgb, kInstPavgb, XmmVar, Mem) - //! @brief Packed average (SSE2). + //! Packed WORD average (SSE2). INST_2x(pavgw, kInstPavgw, XmmVar, XmmVar) //! @overload INST_2x(pavgw, kInstPavgw, XmmVar, Mem) - //! @brief Packed compare bytes for equal (SSE2). + //! Packed BYTE compare for equality (SSE2). INST_2x(pcmpeqb, kInstPcmpeqb, XmmVar, XmmVar) //! @overload INST_2x(pcmpeqb, kInstPcmpeqb, XmmVar, Mem) - //! @brief Packed compare words for equal (SSE2). + //! Packed WROD compare for equality (SSE2). INST_2x(pcmpeqw, kInstPcmpeqw, XmmVar, XmmVar) //! @overload INST_2x(pcmpeqw, kInstPcmpeqw, XmmVar, Mem) - //! @brief Packed compare dwords for equal (SSE2). + //! Packed DWORD compare for equality (SSE2). INST_2x(pcmpeqd, kInstPcmpeqd, XmmVar, XmmVar) //! @overload INST_2x(pcmpeqd, kInstPcmpeqd, XmmVar, Mem) - //! @brief Packed compare bytes for greater than (SSE2). + //! Packed BYTE compare if greater than (SSE2). INST_2x(pcmpgtb, kInstPcmpgtb, XmmVar, XmmVar) //! @overload INST_2x(pcmpgtb, kInstPcmpgtb, XmmVar, Mem) - //! @brief Packed compare words for greater than (SSE2). + //! Packed WORD compare if greater than (SSE2). INST_2x(pcmpgtw, kInstPcmpgtw, XmmVar, XmmVar) //! @overload INST_2x(pcmpgtw, kInstPcmpgtw, XmmVar, Mem) - //! @brief Packed compare dwords for greater than (SSE2). + //! Packed DWORD compare if greater than (SSE2). INST_2x(pcmpgtd, kInstPcmpgtd, XmmVar, XmmVar) //! @overload INST_2x(pcmpgtd, kInstPcmpgtd, XmmVar, Mem) - //! @brief Extract word (SSE2). + //! Extract WORD based on selector (SSE2). INST_3i(pextrw, kInstPextrw, GpVar, XmmVar, Imm) - //! @brief Insert word (SSE2). + //! Insert WORD based on selector (SSE2). INST_3i(pinsrw, kInstPinsrw, XmmVar, GpVar, Imm) //! @overload INST_3i(pinsrw, kInstPinsrw, XmmVar, Mem, Imm) - //! @brief Packed signed integer word maximum (SSE2). + //! Packed WORD maximum (SSE2). INST_2x(pmaxsw, kInstPmaxsw, XmmVar, XmmVar) //! @overload INST_2x(pmaxsw, kInstPmaxsw, XmmVar, Mem) - //! @brief Packed unsigned integer byte maximum (SSE2). + //! Packed BYTE unsigned maximum (SSE2). INST_2x(pmaxub, kInstPmaxub, XmmVar, XmmVar) //! @overload INST_2x(pmaxub, kInstPmaxub, XmmVar, Mem) - //! @brief Packed signed integer word minimum (SSE2). + //! Packed WORD minimum (SSE2). INST_2x(pminsw, kInstPminsw, XmmVar, XmmVar) //! @overload INST_2x(pminsw, kInstPminsw, XmmVar, Mem) - //! @brief Packed unsigned integer byte minimum (SSE2). + //! Packed BYTE unsigned minimum (SSE2). INST_2x(pminub, kInstPminub, XmmVar, XmmVar) //! @overload INST_2x(pminub, kInstPminub, XmmVar, Mem) - //! @brief Move byte mask (SSE2). + //! Move BYTE mask (SSE2). INST_2x(pmovmskb, kInstPmovmskb, GpVar, XmmVar) - //! @brief Packed multiply high (SSE2). + //! Packed WORD multiply high (SSE2). INST_2x(pmulhw, kInstPmulhw, XmmVar, XmmVar) //! @overload INST_2x(pmulhw, kInstPmulhw, XmmVar, Mem) - //! @brief Packed multiply high Unsigned (SSE2). + //! Packed WORD unsigned multiply high (SSE2). INST_2x(pmulhuw, kInstPmulhuw, XmmVar, XmmVar) //! @overload INST_2x(pmulhuw, kInstPmulhuw, XmmVar, Mem) - //! @brief Packed multiply low (SSE2). + //! Packed WORD multiply low (SSE2). INST_2x(pmullw, kInstPmullw, XmmVar, XmmVar) //! @overload INST_2x(pmullw, kInstPmullw, XmmVar, Mem) - //! @brief Packed multiply to QWORD (SSE2). + //! Packed DWORD multiply to QWORD (SSE2). INST_2x(pmuludq, kInstPmuludq, MmVar, MmVar) //! @overload INST_2x(pmuludq, kInstPmuludq, MmVar, Mem) - //! @brief Packed multiply to QWORD (SSE2). + //! Packed DWORD multiply to QWORD (SSE2). INST_2x(pmuludq, kInstPmuludq, XmmVar, XmmVar) //! @overload INST_2x(pmuludq, kInstPmuludq, XmmVar, Mem) - //! @brief Or (SSE2). + //! Packed bitwise or (SSE2). INST_2x(por, kInstPor, XmmVar, XmmVar) //! @overload INST_2x(por, kInstPor, XmmVar, Mem) - //! @brief Packed shift left logical (SSE2). + //! Packed DWORD shift left logical (SSE2). INST_2x(pslld, kInstPslld, XmmVar, XmmVar) //! @overload INST_2x(pslld, kInstPslld, XmmVar, Mem) //! @overload INST_2i(pslld, kInstPslld, XmmVar, Imm) - //! @brief Packed shift left logical (SSE2). + //! Packed QWORD shift left logical (SSE2). INST_2x(psllq, kInstPsllq, XmmVar, XmmVar) //! @overload INST_2x(psllq, kInstPsllq, XmmVar, Mem) //! @overload INST_2i(psllq, kInstPsllq, XmmVar, Imm) - //! @brief Packed shift left logical (SSE2). + //! Packed WORD shift left logical (SSE2). INST_2x(psllw, kInstPsllw, XmmVar, XmmVar) //! @overload INST_2x(psllw, kInstPsllw, XmmVar, Mem) //! @overload INST_2i(psllw, kInstPsllw, XmmVar, Imm) - //! @brief Packed shift left logical (SSE2). + //! Packed OWORD shift left logical (SSE2). INST_2i(pslldq, kInstPslldq, XmmVar, Imm) - //! @brief Packed shift right arithmetic (SSE2). + //! Packed DWORD shift right arithmetic (SSE2). INST_2x(psrad, kInstPsrad, XmmVar, XmmVar) //! @overload INST_2x(psrad, kInstPsrad, XmmVar, Mem) //! @overload INST_2i(psrad, kInstPsrad, XmmVar, Imm) - //! @brief Packed shift right arithmetic (SSE2). + //! Packed WORD shift right arithmetic (SSE2). INST_2x(psraw, kInstPsraw, XmmVar, XmmVar) //! @overload INST_2x(psraw, kInstPsraw, XmmVar, Mem) //! @overload INST_2i(psraw, kInstPsraw, XmmVar, Imm) - //! @brief Packed subtract (SSE2). + //! Packed BYTE subtract (SSE2). INST_2x(psubb, kInstPsubb, XmmVar, XmmVar) //! @overload INST_2x(psubb, kInstPsubb, XmmVar, Mem) - //! @brief Packed subtract (SSE2). - INST_2x(psubw, kInstPsubw, XmmVar, XmmVar) - //! @overload - INST_2x(psubw, kInstPsubw, XmmVar, Mem) - - //! @brief Packed subtract (SSE2). + //! Packed DWORD subtract (SSE2). INST_2x(psubd, kInstPsubd, XmmVar, XmmVar) //! @overload INST_2x(psubd, kInstPsubd, XmmVar, Mem) - //! @brief Packed subtract (SSE2). + //! Packed QWORD subtract (SSE2). INST_2x(psubq, kInstPsubq, MmVar, MmVar) //! @overload INST_2x(psubq, kInstPsubq, MmVar, Mem) - //! @brief Packed subtract (SSE2). + //! Packed QWORD subtract (SSE2). INST_2x(psubq, kInstPsubq, XmmVar, XmmVar) //! @overload INST_2x(psubq, kInstPsubq, XmmVar, Mem) - //! @brief Packed multiply and Add (SSE2). + //! Packed WORD subtract (SSE2). + INST_2x(psubw, kInstPsubw, XmmVar, XmmVar) + //! @overload + INST_2x(psubw, kInstPsubw, XmmVar, Mem) + + //! Packed WORD to DWORD multiply and add (SSE2). INST_2x(pmaddwd, kInstPmaddwd, XmmVar, XmmVar) //! @overload INST_2x(pmaddwd, kInstPmaddwd, XmmVar, Mem) - //! @brief Shuffle packed dwords (SSE2). + //! Packed DWORD shuffle (SSE2). INST_3i(pshufd, kInstPshufd, XmmVar, XmmVar, Imm) //! @overload INST_3i(pshufd, kInstPshufd, XmmVar, Mem, Imm) - //! @brief Shuffle packed high words (SSE2). + //! Packed WORD shuffle high (SSE2). INST_3i(pshufhw, kInstPshufhw, XmmVar, XmmVar, Imm) //! @overload INST_3i(pshufhw, kInstPshufhw, XmmVar, Mem, Imm) - //! @brief Shuffle packed low words (SSE2). + //! Packed WORD shuffle low (SSE2). INST_3i(pshuflw, kInstPshuflw, XmmVar, XmmVar, Imm) //! @overload INST_3i(pshuflw, kInstPshuflw, XmmVar, Mem, Imm) - //! @brief Packed shift right logical (SSE2). + //! Packed DWORD shift right logical (SSE2). INST_2x(psrld, kInstPsrld, XmmVar, XmmVar) //! @overload INST_2x(psrld, kInstPsrld, XmmVar, Mem) //! @overload INST_2i(psrld, kInstPsrld, XmmVar, Imm) - //! @brief Packed shift right logical (SSE2). + //! Packed QWORD shift right logical (SSE2). INST_2x(psrlq, kInstPsrlq, XmmVar, XmmVar) //! @overload INST_2x(psrlq, kInstPsrlq, XmmVar, Mem) //! @overload INST_2i(psrlq, kInstPsrlq, XmmVar, Imm) - //! @brief Oword shift right logical (SSE2). + //! Scalar OWORD shift right logical (SSE2). INST_2i(psrldq, kInstPsrldq, XmmVar, Imm) - //! @brief Packed shift right logical (SSE2). + //! Packed WORD shift right logical (SSE2). INST_2x(psrlw, kInstPsrlw, XmmVar, XmmVar) //! @overload INST_2x(psrlw, kInstPsrlw, XmmVar, Mem) //! @overload INST_2i(psrlw, kInstPsrlw, XmmVar, Imm) - //! @brief Packed subtract with saturation (SSE2). + //! Packed BYTE subtract with saturation (SSE2). INST_2x(psubsb, kInstPsubsb, XmmVar, XmmVar) //! @overload INST_2x(psubsb, kInstPsubsb, XmmVar, Mem) - //! @brief Packed subtract with saturation (SSE2). + //! Packed WORD subtract with saturation (SSE2). INST_2x(psubsw, kInstPsubsw, XmmVar, XmmVar) //! @overload INST_2x(psubsw, kInstPsubsw, XmmVar, Mem) - //! @brief Packed subtract with unsigned saturation (SSE2). + //! Packed BYTE subtract with unsigned saturation (SSE2). INST_2x(psubusb, kInstPsubusb, XmmVar, XmmVar) //! @overload INST_2x(psubusb, kInstPsubusb, XmmVar, Mem) - //! @brief Packed subtract with unsigned saturation (SSE2). + //! Packed WORD subtract with unsigned saturation (SSE2). INST_2x(psubusw, kInstPsubusw, XmmVar, XmmVar) //! @overload INST_2x(psubusw, kInstPsubusw, XmmVar, Mem) - //! @brief Unpack high data (SSE2). + //! Unpack high packed BYTEs to WORDs (SSE2). INST_2x(punpckhbw, kInstPunpckhbw, XmmVar, XmmVar) //! @overload INST_2x(punpckhbw, kInstPunpckhbw, XmmVar, Mem) - //! @brief Unpack high data (SSE2). - INST_2x(punpckhwd, kInstPunpckhwd, XmmVar, XmmVar) - //! @overload - INST_2x(punpckhwd, kInstPunpckhwd, XmmVar, Mem) - - //! @brief Unpack high data (SSE2). + //! Unpack high packed DWORDs to QWORDs (SSE2). INST_2x(punpckhdq, kInstPunpckhdq, XmmVar, XmmVar) //! @overload INST_2x(punpckhdq, kInstPunpckhdq, XmmVar, Mem) - //! @brief Unpack high data (SSE2). + //! Unpack high packed QWORDs to OWORD (SSE2). INST_2x(punpckhqdq, kInstPunpckhqdq, XmmVar, XmmVar) //! @overload INST_2x(punpckhqdq, kInstPunpckhqdq, XmmVar, Mem) - //! @brief Unpack low data (SSE2). + //! Unpack high packed WORDs to DWORDs (SSE2). + INST_2x(punpckhwd, kInstPunpckhwd, XmmVar, XmmVar) + //! @overload + INST_2x(punpckhwd, kInstPunpckhwd, XmmVar, Mem) + + //! Unpack low packed BYTEs to WORDs (SSE2). INST_2x(punpcklbw, kInstPunpcklbw, XmmVar, XmmVar) //! @overload INST_2x(punpcklbw, kInstPunpcklbw, XmmVar, Mem) - //! @brief Unpack low data (SSE2). - INST_2x(punpcklwd, kInstPunpcklwd, XmmVar, XmmVar) - //! @overload - INST_2x(punpcklwd, kInstPunpcklwd, XmmVar, Mem) - - //! @brief Unpack low data (SSE2). + //! Unpack low packed DWORDs to QWORDs (SSE2). INST_2x(punpckldq, kInstPunpckldq, XmmVar, XmmVar) //! @overload INST_2x(punpckldq, kInstPunpckldq, XmmVar, Mem) - //! @brief Unpack low data (SSE2). + //! Unpack low packed QWORDs to OWORD (SSE2). INST_2x(punpcklqdq, kInstPunpcklqdq, XmmVar, XmmVar) //! @overload INST_2x(punpcklqdq, kInstPunpcklqdq, XmmVar, Mem) - //! @brief Xor (SSE2). + //! Unpack low packed WORDs to DWORDs (SSE2). + INST_2x(punpcklwd, kInstPunpcklwd, XmmVar, XmmVar) + //! @overload + INST_2x(punpcklwd, kInstPunpcklwd, XmmVar, Mem) + + //! Packed bitwise xor (SSE2). INST_2x(pxor, kInstPxor, XmmVar, XmmVar) //! @overload INST_2x(pxor, kInstPxor, XmmVar, Mem) - //! @brief Shuffle DP-FP (SSE2). + //! Shuffle DP-FP (SSE2). INST_3i(shufpd, kInstShufpd, XmmVar, XmmVar, Imm) //! @overload INST_3i(shufpd, kInstShufpd, XmmVar, Mem, Imm) - //! @brief Compute square roots of packed DP-FP Values (SSE2). + //! Packed DP-FP square root (SSE2). INST_2x(sqrtpd, kInstSqrtpd, XmmVar, XmmVar) //! @overload INST_2x(sqrtpd, kInstSqrtpd, XmmVar, Mem) - //! @brief Compute square root of scalar DP-FP value (SSE2). + //! Scalar DP-FP square root (SSE2). INST_2x(sqrtsd, kInstSqrtsd, XmmVar, XmmVar) //! @overload INST_2x(sqrtsd, kInstSqrtsd, XmmVar, Mem) - //! @brief Packed DP-FP subtract (SSE2). + //! Packed DP-FP subtract (SSE2). INST_2x(subpd, kInstSubpd, XmmVar, XmmVar) //! @overload INST_2x(subpd, kInstSubpd, XmmVar, Mem) - //! @brief Scalar DP-FP subtract (SSE2). + //! Scalar DP-FP subtract (SSE2). INST_2x(subsd, kInstSubsd, XmmVar, XmmVar) //! @overload INST_2x(subsd, kInstSubsd, XmmVar, Mem) - //! @brief Scalar unordered DP-FP compare and set EFLAGS (SSE2). + //! Scalar DP-FP unordered compare and set EFLAGS (SSE2). INST_2x(ucomisd, kInstUcomisd, XmmVar, XmmVar) //! @overload INST_2x(ucomisd, kInstUcomisd, XmmVar, Mem) - //! @brief Unpack and interleave high packed DP-FP values (SSE2). + //! Unpack and interleave high packed DP-FP (SSE2). INST_2x(unpckhpd, kInstUnpckhpd, XmmVar, XmmVar) //! @overload INST_2x(unpckhpd, kInstUnpckhpd, XmmVar, Mem) - //! @brief Unpack and interleave low packed DP-FP values (SSE2). + //! Unpack and interleave low packed DP-FP (SSE2). INST_2x(unpcklpd, kInstUnpcklpd, XmmVar, XmmVar) //! @overload INST_2x(unpcklpd, kInstUnpcklpd, XmmVar, Mem) - //! @brief Or for DP-FP data (SSE2). + //! Packed DP-FP bitwise xor (SSE2). INST_2x(xorpd, kInstXorpd, XmmVar, XmmVar) //! @overload INST_2x(xorpd, kInstXorpd, XmmVar, Mem) @@ -3466,223 +3451,223 @@ struct X86X64Compiler : public BaseCompiler { // [SSE3] // -------------------------------------------------------------------------- - //! @brief Packed DP-FP add/subtract (SSE3). + //! Packed DP-FP add/subtract (SSE3). INST_2x(addsubpd, kInstAddsubpd, XmmVar, XmmVar) //! @overload INST_2x(addsubpd, kInstAddsubpd, XmmVar, Mem) - //! @brief Packed SP-FP add/subtract (SSE3). + //! Packed SP-FP add/subtract (SSE3). INST_2x(addsubps, kInstAddsubps, XmmVar, XmmVar) //! @overload INST_2x(addsubps, kInstAddsubps, XmmVar, Mem) - // //! @brief Store integer with truncation (SSE3). + // //! Store integer with truncation (SSE3). // INST_1x(fisttp, kInstFisttp, Mem) - //! @brief Packed DP-FP horizontal add (SSE3). + //! Packed DP-FP horizontal add (SSE3). INST_2x(haddpd, kInstHaddpd, XmmVar, XmmVar) //! @overload INST_2x(haddpd, kInstHaddpd, XmmVar, Mem) - //! @brief Packed SP-FP horizontal add (SSE3). + //! Packed SP-FP horizontal add (SSE3). INST_2x(haddps, kInstHaddps, XmmVar, XmmVar) //! @overload INST_2x(haddps, kInstHaddps, XmmVar, Mem) - //! @brief Packed DP-FP horizontal subtract (SSE3). + //! Packed DP-FP horizontal subtract (SSE3). INST_2x(hsubpd, kInstHsubpd, XmmVar, XmmVar) //! @overload INST_2x(hsubpd, kInstHsubpd, XmmVar, Mem) - //! @brief Packed SP-FP horizontal subtract (SSE3). + //! Packed SP-FP horizontal subtract (SSE3). INST_2x(hsubps, kInstHsubps, XmmVar, XmmVar) //! @overload INST_2x(hsubps, kInstHsubps, XmmVar, Mem) - //! @brief Load unaligned Integer 128 Bits (SSE3). + //! Load 128-bits unaligned (SSE3). INST_2x(lddqu, kInstLddqu, XmmVar, Mem) - // //! @brief Setup monitor address (SSE3). + // //! Setup monitor address (SSE3). // INST_0x(monitor, kInstMonitor) - //! @brief Move one DP-FP and duplicate (SSE3). + //! Move one DP-FP and duplicate (SSE3). INST_2x(movddup, kInstMovddup, XmmVar, XmmVar) //! @overload INST_2x(movddup, kInstMovddup, XmmVar, Mem) - //! @brief Move packed SP-FP high and duplicate (SSE3). + //! Move packed SP-FP high and duplicate (SSE3). INST_2x(movshdup, kInstMovshdup, XmmVar, XmmVar) //! @overload INST_2x(movshdup, kInstMovshdup, XmmVar, Mem) - //! @brief Move packed SP-FP low and duplicate (SSE3). + //! Move packed SP-FP low and duplicate (SSE3). INST_2x(movsldup, kInstMovsldup, XmmVar, XmmVar) //! @overload INST_2x(movsldup, kInstMovsldup, XmmVar, Mem) - // //! @brief Monitor wait (SSE3). + // //! Monitor wait (SSE3). // INST_0x(mwait, kInstMwait) // -------------------------------------------------------------------------- // [SSSE3] // -------------------------------------------------------------------------- - //! @brief Packed sign (SSSE3). + //! Packed BYTE sign (SSSE3). INST_2x(psignb, kInstPsignb, MmVar, MmVar) //! @overload INST_2x(psignb, kInstPsignb, MmVar, Mem) - //! @brief Packed sign (SSSE3). + //! PackedBYTE sign (SSSE3). INST_2x(psignb, kInstPsignb, XmmVar, XmmVar) //! @overload INST_2x(psignb, kInstPsignb, XmmVar, Mem) - //! @brief Packed sign (SSSE3). - INST_2x(psignw, kInstPsignw, MmVar, MmVar) - //! @overload - INST_2x(psignw, kInstPsignw, MmVar, Mem) - - //! @brief Packed sign (SSSE3). - INST_2x(psignw, kInstPsignw, XmmVar, XmmVar) - //! @overload - INST_2x(psignw, kInstPsignw, XmmVar, Mem) - - //! @brief Packed sign (SSSE3). + //! Packed DWORD sign (SSSE3). INST_2x(psignd, kInstPsignd, MmVar, MmVar) //! @overload INST_2x(psignd, kInstPsignd, MmVar, Mem) - //! @brief Packed sign (SSSE3). + //! Packed DWORD sign (SSSE3). INST_2x(psignd, kInstPsignd, XmmVar, XmmVar) //! @overload INST_2x(psignd, kInstPsignd, XmmVar, Mem) - //! @brief Packed horizontal add (SSSE3). - INST_2x(phaddw, kInstPhaddw, MmVar, MmVar) + //! Packed WORD sign (SSSE3). + INST_2x(psignw, kInstPsignw, MmVar, MmVar) //! @overload - INST_2x(phaddw, kInstPhaddw, MmVar, Mem) + INST_2x(psignw, kInstPsignw, MmVar, Mem) - //! @brief Packed horizontal add (SSSE3). - INST_2x(phaddw, kInstPhaddw, XmmVar, XmmVar) + //! Packed WORD sign (SSSE3). + INST_2x(psignw, kInstPsignw, XmmVar, XmmVar) //! @overload - INST_2x(phaddw, kInstPhaddw, XmmVar, Mem) + INST_2x(psignw, kInstPsignw, XmmVar, Mem) - //! @brief Packed horizontal add (SSSE3). + //! Packed DWORD horizontal add (SSSE3). INST_2x(phaddd, kInstPhaddd, MmVar, MmVar) //! @overload INST_2x(phaddd, kInstPhaddd, MmVar, Mem) - //! @brief Packed horizontal add (SSSE3). + //! Packed DWORD horizontal add (SSSE3). INST_2x(phaddd, kInstPhaddd, XmmVar, XmmVar) //! @overload INST_2x(phaddd, kInstPhaddd, XmmVar, Mem) - //! @brief Packed horizontal add and saturate (SSSE3). + //! Packed WORD horizontal add with saturation (SSSE3). INST_2x(phaddsw, kInstPhaddsw, MmVar, MmVar) //! @overload INST_2x(phaddsw, kInstPhaddsw, MmVar, Mem) - //! @brief Packed horizontal add and saturate (SSSE3). + //! Packed WORD horizontal add with with saturation (SSSE3). INST_2x(phaddsw, kInstPhaddsw, XmmVar, XmmVar) //! @overload INST_2x(phaddsw, kInstPhaddsw, XmmVar, Mem) - //! @brief Packed horizontal subtract (SSSE3). - INST_2x(phsubw, kInstPhsubw, MmVar, MmVar) + //! Packed WORD horizontal add (SSSE3). + INST_2x(phaddw, kInstPhaddw, MmVar, MmVar) //! @overload - INST_2x(phsubw, kInstPhsubw, MmVar, Mem) + INST_2x(phaddw, kInstPhaddw, MmVar, Mem) - //! @brief Packed horizontal subtract (SSSE3). - INST_2x(phsubw, kInstPhsubw, XmmVar, XmmVar) + //! Packed WORD horizontal add (SSSE3). + INST_2x(phaddw, kInstPhaddw, XmmVar, XmmVar) //! @overload - INST_2x(phsubw, kInstPhsubw, XmmVar, Mem) + INST_2x(phaddw, kInstPhaddw, XmmVar, Mem) - //! @brief Packed horizontal subtract (SSSE3). + //! Packed DWORD horizontal subtract (SSSE3). INST_2x(phsubd, kInstPhsubd, MmVar, MmVar) //! @overload INST_2x(phsubd, kInstPhsubd, MmVar, Mem) - //! @brief Packed horizontal subtract (SSSE3). + //! Packed DWORD horizontal subtract (SSSE3). INST_2x(phsubd, kInstPhsubd, XmmVar, XmmVar) //! @overload INST_2x(phsubd, kInstPhsubd, XmmVar, Mem) - //! @brief Packed horizontal subtract and saturate (SSSE3). + //! Packed WORD horizontal subtract with saturation (SSSE3). INST_2x(phsubsw, kInstPhsubsw, MmVar, MmVar) //! @overload INST_2x(phsubsw, kInstPhsubsw, MmVar, Mem) - //! @brief Packed horizontal subtract and saturate (SSSE3). + //! Packed WORD horizontal subtract with saturation (SSSE3). INST_2x(phsubsw, kInstPhsubsw, XmmVar, XmmVar) //! @overload INST_2x(phsubsw, kInstPhsubsw, XmmVar, Mem) - //! @brief Multiply and add packed signed and unsigned bytes (SSSE3). + //! Packed WORD horizontal subtract (SSSE3). + INST_2x(phsubw, kInstPhsubw, MmVar, MmVar) + //! @overload + INST_2x(phsubw, kInstPhsubw, MmVar, Mem) + + //! Packed WORD horizontal subtract (SSSE3). + INST_2x(phsubw, kInstPhsubw, XmmVar, XmmVar) + //! @overload + INST_2x(phsubw, kInstPhsubw, XmmVar, Mem) + + //! Packed multiply and add signed and unsigned bytes (SSSE3). INST_2x(pmaddubsw, kInstPmaddubsw, MmVar, MmVar) //! @overload INST_2x(pmaddubsw, kInstPmaddubsw, MmVar, Mem) - //! @brief Multiply and add packed signed and unsigned bytes (SSSE3). + //! Packed multiply and add signed and unsigned bytes (SSSE3). INST_2x(pmaddubsw, kInstPmaddubsw, XmmVar, XmmVar) //! @overload INST_2x(pmaddubsw, kInstPmaddubsw, XmmVar, Mem) - //! @brief Packed absolute value (SSSE3). + //! Packed BYTE absolute value (SSSE3). INST_2x(pabsb, kInstPabsb, MmVar, MmVar) //! @overload INST_2x(pabsb, kInstPabsb, MmVar, Mem) - //! @brief Packed absolute value (SSSE3). + //! Packed BYTE absolute value (SSSE3). INST_2x(pabsb, kInstPabsb, XmmVar, XmmVar) //! @overload INST_2x(pabsb, kInstPabsb, XmmVar, Mem) - //! @brief Packed absolute value (SSSE3). - INST_2x(pabsw, kInstPabsw, MmVar, MmVar) - //! @overload - INST_2x(pabsw, kInstPabsw, MmVar, Mem) - - //! @brief Packed absolute value (SSSE3). - INST_2x(pabsw, kInstPabsw, XmmVar, XmmVar) - //! @overload - INST_2x(pabsw, kInstPabsw, XmmVar, Mem) - - //! @brief Packed absolute value (SSSE3). + //! Packed DWORD absolute value (SSSE3). INST_2x(pabsd, kInstPabsd, MmVar, MmVar) //! @overload INST_2x(pabsd, kInstPabsd, MmVar, Mem) - //! @brief Packed absolute value (SSSE3). + //! Packed DWORD absolute value (SSSE3). INST_2x(pabsd, kInstPabsd, XmmVar, XmmVar) //! @overload INST_2x(pabsd, kInstPabsd, XmmVar, Mem) - //! @brief Packed multiply high with round and scale (SSSE3). + //! Packed WORD absolute value (SSSE3). + INST_2x(pabsw, kInstPabsw, MmVar, MmVar) + //! @overload + INST_2x(pabsw, kInstPabsw, MmVar, Mem) + + //! Packed WORD absolute value (SSSE3). + INST_2x(pabsw, kInstPabsw, XmmVar, XmmVar) + //! @overload + INST_2x(pabsw, kInstPabsw, XmmVar, Mem) + + //! Packed WORD multiply high, round and scale (SSSE3). INST_2x(pmulhrsw, kInstPmulhrsw, MmVar, MmVar) //! @overload INST_2x(pmulhrsw, kInstPmulhrsw, MmVar, Mem) - //! @brief Packed multiply high with round and scale (SSSE3). + //! Packed WORD multiply high, round and scale (SSSE3). INST_2x(pmulhrsw, kInstPmulhrsw, XmmVar, XmmVar) //! @overload INST_2x(pmulhrsw, kInstPmulhrsw, XmmVar, Mem) - //! @brief Packed shuffle bytes (SSSE3). + //! Packed BYTE shuffle (SSSE3). INST_2x(pshufb, kInstPshufb, MmVar, MmVar) //! @overload INST_2x(pshufb, kInstPshufb, MmVar, Mem) - //! @brief Packed shuffle bytes (SSSE3). + //! Packed BYTE shuffle (SSSE3). INST_2x(pshufb, kInstPshufb, XmmVar, XmmVar) //! @overload INST_2x(pshufb, kInstPshufb, XmmVar, Mem) - //! @brief Packed shuffle bytes (SSSE3). + //! Packed align right (SSSE3). INST_3i(palignr, kInstPalignr, MmVar, MmVar, Imm) //! @overload INST_3i(palignr, kInstPalignr, MmVar, Mem, Imm) - //! @brief Packed shuffle bytes (SSSE3). + //! Packed align right (SSSE3). INST_3i(palignr, kInstPalignr, XmmVar, XmmVar, Imm) //! @overload INST_3i(palignr, kInstPalignr, XmmVar, Mem, Imm) @@ -3691,267 +3676,272 @@ struct X86X64Compiler : public BaseCompiler { // [SSE4.1] // -------------------------------------------------------------------------- - //! @brief Blend packed DP-FP values (SSE4.1). + //! Packed DP-FP blend (SSE4.1). INST_3i(blendpd, kInstBlendpd, XmmVar, XmmVar, Imm) //! @overload INST_3i(blendpd, kInstBlendpd, XmmVar, Mem, Imm) - //! @brief Blend packed SP-FP values (SSE4.1). + //! Packed SP-FP blend (SSE4.1). INST_3i(blendps, kInstBlendps, XmmVar, XmmVar, Imm) //! @overload INST_3i(blendps, kInstBlendps, XmmVar, Mem, Imm) - //! @brief Variable blend packed DP-FP values (SSE4.1). + //! Packed DP-FP variable blend (SSE4.1). INST_3x(blendvpd, kInstBlendvpd, XmmVar, XmmVar, XmmVar) //! @overload INST_3x(blendvpd, kInstBlendvpd, XmmVar, Mem, XmmVar) - //! @brief Variable blend packed SP-FP values (SSE4.1). + //! Packed SP-FP variable blend (SSE4.1). INST_3x(blendvps, kInstBlendvps, XmmVar, XmmVar, XmmVar) //! @overload INST_3x(blendvps, kInstBlendvps, XmmVar, Mem, XmmVar) - //! @brief Dot product of packed DP-FP values (SSE4.1). + //! Packed DP-FP dot product (SSE4.1). INST_3i(dppd, kInstDppd, XmmVar, XmmVar, Imm) //! @overload INST_3i(dppd, kInstDppd, XmmVar, Mem, Imm) - //! @brief Dot product of packed SP-FP values (SSE4.1). + //! Packed SP-FP dot product (SSE4.1). INST_3i(dpps, kInstDpps, XmmVar, XmmVar, Imm) //! @overload INST_3i(dpps, kInstDpps, XmmVar, Mem, Imm) - //! @brief Extract packed SP-FP value (SSE4.1). + //! Extract SP-FP based on selector (SSE4.1). INST_3i(extractps, kInstExtractps, GpVar, XmmVar, Imm) //! @overload INST_3i(extractps, kInstExtractps, Mem, XmmVar, Imm) - //! @brief Load oword non-temporal aligned hint (SSE4.1). + //! Insert SP-FP based on selector (SSE4.1). + INST_3i(insertps, kInstInsertps, XmmVar, XmmVar, Imm) + //! @overload + INST_3i(insertps, kInstInsertps, XmmVar, Mem, Imm) + + //! Load OWORD aligned using NT hint (SSE4.1). INST_2x(movntdqa, kInstMovntdqa, XmmVar, Mem) - //! @brief Compute multiple packed sums of absolute difference (SSE4.1). + //! Packed WORD sums of absolute difference (SSE4.1). INST_3i(mpsadbw, kInstMpsadbw, XmmVar, XmmVar, Imm) //! @overload INST_3i(mpsadbw, kInstMpsadbw, XmmVar, Mem, Imm) - //! @brief Pack with unsigned saturation (SSE4.1). + //! Pack DWORDs to WORDs with unsigned saturation (SSE4.1). INST_2x(packusdw, kInstPackusdw, XmmVar, XmmVar) //! @overload INST_2x(packusdw, kInstPackusdw, XmmVar, Mem) - //! @brief Variable blend packed bytes (SSE4.1). + //! Packed BYTE variable blend (SSE4.1). INST_3x(pblendvb, kInstPblendvb, XmmVar, XmmVar, XmmVar) //! @overload INST_3x(pblendvb, kInstPblendvb, XmmVar, Mem, XmmVar) - //! @brief Blend packed words (SSE4.1). + //! Packed WORD blend (SSE4.1). INST_3i(pblendw, kInstPblendw, XmmVar, XmmVar, Imm) //! @overload INST_3i(pblendw, kInstPblendw, XmmVar, Mem, Imm) - //! @brief Compare packed qword Data for Equal (SSE4.1). + //! Packed QWORD compare for equality (SSE4.1). INST_2x(pcmpeqq, kInstPcmpeqq, XmmVar, XmmVar) //! @overload INST_2x(pcmpeqq, kInstPcmpeqq, XmmVar, Mem) - //! @brief Extract byte (SSE4.1). + //! Extract BYTE based on selector (SSE4.1). INST_3i(pextrb, kInstPextrb, GpVar, XmmVar, Imm) //! @overload INST_3i(pextrb, kInstPextrb, Mem, XmmVar, Imm) - //! @brief Extract dword (SSE4.1). + //! Extract DWORD based on selector (SSE4.1). INST_3i(pextrd, kInstPextrd, GpVar, XmmVar, Imm) //! @overload INST_3i(pextrd, kInstPextrd, Mem, XmmVar, Imm) - //! @brief Extract qword (SSE4.1). + //! Extract QWORD based on selector (SSE4.1). INST_3i(pextrq, kInstPextrq, GpVar, XmmVar, Imm) //! @overload INST_3i(pextrq, kInstPextrq, Mem, XmmVar, Imm) - //! @brief Extract word (SSE4.1). + //! Extract WORD based on selector (SSE4.1). INST_3i(pextrw, kInstPextrw, Mem, XmmVar, Imm) - //! @brief Packed horizontal word minimum (SSE4.1). + //! Packed WORD horizontal minimum (SSE4.1). INST_2x(phminposuw, kInstPhminposuw, XmmVar, XmmVar) //! @overload INST_2x(phminposuw, kInstPhminposuw, XmmVar, Mem) - //! @brief Insert byte (SSE4.1). + //! Insert BYTE based on selector (SSE4.1). INST_3i(pinsrb, kInstPinsrb, XmmVar, GpVar, Imm) //! @overload INST_3i(pinsrb, kInstPinsrb, XmmVar, Mem, Imm) - //! @brief Insert dword (SSE4.1). + //! Insert DWORD based on selector (SSE4.1). INST_3i(pinsrd, kInstPinsrd, XmmVar, GpVar, Imm) //! @overload INST_3i(pinsrd, kInstPinsrd, XmmVar, Mem, Imm) - //! @brief Insert qword (SSE4.1). + //! Insert QWORD based on selector (SSE4.1). INST_3i(pinsrq, kInstPinsrq, XmmVar, GpVar, Imm) //! @overload INST_3i(pinsrq, kInstPinsrq, XmmVar, Mem, Imm) - //! @brief Maximum of packed word integers (SSE4.1). - INST_2x(pmaxuw, kInstPmaxuw, XmmVar, XmmVar) - //! @overload - INST_2x(pmaxuw, kInstPmaxuw, XmmVar, Mem) - - //! @brief Maximum of packed signed byte integers (SSE4.1). + //! Packed BYTE maximum (SSE4.1). INST_2x(pmaxsb, kInstPmaxsb, XmmVar, XmmVar) //! @overload INST_2x(pmaxsb, kInstPmaxsb, XmmVar, Mem) - //! @brief Maximum of packed signed dword integers (SSE4.1). + //! Packed DWORD maximum (SSE4.1). INST_2x(pmaxsd, kInstPmaxsd, XmmVar, XmmVar) //! @overload INST_2x(pmaxsd, kInstPmaxsd, XmmVar, Mem) - //! @brief Maximum of packed unsigned dword integers (SSE4.1). + //! Packed DWORD unsigned maximum (SSE4.1). INST_2x(pmaxud, kInstPmaxud, XmmVar, XmmVar) //! @overload INST_2x(pmaxud,kInstPmaxud , XmmVar, Mem) - //! @brief Minimum of packed signed byte integers (SSE4.1). + //! Packed WORD unsigned maximum (SSE4.1). + INST_2x(pmaxuw, kInstPmaxuw, XmmVar, XmmVar) + //! @overload + INST_2x(pmaxuw, kInstPmaxuw, XmmVar, Mem) + + //! Packed BYTE minimum (SSE4.1). INST_2x(pminsb, kInstPminsb, XmmVar, XmmVar) //! @overload INST_2x(pminsb, kInstPminsb, XmmVar, Mem) - //! @brief Minimum of packed word integers (SSE4.1). - INST_2x(pminuw, kInstPminuw, XmmVar, XmmVar) - //! @overload - INST_2x(pminuw, kInstPminuw, XmmVar, Mem) - - //! @brief Minimum of packed dword integers (SSE4.1). - INST_2x(pminud, kInstPminud, XmmVar, XmmVar) - //! @overload - INST_2x(pminud, kInstPminud, XmmVar, Mem) - - //! @brief Minimum of packed dword integers (SSE4.1). + //! Packed DWORD minimum (SSE4.1). INST_2x(pminsd, kInstPminsd, XmmVar, XmmVar) //! @overload INST_2x(pminsd, kInstPminsd, XmmVar, Mem) - //! @brief Packed move with sign extend (SSE4.1). - INST_2x(pmovsxbw, kInstPmovsxbw, XmmVar, XmmVar) + //! Packed WORD unsigned minimum (SSE4.1). + INST_2x(pminuw, kInstPminuw, XmmVar, XmmVar) //! @overload - INST_2x(pmovsxbw, kInstPmovsxbw, XmmVar, Mem) + INST_2x(pminuw, kInstPminuw, XmmVar, Mem) - //! @brief Packed move with sign extend (SSE4.1). + //! Packed DWORD unsigned minimum (SSE4.1). + INST_2x(pminud, kInstPminud, XmmVar, XmmVar) + //! @overload + INST_2x(pminud, kInstPminud, XmmVar, Mem) + + //! Packed BYTE to DWORD with sign extend (SSE4.1). INST_2x(pmovsxbd, kInstPmovsxbd, XmmVar, XmmVar) //! @overload INST_2x(pmovsxbd, kInstPmovsxbd, XmmVar, Mem) - //! @brief Packed move with sign extend (SSE4.1). + //! Packed BYTE to QWORD with sign extend (SSE4.1). INST_2x(pmovsxbq, kInstPmovsxbq, XmmVar, XmmVar) //! @overload INST_2x(pmovsxbq, kInstPmovsxbq, XmmVar, Mem) - //! @brief Packed move with sign extend (SSE4.1). - INST_2x(pmovsxwd, kInstPmovsxwd, XmmVar, XmmVar) + //! Packed BYTE to WORD with sign extend (SSE4.1). + INST_2x(pmovsxbw, kInstPmovsxbw, XmmVar, XmmVar) //! @overload - INST_2x(pmovsxwd, kInstPmovsxwd, XmmVar, Mem) + INST_2x(pmovsxbw, kInstPmovsxbw, XmmVar, Mem) - //! @brief (SSE4.1). - INST_2x(pmovsxwq, kInstPmovsxwq, XmmVar, XmmVar) - //! @overload - INST_2x(pmovsxwq, kInstPmovsxwq, XmmVar, Mem) - - //! @brief (SSE4.1). + //! Packed DWORD to QWORD with sign extend (SSE4.1). INST_2x(pmovsxdq, kInstPmovsxdq, XmmVar, XmmVar) //! @overload INST_2x(pmovsxdq, kInstPmovsxdq, XmmVar, Mem) - //! @brief Packed move with zero extend (SSE4.1). - INST_2x(pmovzxbw, kInstPmovzxbw, XmmVar, XmmVar) + //! Packed WORD to DWORD with sign extend (SSE4.1). + INST_2x(pmovsxwd, kInstPmovsxwd, XmmVar, XmmVar) //! @overload - INST_2x(pmovzxbw, kInstPmovzxbw, XmmVar, Mem) + INST_2x(pmovsxwd, kInstPmovsxwd, XmmVar, Mem) - //! @brief Packed move with zero extend (SSE4.1). + //! Packed WORD to QWORD with sign extend (SSE4.1). + INST_2x(pmovsxwq, kInstPmovsxwq, XmmVar, XmmVar) + //! @overload + INST_2x(pmovsxwq, kInstPmovsxwq, XmmVar, Mem) + + //! BYTE to DWORD with zero extend (SSE4.1). INST_2x(pmovzxbd, kInstPmovzxbd, XmmVar, XmmVar) //! @overload INST_2x(pmovzxbd, kInstPmovzxbd, XmmVar, Mem) - //! @brief Packed move with zero extend (SSE4.1). + //! Packed BYTE to QWORD with zero extend (SSE4.1). INST_2x(pmovzxbq, kInstPmovzxbq, XmmVar, XmmVar) //! @overload INST_2x(pmovzxbq, kInstPmovzxbq, XmmVar, Mem) - //! @brief Packed move with zero extend (SSE4.1). - INST_2x(pmovzxwd, kInstPmovzxwd, XmmVar, XmmVar) + //! BYTE to WORD with zero extend (SSE4.1). + INST_2x(pmovzxbw, kInstPmovzxbw, XmmVar, XmmVar) //! @overload - INST_2x(pmovzxwd, kInstPmovzxwd, XmmVar, Mem) + INST_2x(pmovzxbw, kInstPmovzxbw, XmmVar, Mem) - //! @brief (SSE4.1). - INST_2x(pmovzxwq, kInstPmovzxwq, XmmVar, XmmVar) - //! @overload - INST_2x(pmovzxwq, kInstPmovzxwq, XmmVar, Mem) - - //! @brief (SSE4.1). + //! Packed DWORD to QWORD with zero extend (SSE4.1). INST_2x(pmovzxdq, kInstPmovzxdq, XmmVar, XmmVar) //! @overload INST_2x(pmovzxdq, kInstPmovzxdq, XmmVar, Mem) - //! @brief Multiply packed signed dword integers (SSE4.1). + //! Packed WORD to DWORD with zero extend (SSE4.1). + INST_2x(pmovzxwd, kInstPmovzxwd, XmmVar, XmmVar) + //! @overload + INST_2x(pmovzxwd, kInstPmovzxwd, XmmVar, Mem) + + //! Packed WORD to QWORD with zero extend (SSE4.1). + INST_2x(pmovzxwq, kInstPmovzxwq, XmmVar, XmmVar) + //! @overload + INST_2x(pmovzxwq, kInstPmovzxwq, XmmVar, Mem) + + //! Packed DWORD to QWORD multiply (SSE4.1). INST_2x(pmuldq, kInstPmuldq, XmmVar, XmmVar) //! @overload INST_2x(pmuldq, kInstPmuldq, XmmVar, Mem) - //! @brief Multiply packed signed integers and store low result (SSE4.1). + //! Packed DWORD multiply low (SSE4.1). INST_2x(pmulld, kInstPmulld, XmmVar, XmmVar) //! @overload INST_2x(pmulld, kInstPmulld, XmmVar, Mem) - //! @brief Logical compare (SSE4.1). + //! Logical compare (SSE4.1). INST_2x(ptest, kInstPtest, XmmVar, XmmVar) //! @overload INST_2x(ptest, kInstPtest, XmmVar, Mem) - //! @brief Round packed SP-FP values (SSE4.1). - INST_3i(roundps, kInstRoundps, XmmVar, XmmVar, Imm) - //! @overload - INST_3i(roundps, kInstRoundps, XmmVar, Mem, Imm) - - //! @brief Round scalar SP-FP values (SSE4.1). - INST_3i(roundss, kInstRoundss, XmmVar, XmmVar, Imm) - //! @overload - INST_3i(roundss, kInstRoundss, XmmVar, Mem, Imm) - - //! @brief Round packed DP-FP values (SSE4.1). + //! Packed DP-FP round (SSE4.1). INST_3i(roundpd, kInstRoundpd, XmmVar, XmmVar, Imm) //! @overload INST_3i(roundpd, kInstRoundpd, XmmVar, Mem, Imm) - //! @brief Round scalar DP-FP values (SSE4.1). + //! Packed SP-FP round (SSE4.1). + INST_3i(roundps, kInstRoundps, XmmVar, XmmVar, Imm) + //! @overload + INST_3i(roundps, kInstRoundps, XmmVar, Mem, Imm) + + //! Scalar DP-FP round (SSE4.1). INST_3i(roundsd, kInstRoundsd, XmmVar, XmmVar, Imm) //! @overload INST_3i(roundsd, kInstRoundsd, XmmVar, Mem, Imm) + //! Scalar SP-FP round (SSE4.1). + INST_3i(roundss, kInstRoundss, XmmVar, XmmVar, Imm) + //! @overload + INST_3i(roundss, kInstRoundss, XmmVar, Mem, Imm) + // -------------------------------------------------------------------------- // [SSE4.2] // -------------------------------------------------------------------------- - //! @brief Packed compare explicit length strings, return index (SSE4.2). + //! Packed compare explicit length strings, return index (SSE4.2). INST_3i(pcmpestri, kInstPcmpestri, XmmVar, XmmVar, Imm) //! @overload INST_3i(pcmpestri, kInstPcmpestri, XmmVar, Mem, Imm) - //! @brief Packed compare explicit length strings, return mask (SSE4.2). + //! Packed compare explicit length strings, return mask (SSE4.2). INST_3i(pcmpestrm, kInstPcmpestrm, XmmVar, XmmVar, Imm) //! @overload INST_3i(pcmpestrm, kInstPcmpestrm, XmmVar, Mem, Imm) - //! @brief Packed compare implicit length strings, return index (SSE4.2). + //! Packed compare implicit length strings, return index (SSE4.2). INST_3i(pcmpistri, kInstPcmpistri, XmmVar, XmmVar, Imm) //! @overload INST_3i(pcmpistri, kInstPcmpistri, XmmVar, Mem, Imm) - //! @brief Packed compare implicit length strings, return mask (SSE4.2). + //! Packed compare implicit length strings, return mask (SSE4.2). INST_3i(pcmpistrm, kInstPcmpistrm, XmmVar, XmmVar, Imm) //! @overload INST_3i(pcmpistrm, kInstPcmpistrm, XmmVar, Mem, Imm) - //! @brief Compare packed data for greater than (SSE4.2). + //! Packed QWORD compare if greater than (SSE4.2). INST_2x(pcmpgtq, kInstPcmpgtq, XmmVar, XmmVar) //! @overload INST_2x(pcmpgtq, kInstPcmpgtq, XmmVar, Mem) @@ -3960,32 +3950,32 @@ struct X86X64Compiler : public BaseCompiler { // [AESNI] // -------------------------------------------------------------------------- - //! @brief Perform a single round of the AES decryption flow. + //! Perform a single round of the AES decryption flow. INST_2x(aesdec, kInstAesdec, XmmVar, XmmVar) //! @overload INST_2x(aesdec, kInstAesdec, XmmVar, Mem) - //! @brief Perform the last round of the AES decryption flow. + //! Perform the last round of the AES decryption flow. INST_2x(aesdeclast, kInstAesdeclast, XmmVar, XmmVar) //! @overload INST_2x(aesdeclast, kInstAesdeclast, XmmVar, Mem) - //! @brief Perform a single round of the AES encryption flow. + //! Perform a single round of the AES encryption flow. INST_2x(aesenc, kInstAesenc, XmmVar, XmmVar) //! @overload INST_2x(aesenc, kInstAesenc, XmmVar, Mem) - //! @brief Perform the last round of the AES encryption flow. + //! Perform the last round of the AES encryption flow. INST_2x(aesenclast, kInstAesenclast, XmmVar, XmmVar) //! @overload INST_2x(aesenclast, kInstAesenclast, XmmVar, Mem) - //! @brief Perform the InvMixColumns transformation. + //! Perform the InvMixColumns transformation. INST_2x(aesimc, kInstAesimc, XmmVar, XmmVar) //! @overload INST_2x(aesimc, kInstAesimc, XmmVar, Mem) - //! @brief Assist in expanding the AES cipher key. + //! Assist in expanding the AES cipher key. INST_3i(aeskeygenassist, kInstAeskeygenassist, XmmVar, XmmVar, Imm) //! @overload INST_3i(aeskeygenassist, kInstAeskeygenassist, XmmVar, Mem, Imm) @@ -3994,7 +3984,7 @@ struct X86X64Compiler : public BaseCompiler { // [PCLMULQDQ] // -------------------------------------------------------------------------- - //! @brief Carry-less multiplication quadword. + //! Packed QWORD to OWORD carry-less multiply (PCLMULQDQ). INST_3i(pclmulqdq, kInstPclmulqdq, XmmVar, XmmVar, Imm); //! @overload INST_3i(pclmulqdq, kInstPclmulqdq, XmmVar, Mem, Imm); @@ -4024,9 +4014,9 @@ struct Compiler : public X86X64Compiler { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a @ref Compiler instance. - ASMJIT_API Compiler(BaseRuntime* runtime); - //! @brief Destroy the @ref Compiler instance. + //! Create a `x86::Compiler` instance. + ASMJIT_API Compiler(Runtime* runtime); + //! Destroy the `x86::Compiler` instance. ASMJIT_API ~Compiler(); // ------------------------------------------------------------------------- @@ -4039,16 +4029,10 @@ struct Compiler : public X86X64Compiler { // [X86-Only Instructions] // -------------------------------------------------------------------------- - //! @brief Decimal adjust AL after addition (32-bit). + //! Decimal adjust AL after addition (32-bit). INST_1x(daa, kInstDaa, GpVar) - //! @brief Decimal adjust AL after subtraction (32-bit). + //! Decimal adjust AL after subtraction (32-bit). INST_1x(das, kInstDas, GpVar) - - //! @brief Pop all Gp registers (EDI|ESI|EBP|EBX|EDX|ECX|EAX). - INST_0x(popa, kInstPopa) - - //! @brief Push all Gp registers (EAX|ECX|EDX|EBX|original ESP|EBP|ESI|EDI). - INST_0x(pusha, kInstPusha) }; //! @} @@ -4077,9 +4061,9 @@ struct Compiler : public X86X64Compiler { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a @ref Compiler instance. - ASMJIT_API Compiler(BaseRuntime* runtime); - //! @brief Destroy the @ref Compiler instance. + //! Create a `x64::Compiler` instance. + ASMJIT_API Compiler(Runtime* runtime); + //! Destroy the `x64::Compiler` instance. ASMJIT_API ~Compiler(); // ------------------------------------------------------------------------- @@ -4092,12 +4076,12 @@ struct Compiler : public X86X64Compiler { // [X64-Only Instructions] // -------------------------------------------------------------------------- - //! @brief Convert dword to qword (RAX <- Sign Extend EAX). + //! Convert dword to qword (RAX <- Sign Extend EAX). INST_1x(cdqe, kInstCdqe, GpVar /* eax */) - //! @brief Convert qword to oword (RDX:RAX <- Sign Extend RAX). + //! Convert qword to oword (RDX:RAX <- Sign Extend RAX). INST_2x(cqo, kInstCdq, GpVar /* rdx */, GpVar /* rax */) - //! @brief Compares the 128-bit value in RDX:RAX with the memory operand (X64). + //! Compares the 128-bit value in RDX:RAX with the memory operand (X64). ASMJIT_INLINE InstNode* cmpxchg16b( const GpVar& cmp_edx, const GpVar& cmp_eax, const GpVar& cmp_ecx, const GpVar& cmp_ebx, @@ -4106,26 +4090,26 @@ struct Compiler : public X86X64Compiler { return emit(kInstCmpxchg16b, cmp_edx, cmp_eax, cmp_ecx, cmp_ebx, dst); } - //! @brief Move dword to qword with sign-extension. + //! Move dword to qword with sign-extension. INST_2x(movsxd, kInstMovsxd, GpVar, GpVar) //! @overload INST_2x(movsxd, kInstMovsxd, GpVar, Mem) - //! @brief Load ECX/RCX QWORDs from DS:[ESI/RSI] to RAX. + //! Load ECX/RCX QWORDs from DS:[ESI/RSI] to RAX. INST_3x_(rep_lodsq, kInstRepLodsq, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Move ECX/RCX QWORDs from DS:[ESI/RSI] to ES:[EDI/RDI]. + //! Move ECX/RCX QWORDs from DS:[ESI/RSI] to ES:[EDI/RDI]. INST_3x_(rep_movsq, kInstRepMovsq, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Fill ECX/RCX QWORDs at ES:[EDI/RDI] with RAX. + //! Fill ECX/RCX QWORDs at ES:[EDI/RDI] with RAX. INST_3x_(rep_stosq, kInstRepStosq, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Repeated find nonmatching QWORDs in ES:[EDI/RDI] and DS:[ESI/RDI]. + //! Repeated find nonmatching QWORDs in ES:[EDI/RDI] and DS:[ESI/RDI]. INST_3x_(repe_cmpsq, kInstRepeCmpsq, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find non-RAX QWORD starting at ES:[EDI/RDI]. + //! Find non-RAX QWORD starting at ES:[EDI/RDI]. INST_3x_(repe_scasq, kInstRepeScasq, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find matching QWORDs in [RDI] and [RSI]. + //! Find matching QWORDs in [RDI] and [RSI]. INST_3x_(repne_cmpsq, kInstRepneCmpsq, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) - //! @brief Find RAX, starting at ES:[EDI/RDI]. + //! Find RAX, starting at ES:[EDI/RDI]. INST_3x_(repne_scasq, kInstRepneScasq, GpVar, GpVar, GpVar, o0.getId() != o1.getId() && o1.getId() != o2.getId()) using X86X64Compiler::movq; diff --git a/src/asmjit/x86/x86context.cpp b/src/asmjit/x86/x86context.cpp index 74a0006..8ff29ac 100644 --- a/src/asmjit/x86/x86context.cpp +++ b/src/asmjit/x86/x86context.cpp @@ -1557,7 +1557,7 @@ static void X86X64Context_prepareSingleVarInst(uint32_t code, VarAttr* va) { //! @internal //! -//! @brief Add unreachable-flow data to the unreachable flow list. +//! Add unreachable-flow data to the unreachable flow list. static ASMJIT_INLINE Error X86X64Context_addUnreachableNode(X86X64Context* self, BaseNode* node) { PodList::Link* link = self->_baseZone.allocT::Link>(); if (link == NULL) @@ -1571,7 +1571,7 @@ static ASMJIT_INLINE Error X86X64Context_addUnreachableNode(X86X64Context* self, //! @internal //! -//! @brief Add jump-flow data to the jcc flow list. +//! Add jump-flow data to the jcc flow list. static ASMJIT_INLINE Error X86X64Context_addJccNode(X86X64Context* self, BaseNode* node) { PodList::Link* link = self->_baseZone.allocT::Link>(); @@ -1586,7 +1586,7 @@ static ASMJIT_INLINE Error X86X64Context_addJccNode(X86X64Context* self, BaseNod //! @internal //! -//! @brief Get mask of all registers actually used to pass function arguments. +//! Get mask of all registers actually used to pass function arguments. static ASMJIT_INLINE RegMask X86X64Context_getUsedArgs(X86X64Context* self, X86X64CallNode* node, X86X64FuncDecl* decl) { RegMask regs; regs.reset(); @@ -1815,7 +1815,7 @@ static ASMJIT_INLINE Error X86X64Context_insertSArgNode( //! @internal //! -//! @brief Prepare the given function @a func. +//! Prepare the given function `func`. //! //! For each node: //! - Create and assign groupId and flowId. @@ -2608,12 +2608,12 @@ _NoMemory: //! @internal struct LivenessTarget { - //! @brief Previous target. + //! Previous target. LivenessTarget* prev; - //! @brief Target node. + //! Target node. TargetNode* node; - //! @brief Jumped from. + //! Jumped from. JumpNode* from; }; @@ -2952,33 +2952,33 @@ struct X86X64BaseAlloc { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get the context. + //! Get the context. ASMJIT_INLINE X86X64Context* getContext() const { return _context; } - //! @brief Get the current state (always the same instance as X86X64Context::_x86State). + //! Get the current state (always the same instance as X86X64Context::_x86State). ASMJIT_INLINE VarState* getState() const { return _context->getState(); } - //! @brief Get the node. + //! Get the node. ASMJIT_INLINE BaseNode* getNode() const { return _node; } - //! @brief Get VarAttr list (all). + //! Get VarAttr list (all). ASMJIT_INLINE VarAttr* getVaList() const { return _vaList[0]; } - //! @brief Get VarAttr list (per class). + //! Get VarAttr list (per class). ASMJIT_INLINE VarAttr* getVaListByClass(uint32_t c) const { return _vaList[c]; } - //! @brief Get VarAttr count (all). + //! Get VarAttr count (all). ASMJIT_INLINE uint32_t getVaCount() const { return _vaCount; } - //! @brief Get VarAttr count (per class). + //! Get VarAttr count (per class). ASMJIT_INLINE uint32_t getVaCountByClass(uint32_t c) const { return _count.get(c); } - //! @brief Get whether all variables of class @a c are done. + //! Get whether all variables of class `c` are done. ASMJIT_INLINE bool isVaDone(uint32_t c) const { return _done.get(c) == _count.get(c); } - //! @brief Get how many variables have been allocated. + //! Get how many variables have been allocated. ASMJIT_INLINE uint32_t getVaDone(uint32_t c) const { return _done.get(c); } ASMJIT_INLINE void addVaDone(uint32_t c, uint32_t n = 1) { _done.add(c, n); } - //! @brief Get number of allocable registers per class. + //! Get number of allocable registers per class. ASMJIT_INLINE uint32_t getGaRegs(uint32_t c) const { return _context->_gaRegs[c]; } @@ -3007,25 +3007,25 @@ protected: // [Members] // -------------------------------------------------------------------------- - //! @brief Context. + //! Context. X86X64Context* _context; - //! @brief Compiler. + //! Compiler. X86X64Compiler* _compiler; - //! @brief Node. + //! Node. BaseNode* _node; - //! @brief Variable instructions. + //! Variable instructions. VarInst* _vi; - //! @brief VarAttr list (per register class). + //! VarAttr list (per register class). VarAttr* _vaList[4]; - //! @brief Count of all VarAttr's. + //! Count of all VarAttr's. uint32_t _vaCount; - //! @brief VarAttr's total counter. + //! VarAttr's total counter. RegCount _count; - //! @brief VarAttr's done counter. + //! VarAttr's done counter. RegCount _done; }; @@ -3120,7 +3120,7 @@ ASMJIT_INLINE void X86X64BaseAlloc::unuseAfter() { //! @internal //! -//! @brief Register allocator context (asm instructions). +//! Register allocator context (asm instructions). struct X86X64VarAlloc : public X86X64BaseAlloc { // -------------------------------------------------------------------------- // [Construction / Destruction] @@ -3162,7 +3162,7 @@ protected: // [GuessAlloc / GuessSpill] // -------------------------------------------------------------------------- - //! @brief Guess which register is the best candidate for 'vd' from + //! Guess which register is the best candidate for 'vd' from //! 'allocableRegs'. //! //! The guess is based on looking ahead and inspecting register allocator @@ -3173,7 +3173,7 @@ protected: template ASMJIT_INLINE uint32_t guessAlloc(VarData* vd, uint32_t allocableRegs); - //! @brief Guess whether to move the given 'vd' instead of spill. + //! Guess whether to move the given 'vd' instead of spill. template ASMJIT_INLINE uint32_t guessSpill(VarData* vd, uint32_t allocableRegs); @@ -3188,9 +3188,9 @@ protected: // [Members] // -------------------------------------------------------------------------- - //! @brief Will alloc to these registers. + //! Will alloc to these registers. RegMask _willAlloc; - //! @brief Will spill these registers. + //! Will spill these registers. RegMask _willSpill; }; @@ -3745,7 +3745,7 @@ ASMJIT_INLINE void X86X64VarAlloc::modified() { //! @internal //! -//! @brief Register allocator context (function call). +//! Register allocator context (function call). struct X86X64CallAlloc : public X86X64BaseAlloc { // -------------------------------------------------------------------------- // [Construction / Destruction] @@ -3758,7 +3758,7 @@ struct X86X64CallAlloc : public X86X64BaseAlloc { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get the node. + //! Get the node. ASMJIT_INLINE X86X64CallNode* getNode() const { return static_cast(_node); } // -------------------------------------------------------------------------- @@ -3837,9 +3837,9 @@ protected: // [Members] // -------------------------------------------------------------------------- - //! @brief Will alloc to these registers. + //! Will alloc to these registers. RegMask _willAlloc; - //! @brief Will spill these registers. + //! Will spill these registers. RegMask _willSpill; }; @@ -5298,7 +5298,7 @@ static ASMJIT_INLINE Error X86X64Context_serialize(X86X64Context* self, X86X64As BaseNode* node_ = start; StringBuilder& sb = self->_stringBuilder; - BaseLogger* logger; + Logger* logger; uint32_t vdCount; uint32_t annotationLength; diff --git a/src/asmjit/x86/x86context_p.h b/src/asmjit/x86/x86context_p.h index 768150f..468d603 100644 --- a/src/asmjit/x86/x86context_p.h +++ b/src/asmjit/x86/x86context_p.h @@ -22,7 +22,7 @@ namespace asmjit { namespace x86x64 { -//! @addtogroup asmjit_x86x64 +//! @addtogroup asmjit_x86x64_codegen //! @{ // ============================================================================ @@ -31,7 +31,7 @@ namespace x86x64 { //! @internal //! -//! @brief Compiler context is used by @ref X86X64Compiler. +//! Compiler context is used by `X86X64Compiler`. //! //! Compiler context is used during compilation and normally developer doesn't //! need access to it. The context is user per function (it's reset after each @@ -43,9 +43,9 @@ struct X86X64Context : public BaseContext { // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref Context instance. + //! Create a new `X86X64Context` instance. X86X64Context(X86X64Compiler* compiler); - //! @brief Destroy the @ref Context instance. + //! Destroy the `X86X64Context` instance. virtual ~X86X64Context(); // -------------------------------------------------------------------------- @@ -58,12 +58,12 @@ struct X86X64Context : public BaseContext { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get compiler as @ref X86X64Compiler. + //! Get compiler as `X86X64Compiler`. ASMJIT_INLINE X86X64Compiler* getCompiler() const { return static_cast(_compiler); } - //! @brief Get function as @ref X86X64FuncNode. + //! Get function as `X86X64FuncNode`. ASMJIT_INLINE X86X64FuncNode* getFunc() const { return reinterpret_cast(_func); } @@ -72,7 +72,7 @@ struct X86X64Context : public BaseContext { return _baseRegsCount == 16; } - //! @brief Get clobbered registers (global). + //! Get clobbered registers (global). ASMJIT_INLINE uint32_t getClobberedRegs(uint32_t c) { return _clobberedRegs.get(c); } @@ -131,7 +131,7 @@ struct X86X64Context : public BaseContext { // [Attach / Detach] // -------------------------------------------------------------------------- - //! @brief Attach. + //! Attach. //! //! Attach a register to the 'VarData', changing 'VarData' members to show //! that the variable is currently alive and linking variable with the @@ -157,7 +157,7 @@ struct X86X64Context : public BaseContext { ASMJIT_CONTEXT_CHECK_STATE } - //! @brief Detach. + //! Detach. //! //! The opposite of 'Attach'. Detach resets the members in 'VarData' //! (regIndex, state and changed flags) and unlinks the variable with the @@ -185,7 +185,7 @@ struct X86X64Context : public BaseContext { // [Rebase] // -------------------------------------------------------------------------- - //! @brief Rebase. + //! Rebase. //! //! Change the register of the 'VarData' changing also the current 'VarState'. //! Rebase is nearly identical to 'Detach' and 'Attach' sequence, but doesn't @@ -213,7 +213,7 @@ struct X86X64Context : public BaseContext { // [Load / Save] // -------------------------------------------------------------------------- - //! @brief Load. + //! Load. //! //! Load variable from its memory slot to a register, emitting 'Load' //! instruction and changing the variable state to allocated. @@ -230,7 +230,7 @@ struct X86X64Context : public BaseContext { ASMJIT_CONTEXT_CHECK_STATE } - //! @brief Save. + //! Save. //! //! Save the variable into its home location, but keep it as allocated. template @@ -254,7 +254,7 @@ struct X86X64Context : public BaseContext { // [Move / Swap] // -------------------------------------------------------------------------- - //! @brief Move a register. + //! Move a register. //! //! Move register from one index to another, emitting 'Move' if needed. This //! function does nothing if register is already at the given index. @@ -273,7 +273,7 @@ struct X86X64Context : public BaseContext { ASMJIT_CONTEXT_CHECK_STATE } - //! @brief Swap two registers + //! Swap two registers //! //! It's only possible to swap Gp registers. ASMJIT_INLINE void swapGp(VarData* aVd, VarData* bVd) { @@ -308,7 +308,7 @@ struct X86X64Context : public BaseContext { // [Alloc / Spill] // -------------------------------------------------------------------------- - //! @brief Alloc + //! Alloc template ASMJIT_INLINE void alloc(VarData* vd, uint32_t regIndex) { ASMJIT_ASSERT(vd->getClass() == C); @@ -346,7 +346,7 @@ struct X86X64Context : public BaseContext { ASMJIT_CONTEXT_CHECK_STATE } - //! @brief Spill. + //! Spill. //! //! Spill variable/register, saves the content to the memory-home if modified. template @@ -391,7 +391,7 @@ struct X86X64Context : public BaseContext { // [Unuse] // -------------------------------------------------------------------------- - //! @brief Unuse. + //! Unuse. //! //! Unuse variable, it will be detached it if it's allocated then its state //! will be changed to kVarStateUnused. @@ -413,7 +413,7 @@ struct X86X64Context : public BaseContext { // [State] // -------------------------------------------------------------------------- - //! @brief Get state as @ref VarState. + //! Get state as `VarState`. ASMJIT_INLINE VarState* getState() const { return const_cast(&_x86State); } @@ -465,45 +465,45 @@ struct X86X64Context : public BaseContext { // [Members] // -------------------------------------------------------------------------- - //! @brief X86/X64 stack-pointer (esp or rsp). + //! X86/X64 stack-pointer (esp or rsp). GpReg _zsp; - //! @brief X86/X64 frame-pointer (ebp or rbp). + //! X86/X64 frame-pointer (ebp or rbp). GpReg _zbp; - //! @brief Temporary memory operand. + //! Temporary memory operand. Mem _memSlot; - //! @brief X86/X64 specific compiler state (linked with @ref _state). + //! X86/X64 specific compiler state, linked to `_state`. VarState _x86State; - //! @brief Clobbered registers (for the whole function). + //! Clobbered registers (for the whole function). RegMask _clobberedRegs; - //! @brief Memory cell where is stored address used to restore manually + //! Memory cell where is stored address used to restore manually //! aligned stack. MemCell* _stackFrameCell; - //! @brief Global allocable registers mask. + //! Global allocable registers mask. uint32_t _gaRegs[kRegClassCount]; - //! @brief X86/X64 number of Gp/Xmm registers. + //! X86/X64 number of Gp/Xmm registers. uint8_t _baseRegsCount; - //! @brief Function arguments base pointer (register). + //! Function arguments base pointer (register). uint8_t _argBaseReg; - //! @brief Function variables base pointer (register). + //! Function variables base pointer (register). uint8_t _varBaseReg; - //! @brief Whether to emit comments. + //! Whether to emit comments. uint8_t _emitComments; - //! @brief Function arguments base offset. + //! Function arguments base offset. int32_t _argBaseOffset; - //! @brief Function variables base offset. + //! Function variables base offset. int32_t _varBaseOffset; - //! @brief Function arguments displacement. + //! Function arguments displacement. int32_t _argActualDisp; - //! @brief Function variables displacement. + //! Function variables displacement. int32_t _varActualDisp; - //! @brief Temporary string builder used for logging. + //! Temporary string builder used for logging. StringBuilderT<256> _stringBuilder; }; diff --git a/src/asmjit/x86/x86cpuinfo.cpp b/src/asmjit/x86/x86cpuinfo.cpp index f1c78d0..7ca4010 100644 --- a/src/asmjit/x86/x86cpuinfo.cpp +++ b/src/asmjit/x86/x86cpuinfo.cpp @@ -28,65 +28,34 @@ namespace asmjit { namespace x86x64 { // ============================================================================ -// [asmjit::x86x64::hostCpuId] +// [asmjit::x86x64::CpuVendor] // ============================================================================ -// This is messy, I know. Cpuid is implemented as intrinsic in VS2005, but -// we should support other compilers as well. Main problem is that MS compilers -// in 64-bit mode not allows to use inline assembler, so we need intrinsic and -// we need also asm version. +struct CpuVendor { + uint32_t id; + char text[12]; +}; -// hostCpuId() and detectCpuInfo() for x86 and x64 platforms begins here. -#if defined(ASMJIT_HOST_X86) || defined(ASMJIT_HOST_X64) -void hostCpuId(uint32_t inEax, uint32_t inEcx, CpuId* result) { +static const CpuVendor cpuVendorTable[] = { + { kCpuVendorAmd , { 'A', 'M', 'D', 'i', 's', 'b', 'e', 't', 't', 'e', 'r', '!' } }, + { kCpuVendorAmd , { 'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'A', 'M', 'D' } }, + { kCpuVendorVia , { 'C', 'e', 'n', 't', 'a', 'u', 'r', 'H', 'a', 'u', 'l', 's' } }, + { kCpuVendorNSM , { 'C', 'y', 'r', 'i', 'x', 'I', 'n', 's', 't', 'e', 'a', 'd' } }, + { kCpuVendorIntel , { 'G', 'e', 'n', 'u', 'i', 'n', 'e', 'I', 'n', 't', 'e', 'l' } }, + { kCpuVendorTransmeta, { 'G', 'e', 'n', 'u', 'i', 'n', 'e', 'T', 'M', 'x', '8', '6' } }, + { kCpuVendorNSM , { 'G', 'e', 'o', 'd', 'e', ' ', 'b', 'y', ' ', 'N', 'S', 'C' } }, + { kCpuVendorTransmeta, { 'T', 'r', 'a', 'n', 's', 'm', 'e', 't', 'a', 'C', 'P', 'U' } }, + { kCpuVendorVia , { 'V', 'I', 'A', 0 , 'V', 'I', 'A', 0 , 'V', 'I', 'A', 0 } } +}; -#if defined(_MSC_VER) -// 2009-02-05: Thanks to Mike Tajmajer for supporting VC7.1 compiler. -// ASMJIT_HOST_X64 is here only for readibility, only VS2005 can compile 64-bit code. -# if _MSC_VER >= 1400 || defined(ASMJIT_HOST_X64) - // Done by intrinsics. - __cpuidex(reinterpret_cast(result->i), inEax, inEcx); -# else // _MSC_VER < 1400 - uint32_t cpuid_eax = inEax; - uint32_t cpuid_ecx = inCax; - uint32_t* cpuid_out = result->i; +static ASMJIT_INLINE bool cpuVendorEq(const CpuVendor& info, const char* vendorString) { + const uint32_t* a = reinterpret_cast(info.text); + const uint32_t* b = reinterpret_cast(vendorString); - __asm { - mov eax, cpuid_eax - mov ecx, cpuid_ecx - mov edi, cpuid_out - cpuid - mov dword ptr[edi + 0], eax - mov dword ptr[edi + 4], ebx - mov dword ptr[edi + 8], ecx - mov dword ptr[edi + 12], edx - } -# endif // _MSC_VER < 1400 - -#elif defined(__GNUC__) -// Note, patched to preserve ebx/rbx register which is used by GCC. -# if defined(ASMJIT_HOST_X86) -# define __myCpuId(inEax, inEcx, outEax, outEbx, outEcx, outEdx) \ - asm ("mov %%ebx, %%edi\n" \ - "cpuid\n" \ - "xchg %%edi, %%ebx\n" \ - : "=a" (outEax), "=D" (outEbx), "=c" (outEcx), "=d" (outEdx) : "a" (inEax), "c" (inEcx)) -# else -# define __myCpuId(inEax, inEcx, outEax, outEbx, outEcx, outEdx) \ - asm ("mov %%rbx, %%rdi\n" \ - "cpuid\n" \ - "xchg %%rdi, %%rbx\n" \ - : "=a" (outEax), "=D" (outEbx), "=c" (outEcx), "=d" (outEdx) : "a" (inEax), "c" (inEcx)) -# endif - __myCpuId(inEax, inEcx, result->eax, result->ebx, result->ecx, result->edx); -#endif // Compiler #ifdef. + return (a[0] == b[0]) & (a[1] == b[1]) & (a[2] == b[2]); } -// ============================================================================ -// [asmjit::x86x64::cpuSimplifyBrandString] -// ============================================================================ - -static ASMJIT_INLINE void cpuSimplifyBrandString(char* s) { +static ASMJIT_INLINE void simplifyBrandString(char* s) { // Always clear the current character in the buffer. It ensures that there // is no garbage after the string NULL terminator. char* d = s; @@ -117,38 +86,61 @@ _Skip: } // ============================================================================ -// [asmjit::x86x64::CpuVendor] +// [asmjit::x86x64::CpuUtil] // ============================================================================ -struct CpuVendor { - uint32_t id; - char text[12]; -}; +// This is messy, I know. Cpuid is implemented as intrinsic in VS2005, but +// we should support other compilers as well. Main problem is that MS compilers +// in 64-bit mode not allows to use inline assembler, so we need intrinsic and +// we need also asm version. -static const CpuVendor cpuVendorTable[] = { - { kCpuVendorAmd , { 'A', 'M', 'D', 'i', 's', 'b', 'e', 't', 't', 'e', 'r', '!' } }, - { kCpuVendorAmd , { 'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'A', 'M', 'D' } }, - { kCpuVendorVia , { 'C', 'e', 'n', 't', 'a', 'u', 'r', 'H', 'a', 'u', 'l', 's' } }, - { kCpuVendorNSM , { 'C', 'y', 'r', 'i', 'x', 'I', 'n', 's', 't', 'e', 'a', 'd' } }, - { kCpuVendorIntel , { 'G', 'e', 'n', 'u', 'i', 'n', 'e', 'I', 'n', 't', 'e', 'l' } }, - { kCpuVendorTransmeta, { 'G', 'e', 'n', 'u', 'i', 'n', 'e', 'T', 'M', 'x', '8', '6' } }, - { kCpuVendorNSM , { 'G', 'e', 'o', 'd', 'e', ' ', 'b', 'y', ' ', 'N', 'S', 'C' } }, - { kCpuVendorTransmeta, { 'T', 'r', 'a', 'n', 's', 'm', 'e', 't', 'a', 'C', 'P', 'U' } }, - { kCpuVendorVia , { 'V', 'I', 'A', 0 , 'V', 'I', 'A', 0 , 'V', 'I', 'A', 0 } } -}; +// callCpuId() and detectCpuInfo() for x86 and x64 platforms begins here. +#if defined(ASMJIT_HOST_X86) || defined(ASMJIT_HOST_X64) +void CpuUtil::callCpuId(uint32_t inEax, uint32_t inEcx, CpuId* outResult) { -static ASMJIT_INLINE bool cpuVendorEq(const CpuVendor& info, const char* vendorString) { - const uint32_t* a = reinterpret_cast(info.text); - const uint32_t* b = reinterpret_cast(vendorString); +#if defined(_MSC_VER) +// 2009-02-05: Thanks to Mike Tajmajer for supporting VC7.1 compiler. +// ASMJIT_HOST_X64 is here only for readibility, only VS2005 can compile 64-bit code. +# if _MSC_VER >= 1400 || defined(ASMJIT_HOST_X64) + // Done by intrinsics. + __cpuidex(reinterpret_cast(outResult->i), inEax, inEcx); +# else // _MSC_VER < 1400 + uint32_t cpuid_eax = inEax; + uint32_t cpuid_ecx = inCax; + uint32_t* cpuid_out = outResult->i; - return (a[0] == b[0]) & (a[1] == b[1]) & (a[2] == b[2]); + __asm { + mov eax, cpuid_eax + mov ecx, cpuid_ecx + mov edi, cpuid_out + cpuid + mov dword ptr[edi + 0], eax + mov dword ptr[edi + 4], ebx + mov dword ptr[edi + 8], ecx + mov dword ptr[edi + 12], edx + } +# endif // _MSC_VER < 1400 + +#elif defined(__GNUC__) +// Note, patched to preserve ebx/rbx register which is used by GCC. +# if defined(ASMJIT_HOST_X86) +# define __myCpuId(inEax, inEcx, outEax, outEbx, outEcx, outEdx) \ + asm ("mov %%ebx, %%edi\n" \ + "cpuid\n" \ + "xchg %%edi, %%ebx\n" \ + : "=a" (outEax), "=D" (outEbx), "=c" (outEcx), "=d" (outEdx) : "a" (inEax), "c" (inEcx)) +# else +# define __myCpuId(inEax, inEcx, outEax, outEbx, outEcx, outEdx) \ + asm ("mov %%rbx, %%rdi\n" \ + "cpuid\n" \ + "xchg %%rdi, %%rbx\n" \ + : "=a" (outEax), "=D" (outEbx), "=c" (outEcx), "=d" (outEdx) : "a" (inEax), "c" (inEcx)) +# endif + __myCpuId(inEax, inEcx, outResult->eax, outResult->ebx, outResult->ecx, outResult->edx); +#endif // COMPILER } -// ============================================================================ -// [asmjit::x86x64::hostCpuDetect] -// ============================================================================ - -void hostCpuDetect(CpuInfo* cpuInfo) { +void CpuUtil::detect(CpuInfo* cpuInfo) { CpuId regs; uint32_t i; @@ -163,7 +155,7 @@ void hostCpuDetect(CpuInfo* cpuInfo) { cpuInfo->_coresCount = BaseCpuInfo::detectNumberOfCores(); // Get vendor string/id. - hostCpuId(0, 0, ®s); + callCpuId(0, 0, ®s); maxId = regs.eax; ::memcpy(cpuInfo->_vendorString, ®s.ebx, 4); @@ -178,7 +170,7 @@ void hostCpuDetect(CpuInfo* cpuInfo) { } // Get feature flags in ecx/edx and family/model in eax. - hostCpuId(1, 0, ®s); + callCpuId(1, 0, ®s); // Fill family and model fields. cpuInfo->_family = (regs.eax >> 8) & 0x0F; @@ -235,7 +227,7 @@ void hostCpuDetect(CpuInfo* cpuInfo) { // Detect new features if the processor supports CPUID-07. if (maxId >= 7) { - hostCpuId(7, 0, ®s); + callCpuId(7, 0, ®s); if (regs.ebx & 0x00000001) cpuInfo->addFeature(kCpuFeatureFsGsBase); if (regs.ebx & 0x00000008) cpuInfo->addFeature(kCpuFeatureBmi); @@ -252,13 +244,13 @@ void hostCpuDetect(CpuInfo* cpuInfo) { // Calling cpuid with 0x80000000 as the in argument gets the number of valid // extended IDs. - hostCpuId(0x80000000, 0, ®s); + callCpuId(0x80000000, 0, ®s); uint32_t maxExtId = IntUtil::iMin(regs.eax, 0x80000004); uint32_t* brand = reinterpret_cast(cpuInfo->_brandString); for (i = 0x80000001; i <= maxExtId; i++) { - hostCpuId(i, 0, ®s); + callCpuId(i, 0, ®s); switch (i) { case 0x80000001: @@ -292,7 +284,7 @@ void hostCpuDetect(CpuInfo* cpuInfo) { } // Simplify the brand string (remove unnecessary spaces to make printing nicer). - cpuSimplifyBrandString(cpuInfo->_brandString); + simplifyBrandString(cpuInfo->_brandString); } #endif diff --git a/src/asmjit/x86/x86cpuinfo.h b/src/asmjit/x86/x86cpuinfo.h index 2d1fd63..a5cbe4b 100644 --- a/src/asmjit/x86/x86cpuinfo.h +++ b/src/asmjit/x86/x86cpuinfo.h @@ -18,103 +18,109 @@ namespace asmjit { namespace x86x64 { -//! @addtogroup asmjit_x86x64 +//! @addtogroup asmjit_x86x64_cpu_info //! @{ +// ============================================================================ +// [Forward Declarations] +// ============================================================================ + +struct CpuInfo; + // ============================================================================ // [asmjit::x86x64::kCpuFeature] // ============================================================================ -//! @brief X86 CPU features. +//! X86 CPU features. ASMJIT_ENUM(kCpuFeature) { - //! @brief Cpu has multithreading. + //! Cpu has multithreading. kCpuFeatureMultithreading = 1, - //! @brief Cpu has execute disable bit. + //! Cpu has execute disable bit. kCpuFeatureExecuteDisableBit, - //! @brief Cpu has RDTSC. + //! Cpu has RDTSC. kCpuFeatureRdtsc, - //! @brief Cpu has RDTSCP. + //! Cpu has RDTSCP. kCpuFeatureRdtscp, - //! @brief Cpu has CMOV. + //! Cpu has CMOV. kCpuFeatureCmov, - //! @brief Cpu has CMPXCHG8B. + //! Cpu has CMPXCHG8B. kCpuFeatureCmpXchg8B, - //! @brief Cpu has CMPXCHG16B (x64). + //! Cpu has CMPXCHG16B (x64). kCpuFeatureCmpXchg16B, - //! @brief Cpu has CLFUSH. + //! Cpu has CLFUSH. kCpuFeatureClflush, - //! @brief Cpu has PREFETCH. + //! Cpu has PREFETCH. kCpuFeaturePrefetch, - //! @brief Cpu has LAHF/SAHF. + //! Cpu has LAHF/SAHF. kCpuFeatureLahfSahf, - //! @brief Cpu has FXSAVE/FXRSTOR. + //! Cpu has FXSAVE/FXRSTOR. kCpuFeatureFxsr, - //! @brief Cpu has FXSAVE/FXRSTOR optimizations. + //! Cpu has FXSAVE/FXRSTOR optimizations. kCpuFeatureFfxsr, - //! @brief Cpu has MMX. + //! Cpu has MMX. kCpuFeatureMmx, - //! @brief Cpu has extended MMX. + //! Cpu has extended MMX. kCpuFeatureMmxExt, - //! @brief Cpu has 3dNow! + //! Cpu has 3dNow! kCpuFeature3dNow, - //! @brief Cpu has enchanced 3dNow! + //! Cpu has enchanced 3dNow! kCpuFeature3dNowExt, - //! @brief Cpu has SSE. + //! Cpu has SSE. kCpuFeatureSse, - //! @brief Cpu has SSE2. + //! Cpu has SSE2. kCpuFeatureSse2, - //! @brief Cpu has SSE3. + //! Cpu has SSE3. kCpuFeatureSse3, - //! @brief Cpu has Supplemental SSE3 (SSSE3). + //! Cpu has Supplemental SSE3 (SSSE3). kCpuFeatureSsse3, - //! @brief Cpu has SSE4.A. + //! Cpu has SSE4.A. kCpuFeatureSse4A, - //! @brief Cpu has SSE4.1. + //! Cpu has SSE4.1. kCpuFeatureSse41, - //! @brief Cpu has SSE4.2. + //! Cpu has SSE4.2. kCpuFeatureSse42, - //! @brief Cpu has Misaligned SSE (MSSE). + //! Cpu has Misaligned SSE (MSSE). kCpuFeatureMsse, - //! @brief Cpu has MONITOR and MWAIT. + //! Cpu has MONITOR and MWAIT. kCpuFeatureMonitorMWait, - //! @brief Cpu has MOVBE. + //! Cpu has MOVBE. kCpuFeatureMovbe, - //! @brief Cpu has POPCNT. + //! Cpu has POPCNT. kCpuFeaturePopcnt, - //! @brief Cpu has LZCNT. + //! Cpu has LZCNT. kCpuFeatureLzcnt, - //! @brief Cpu has AESNI. + //! Cpu has AESNI. kCpuFeatureAesni, - //! @brief Cpu has PCLMULQDQ. + //! Cpu has PCLMULQDQ. kCpuFeaturePclmulqdq, - //! @brief Cpu has RDRAND. + //! Cpu has RDRAND. kCpuFeatureRdrand, - //! @brief Cpu has AVX. + //! Cpu has AVX. kCpuFeatureAvx, - //! @brief Cpu has AVX2. + //! Cpu has AVX2. kCpuFeatureAvx2, - //! @brief Cpu has F16C. + //! Cpu has F16C. kCpuFeatureF16C, - //! @brief Cpu has FMA3. + //! Cpu has FMA3. kCpuFeatureFma3, - //! @brief Cpu has FMA4. + //! Cpu has FMA4. kCpuFeatureFma4, - //! @brief Cpu has XOP. + //! Cpu has XOP. kCpuFeatureXop, - //! @brief Cpu has BMI. + //! Cpu has BMI. kCpuFeatureBmi, - //! @brief Cpu has BMI2. + //! Cpu has BMI2. kCpuFeatureBmi2, - //! @brief Cpu has HLE. + //! Cpu has HLE. kCpuFeatureHle, - //! @brief Cpu has RTM. + //! Cpu has RTM. kCpuFeatureRtm, - //! @brief Cpu has FSGSBASE. + //! Cpu has FSGSBASE. kCpuFeatureFsGsBase, - //! @brief Cpu has enhanced REP MOVSB/STOSB. + //! Cpu has enhanced REP MOVSB/STOSB. kCpuFeatureRepMovsbStosbExt, - //! @brief Count of X86/X64 Cpu features. + //! Count of X86/X64 Cpu features. kCpuFeatureCount }; @@ -122,23 +128,38 @@ ASMJIT_ENUM(kCpuFeature) { // [asmjit::x86x64::CpuId] // ============================================================================ -//! @brief X86/X64 cpuid output. +//! X86/X64 CPUID output. union CpuId { - //! @brief EAX/EBX/ECX/EDX output. + //! EAX/EBX/ECX/EDX output. uint32_t i[4]; struct { - //! @brief EAX output. + //! EAX output. uint32_t eax; - //! @brief EBX output. + //! EBX output. uint32_t ebx; - //! @brief ECX output. + //! ECX output. uint32_t ecx; - //! @brief EDX output. + //! EDX output. uint32_t edx; }; }; +// ============================================================================ +// [asmjit::x86x64::CpuUtil] +// ============================================================================ + +#if defined(ASMJIT_HOST_X86) || defined(ASMJIT_HOST_X64) +//! CPU utilities available only if the host processor is X86/X64. +struct CpuUtil { + //! Get the result of calling CPUID instruction to `out`. + ASMJIT_API static void callCpuId(uint32_t inEax, uint32_t inEcx, CpuId* out); + + //! Detect the Host CPU. + ASMJIT_API static void detect(CpuInfo* cpuInfo); +}; +#endif // ASMJIT_HOST_X86 || ASMJIT_HOST_X64 + // ============================================================================ // [asmjit::x86x64::CpuInfo] // ============================================================================ @@ -157,22 +178,22 @@ struct CpuInfo : public BaseCpuInfo { // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get processor type. + //! Get processor type. ASMJIT_INLINE uint32_t getProcessorType() const { return _processorType; } - //! @brief Get brand index. + //! Get brand index. ASMJIT_INLINE uint32_t getBrandIndex() const { return _brandIndex; } - //! @brief Get flush cache line size. + //! Get flush cache line size. ASMJIT_INLINE uint32_t getFlushCacheLineSize() const { return _flushCacheLineSize; } - //! @brief Get maximum logical processors count. + //! Get maximum logical processors count. ASMJIT_INLINE uint32_t getMaxLogicalProcessors() const { return _maxLogicalProcessors; } @@ -181,7 +202,7 @@ struct CpuInfo : public BaseCpuInfo { // [Statics] // -------------------------------------------------------------------------- - //! @brief Get global instance of @ref X86CpuInfo. + //! Get global instance of `x86x64::CpuInfo`. static ASMJIT_INLINE const CpuInfo* getHost() { return static_cast(BaseCpuInfo::getHost()); } @@ -190,27 +211,16 @@ struct CpuInfo : public BaseCpuInfo { // [Members] // -------------------------------------------------------------------------- - //! @brief Processor type. + //! Processor type. uint32_t _processorType; - //! @brief Brand index. + //! Brand index. uint32_t _brandIndex; - //! @brief Flush cache line size in bytes. + //! Flush cache line size in bytes. uint32_t _flushCacheLineSize; - //! @brief Maximum number of addressable IDs for logical processors. + //! Maximum number of addressable IDs for logical processors. uint32_t _maxLogicalProcessors; }; -// ============================================================================ -// [asmjit::x86x64::hostCpuId / hostCpuDetect] -// ============================================================================ - -#if defined(ASMJIT_HOST_X86) || defined(ASMJIT_HOST_X64) -//! @brief Get the result of calling CPUID instruction. -ASMJIT_API void hostCpuId(uint32_t inEax, uint32_t inEcx, CpuId* result); -//! @brief Detect host CPU. -ASMJIT_API void hostCpuDetect(CpuInfo* cpuInfo); -#endif // ASMJIT_HOST_X86 || ASMJIT_HOST_X64 - //! @} } // x86x64 namespace diff --git a/src/asmjit/x86/x86defs.cpp b/src/asmjit/x86/x86defs.cpp index a49d556..c868719 100644 --- a/src/asmjit/x86/x86defs.cpp +++ b/src/asmjit/x86/x86defs.cpp @@ -256,6 +256,7 @@ const char _instName[] = "idiv\0" "imul\0" "inc\0" + "insertps\0" "int\0" "ja\0" "jae\0" @@ -1286,806 +1287,807 @@ enum kInstData_NameIndex { kInstIdiv_NameIndex = 1490, kInstImul_NameIndex = 1495, kInstInc_NameIndex = 1500, - kInstInt_NameIndex = 1504, - kInstJa_NameIndex = 1508, - kInstJae_NameIndex = 1511, - kInstJb_NameIndex = 1515, - kInstJbe_NameIndex = 1518, - kInstJc_NameIndex = 1522, - kInstJe_NameIndex = 1525, - kInstJg_NameIndex = 1528, - kInstJge_NameIndex = 1531, - kInstJl_NameIndex = 1535, - kInstJle_NameIndex = 1538, - kInstJna_NameIndex = 1542, - kInstJnae_NameIndex = 1546, - kInstJnb_NameIndex = 1551, - kInstJnbe_NameIndex = 1555, - kInstJnc_NameIndex = 1560, - kInstJne_NameIndex = 1564, - kInstJng_NameIndex = 1568, - kInstJnge_NameIndex = 1572, - kInstJnl_NameIndex = 1577, - kInstJnle_NameIndex = 1581, - kInstJno_NameIndex = 1586, - kInstJnp_NameIndex = 1590, - kInstJns_NameIndex = 1594, - kInstJnz_NameIndex = 1598, - kInstJo_NameIndex = 1602, - kInstJp_NameIndex = 1605, - kInstJpe_NameIndex = 1608, - kInstJpo_NameIndex = 1612, - kInstJs_NameIndex = 1616, - kInstJz_NameIndex = 1619, - kInstJmp_NameIndex = 1622, - kInstLahf_NameIndex = 1626, - kInstLddqu_NameIndex = 1631, - kInstLdmxcsr_NameIndex = 1637, - kInstLea_NameIndex = 1645, - kInstLeave_NameIndex = 1649, - kInstLfence_NameIndex = 1655, - kInstLzcnt_NameIndex = 1662, - kInstMaskmovdqu_NameIndex = 1668, - kInstMaskmovq_NameIndex = 1679, - kInstMaxpd_NameIndex = 1688, - kInstMaxps_NameIndex = 1694, - kInstMaxsd_NameIndex = 1700, - kInstMaxss_NameIndex = 1706, - kInstMfence_NameIndex = 1712, - kInstMinpd_NameIndex = 1719, - kInstMinps_NameIndex = 1725, - kInstMinsd_NameIndex = 1731, - kInstMinss_NameIndex = 1737, - kInstMonitor_NameIndex = 1743, - kInstMov_NameIndex = 1751, - kInstMovapd_NameIndex = 1755, - kInstMovaps_NameIndex = 1762, - kInstMovbe_NameIndex = 1769, - kInstMovd_NameIndex = 1775, - kInstMovddup_NameIndex = 1780, - kInstMovdq2q_NameIndex = 1788, - kInstMovdqa_NameIndex = 1796, - kInstMovdqu_NameIndex = 1803, - kInstMovhlps_NameIndex = 1810, - kInstMovhpd_NameIndex = 1818, - kInstMovhps_NameIndex = 1825, - kInstMovlhps_NameIndex = 1832, - kInstMovlpd_NameIndex = 1840, - kInstMovlps_NameIndex = 1847, - kInstMovmskpd_NameIndex = 1854, - kInstMovmskps_NameIndex = 1863, - kInstMovntdq_NameIndex = 1872, - kInstMovntdqa_NameIndex = 1880, - kInstMovnti_NameIndex = 1889, - kInstMovntpd_NameIndex = 1896, - kInstMovntps_NameIndex = 1904, - kInstMovntq_NameIndex = 1912, - kInstMovptr_NameIndex = 1919, - kInstMovq_NameIndex = 1927, - kInstMovq2dq_NameIndex = 1932, - kInstMovsd_NameIndex = 1940, - kInstMovshdup_NameIndex = 1946, - kInstMovsldup_NameIndex = 1955, - kInstMovss_NameIndex = 1964, - kInstMovsx_NameIndex = 1970, - kInstMovsxd_NameIndex = 1976, - kInstMovupd_NameIndex = 1983, - kInstMovups_NameIndex = 1990, - kInstMovzx_NameIndex = 1997, - kInstMpsadbw_NameIndex = 2003, - kInstMul_NameIndex = 2011, - kInstMulpd_NameIndex = 2015, - kInstMulps_NameIndex = 2021, - kInstMulsd_NameIndex = 2027, - kInstMulss_NameIndex = 2033, - kInstMulx_NameIndex = 2039, - kInstMwait_NameIndex = 2044, - kInstNeg_NameIndex = 2050, - kInstNop_NameIndex = 2054, - kInstNot_NameIndex = 2058, - kInstOr_NameIndex = 2062, - kInstOrpd_NameIndex = 2065, - kInstOrps_NameIndex = 2070, - kInstPabsb_NameIndex = 2075, - kInstPabsd_NameIndex = 2081, - kInstPabsw_NameIndex = 2087, - kInstPackssdw_NameIndex = 2093, - kInstPacksswb_NameIndex = 2102, - kInstPackusdw_NameIndex = 2111, - kInstPackuswb_NameIndex = 2120, - kInstPaddb_NameIndex = 2129, - kInstPaddd_NameIndex = 2135, - kInstPaddq_NameIndex = 2141, - kInstPaddsb_NameIndex = 2147, - kInstPaddsw_NameIndex = 2154, - kInstPaddusb_NameIndex = 2161, - kInstPaddusw_NameIndex = 2169, - kInstPaddw_NameIndex = 2177, - kInstPalignr_NameIndex = 2183, - kInstPand_NameIndex = 2191, - kInstPandn_NameIndex = 2196, - kInstPause_NameIndex = 2202, - kInstPavgb_NameIndex = 2208, - kInstPavgw_NameIndex = 2214, - kInstPblendvb_NameIndex = 2220, - kInstPblendw_NameIndex = 2229, - kInstPclmulqdq_NameIndex = 2237, - kInstPcmpeqb_NameIndex = 2247, - kInstPcmpeqd_NameIndex = 2255, - kInstPcmpeqq_NameIndex = 2263, - kInstPcmpeqw_NameIndex = 2271, - kInstPcmpestri_NameIndex = 2279, - kInstPcmpestrm_NameIndex = 2289, - kInstPcmpgtb_NameIndex = 2299, - kInstPcmpgtd_NameIndex = 2307, - kInstPcmpgtq_NameIndex = 2315, - kInstPcmpgtw_NameIndex = 2323, - kInstPcmpistri_NameIndex = 2331, - kInstPcmpistrm_NameIndex = 2341, - kInstPdep_NameIndex = 2351, - kInstPext_NameIndex = 2356, - kInstPextrb_NameIndex = 2361, - kInstPextrd_NameIndex = 2368, - kInstPextrq_NameIndex = 2375, - kInstPextrw_NameIndex = 2382, - kInstPf2id_NameIndex = 2389, - kInstPf2iw_NameIndex = 2395, - kInstPfacc_NameIndex = 2401, - kInstPfadd_NameIndex = 2407, - kInstPfcmpeq_NameIndex = 2413, - kInstPfcmpge_NameIndex = 2421, - kInstPfcmpgt_NameIndex = 2429, - kInstPfmax_NameIndex = 2437, - kInstPfmin_NameIndex = 2443, - kInstPfmul_NameIndex = 2449, - kInstPfnacc_NameIndex = 2455, - kInstPfpnacc_NameIndex = 2462, - kInstPfrcp_NameIndex = 2470, - kInstPfrcpit1_NameIndex = 2476, - kInstPfrcpit2_NameIndex = 2485, - kInstPfrsqit1_NameIndex = 2494, - kInstPfrsqrt_NameIndex = 2503, - kInstPfsub_NameIndex = 2511, - kInstPfsubr_NameIndex = 2517, - kInstPhaddd_NameIndex = 2524, - kInstPhaddsw_NameIndex = 2531, - kInstPhaddw_NameIndex = 2539, - kInstPhminposuw_NameIndex = 2546, - kInstPhsubd_NameIndex = 2557, - kInstPhsubsw_NameIndex = 2564, - kInstPhsubw_NameIndex = 2572, - kInstPi2fd_NameIndex = 2579, - kInstPi2fw_NameIndex = 2585, - kInstPinsrb_NameIndex = 2591, - kInstPinsrd_NameIndex = 2598, - kInstPinsrq_NameIndex = 2605, - kInstPinsrw_NameIndex = 2612, - kInstPmaddubsw_NameIndex = 2619, - kInstPmaddwd_NameIndex = 2629, - kInstPmaxsb_NameIndex = 2637, - kInstPmaxsd_NameIndex = 2644, - kInstPmaxsw_NameIndex = 2651, - kInstPmaxub_NameIndex = 2658, - kInstPmaxud_NameIndex = 2665, - kInstPmaxuw_NameIndex = 2672, - kInstPminsb_NameIndex = 2679, - kInstPminsd_NameIndex = 2686, - kInstPminsw_NameIndex = 2693, - kInstPminub_NameIndex = 2700, - kInstPminud_NameIndex = 2707, - kInstPminuw_NameIndex = 2714, - kInstPmovmskb_NameIndex = 2721, - kInstPmovsxbd_NameIndex = 2730, - kInstPmovsxbq_NameIndex = 2739, - kInstPmovsxbw_NameIndex = 2748, - kInstPmovsxdq_NameIndex = 2757, - kInstPmovsxwd_NameIndex = 2766, - kInstPmovsxwq_NameIndex = 2775, - kInstPmovzxbd_NameIndex = 2784, - kInstPmovzxbq_NameIndex = 2793, - kInstPmovzxbw_NameIndex = 2802, - kInstPmovzxdq_NameIndex = 2811, - kInstPmovzxwd_NameIndex = 2820, - kInstPmovzxwq_NameIndex = 2829, - kInstPmuldq_NameIndex = 2838, - kInstPmulhrsw_NameIndex = 2845, - kInstPmulhuw_NameIndex = 2854, - kInstPmulhw_NameIndex = 2862, - kInstPmulld_NameIndex = 2869, - kInstPmullw_NameIndex = 2876, - kInstPmuludq_NameIndex = 2883, - kInstPop_NameIndex = 2891, - kInstPopa_NameIndex = 2895, - kInstPopcnt_NameIndex = 2900, - kInstPopf_NameIndex = 2907, - kInstPor_NameIndex = 2912, - kInstPrefetch_NameIndex = 2916, - kInstPrefetch3dNow_NameIndex = 2925, - kInstPrefetchw3dNow_NameIndex = 2940, - kInstPsadbw_NameIndex = 2956, - kInstPshufb_NameIndex = 2963, - kInstPshufd_NameIndex = 2970, - kInstPshufhw_NameIndex = 2977, - kInstPshuflw_NameIndex = 2985, - kInstPshufw_NameIndex = 2993, - kInstPsignb_NameIndex = 3000, - kInstPsignd_NameIndex = 3007, - kInstPsignw_NameIndex = 3014, - kInstPslld_NameIndex = 3021, - kInstPslldq_NameIndex = 3027, - kInstPsllq_NameIndex = 3034, - kInstPsllw_NameIndex = 3040, - kInstPsrad_NameIndex = 3046, - kInstPsraw_NameIndex = 3052, - kInstPsrld_NameIndex = 3058, - kInstPsrldq_NameIndex = 3064, - kInstPsrlq_NameIndex = 3071, - kInstPsrlw_NameIndex = 3077, - kInstPsubb_NameIndex = 3083, - kInstPsubd_NameIndex = 3089, - kInstPsubq_NameIndex = 3095, - kInstPsubsb_NameIndex = 3101, - kInstPsubsw_NameIndex = 3108, - kInstPsubusb_NameIndex = 3115, - kInstPsubusw_NameIndex = 3123, - kInstPsubw_NameIndex = 3131, - kInstPswapd_NameIndex = 3137, - kInstPtest_NameIndex = 3144, - kInstPunpckhbw_NameIndex = 3150, - kInstPunpckhdq_NameIndex = 3160, - kInstPunpckhqdq_NameIndex = 3170, - kInstPunpckhwd_NameIndex = 3181, - kInstPunpcklbw_NameIndex = 3191, - kInstPunpckldq_NameIndex = 3201, - kInstPunpcklqdq_NameIndex = 3211, - kInstPunpcklwd_NameIndex = 3222, - kInstPush_NameIndex = 3232, - kInstPusha_NameIndex = 3237, - kInstPushf_NameIndex = 3243, - kInstPxor_NameIndex = 3249, - kInstRcl_NameIndex = 3254, - kInstRcpps_NameIndex = 3258, - kInstRcpss_NameIndex = 3264, - kInstRcr_NameIndex = 3270, - kInstRdfsbase_NameIndex = 3274, - kInstRdgsbase_NameIndex = 3283, - kInstRdrand_NameIndex = 3292, - kInstRdtsc_NameIndex = 3299, - kInstRdtscp_NameIndex = 3305, - kInstRepLodsb_NameIndex = 3312, - kInstRepLodsd_NameIndex = 3322, - kInstRepLodsq_NameIndex = 3332, - kInstRepLodsw_NameIndex = 3342, - kInstRepMovsb_NameIndex = 3352, - kInstRepMovsd_NameIndex = 3362, - kInstRepMovsq_NameIndex = 3372, - kInstRepMovsw_NameIndex = 3382, - kInstRepStosb_NameIndex = 3392, - kInstRepStosd_NameIndex = 3402, - kInstRepStosq_NameIndex = 3412, - kInstRepStosw_NameIndex = 3422, - kInstRepeCmpsb_NameIndex = 3432, - kInstRepeCmpsd_NameIndex = 3443, - kInstRepeCmpsq_NameIndex = 3454, - kInstRepeCmpsw_NameIndex = 3465, - kInstRepeScasb_NameIndex = 3476, - kInstRepeScasd_NameIndex = 3487, - kInstRepeScasq_NameIndex = 3498, - kInstRepeScasw_NameIndex = 3509, - kInstRepneCmpsb_NameIndex = 3520, - kInstRepneCmpsd_NameIndex = 3532, - kInstRepneCmpsq_NameIndex = 3544, - kInstRepneCmpsw_NameIndex = 3556, - kInstRepneScasb_NameIndex = 3568, - kInstRepneScasd_NameIndex = 3580, - kInstRepneScasq_NameIndex = 3592, - kInstRepneScasw_NameIndex = 3604, - kInstRet_NameIndex = 3616, - kInstRol_NameIndex = 3620, - kInstRor_NameIndex = 3624, - kInstRorx_NameIndex = 3628, - kInstRoundpd_NameIndex = 3633, - kInstRoundps_NameIndex = 3641, - kInstRoundsd_NameIndex = 3649, - kInstRoundss_NameIndex = 3657, - kInstRsqrtps_NameIndex = 3665, - kInstRsqrtss_NameIndex = 3673, - kInstSahf_NameIndex = 3681, - kInstSal_NameIndex = 3686, - kInstSar_NameIndex = 3690, - kInstSarx_NameIndex = 3694, - kInstSbb_NameIndex = 3699, - kInstSeta_NameIndex = 3703, - kInstSetae_NameIndex = 3708, - kInstSetb_NameIndex = 3714, - kInstSetbe_NameIndex = 3719, - kInstSetc_NameIndex = 3725, - kInstSete_NameIndex = 3730, - kInstSetg_NameIndex = 3735, - kInstSetge_NameIndex = 3740, - kInstSetl_NameIndex = 3746, - kInstSetle_NameIndex = 3751, - kInstSetna_NameIndex = 3757, - kInstSetnae_NameIndex = 3763, - kInstSetnb_NameIndex = 3770, - kInstSetnbe_NameIndex = 3776, - kInstSetnc_NameIndex = 3783, - kInstSetne_NameIndex = 3789, - kInstSetng_NameIndex = 3795, - kInstSetnge_NameIndex = 3801, - kInstSetnl_NameIndex = 3808, - kInstSetnle_NameIndex = 3814, - kInstSetno_NameIndex = 3821, - kInstSetnp_NameIndex = 3827, - kInstSetns_NameIndex = 3833, - kInstSetnz_NameIndex = 3839, - kInstSeto_NameIndex = 3845, - kInstSetp_NameIndex = 3850, - kInstSetpe_NameIndex = 3855, - kInstSetpo_NameIndex = 3861, - kInstSets_NameIndex = 3867, - kInstSetz_NameIndex = 3872, - kInstSfence_NameIndex = 3877, - kInstShl_NameIndex = 3884, - kInstShld_NameIndex = 3888, - kInstShlx_NameIndex = 3893, - kInstShr_NameIndex = 3898, - kInstShrd_NameIndex = 3902, - kInstShrx_NameIndex = 3907, - kInstShufpd_NameIndex = 3912, - kInstShufps_NameIndex = 3919, - kInstSqrtpd_NameIndex = 3926, - kInstSqrtps_NameIndex = 3933, - kInstSqrtsd_NameIndex = 3940, - kInstSqrtss_NameIndex = 3947, - kInstStc_NameIndex = 3954, - kInstStd_NameIndex = 3958, - kInstStmxcsr_NameIndex = 3962, - kInstSub_NameIndex = 3970, - kInstSubpd_NameIndex = 3974, - kInstSubps_NameIndex = 3980, - kInstSubsd_NameIndex = 3986, - kInstSubss_NameIndex = 3992, - kInstTest_NameIndex = 3998, - kInstTzcnt_NameIndex = 4003, - kInstUcomisd_NameIndex = 4009, - kInstUcomiss_NameIndex = 4017, - kInstUd2_NameIndex = 4025, - kInstUnpckhpd_NameIndex = 4029, - kInstUnpckhps_NameIndex = 4038, - kInstUnpcklpd_NameIndex = 4047, - kInstUnpcklps_NameIndex = 4056, - kInstVaddpd_NameIndex = 4065, - kInstVaddps_NameIndex = 4072, - kInstVaddsd_NameIndex = 4079, - kInstVaddss_NameIndex = 4086, - kInstVaddsubpd_NameIndex = 4093, - kInstVaddsubps_NameIndex = 4103, - kInstVaesdec_NameIndex = 4113, - kInstVaesdeclast_NameIndex = 4121, - kInstVaesenc_NameIndex = 4133, - kInstVaesenclast_NameIndex = 4141, - kInstVaesimc_NameIndex = 4153, - kInstVaeskeygenassist_NameIndex = 4161, - kInstVandnpd_NameIndex = 4178, - kInstVandnps_NameIndex = 4186, - kInstVandpd_NameIndex = 4194, - kInstVandps_NameIndex = 4201, - kInstVblendpd_NameIndex = 4208, - kInstVblendps_NameIndex = 4217, - kInstVblendvpd_NameIndex = 4226, - kInstVblendvps_NameIndex = 4236, - kInstVbroadcastf128_NameIndex = 4246, - kInstVbroadcasti128_NameIndex = 4261, - kInstVbroadcastsd_NameIndex = 4276, - kInstVbroadcastss_NameIndex = 4289, - kInstVcmppd_NameIndex = 4302, - kInstVcmpps_NameIndex = 4309, - kInstVcmpsd_NameIndex = 4316, - kInstVcmpss_NameIndex = 4323, - kInstVcomisd_NameIndex = 4330, - kInstVcomiss_NameIndex = 4338, - kInstVcvtdq2pd_NameIndex = 4346, - kInstVcvtdq2ps_NameIndex = 4356, - kInstVcvtpd2dq_NameIndex = 4366, - kInstVcvtpd2ps_NameIndex = 4376, - kInstVcvtph2ps_NameIndex = 4386, - kInstVcvtps2dq_NameIndex = 4396, - kInstVcvtps2pd_NameIndex = 4406, - kInstVcvtps2ph_NameIndex = 4416, - kInstVcvtsd2si_NameIndex = 4426, - kInstVcvtsd2ss_NameIndex = 4436, - kInstVcvtsi2sd_NameIndex = 4446, - kInstVcvtsi2ss_NameIndex = 4456, - kInstVcvtss2sd_NameIndex = 4466, - kInstVcvtss2si_NameIndex = 4476, - kInstVcvttpd2dq_NameIndex = 4486, - kInstVcvttps2dq_NameIndex = 4497, - kInstVcvttsd2si_NameIndex = 4508, - kInstVcvttss2si_NameIndex = 4519, - kInstVdivpd_NameIndex = 4530, - kInstVdivps_NameIndex = 4537, - kInstVdivsd_NameIndex = 4544, - kInstVdivss_NameIndex = 4551, - kInstVdppd_NameIndex = 4558, - kInstVdpps_NameIndex = 4564, - kInstVextractf128_NameIndex = 4570, - kInstVextracti128_NameIndex = 4583, - kInstVextractps_NameIndex = 4596, - kInstVfmadd132pd_NameIndex = 4607, - kInstVfmadd132ps_NameIndex = 4619, - kInstVfmadd132sd_NameIndex = 4631, - kInstVfmadd132ss_NameIndex = 4643, - kInstVfmadd213pd_NameIndex = 4655, - kInstVfmadd213ps_NameIndex = 4667, - kInstVfmadd213sd_NameIndex = 4679, - kInstVfmadd213ss_NameIndex = 4691, - kInstVfmadd231pd_NameIndex = 4703, - kInstVfmadd231ps_NameIndex = 4715, - kInstVfmadd231sd_NameIndex = 4727, - kInstVfmadd231ss_NameIndex = 4739, - kInstVfmaddpd_NameIndex = 4751, - kInstVfmaddps_NameIndex = 4760, - kInstVfmaddsd_NameIndex = 4769, - kInstVfmaddss_NameIndex = 4778, - kInstVfmaddsubpd_NameIndex = 4787, - kInstVfmaddsubps_NameIndex = 4799, - kInstVfmaddsub132pd_NameIndex = 4811, - kInstVfmaddsub132ps_NameIndex = 4826, - kInstVfmaddsub213pd_NameIndex = 4841, - kInstVfmaddsub213ps_NameIndex = 4856, - kInstVfmaddsub231pd_NameIndex = 4871, - kInstVfmaddsub231ps_NameIndex = 4886, - kInstVfmsub132pd_NameIndex = 4901, - kInstVfmsub132ps_NameIndex = 4913, - kInstVfmsub132sd_NameIndex = 4925, - kInstVfmsub132ss_NameIndex = 4937, - kInstVfmsub213pd_NameIndex = 4949, - kInstVfmsub213ps_NameIndex = 4961, - kInstVfmsub213sd_NameIndex = 4973, - kInstVfmsub213ss_NameIndex = 4985, - kInstVfmsub231pd_NameIndex = 4997, - kInstVfmsub231ps_NameIndex = 5009, - kInstVfmsub231sd_NameIndex = 5021, - kInstVfmsub231ss_NameIndex = 5033, - kInstVfmsubadd132pd_NameIndex = 5045, - kInstVfmsubadd132ps_NameIndex = 5060, - kInstVfmsubadd213pd_NameIndex = 5075, - kInstVfmsubadd213ps_NameIndex = 5090, - kInstVfmsubadd231pd_NameIndex = 5105, - kInstVfmsubadd231ps_NameIndex = 5120, - kInstVfmsubaddpd_NameIndex = 5135, - kInstVfmsubaddps_NameIndex = 5147, - kInstVfmsubpd_NameIndex = 5159, - kInstVfmsubps_NameIndex = 5168, - kInstVfmsubsd_NameIndex = 5177, - kInstVfmsubss_NameIndex = 5186, - kInstVfnmadd132pd_NameIndex = 5195, - kInstVfnmadd132ps_NameIndex = 5208, - kInstVfnmadd132sd_NameIndex = 5221, - kInstVfnmadd132ss_NameIndex = 5234, - kInstVfnmadd213pd_NameIndex = 5247, - kInstVfnmadd213ps_NameIndex = 5260, - kInstVfnmadd213sd_NameIndex = 5273, - kInstVfnmadd213ss_NameIndex = 5286, - kInstVfnmadd231pd_NameIndex = 5299, - kInstVfnmadd231ps_NameIndex = 5312, - kInstVfnmadd231sd_NameIndex = 5325, - kInstVfnmadd231ss_NameIndex = 5338, - kInstVfnmaddpd_NameIndex = 5351, - kInstVfnmaddps_NameIndex = 5361, - kInstVfnmaddsd_NameIndex = 5371, - kInstVfnmaddss_NameIndex = 5381, - kInstVfnmsub132pd_NameIndex = 5391, - kInstVfnmsub132ps_NameIndex = 5404, - kInstVfnmsub132sd_NameIndex = 5417, - kInstVfnmsub132ss_NameIndex = 5430, - kInstVfnmsub213pd_NameIndex = 5443, - kInstVfnmsub213ps_NameIndex = 5456, - kInstVfnmsub213sd_NameIndex = 5469, - kInstVfnmsub213ss_NameIndex = 5482, - kInstVfnmsub231pd_NameIndex = 5495, - kInstVfnmsub231ps_NameIndex = 5508, - kInstVfnmsub231sd_NameIndex = 5521, - kInstVfnmsub231ss_NameIndex = 5534, - kInstVfnmsubpd_NameIndex = 5547, - kInstVfnmsubps_NameIndex = 5557, - kInstVfnmsubsd_NameIndex = 5567, - kInstVfnmsubss_NameIndex = 5577, - kInstVfrczpd_NameIndex = 5587, - kInstVfrczps_NameIndex = 5595, - kInstVfrczsd_NameIndex = 5603, - kInstVfrczss_NameIndex = 5611, - kInstVgatherdpd_NameIndex = 5619, - kInstVgatherdps_NameIndex = 5630, - kInstVgatherqpd_NameIndex = 5641, - kInstVgatherqps_NameIndex = 5652, - kInstVhaddpd_NameIndex = 5663, - kInstVhaddps_NameIndex = 5671, - kInstVhsubpd_NameIndex = 5679, - kInstVhsubps_NameIndex = 5687, - kInstVinsertf128_NameIndex = 5695, - kInstVinserti128_NameIndex = 5707, - kInstVinsertps_NameIndex = 5719, - kInstVlddqu_NameIndex = 5729, - kInstVldmxcsr_NameIndex = 5736, - kInstVmaskmovdqu_NameIndex = 5745, - kInstVmaskmovpd_NameIndex = 5757, - kInstVmaskmovps_NameIndex = 5768, - kInstVmaxpd_NameIndex = 5779, - kInstVmaxps_NameIndex = 5786, - kInstVmaxsd_NameIndex = 5793, - kInstVmaxss_NameIndex = 5800, - kInstVminpd_NameIndex = 5807, - kInstVminps_NameIndex = 5814, - kInstVminsd_NameIndex = 5821, - kInstVminss_NameIndex = 5828, - kInstVmovapd_NameIndex = 5835, - kInstVmovaps_NameIndex = 5843, - kInstVmovd_NameIndex = 5851, - kInstVmovddup_NameIndex = 5857, - kInstVmovdqa_NameIndex = 5866, - kInstVmovdqu_NameIndex = 5874, - kInstVmovhlps_NameIndex = 5882, - kInstVmovhpd_NameIndex = 5891, - kInstVmovhps_NameIndex = 5899, - kInstVmovlhps_NameIndex = 5907, - kInstVmovlpd_NameIndex = 5916, - kInstVmovlps_NameIndex = 5924, - kInstVmovmskpd_NameIndex = 5932, - kInstVmovmskps_NameIndex = 5942, - kInstVmovntdq_NameIndex = 5952, - kInstVmovntdqa_NameIndex = 5961, - kInstVmovntpd_NameIndex = 5971, - kInstVmovntps_NameIndex = 5980, - kInstVmovq_NameIndex = 5989, - kInstVmovsd_NameIndex = 5995, - kInstVmovshdup_NameIndex = 6002, - kInstVmovsldup_NameIndex = 6012, - kInstVmovss_NameIndex = 6022, - kInstVmovupd_NameIndex = 6029, - kInstVmovups_NameIndex = 6037, - kInstVmpsadbw_NameIndex = 6045, - kInstVmulpd_NameIndex = 6054, - kInstVmulps_NameIndex = 6061, - kInstVmulsd_NameIndex = 6068, - kInstVmulss_NameIndex = 6075, - kInstVorpd_NameIndex = 6082, - kInstVorps_NameIndex = 6088, - kInstVpabsb_NameIndex = 6094, - kInstVpabsd_NameIndex = 6101, - kInstVpabsw_NameIndex = 6108, - kInstVpackssdw_NameIndex = 6115, - kInstVpacksswb_NameIndex = 6125, - kInstVpackusdw_NameIndex = 6135, - kInstVpackuswb_NameIndex = 6145, - kInstVpaddb_NameIndex = 6155, - kInstVpaddd_NameIndex = 6162, - kInstVpaddq_NameIndex = 6169, - kInstVpaddsb_NameIndex = 6176, - kInstVpaddsw_NameIndex = 6184, - kInstVpaddusb_NameIndex = 6192, - kInstVpaddusw_NameIndex = 6201, - kInstVpaddw_NameIndex = 6210, - kInstVpalignr_NameIndex = 6217, - kInstVpand_NameIndex = 6226, - kInstVpandn_NameIndex = 6232, - kInstVpavgb_NameIndex = 6239, - kInstVpavgw_NameIndex = 6246, - kInstVpblendd_NameIndex = 6253, - kInstVpblendvb_NameIndex = 6262, - kInstVpblendw_NameIndex = 6272, - kInstVpbroadcastb_NameIndex = 6281, - kInstVpbroadcastd_NameIndex = 6294, - kInstVpbroadcastq_NameIndex = 6307, - kInstVpbroadcastw_NameIndex = 6320, - kInstVpclmulqdq_NameIndex = 6333, - kInstVpcmov_NameIndex = 6344, - kInstVpcmpeqb_NameIndex = 6351, - kInstVpcmpeqd_NameIndex = 6360, - kInstVpcmpeqq_NameIndex = 6369, - kInstVpcmpeqw_NameIndex = 6378, - kInstVpcmpestri_NameIndex = 6387, - kInstVpcmpestrm_NameIndex = 6398, - kInstVpcmpgtb_NameIndex = 6409, - kInstVpcmpgtd_NameIndex = 6418, - kInstVpcmpgtq_NameIndex = 6427, - kInstVpcmpgtw_NameIndex = 6436, - kInstVpcmpistri_NameIndex = 6445, - kInstVpcmpistrm_NameIndex = 6456, - kInstVpcomb_NameIndex = 6467, - kInstVpcomd_NameIndex = 6474, - kInstVpcomq_NameIndex = 6481, - kInstVpcomub_NameIndex = 6488, - kInstVpcomud_NameIndex = 6496, - kInstVpcomuq_NameIndex = 6504, - kInstVpcomuw_NameIndex = 6512, - kInstVpcomw_NameIndex = 6520, - kInstVperm2f128_NameIndex = 6527, - kInstVperm2i128_NameIndex = 6538, - kInstVpermd_NameIndex = 6549, - kInstVpermil2pd_NameIndex = 6556, - kInstVpermil2ps_NameIndex = 6567, - kInstVpermilpd_NameIndex = 6578, - kInstVpermilps_NameIndex = 6588, - kInstVpermpd_NameIndex = 6598, - kInstVpermps_NameIndex = 6606, - kInstVpermq_NameIndex = 6614, - kInstVpextrb_NameIndex = 6621, - kInstVpextrd_NameIndex = 6629, - kInstVpextrq_NameIndex = 6637, - kInstVpextrw_NameIndex = 6645, - kInstVpgatherdd_NameIndex = 6653, - kInstVpgatherdq_NameIndex = 6664, - kInstVpgatherqd_NameIndex = 6675, - kInstVpgatherqq_NameIndex = 6686, - kInstVphaddbd_NameIndex = 6697, - kInstVphaddbq_NameIndex = 6706, - kInstVphaddbw_NameIndex = 6715, - kInstVphaddd_NameIndex = 6724, - kInstVphadddq_NameIndex = 6732, - kInstVphaddsw_NameIndex = 6741, - kInstVphaddubd_NameIndex = 6750, - kInstVphaddubq_NameIndex = 6760, - kInstVphaddubw_NameIndex = 6770, - kInstVphaddudq_NameIndex = 6780, - kInstVphadduwd_NameIndex = 6790, - kInstVphadduwq_NameIndex = 6800, - kInstVphaddw_NameIndex = 6810, - kInstVphaddwd_NameIndex = 6818, - kInstVphaddwq_NameIndex = 6827, - kInstVphminposuw_NameIndex = 6836, - kInstVphsubbw_NameIndex = 6848, - kInstVphsubdq_NameIndex = 6857, - kInstVphsubd_NameIndex = 6866, - kInstVphsubsw_NameIndex = 6874, - kInstVphsubw_NameIndex = 6883, - kInstVphsubwd_NameIndex = 6891, - kInstVpinsrb_NameIndex = 6900, - kInstVpinsrd_NameIndex = 6908, - kInstVpinsrq_NameIndex = 6916, - kInstVpinsrw_NameIndex = 6924, - kInstVpmacsdd_NameIndex = 6932, - kInstVpmacsdqh_NameIndex = 6941, - kInstVpmacsdql_NameIndex = 6951, - kInstVpmacssdd_NameIndex = 6961, - kInstVpmacssdqh_NameIndex = 6971, - kInstVpmacssdql_NameIndex = 6982, - kInstVpmacsswd_NameIndex = 6993, - kInstVpmacssww_NameIndex = 7003, - kInstVpmacswd_NameIndex = 7013, - kInstVpmacsww_NameIndex = 7022, - kInstVpmadcsswd_NameIndex = 7031, - kInstVpmadcswd_NameIndex = 7042, - kInstVpmaddubsw_NameIndex = 7052, - kInstVpmaddwd_NameIndex = 7063, - kInstVpmaskmovd_NameIndex = 7072, - kInstVpmaskmovq_NameIndex = 7083, - kInstVpmaxsb_NameIndex = 7094, - kInstVpmaxsd_NameIndex = 7102, - kInstVpmaxsw_NameIndex = 7110, - kInstVpmaxub_NameIndex = 7118, - kInstVpmaxud_NameIndex = 7126, - kInstVpmaxuw_NameIndex = 7134, - kInstVpminsb_NameIndex = 7142, - kInstVpminsd_NameIndex = 7150, - kInstVpminsw_NameIndex = 7158, - kInstVpminub_NameIndex = 7166, - kInstVpminud_NameIndex = 7174, - kInstVpminuw_NameIndex = 7182, - kInstVpmovmskb_NameIndex = 7190, - kInstVpmovsxbd_NameIndex = 7200, - kInstVpmovsxbq_NameIndex = 7210, - kInstVpmovsxbw_NameIndex = 7220, - kInstVpmovsxdq_NameIndex = 7230, - kInstVpmovsxwd_NameIndex = 7240, - kInstVpmovsxwq_NameIndex = 7250, - kInstVpmovzxbd_NameIndex = 7260, - kInstVpmovzxbq_NameIndex = 7270, - kInstVpmovzxbw_NameIndex = 7280, - kInstVpmovzxdq_NameIndex = 7290, - kInstVpmovzxwd_NameIndex = 7300, - kInstVpmovzxwq_NameIndex = 7310, - kInstVpmuldq_NameIndex = 7320, - kInstVpmulhrsw_NameIndex = 7328, - kInstVpmulhuw_NameIndex = 7338, - kInstVpmulhw_NameIndex = 7347, - kInstVpmulld_NameIndex = 7355, - kInstVpmullw_NameIndex = 7363, - kInstVpmuludq_NameIndex = 7371, - kInstVpor_NameIndex = 7380, - kInstVpperm_NameIndex = 7385, - kInstVprotb_NameIndex = 7392, - kInstVprotd_NameIndex = 7399, - kInstVprotq_NameIndex = 7406, - kInstVprotw_NameIndex = 7413, - kInstVpsadbw_NameIndex = 7420, - kInstVpshab_NameIndex = 7428, - kInstVpshad_NameIndex = 7435, - kInstVpshaq_NameIndex = 7442, - kInstVpshaw_NameIndex = 7449, - kInstVpshlb_NameIndex = 7456, - kInstVpshld_NameIndex = 7463, - kInstVpshlq_NameIndex = 7470, - kInstVpshlw_NameIndex = 7477, - kInstVpshufb_NameIndex = 7484, - kInstVpshufd_NameIndex = 7492, - kInstVpshufhw_NameIndex = 7500, - kInstVpshuflw_NameIndex = 7509, - kInstVpsignb_NameIndex = 7518, - kInstVpsignd_NameIndex = 7526, - kInstVpsignw_NameIndex = 7534, - kInstVpslld_NameIndex = 7542, - kInstVpslldq_NameIndex = 7549, - kInstVpsllq_NameIndex = 7557, - kInstVpsllvd_NameIndex = 7564, - kInstVpsllvq_NameIndex = 7572, - kInstVpsllw_NameIndex = 7580, - kInstVpsrad_NameIndex = 7587, - kInstVpsravd_NameIndex = 7594, - kInstVpsraw_NameIndex = 7602, - kInstVpsrld_NameIndex = 7609, - kInstVpsrldq_NameIndex = 7616, - kInstVpsrlq_NameIndex = 7624, - kInstVpsrlvd_NameIndex = 7631, - kInstVpsrlvq_NameIndex = 7639, - kInstVpsrlw_NameIndex = 7647, - kInstVpsubb_NameIndex = 7654, - kInstVpsubd_NameIndex = 7661, - kInstVpsubq_NameIndex = 7668, - kInstVpsubsb_NameIndex = 7675, - kInstVpsubsw_NameIndex = 7683, - kInstVpsubusb_NameIndex = 7691, - kInstVpsubusw_NameIndex = 7700, - kInstVpsubw_NameIndex = 7709, - kInstVptest_NameIndex = 7716, - kInstVpunpckhbw_NameIndex = 7723, - kInstVpunpckhdq_NameIndex = 7734, - kInstVpunpckhqdq_NameIndex = 7745, - kInstVpunpckhwd_NameIndex = 7757, - kInstVpunpcklbw_NameIndex = 7768, - kInstVpunpckldq_NameIndex = 7779, - kInstVpunpcklqdq_NameIndex = 7790, - kInstVpunpcklwd_NameIndex = 7802, - kInstVpxor_NameIndex = 7813, - kInstVrcpps_NameIndex = 7819, - kInstVrcpss_NameIndex = 7826, - kInstVroundpd_NameIndex = 7833, - kInstVroundps_NameIndex = 7842, - kInstVroundsd_NameIndex = 7851, - kInstVroundss_NameIndex = 7860, - kInstVrsqrtps_NameIndex = 7869, - kInstVrsqrtss_NameIndex = 7878, - kInstVshufpd_NameIndex = 7887, - kInstVshufps_NameIndex = 7895, - kInstVsqrtpd_NameIndex = 7903, - kInstVsqrtps_NameIndex = 7911, - kInstVsqrtsd_NameIndex = 7919, - kInstVsqrtss_NameIndex = 7927, - kInstVstmxcsr_NameIndex = 7935, - kInstVsubpd_NameIndex = 7944, - kInstVsubps_NameIndex = 7951, - kInstVsubsd_NameIndex = 7958, - kInstVsubss_NameIndex = 7965, - kInstVtestpd_NameIndex = 7972, - kInstVtestps_NameIndex = 7980, - kInstVucomisd_NameIndex = 7988, - kInstVucomiss_NameIndex = 7997, - kInstVunpckhpd_NameIndex = 8006, - kInstVunpckhps_NameIndex = 8016, - kInstVunpcklpd_NameIndex = 8026, - kInstVunpcklps_NameIndex = 8036, - kInstVxorpd_NameIndex = 8046, - kInstVxorps_NameIndex = 8053, - kInstVzeroall_NameIndex = 8060, - kInstVzeroupper_NameIndex = 8069, - kInstWrfsbase_NameIndex = 8080, - kInstWrgsbase_NameIndex = 8089, - kInstXadd_NameIndex = 8098, - kInstXchg_NameIndex = 8103, - kInstXor_NameIndex = 8108, - kInstXorpd_NameIndex = 8112, - kInstXorps_NameIndex = 8118 + kInstInsertps_NameIndex = 1504, + kInstInt_NameIndex = 1513, + kInstJa_NameIndex = 1517, + kInstJae_NameIndex = 1520, + kInstJb_NameIndex = 1524, + kInstJbe_NameIndex = 1527, + kInstJc_NameIndex = 1531, + kInstJe_NameIndex = 1534, + kInstJg_NameIndex = 1537, + kInstJge_NameIndex = 1540, + kInstJl_NameIndex = 1544, + kInstJle_NameIndex = 1547, + kInstJna_NameIndex = 1551, + kInstJnae_NameIndex = 1555, + kInstJnb_NameIndex = 1560, + kInstJnbe_NameIndex = 1564, + kInstJnc_NameIndex = 1569, + kInstJne_NameIndex = 1573, + kInstJng_NameIndex = 1577, + kInstJnge_NameIndex = 1581, + kInstJnl_NameIndex = 1586, + kInstJnle_NameIndex = 1590, + kInstJno_NameIndex = 1595, + kInstJnp_NameIndex = 1599, + kInstJns_NameIndex = 1603, + kInstJnz_NameIndex = 1607, + kInstJo_NameIndex = 1611, + kInstJp_NameIndex = 1614, + kInstJpe_NameIndex = 1617, + kInstJpo_NameIndex = 1621, + kInstJs_NameIndex = 1625, + kInstJz_NameIndex = 1628, + kInstJmp_NameIndex = 1631, + kInstLahf_NameIndex = 1635, + kInstLddqu_NameIndex = 1640, + kInstLdmxcsr_NameIndex = 1646, + kInstLea_NameIndex = 1654, + kInstLeave_NameIndex = 1658, + kInstLfence_NameIndex = 1664, + kInstLzcnt_NameIndex = 1671, + kInstMaskmovdqu_NameIndex = 1677, + kInstMaskmovq_NameIndex = 1688, + kInstMaxpd_NameIndex = 1697, + kInstMaxps_NameIndex = 1703, + kInstMaxsd_NameIndex = 1709, + kInstMaxss_NameIndex = 1715, + kInstMfence_NameIndex = 1721, + kInstMinpd_NameIndex = 1728, + kInstMinps_NameIndex = 1734, + kInstMinsd_NameIndex = 1740, + kInstMinss_NameIndex = 1746, + kInstMonitor_NameIndex = 1752, + kInstMov_NameIndex = 1760, + kInstMovapd_NameIndex = 1764, + kInstMovaps_NameIndex = 1771, + kInstMovbe_NameIndex = 1778, + kInstMovd_NameIndex = 1784, + kInstMovddup_NameIndex = 1789, + kInstMovdq2q_NameIndex = 1797, + kInstMovdqa_NameIndex = 1805, + kInstMovdqu_NameIndex = 1812, + kInstMovhlps_NameIndex = 1819, + kInstMovhpd_NameIndex = 1827, + kInstMovhps_NameIndex = 1834, + kInstMovlhps_NameIndex = 1841, + kInstMovlpd_NameIndex = 1849, + kInstMovlps_NameIndex = 1856, + kInstMovmskpd_NameIndex = 1863, + kInstMovmskps_NameIndex = 1872, + kInstMovntdq_NameIndex = 1881, + kInstMovntdqa_NameIndex = 1889, + kInstMovnti_NameIndex = 1898, + kInstMovntpd_NameIndex = 1905, + kInstMovntps_NameIndex = 1913, + kInstMovntq_NameIndex = 1921, + kInstMovptr_NameIndex = 1928, + kInstMovq_NameIndex = 1936, + kInstMovq2dq_NameIndex = 1941, + kInstMovsd_NameIndex = 1949, + kInstMovshdup_NameIndex = 1955, + kInstMovsldup_NameIndex = 1964, + kInstMovss_NameIndex = 1973, + kInstMovsx_NameIndex = 1979, + kInstMovsxd_NameIndex = 1985, + kInstMovupd_NameIndex = 1992, + kInstMovups_NameIndex = 1999, + kInstMovzx_NameIndex = 2006, + kInstMpsadbw_NameIndex = 2012, + kInstMul_NameIndex = 2020, + kInstMulpd_NameIndex = 2024, + kInstMulps_NameIndex = 2030, + kInstMulsd_NameIndex = 2036, + kInstMulss_NameIndex = 2042, + kInstMulx_NameIndex = 2048, + kInstMwait_NameIndex = 2053, + kInstNeg_NameIndex = 2059, + kInstNop_NameIndex = 2063, + kInstNot_NameIndex = 2067, + kInstOr_NameIndex = 2071, + kInstOrpd_NameIndex = 2074, + kInstOrps_NameIndex = 2079, + kInstPabsb_NameIndex = 2084, + kInstPabsd_NameIndex = 2090, + kInstPabsw_NameIndex = 2096, + kInstPackssdw_NameIndex = 2102, + kInstPacksswb_NameIndex = 2111, + kInstPackusdw_NameIndex = 2120, + kInstPackuswb_NameIndex = 2129, + kInstPaddb_NameIndex = 2138, + kInstPaddd_NameIndex = 2144, + kInstPaddq_NameIndex = 2150, + kInstPaddsb_NameIndex = 2156, + kInstPaddsw_NameIndex = 2163, + kInstPaddusb_NameIndex = 2170, + kInstPaddusw_NameIndex = 2178, + kInstPaddw_NameIndex = 2186, + kInstPalignr_NameIndex = 2192, + kInstPand_NameIndex = 2200, + kInstPandn_NameIndex = 2205, + kInstPause_NameIndex = 2211, + kInstPavgb_NameIndex = 2217, + kInstPavgw_NameIndex = 2223, + kInstPblendvb_NameIndex = 2229, + kInstPblendw_NameIndex = 2238, + kInstPclmulqdq_NameIndex = 2246, + kInstPcmpeqb_NameIndex = 2256, + kInstPcmpeqd_NameIndex = 2264, + kInstPcmpeqq_NameIndex = 2272, + kInstPcmpeqw_NameIndex = 2280, + kInstPcmpestri_NameIndex = 2288, + kInstPcmpestrm_NameIndex = 2298, + kInstPcmpgtb_NameIndex = 2308, + kInstPcmpgtd_NameIndex = 2316, + kInstPcmpgtq_NameIndex = 2324, + kInstPcmpgtw_NameIndex = 2332, + kInstPcmpistri_NameIndex = 2340, + kInstPcmpistrm_NameIndex = 2350, + kInstPdep_NameIndex = 2360, + kInstPext_NameIndex = 2365, + kInstPextrb_NameIndex = 2370, + kInstPextrd_NameIndex = 2377, + kInstPextrq_NameIndex = 2384, + kInstPextrw_NameIndex = 2391, + kInstPf2id_NameIndex = 2398, + kInstPf2iw_NameIndex = 2404, + kInstPfacc_NameIndex = 2410, + kInstPfadd_NameIndex = 2416, + kInstPfcmpeq_NameIndex = 2422, + kInstPfcmpge_NameIndex = 2430, + kInstPfcmpgt_NameIndex = 2438, + kInstPfmax_NameIndex = 2446, + kInstPfmin_NameIndex = 2452, + kInstPfmul_NameIndex = 2458, + kInstPfnacc_NameIndex = 2464, + kInstPfpnacc_NameIndex = 2471, + kInstPfrcp_NameIndex = 2479, + kInstPfrcpit1_NameIndex = 2485, + kInstPfrcpit2_NameIndex = 2494, + kInstPfrsqit1_NameIndex = 2503, + kInstPfrsqrt_NameIndex = 2512, + kInstPfsub_NameIndex = 2520, + kInstPfsubr_NameIndex = 2526, + kInstPhaddd_NameIndex = 2533, + kInstPhaddsw_NameIndex = 2540, + kInstPhaddw_NameIndex = 2548, + kInstPhminposuw_NameIndex = 2555, + kInstPhsubd_NameIndex = 2566, + kInstPhsubsw_NameIndex = 2573, + kInstPhsubw_NameIndex = 2581, + kInstPi2fd_NameIndex = 2588, + kInstPi2fw_NameIndex = 2594, + kInstPinsrb_NameIndex = 2600, + kInstPinsrd_NameIndex = 2607, + kInstPinsrq_NameIndex = 2614, + kInstPinsrw_NameIndex = 2621, + kInstPmaddubsw_NameIndex = 2628, + kInstPmaddwd_NameIndex = 2638, + kInstPmaxsb_NameIndex = 2646, + kInstPmaxsd_NameIndex = 2653, + kInstPmaxsw_NameIndex = 2660, + kInstPmaxub_NameIndex = 2667, + kInstPmaxud_NameIndex = 2674, + kInstPmaxuw_NameIndex = 2681, + kInstPminsb_NameIndex = 2688, + kInstPminsd_NameIndex = 2695, + kInstPminsw_NameIndex = 2702, + kInstPminub_NameIndex = 2709, + kInstPminud_NameIndex = 2716, + kInstPminuw_NameIndex = 2723, + kInstPmovmskb_NameIndex = 2730, + kInstPmovsxbd_NameIndex = 2739, + kInstPmovsxbq_NameIndex = 2748, + kInstPmovsxbw_NameIndex = 2757, + kInstPmovsxdq_NameIndex = 2766, + kInstPmovsxwd_NameIndex = 2775, + kInstPmovsxwq_NameIndex = 2784, + kInstPmovzxbd_NameIndex = 2793, + kInstPmovzxbq_NameIndex = 2802, + kInstPmovzxbw_NameIndex = 2811, + kInstPmovzxdq_NameIndex = 2820, + kInstPmovzxwd_NameIndex = 2829, + kInstPmovzxwq_NameIndex = 2838, + kInstPmuldq_NameIndex = 2847, + kInstPmulhrsw_NameIndex = 2854, + kInstPmulhuw_NameIndex = 2863, + kInstPmulhw_NameIndex = 2871, + kInstPmulld_NameIndex = 2878, + kInstPmullw_NameIndex = 2885, + kInstPmuludq_NameIndex = 2892, + kInstPop_NameIndex = 2900, + kInstPopa_NameIndex = 2904, + kInstPopcnt_NameIndex = 2909, + kInstPopf_NameIndex = 2916, + kInstPor_NameIndex = 2921, + kInstPrefetch_NameIndex = 2925, + kInstPrefetch3dNow_NameIndex = 2934, + kInstPrefetchw3dNow_NameIndex = 2949, + kInstPsadbw_NameIndex = 2965, + kInstPshufb_NameIndex = 2972, + kInstPshufd_NameIndex = 2979, + kInstPshufhw_NameIndex = 2986, + kInstPshuflw_NameIndex = 2994, + kInstPshufw_NameIndex = 3002, + kInstPsignb_NameIndex = 3009, + kInstPsignd_NameIndex = 3016, + kInstPsignw_NameIndex = 3023, + kInstPslld_NameIndex = 3030, + kInstPslldq_NameIndex = 3036, + kInstPsllq_NameIndex = 3043, + kInstPsllw_NameIndex = 3049, + kInstPsrad_NameIndex = 3055, + kInstPsraw_NameIndex = 3061, + kInstPsrld_NameIndex = 3067, + kInstPsrldq_NameIndex = 3073, + kInstPsrlq_NameIndex = 3080, + kInstPsrlw_NameIndex = 3086, + kInstPsubb_NameIndex = 3092, + kInstPsubd_NameIndex = 3098, + kInstPsubq_NameIndex = 3104, + kInstPsubsb_NameIndex = 3110, + kInstPsubsw_NameIndex = 3117, + kInstPsubusb_NameIndex = 3124, + kInstPsubusw_NameIndex = 3132, + kInstPsubw_NameIndex = 3140, + kInstPswapd_NameIndex = 3146, + kInstPtest_NameIndex = 3153, + kInstPunpckhbw_NameIndex = 3159, + kInstPunpckhdq_NameIndex = 3169, + kInstPunpckhqdq_NameIndex = 3179, + kInstPunpckhwd_NameIndex = 3190, + kInstPunpcklbw_NameIndex = 3200, + kInstPunpckldq_NameIndex = 3210, + kInstPunpcklqdq_NameIndex = 3220, + kInstPunpcklwd_NameIndex = 3231, + kInstPush_NameIndex = 3241, + kInstPusha_NameIndex = 3246, + kInstPushf_NameIndex = 3252, + kInstPxor_NameIndex = 3258, + kInstRcl_NameIndex = 3263, + kInstRcpps_NameIndex = 3267, + kInstRcpss_NameIndex = 3273, + kInstRcr_NameIndex = 3279, + kInstRdfsbase_NameIndex = 3283, + kInstRdgsbase_NameIndex = 3292, + kInstRdrand_NameIndex = 3301, + kInstRdtsc_NameIndex = 3308, + kInstRdtscp_NameIndex = 3314, + kInstRepLodsb_NameIndex = 3321, + kInstRepLodsd_NameIndex = 3331, + kInstRepLodsq_NameIndex = 3341, + kInstRepLodsw_NameIndex = 3351, + kInstRepMovsb_NameIndex = 3361, + kInstRepMovsd_NameIndex = 3371, + kInstRepMovsq_NameIndex = 3381, + kInstRepMovsw_NameIndex = 3391, + kInstRepStosb_NameIndex = 3401, + kInstRepStosd_NameIndex = 3411, + kInstRepStosq_NameIndex = 3421, + kInstRepStosw_NameIndex = 3431, + kInstRepeCmpsb_NameIndex = 3441, + kInstRepeCmpsd_NameIndex = 3452, + kInstRepeCmpsq_NameIndex = 3463, + kInstRepeCmpsw_NameIndex = 3474, + kInstRepeScasb_NameIndex = 3485, + kInstRepeScasd_NameIndex = 3496, + kInstRepeScasq_NameIndex = 3507, + kInstRepeScasw_NameIndex = 3518, + kInstRepneCmpsb_NameIndex = 3529, + kInstRepneCmpsd_NameIndex = 3541, + kInstRepneCmpsq_NameIndex = 3553, + kInstRepneCmpsw_NameIndex = 3565, + kInstRepneScasb_NameIndex = 3577, + kInstRepneScasd_NameIndex = 3589, + kInstRepneScasq_NameIndex = 3601, + kInstRepneScasw_NameIndex = 3613, + kInstRet_NameIndex = 3625, + kInstRol_NameIndex = 3629, + kInstRor_NameIndex = 3633, + kInstRorx_NameIndex = 3637, + kInstRoundpd_NameIndex = 3642, + kInstRoundps_NameIndex = 3650, + kInstRoundsd_NameIndex = 3658, + kInstRoundss_NameIndex = 3666, + kInstRsqrtps_NameIndex = 3674, + kInstRsqrtss_NameIndex = 3682, + kInstSahf_NameIndex = 3690, + kInstSal_NameIndex = 3695, + kInstSar_NameIndex = 3699, + kInstSarx_NameIndex = 3703, + kInstSbb_NameIndex = 3708, + kInstSeta_NameIndex = 3712, + kInstSetae_NameIndex = 3717, + kInstSetb_NameIndex = 3723, + kInstSetbe_NameIndex = 3728, + kInstSetc_NameIndex = 3734, + kInstSete_NameIndex = 3739, + kInstSetg_NameIndex = 3744, + kInstSetge_NameIndex = 3749, + kInstSetl_NameIndex = 3755, + kInstSetle_NameIndex = 3760, + kInstSetna_NameIndex = 3766, + kInstSetnae_NameIndex = 3772, + kInstSetnb_NameIndex = 3779, + kInstSetnbe_NameIndex = 3785, + kInstSetnc_NameIndex = 3792, + kInstSetne_NameIndex = 3798, + kInstSetng_NameIndex = 3804, + kInstSetnge_NameIndex = 3810, + kInstSetnl_NameIndex = 3817, + kInstSetnle_NameIndex = 3823, + kInstSetno_NameIndex = 3830, + kInstSetnp_NameIndex = 3836, + kInstSetns_NameIndex = 3842, + kInstSetnz_NameIndex = 3848, + kInstSeto_NameIndex = 3854, + kInstSetp_NameIndex = 3859, + kInstSetpe_NameIndex = 3864, + kInstSetpo_NameIndex = 3870, + kInstSets_NameIndex = 3876, + kInstSetz_NameIndex = 3881, + kInstSfence_NameIndex = 3886, + kInstShl_NameIndex = 3893, + kInstShld_NameIndex = 3897, + kInstShlx_NameIndex = 3902, + kInstShr_NameIndex = 3907, + kInstShrd_NameIndex = 3911, + kInstShrx_NameIndex = 3916, + kInstShufpd_NameIndex = 3921, + kInstShufps_NameIndex = 3928, + kInstSqrtpd_NameIndex = 3935, + kInstSqrtps_NameIndex = 3942, + kInstSqrtsd_NameIndex = 3949, + kInstSqrtss_NameIndex = 3956, + kInstStc_NameIndex = 3963, + kInstStd_NameIndex = 3967, + kInstStmxcsr_NameIndex = 3971, + kInstSub_NameIndex = 3979, + kInstSubpd_NameIndex = 3983, + kInstSubps_NameIndex = 3989, + kInstSubsd_NameIndex = 3995, + kInstSubss_NameIndex = 4001, + kInstTest_NameIndex = 4007, + kInstTzcnt_NameIndex = 4012, + kInstUcomisd_NameIndex = 4018, + kInstUcomiss_NameIndex = 4026, + kInstUd2_NameIndex = 4034, + kInstUnpckhpd_NameIndex = 4038, + kInstUnpckhps_NameIndex = 4047, + kInstUnpcklpd_NameIndex = 4056, + kInstUnpcklps_NameIndex = 4065, + kInstVaddpd_NameIndex = 4074, + kInstVaddps_NameIndex = 4081, + kInstVaddsd_NameIndex = 4088, + kInstVaddss_NameIndex = 4095, + kInstVaddsubpd_NameIndex = 4102, + kInstVaddsubps_NameIndex = 4112, + kInstVaesdec_NameIndex = 4122, + kInstVaesdeclast_NameIndex = 4130, + kInstVaesenc_NameIndex = 4142, + kInstVaesenclast_NameIndex = 4150, + kInstVaesimc_NameIndex = 4162, + kInstVaeskeygenassist_NameIndex = 4170, + kInstVandnpd_NameIndex = 4187, + kInstVandnps_NameIndex = 4195, + kInstVandpd_NameIndex = 4203, + kInstVandps_NameIndex = 4210, + kInstVblendpd_NameIndex = 4217, + kInstVblendps_NameIndex = 4226, + kInstVblendvpd_NameIndex = 4235, + kInstVblendvps_NameIndex = 4245, + kInstVbroadcastf128_NameIndex = 4255, + kInstVbroadcasti128_NameIndex = 4270, + kInstVbroadcastsd_NameIndex = 4285, + kInstVbroadcastss_NameIndex = 4298, + kInstVcmppd_NameIndex = 4311, + kInstVcmpps_NameIndex = 4318, + kInstVcmpsd_NameIndex = 4325, + kInstVcmpss_NameIndex = 4332, + kInstVcomisd_NameIndex = 4339, + kInstVcomiss_NameIndex = 4347, + kInstVcvtdq2pd_NameIndex = 4355, + kInstVcvtdq2ps_NameIndex = 4365, + kInstVcvtpd2dq_NameIndex = 4375, + kInstVcvtpd2ps_NameIndex = 4385, + kInstVcvtph2ps_NameIndex = 4395, + kInstVcvtps2dq_NameIndex = 4405, + kInstVcvtps2pd_NameIndex = 4415, + kInstVcvtps2ph_NameIndex = 4425, + kInstVcvtsd2si_NameIndex = 4435, + kInstVcvtsd2ss_NameIndex = 4445, + kInstVcvtsi2sd_NameIndex = 4455, + kInstVcvtsi2ss_NameIndex = 4465, + kInstVcvtss2sd_NameIndex = 4475, + kInstVcvtss2si_NameIndex = 4485, + kInstVcvttpd2dq_NameIndex = 4495, + kInstVcvttps2dq_NameIndex = 4506, + kInstVcvttsd2si_NameIndex = 4517, + kInstVcvttss2si_NameIndex = 4528, + kInstVdivpd_NameIndex = 4539, + kInstVdivps_NameIndex = 4546, + kInstVdivsd_NameIndex = 4553, + kInstVdivss_NameIndex = 4560, + kInstVdppd_NameIndex = 4567, + kInstVdpps_NameIndex = 4573, + kInstVextractf128_NameIndex = 4579, + kInstVextracti128_NameIndex = 4592, + kInstVextractps_NameIndex = 4605, + kInstVfmadd132pd_NameIndex = 4616, + kInstVfmadd132ps_NameIndex = 4628, + kInstVfmadd132sd_NameIndex = 4640, + kInstVfmadd132ss_NameIndex = 4652, + kInstVfmadd213pd_NameIndex = 4664, + kInstVfmadd213ps_NameIndex = 4676, + kInstVfmadd213sd_NameIndex = 4688, + kInstVfmadd213ss_NameIndex = 4700, + kInstVfmadd231pd_NameIndex = 4712, + kInstVfmadd231ps_NameIndex = 4724, + kInstVfmadd231sd_NameIndex = 4736, + kInstVfmadd231ss_NameIndex = 4748, + kInstVfmaddpd_NameIndex = 4760, + kInstVfmaddps_NameIndex = 4769, + kInstVfmaddsd_NameIndex = 4778, + kInstVfmaddss_NameIndex = 4787, + kInstVfmaddsubpd_NameIndex = 4796, + kInstVfmaddsubps_NameIndex = 4808, + kInstVfmaddsub132pd_NameIndex = 4820, + kInstVfmaddsub132ps_NameIndex = 4835, + kInstVfmaddsub213pd_NameIndex = 4850, + kInstVfmaddsub213ps_NameIndex = 4865, + kInstVfmaddsub231pd_NameIndex = 4880, + kInstVfmaddsub231ps_NameIndex = 4895, + kInstVfmsub132pd_NameIndex = 4910, + kInstVfmsub132ps_NameIndex = 4922, + kInstVfmsub132sd_NameIndex = 4934, + kInstVfmsub132ss_NameIndex = 4946, + kInstVfmsub213pd_NameIndex = 4958, + kInstVfmsub213ps_NameIndex = 4970, + kInstVfmsub213sd_NameIndex = 4982, + kInstVfmsub213ss_NameIndex = 4994, + kInstVfmsub231pd_NameIndex = 5006, + kInstVfmsub231ps_NameIndex = 5018, + kInstVfmsub231sd_NameIndex = 5030, + kInstVfmsub231ss_NameIndex = 5042, + kInstVfmsubadd132pd_NameIndex = 5054, + kInstVfmsubadd132ps_NameIndex = 5069, + kInstVfmsubadd213pd_NameIndex = 5084, + kInstVfmsubadd213ps_NameIndex = 5099, + kInstVfmsubadd231pd_NameIndex = 5114, + kInstVfmsubadd231ps_NameIndex = 5129, + kInstVfmsubaddpd_NameIndex = 5144, + kInstVfmsubaddps_NameIndex = 5156, + kInstVfmsubpd_NameIndex = 5168, + kInstVfmsubps_NameIndex = 5177, + kInstVfmsubsd_NameIndex = 5186, + kInstVfmsubss_NameIndex = 5195, + kInstVfnmadd132pd_NameIndex = 5204, + kInstVfnmadd132ps_NameIndex = 5217, + kInstVfnmadd132sd_NameIndex = 5230, + kInstVfnmadd132ss_NameIndex = 5243, + kInstVfnmadd213pd_NameIndex = 5256, + kInstVfnmadd213ps_NameIndex = 5269, + kInstVfnmadd213sd_NameIndex = 5282, + kInstVfnmadd213ss_NameIndex = 5295, + kInstVfnmadd231pd_NameIndex = 5308, + kInstVfnmadd231ps_NameIndex = 5321, + kInstVfnmadd231sd_NameIndex = 5334, + kInstVfnmadd231ss_NameIndex = 5347, + kInstVfnmaddpd_NameIndex = 5360, + kInstVfnmaddps_NameIndex = 5370, + kInstVfnmaddsd_NameIndex = 5380, + kInstVfnmaddss_NameIndex = 5390, + kInstVfnmsub132pd_NameIndex = 5400, + kInstVfnmsub132ps_NameIndex = 5413, + kInstVfnmsub132sd_NameIndex = 5426, + kInstVfnmsub132ss_NameIndex = 5439, + kInstVfnmsub213pd_NameIndex = 5452, + kInstVfnmsub213ps_NameIndex = 5465, + kInstVfnmsub213sd_NameIndex = 5478, + kInstVfnmsub213ss_NameIndex = 5491, + kInstVfnmsub231pd_NameIndex = 5504, + kInstVfnmsub231ps_NameIndex = 5517, + kInstVfnmsub231sd_NameIndex = 5530, + kInstVfnmsub231ss_NameIndex = 5543, + kInstVfnmsubpd_NameIndex = 5556, + kInstVfnmsubps_NameIndex = 5566, + kInstVfnmsubsd_NameIndex = 5576, + kInstVfnmsubss_NameIndex = 5586, + kInstVfrczpd_NameIndex = 5596, + kInstVfrczps_NameIndex = 5604, + kInstVfrczsd_NameIndex = 5612, + kInstVfrczss_NameIndex = 5620, + kInstVgatherdpd_NameIndex = 5628, + kInstVgatherdps_NameIndex = 5639, + kInstVgatherqpd_NameIndex = 5650, + kInstVgatherqps_NameIndex = 5661, + kInstVhaddpd_NameIndex = 5672, + kInstVhaddps_NameIndex = 5680, + kInstVhsubpd_NameIndex = 5688, + kInstVhsubps_NameIndex = 5696, + kInstVinsertf128_NameIndex = 5704, + kInstVinserti128_NameIndex = 5716, + kInstVinsertps_NameIndex = 5728, + kInstVlddqu_NameIndex = 5738, + kInstVldmxcsr_NameIndex = 5745, + kInstVmaskmovdqu_NameIndex = 5754, + kInstVmaskmovpd_NameIndex = 5766, + kInstVmaskmovps_NameIndex = 5777, + kInstVmaxpd_NameIndex = 5788, + kInstVmaxps_NameIndex = 5795, + kInstVmaxsd_NameIndex = 5802, + kInstVmaxss_NameIndex = 5809, + kInstVminpd_NameIndex = 5816, + kInstVminps_NameIndex = 5823, + kInstVminsd_NameIndex = 5830, + kInstVminss_NameIndex = 5837, + kInstVmovapd_NameIndex = 5844, + kInstVmovaps_NameIndex = 5852, + kInstVmovd_NameIndex = 5860, + kInstVmovddup_NameIndex = 5866, + kInstVmovdqa_NameIndex = 5875, + kInstVmovdqu_NameIndex = 5883, + kInstVmovhlps_NameIndex = 5891, + kInstVmovhpd_NameIndex = 5900, + kInstVmovhps_NameIndex = 5908, + kInstVmovlhps_NameIndex = 5916, + kInstVmovlpd_NameIndex = 5925, + kInstVmovlps_NameIndex = 5933, + kInstVmovmskpd_NameIndex = 5941, + kInstVmovmskps_NameIndex = 5951, + kInstVmovntdq_NameIndex = 5961, + kInstVmovntdqa_NameIndex = 5970, + kInstVmovntpd_NameIndex = 5980, + kInstVmovntps_NameIndex = 5989, + kInstVmovq_NameIndex = 5998, + kInstVmovsd_NameIndex = 6004, + kInstVmovshdup_NameIndex = 6011, + kInstVmovsldup_NameIndex = 6021, + kInstVmovss_NameIndex = 6031, + kInstVmovupd_NameIndex = 6038, + kInstVmovups_NameIndex = 6046, + kInstVmpsadbw_NameIndex = 6054, + kInstVmulpd_NameIndex = 6063, + kInstVmulps_NameIndex = 6070, + kInstVmulsd_NameIndex = 6077, + kInstVmulss_NameIndex = 6084, + kInstVorpd_NameIndex = 6091, + kInstVorps_NameIndex = 6097, + kInstVpabsb_NameIndex = 6103, + kInstVpabsd_NameIndex = 6110, + kInstVpabsw_NameIndex = 6117, + kInstVpackssdw_NameIndex = 6124, + kInstVpacksswb_NameIndex = 6134, + kInstVpackusdw_NameIndex = 6144, + kInstVpackuswb_NameIndex = 6154, + kInstVpaddb_NameIndex = 6164, + kInstVpaddd_NameIndex = 6171, + kInstVpaddq_NameIndex = 6178, + kInstVpaddsb_NameIndex = 6185, + kInstVpaddsw_NameIndex = 6193, + kInstVpaddusb_NameIndex = 6201, + kInstVpaddusw_NameIndex = 6210, + kInstVpaddw_NameIndex = 6219, + kInstVpalignr_NameIndex = 6226, + kInstVpand_NameIndex = 6235, + kInstVpandn_NameIndex = 6241, + kInstVpavgb_NameIndex = 6248, + kInstVpavgw_NameIndex = 6255, + kInstVpblendd_NameIndex = 6262, + kInstVpblendvb_NameIndex = 6271, + kInstVpblendw_NameIndex = 6281, + kInstVpbroadcastb_NameIndex = 6290, + kInstVpbroadcastd_NameIndex = 6303, + kInstVpbroadcastq_NameIndex = 6316, + kInstVpbroadcastw_NameIndex = 6329, + kInstVpclmulqdq_NameIndex = 6342, + kInstVpcmov_NameIndex = 6353, + kInstVpcmpeqb_NameIndex = 6360, + kInstVpcmpeqd_NameIndex = 6369, + kInstVpcmpeqq_NameIndex = 6378, + kInstVpcmpeqw_NameIndex = 6387, + kInstVpcmpestri_NameIndex = 6396, + kInstVpcmpestrm_NameIndex = 6407, + kInstVpcmpgtb_NameIndex = 6418, + kInstVpcmpgtd_NameIndex = 6427, + kInstVpcmpgtq_NameIndex = 6436, + kInstVpcmpgtw_NameIndex = 6445, + kInstVpcmpistri_NameIndex = 6454, + kInstVpcmpistrm_NameIndex = 6465, + kInstVpcomb_NameIndex = 6476, + kInstVpcomd_NameIndex = 6483, + kInstVpcomq_NameIndex = 6490, + kInstVpcomub_NameIndex = 6497, + kInstVpcomud_NameIndex = 6505, + kInstVpcomuq_NameIndex = 6513, + kInstVpcomuw_NameIndex = 6521, + kInstVpcomw_NameIndex = 6529, + kInstVperm2f128_NameIndex = 6536, + kInstVperm2i128_NameIndex = 6547, + kInstVpermd_NameIndex = 6558, + kInstVpermil2pd_NameIndex = 6565, + kInstVpermil2ps_NameIndex = 6576, + kInstVpermilpd_NameIndex = 6587, + kInstVpermilps_NameIndex = 6597, + kInstVpermpd_NameIndex = 6607, + kInstVpermps_NameIndex = 6615, + kInstVpermq_NameIndex = 6623, + kInstVpextrb_NameIndex = 6630, + kInstVpextrd_NameIndex = 6638, + kInstVpextrq_NameIndex = 6646, + kInstVpextrw_NameIndex = 6654, + kInstVpgatherdd_NameIndex = 6662, + kInstVpgatherdq_NameIndex = 6673, + kInstVpgatherqd_NameIndex = 6684, + kInstVpgatherqq_NameIndex = 6695, + kInstVphaddbd_NameIndex = 6706, + kInstVphaddbq_NameIndex = 6715, + kInstVphaddbw_NameIndex = 6724, + kInstVphaddd_NameIndex = 6733, + kInstVphadddq_NameIndex = 6741, + kInstVphaddsw_NameIndex = 6750, + kInstVphaddubd_NameIndex = 6759, + kInstVphaddubq_NameIndex = 6769, + kInstVphaddubw_NameIndex = 6779, + kInstVphaddudq_NameIndex = 6789, + kInstVphadduwd_NameIndex = 6799, + kInstVphadduwq_NameIndex = 6809, + kInstVphaddw_NameIndex = 6819, + kInstVphaddwd_NameIndex = 6827, + kInstVphaddwq_NameIndex = 6836, + kInstVphminposuw_NameIndex = 6845, + kInstVphsubbw_NameIndex = 6857, + kInstVphsubdq_NameIndex = 6866, + kInstVphsubd_NameIndex = 6875, + kInstVphsubsw_NameIndex = 6883, + kInstVphsubw_NameIndex = 6892, + kInstVphsubwd_NameIndex = 6900, + kInstVpinsrb_NameIndex = 6909, + kInstVpinsrd_NameIndex = 6917, + kInstVpinsrq_NameIndex = 6925, + kInstVpinsrw_NameIndex = 6933, + kInstVpmacsdd_NameIndex = 6941, + kInstVpmacsdqh_NameIndex = 6950, + kInstVpmacsdql_NameIndex = 6960, + kInstVpmacssdd_NameIndex = 6970, + kInstVpmacssdqh_NameIndex = 6980, + kInstVpmacssdql_NameIndex = 6991, + kInstVpmacsswd_NameIndex = 7002, + kInstVpmacssww_NameIndex = 7012, + kInstVpmacswd_NameIndex = 7022, + kInstVpmacsww_NameIndex = 7031, + kInstVpmadcsswd_NameIndex = 7040, + kInstVpmadcswd_NameIndex = 7051, + kInstVpmaddubsw_NameIndex = 7061, + kInstVpmaddwd_NameIndex = 7072, + kInstVpmaskmovd_NameIndex = 7081, + kInstVpmaskmovq_NameIndex = 7092, + kInstVpmaxsb_NameIndex = 7103, + kInstVpmaxsd_NameIndex = 7111, + kInstVpmaxsw_NameIndex = 7119, + kInstVpmaxub_NameIndex = 7127, + kInstVpmaxud_NameIndex = 7135, + kInstVpmaxuw_NameIndex = 7143, + kInstVpminsb_NameIndex = 7151, + kInstVpminsd_NameIndex = 7159, + kInstVpminsw_NameIndex = 7167, + kInstVpminub_NameIndex = 7175, + kInstVpminud_NameIndex = 7183, + kInstVpminuw_NameIndex = 7191, + kInstVpmovmskb_NameIndex = 7199, + kInstVpmovsxbd_NameIndex = 7209, + kInstVpmovsxbq_NameIndex = 7219, + kInstVpmovsxbw_NameIndex = 7229, + kInstVpmovsxdq_NameIndex = 7239, + kInstVpmovsxwd_NameIndex = 7249, + kInstVpmovsxwq_NameIndex = 7259, + kInstVpmovzxbd_NameIndex = 7269, + kInstVpmovzxbq_NameIndex = 7279, + kInstVpmovzxbw_NameIndex = 7289, + kInstVpmovzxdq_NameIndex = 7299, + kInstVpmovzxwd_NameIndex = 7309, + kInstVpmovzxwq_NameIndex = 7319, + kInstVpmuldq_NameIndex = 7329, + kInstVpmulhrsw_NameIndex = 7337, + kInstVpmulhuw_NameIndex = 7347, + kInstVpmulhw_NameIndex = 7356, + kInstVpmulld_NameIndex = 7364, + kInstVpmullw_NameIndex = 7372, + kInstVpmuludq_NameIndex = 7380, + kInstVpor_NameIndex = 7389, + kInstVpperm_NameIndex = 7394, + kInstVprotb_NameIndex = 7401, + kInstVprotd_NameIndex = 7408, + kInstVprotq_NameIndex = 7415, + kInstVprotw_NameIndex = 7422, + kInstVpsadbw_NameIndex = 7429, + kInstVpshab_NameIndex = 7437, + kInstVpshad_NameIndex = 7444, + kInstVpshaq_NameIndex = 7451, + kInstVpshaw_NameIndex = 7458, + kInstVpshlb_NameIndex = 7465, + kInstVpshld_NameIndex = 7472, + kInstVpshlq_NameIndex = 7479, + kInstVpshlw_NameIndex = 7486, + kInstVpshufb_NameIndex = 7493, + kInstVpshufd_NameIndex = 7501, + kInstVpshufhw_NameIndex = 7509, + kInstVpshuflw_NameIndex = 7518, + kInstVpsignb_NameIndex = 7527, + kInstVpsignd_NameIndex = 7535, + kInstVpsignw_NameIndex = 7543, + kInstVpslld_NameIndex = 7551, + kInstVpslldq_NameIndex = 7558, + kInstVpsllq_NameIndex = 7566, + kInstVpsllvd_NameIndex = 7573, + kInstVpsllvq_NameIndex = 7581, + kInstVpsllw_NameIndex = 7589, + kInstVpsrad_NameIndex = 7596, + kInstVpsravd_NameIndex = 7603, + kInstVpsraw_NameIndex = 7611, + kInstVpsrld_NameIndex = 7618, + kInstVpsrldq_NameIndex = 7625, + kInstVpsrlq_NameIndex = 7633, + kInstVpsrlvd_NameIndex = 7640, + kInstVpsrlvq_NameIndex = 7648, + kInstVpsrlw_NameIndex = 7656, + kInstVpsubb_NameIndex = 7663, + kInstVpsubd_NameIndex = 7670, + kInstVpsubq_NameIndex = 7677, + kInstVpsubsb_NameIndex = 7684, + kInstVpsubsw_NameIndex = 7692, + kInstVpsubusb_NameIndex = 7700, + kInstVpsubusw_NameIndex = 7709, + kInstVpsubw_NameIndex = 7718, + kInstVptest_NameIndex = 7725, + kInstVpunpckhbw_NameIndex = 7732, + kInstVpunpckhdq_NameIndex = 7743, + kInstVpunpckhqdq_NameIndex = 7754, + kInstVpunpckhwd_NameIndex = 7766, + kInstVpunpcklbw_NameIndex = 7777, + kInstVpunpckldq_NameIndex = 7788, + kInstVpunpcklqdq_NameIndex = 7799, + kInstVpunpcklwd_NameIndex = 7811, + kInstVpxor_NameIndex = 7822, + kInstVrcpps_NameIndex = 7828, + kInstVrcpss_NameIndex = 7835, + kInstVroundpd_NameIndex = 7842, + kInstVroundps_NameIndex = 7851, + kInstVroundsd_NameIndex = 7860, + kInstVroundss_NameIndex = 7869, + kInstVrsqrtps_NameIndex = 7878, + kInstVrsqrtss_NameIndex = 7887, + kInstVshufpd_NameIndex = 7896, + kInstVshufps_NameIndex = 7904, + kInstVsqrtpd_NameIndex = 7912, + kInstVsqrtps_NameIndex = 7920, + kInstVsqrtsd_NameIndex = 7928, + kInstVsqrtss_NameIndex = 7936, + kInstVstmxcsr_NameIndex = 7944, + kInstVsubpd_NameIndex = 7953, + kInstVsubps_NameIndex = 7960, + kInstVsubsd_NameIndex = 7967, + kInstVsubss_NameIndex = 7974, + kInstVtestpd_NameIndex = 7981, + kInstVtestps_NameIndex = 7989, + kInstVucomisd_NameIndex = 7997, + kInstVucomiss_NameIndex = 8006, + kInstVunpckhpd_NameIndex = 8015, + kInstVunpckhps_NameIndex = 8025, + kInstVunpcklpd_NameIndex = 8035, + kInstVunpcklps_NameIndex = 8045, + kInstVxorpd_NameIndex = 8055, + kInstVxorps_NameIndex = 8062, + kInstVzeroall_NameIndex = 8069, + kInstVzeroupper_NameIndex = 8078, + kInstWrfsbase_NameIndex = 8089, + kInstWrgsbase_NameIndex = 8098, + kInstXadd_NameIndex = 8107, + kInstXchg_NameIndex = 8112, + kInstXor_NameIndex = 8117, + kInstXorpd_NameIndex = 8121, + kInstXorps_NameIndex = 8127 }; // ${kInstData:End} @@ -2360,6 +2362,7 @@ const InstInfo _instInfo[] = { INST(kInstIdiv , "idiv" , G(X86Rm_B) , F(None)|F(Special) , 0 , 0 , 0 , U , U , O_000000(F6,7) , U ), INST(kInstImul , "imul" , G(X86Imul) , F(None)|F(Special) , 0 , 0 , 0 , U , U , U , U ), INST(kInstInc , "inc" , G(X86IncDec) , F(Lock) , 0 , O(GqdwbMem) , U , U , U , O_000000(FE,0) , O_000000(40,U) ), + INST(kInstInsertps , "insertps" , G(ExtRmi) , F(None) , 0 , O(Xmm) , O(XmmMem) , O(Imm) , U , O_660F3A(21,U) , U ), INST(kInstInt , "int" , G(X86Int) , F(None) , 0 , U , U , U , U , O_000000(CC,U) , U ), INST(kInstJa , "ja" , G(X86Jcc) , F(Flow) , 0 , U , U , U , U , O_000000(77,U) , U ), INST(kInstJae , "jae" , G(X86Jcc) , F(Flow) , 0 , U , U , U , U , O_000000(73,U) , U ), diff --git a/src/asmjit/x86/x86defs.h b/src/asmjit/x86/x86defs.h index 010d232..7ea3554 100644 --- a/src/asmjit/x86/x86defs.h +++ b/src/asmjit/x86/x86defs.h @@ -22,7 +22,7 @@ namespace asmjit { namespace x86x64 { -//! @addtogroup asmjit_x86x64 +//! @addtogroup asmjit_x86x64_codegen //! @{ // ============================================================================ @@ -61,56 +61,57 @@ typedef Vec256Data YmmData; //! @internal //! -//! @brief X86/X64 instructions' names. +//! X86/X64 instructions' names. ASMJIT_VAR const char _instName[]; //! @internal //! -//! @brief X86/X64 instructions' information. +//! X86/X64 instructions' information. ASMJIT_VAR const InstInfo _instInfo[]; //! @internal //! -//! @brief X86/X64 condition codes to reversed condition codes map. +//! X86/X64 condition codes to reversed condition codes map. ASMJIT_VAR const uint32_t _reverseCond[20]; //! @internal //! -//! @brief X86X64 condition codes to "cmovcc" group map. +//! X86X64 condition codes to "cmovcc" group map. ASMJIT_VAR const uint32_t _condToCmovcc[20]; //! @internal //! -//! @brief X86X64 condition codes to "jcc" group map. +//! X86X64 condition codes to "jcc" group map. ASMJIT_VAR const uint32_t _condToJcc[20]; //! @internal //! -//! @brief X86X64 condition codes to "setcc" group map. +//! X86X64 condition codes to "setcc" group map. ASMJIT_VAR const uint32_t _condToSetcc[20]; // ============================================================================ // [asmjit::x86x64::Variables] // ============================================================================ +//! @internal ASMJIT_VAR const VarInfo _varInfo[]; // ============================================================================ // [asmjit::x86x64::kRegClass] // ============================================================================ -//! @brief X86/X64 variable class. +//! X86/X64 variable class. ASMJIT_ENUM(kRegClass) { // kRegClassGp defined in base/defs.h; it's used by all implementations. - //! @brief X86/X64 Fp register class. + //! X86/X64 Fp register class. kRegClassFp = 1, - //! @brief X86/X64 Mm register class. + //! X86/X64 Mm register class. kRegClassMm = 2, - //! @brief X86/X64 Xmm/Ymm register class. + //! X86/X64 Xmm/Ymm register class. kRegClassXy = 3, - //! @brief Count of X86/X64 register classes. + //! Count of X86/X64 register classes. kRegClassCount = 4 }; @@ -118,13 +119,13 @@ ASMJIT_ENUM(kRegClass) { // [asmjit::x86x64::kRegCount] // ============================================================================ -//! @brief X86/X64 registers count. +//! X86/X64 registers count. ASMJIT_ENUM(kRegCount) { - //! @brief Count of Fp registers (8). + //! Count of Fp registers (8). kRegCountFp = 8, - //! @brief Count of Mm registers (8). + //! Count of Mm registers (8). kRegCountMm = 8, - //! @brief Count of segment registers (6). + //! Count of segment registers (6). kRegCountSeg = 6 }; @@ -132,38 +133,38 @@ ASMJIT_ENUM(kRegCount) { // [asmjit::x86x64::kRegType] // ============================================================================ -//! @brief X86/X64 register types. +//! X86/X64 register types. ASMJIT_ENUM(kRegType) { - //! @brief Gpb-lo register (AL, BL, CL, DL, ...). + //! Gpb-lo register (AL, BL, CL, DL, ...). kRegTypeGpbLo = 0x01, - //! @brief Gpb-hi register (AH, BH, CH, DH only). + //! Gpb-hi register (AH, BH, CH, DH only). kRegTypeGpbHi = 0x02, //! @internal //! - //! @brief Gpb-hi register patched to native index (4-7). + //! Gpb-hi register patched to native index (4-7). kRegTypePatchedGpbHi = kRegTypeGpbLo | kRegTypeGpbHi, - //! @brief Gpw register. + //! Gpw register. kRegTypeGpw = 0x10, - //! @brief Gpd register. + //! Gpd register. kRegTypeGpd = 0x20, - //! @brief Gpq register. + //! Gpq register. kRegTypeGpq = 0x30, - //! @brief Fp register. + //! Fp register. kRegTypeFp = 0x50, - //! @brief Mm register. + //! Mm register. kRegTypeMm = 0x60, - //! @brief Xmm register. + //! Xmm register. kRegTypeXmm = 0x70, - //! @brief Ymm register. + //! Ymm register. kRegTypeYmm = 0x80, - //! @brief Zmm register. + //! Zmm register. kRegTypeZmm = 0x90, - //! @brief Segment register. + //! Segment register. kRegTypeSeg = 0xF0 }; @@ -171,142 +172,139 @@ ASMJIT_ENUM(kRegType) { // [asmjit::x86x64::kRegIndex] // ============================================================================ -//! @brief X86/X64 register indices. -//! -//! These codes are real, don't miss with @c REG enum! and don't use these -//! values if you are not writing AsmJit code. +//! X86/X64 register indexes. ASMJIT_ENUM(kRegIndex) { - //! @brief Index of AL/AH/AX/EAX/RAX registers. + //! Index of AL/AH/AX/EAX/RAX registers. kRegIndexAx = 0, - //! @brief Index of CL/CH/CX/ECX/RCX registers. + //! Index of CL/CH/CX/ECX/RCX registers. kRegIndexCx = 1, - //! @brief Index of DL/DH/DX/EDX/RDX registers. + //! Index of DL/DH/DX/EDX/RDX registers. kRegIndexDx = 2, - //! @brief Index of BL/BH/BX/EBX/RBX registers. + //! Index of BL/BH/BX/EBX/RBX registers. kRegIndexBx = 3, - //! @brief Index of SPL/SP/ESP/RSP registers. + //! Index of SPL/SP/ESP/RSP registers. kRegIndexSp = 4, - //! @brief Index of BPL/BP/EBP/RBP registers. + //! Index of BPL/BP/EBP/RBP registers. kRegIndexBp = 5, - //! @brief Index of SIL/SI/ESI/RSI registers. + //! Index of SIL/SI/ESI/RSI registers. kRegIndexSi = 6, - //! @brief Index of DIL/DI/EDI/RDI registers. + //! Index of DIL/DI/EDI/RDI registers. kRegIndexDi = 7, - //! @brief Index of R8B/R8W/R8D/R8 registers (64-bit only). + //! Index of R8B/R8W/R8D/R8 registers (64-bit only). kRegIndexR8 = 8, - //! @brief Index of R9B/R9W/R9D/R9 registers (64-bit only). + //! Index of R9B/R9W/R9D/R9 registers (64-bit only). kRegIndexR9 = 9, - //! @brief Index of R10B/R10W/R10D/R10 registers (64-bit only). + //! Index of R10B/R10W/R10D/R10 registers (64-bit only). kRegIndexR10 = 10, - //! @brief Index of R11B/R11W/R11D/R11 registers (64-bit only). + //! Index of R11B/R11W/R11D/R11 registers (64-bit only). kRegIndexR11 = 11, - //! @brief Index of R12B/R12W/R12D/R12 registers (64-bit only). + //! Index of R12B/R12W/R12D/R12 registers (64-bit only). kRegIndexR12 = 12, - //! @brief Index of R13B/R13W/R13D/R13 registers (64-bit only). + //! Index of R13B/R13W/R13D/R13 registers (64-bit only). kRegIndexR13 = 13, - //! @brief Index of R14B/R14W/R14D/R14 registers (64-bit only). + //! Index of R14B/R14W/R14D/R14 registers (64-bit only). kRegIndexR14 = 14, - //! @brief Index of R15B/R15W/R15D/R15 registers (64-bit only). + //! Index of R15B/R15W/R15D/R15 registers (64-bit only). kRegIndexR15 = 15, - //! @brief Index of FP0 register. + //! Index of FP0 register. kRegIndexFp0 = 0, - //! @brief Index of FP1 register. + //! Index of FP1 register. kRegIndexFp1 = 1, - //! @brief Index of FP2 register. + //! Index of FP2 register. kRegIndexFp2 = 2, - //! @brief Index of FP3 register. + //! Index of FP3 register. kRegIndexFp3 = 3, - //! @brief Index of FP4 register. + //! Index of FP4 register. kRegIndexFp4 = 4, - //! @brief Index of FP5 register. + //! Index of FP5 register. kRegIndexFp5 = 5, - //! @brief Index of FP6 register. + //! Index of FP6 register. kRegIndexFp6 = 6, - //! @brief Index of FP7 register. + //! Index of FP7 register. kRegIndexFp7 = 7, - //! @brief Index of MM0 register. + //! Index of MM0 register. kRegIndexMm0 = 0, - //! @brief Index of MM1 register. + //! Index of MM1 register. kRegIndexMm1 = 1, - //! @brief Index of MM2 register. + //! Index of MM2 register. kRegIndexMm2 = 2, - //! @brief Index of MM3 register. + //! Index of MM3 register. kRegIndexMm3 = 3, - //! @brief Index of MM4 register. + //! Index of MM4 register. kRegIndexMm4 = 4, - //! @brief Index of MM5 register. + //! Index of MM5 register. kRegIndexMm5 = 5, - //! @brief Index of MM6 register. + //! Index of MM6 register. kRegIndexMm6 = 6, - //! @brief Index of MM7 register. + //! Index of MM7 register. kRegIndexMm7 = 7, - //! @brief Index of XMM0 register. + //! Index of XMM0 register. kRegIndexXmm0 = 0, - //! @brief Index of XMM1 register. + //! Index of XMM1 register. kRegIndexXmm1 = 1, - //! @brief Index of XMM2 register. + //! Index of XMM2 register. kRegIndexXmm2 = 2, - //! @brief Index of XMM3 register. + //! Index of XMM3 register. kRegIndexXmm3 = 3, - //! @brief Index of XMM4 register. + //! Index of XMM4 register. kRegIndexXmm4 = 4, - //! @brief Index of XMM5 register. + //! Index of XMM5 register. kRegIndexXmm5 = 5, - //! @brief Index of XMM6 register. + //! Index of XMM6 register. kRegIndexXmm6 = 6, - //! @brief Index of XMM7 register. + //! Index of XMM7 register. kRegIndexXmm7 = 7, - //! @brief Index of XMM8 register (64-bit only). + //! Index of XMM8 register (64-bit only). kRegIndexXmm8 = 8, - //! @brief Index of XMM9 register (64-bit only). + //! Index of XMM9 register (64-bit only). kRegIndexXmm9 = 9, - //! @brief Index of XMM10 register (64-bit only). + //! Index of XMM10 register (64-bit only). kRegIndexXmm10 = 10, - //! @brief Index of XMM11 register (64-bit only). + //! Index of XMM11 register (64-bit only). kRegIndexXmm11 = 11, - //! @brief Index of XMM12 register (64-bit only). + //! Index of XMM12 register (64-bit only). kRegIndexXmm12 = 12, - //! @brief Index of XMM13 register (64-bit only). + //! Index of XMM13 register (64-bit only). kRegIndexXmm13 = 13, - //! @brief Index of XMM14 register (64-bit only). + //! Index of XMM14 register (64-bit only). kRegIndexXmm14 = 14, - //! @brief Index of XMM15 register (64-bit only). + //! Index of XMM15 register (64-bit only). kRegIndexXmm15 = 15, - //! @brief Index of YMM0 register. + //! Index of YMM0 register. kRegIndexYmm0 = 0, - //! @brief Index of YMM1 register. + //! Index of YMM1 register. kRegIndexYmm1 = 1, - //! @brief Index of YMM2 register. + //! Index of YMM2 register. kRegIndexYmm2 = 2, - //! @brief Index of YMM3 register. + //! Index of YMM3 register. kRegIndexYmm3 = 3, - //! @brief Index of YMM4 register. + //! Index of YMM4 register. kRegIndexYmm4 = 4, - //! @brief Index of YMM5 register. + //! Index of YMM5 register. kRegIndexYmm5 = 5, - //! @brief Index of YMM6 register. + //! Index of YMM6 register. kRegIndexYmm6 = 6, - //! @brief Index of YMM7 register. + //! Index of YMM7 register. kRegIndexYmm7 = 7, - //! @brief Index of YMM8 register (64-bit only). + //! Index of YMM8 register (64-bit only). kRegIndexYmm8 = 8, - //! @brief Index of YMM9 register (64-bit only). + //! Index of YMM9 register (64-bit only). kRegIndexYmm9 = 9, - //! @brief Index of YMM10 register (64-bit only). + //! Index of YMM10 register (64-bit only). kRegIndexYmm10 = 10, - //! @brief Index of YMM11 register (64-bit only). + //! Index of YMM11 register (64-bit only). kRegIndexYmm11 = 11, - //! @brief Index of YMM12 register (64-bit only). + //! Index of YMM12 register (64-bit only). kRegIndexYmm12 = 12, - //! @brief Index of YMM13 register (64-bit only). + //! Index of YMM13 register (64-bit only). kRegIndexYmm13 = 13, - //! @brief Index of YMM14 register (64-bit only). + //! Index of YMM14 register (64-bit only). kRegIndexYmm14 = 14, - //! @brief Index of YMM15 register (64-bit only). + //! Index of YMM15 register (64-bit only). kRegIndexYmm15 = 15 }; @@ -314,21 +312,21 @@ ASMJIT_ENUM(kRegIndex) { // [asmjit::x86x64::kSeg] // ============================================================================ -//! @brief X86/X64 segment codes. +//! X86/X64 segment codes. ASMJIT_ENUM(kSeg) { - //! @brief No segment. + //! No segment. kSegDefault = 0, - //! @brief Es segment. + //! Es segment. kSegEs = 1, - //! @brief Cs segment. + //! Cs segment. kSegCs = 2, - //! @brief Ss segment. + //! Ss segment. kSegSs = 3, - //! @brief Ds segment. + //! Ds segment. kSegDs = 4, - //! @brief Fs segment. + //! Fs segment. kSegFs = 5, - //! @brief Gs segment. + //! Gs segment. kSegGs = 6 }; @@ -336,13 +334,13 @@ ASMJIT_ENUM(kSeg) { // [asmjit::x86x64::kMemVSib] // ============================================================================ -//! @brief X86/X64 index register legacy and AVX2 (VSIB) support. +//! X86/X64 index register legacy and AVX2 (VSIB) support. ASMJIT_ENUM(kMemVSib) { - //! @brief Memory operand uses Gp or no index register. + //! Memory operand uses Gp or no index register. kMemVSibGpz = 0, - //! @brief Memory operand uses Xmm or no index register. + //! Memory operand uses Xmm or no index register. kMemVSibXmm = 1, - //! @brief Memory operand uses Ymm or no index register. + //! Memory operand uses Ymm or no index register. kMemVSibYmm = 2 }; @@ -352,7 +350,7 @@ ASMJIT_ENUM(kMemVSib) { //! @internal //! -//! @brief X86/X64 specific memory flags. +//! X86/X64 specific memory flags. ASMJIT_ENUM(kMemFlags) { kMemSegBits = 0x7, kMemSegIndex = 0, @@ -375,15 +373,15 @@ ASMJIT_ENUM(kMemFlags) { // [asmjit::x86x64::kPrefetchHint] // ============================================================================ -//! @brief X86/X64 Prefetch hints. +//! X86/X64 Prefetch hints. ASMJIT_ENUM(kPrefetchHint) { - //! @brief Prefetch using NT hint. + //! Prefetch using NT hint. kPrefetchNta = 0, - //! @brief Prefetch to L0 cache. + //! Prefetch to L0 cache. kPrefetchT0 = 1, - //! @brief Prefetch to L1 cache. + //! Prefetch to L1 cache. kPrefetchT1 = 2, - //! @brief Prefetch to L2 cache. + //! Prefetch to L2 cache. kPrefetchT2 = 3 }; @@ -391,7 +389,7 @@ ASMJIT_ENUM(kPrefetchHint) { // [asmjit::x86x64::kFPSW] // ============================================================================ -//! @brief X86/X64 FPU status Word. +//! X86/X64 FPU status Word. ASMJIT_ENUM(kFPSW) { kFPSW_Invalid = 0x0001, kFPSW_Denormalized = 0x0002, @@ -413,7 +411,7 @@ ASMJIT_ENUM(kFPSW) { // [asmjit::x86x64::kFPCW] // ============================================================================ -//! @brief X86/X64 FPU control Word. +//! X86/X64 FPU control Word. ASMJIT_ENUM(kFPCW) { kFPCW_EM_Mask = 0x003F, // Bits 0-5. kFPCW_EM_Invalid = 0x0001, @@ -444,7 +442,7 @@ ASMJIT_ENUM(kFPCW) { // [asmjit::x86x64::kInstCode] // ============================================================================ -//! @brief X86/X64 instruction codes. +//! X86/X64 instruction codes. //! //! Note that these instruction codes are AsmJit specific. Each instruction has //! a unique ID that is used as an index to AsmJit instruction table. @@ -676,6 +674,7 @@ ASMJIT_ENUM(kInstCode) { kInstIdiv, // X86/X64 kInstImul, // X86/X64 kInstInc, // X86/X64 + kInstInsertps, // SSE4.1 kInstInt, // X86/X64 kInstJa, // X86/X64 (jcc) kInstJae, // X86/X64 (jcc) @@ -1491,15 +1490,15 @@ ASMJIT_ENUM(kInstCode) { // [asmjit::x86x64::kInstOptions] // ============================================================================ -//! @brief X86/X64 instruction emit options, mainly for internal purposes. +//! X86/X64 instruction emit options, mainly for internal purposes. ASMJIT_ENUM(kInstOptions) { - //! @brief Emit instruction with LOCK prefix. + //! Emit instruction with LOCK prefix. //! //! If this option is used and instruction doesn't support LOCK prefix an //! invalid instruction error is generated. kInstOptionLock = 0x10, - //! @brief Force REX prefix to be emitted. + //! Force REX prefix to be emitted. //! //! This option should be used carefully, because there are unencodable //! combinations. If you want to access ah, bh, ch or dh registers the REX @@ -1507,7 +1506,7 @@ ASMJIT_ENUM(kInstOptions) { //! returned. kInstOptionRex = 0x40, - //! @brief Force three-byte VEX prefix to be emitted (instead of more compact + //! Force three-byte VEX prefix to be emitted (instead of more compact //! two-byte VEX prefix). //! //! Ignored if the instruction is not AVX instruction or extension to the @@ -1519,13 +1518,13 @@ ASMJIT_ENUM(kInstOptions) { // [asmjit::x86x64::kInstGroup] // ============================================================================ -//! @brief X86/X64 instruction groups. +//! @internal //! -//! This should be only used by assembler, because it's @c asmjit::Assembler -//! specific grouping. Each group represents one 'case' in the Assembler's -//! main emit method. +//! X86/X64 instruction groups. +//! +//! This group is specific to AsmJit and only used by `x86x64::X86X64Assembler`. ASMJIT_ENUM(kInstGroup) { - //! @brief Never used. + //! Never used. kInstGroupNone, kInstGroupX86Op, @@ -1534,265 +1533,265 @@ ASMJIT_ENUM(kInstGroup) { kInstGroupX86RmReg, kInstGroupX86RegRm, kInstGroupX86M, - //! @brief Adc/Add/And/Cmp/Or/Sbb/Sub/Xor. + //! Adc/Add/And/Cmp/Or/Sbb/Sub/Xor. kInstGroupX86Arith, - //! @brief Bswap. + //! Bswap. kInstGroupX86BSwap, - //! @brief Bt/Btc/Btr/Bts. + //! Bt/Btc/Btr/Bts. kInstGroupX86BTest, - //! @brief Call. + //! Call. kInstGroupX86Call, - //! @brief Enter. + //! Enter. kInstGroupX86Enter, - //! @brief Imul. + //! Imul. kInstGroupX86Imul, - //! @brief Inc/Dec. + //! Inc/Dec. kInstGroupX86IncDec, - //! @brief Int. + //! Int. kInstGroupX86Int, - //! @brief Jcc. + //! Jcc. kInstGroupX86Jcc, - //! @brief Jmp. + //! Jmp. kInstGroupX86Jmp, - //! @brief Lea. + //! Lea. kInstGroupX86Lea, - //! @brief Mov. + //! Mov. kInstGroupX86Mov, - //! @brief Movsx/Movzx. + //! Movsx/Movzx. kInstGroupX86MovSxZx, - //! @brief Movsxd. + //! Movsxd. kInstGroupX86MovSxd, - //! @brief Mov having absolute memory operand (x86/x64). + //! Mov having absolute memory operand (x86/x64). kInstGroupX86MovPtr, - //! @brief Push. + //! Push. kInstGroupX86Push, - //! @brief Pop. + //! Pop. kInstGroupX86Pop, - //! @brief Rep/Repe/Repne LodsX/MovsX/StosX/CmpsX/ScasX. + //! Rep/Repe/Repne LodsX/MovsX/StosX/CmpsX/ScasX. kInstGroupX86Rep, - //! @brief Ret. + //! Ret. kInstGroupX86Ret, - //! @brief Rcl/Rcr/Rol/Ror/Sal/Sar/Shl/Shr. + //! Rcl/Rcr/Rol/Ror/Sal/Sar/Shl/Shr. kInstGroupX86Rot, - //! @brief Setcc. + //! Setcc. kInstGroupX86Set, - //! @brief Shld/Rhrd. + //! Shld/Rhrd. kInstGroupX86Shlrd, - //! @brief Test. + //! Test. kInstGroupX86Test, - //! @brief Xadd. + //! Xadd. kInstGroupX86Xadd, - //! @brief Xchg. + //! Xchg. kInstGroupX86Xchg, - //! @brief Fincstp/Finit/FldX/Fnclex/Fninit/Fnop/Fpatan/Fprem/Fprem1/Fptan/Frndint/Fscale/Fsin/Fsincos/Fsqrt/Ftst/Fucompp/Fxam/Fxtract/Fyl2x/Fyl2xp1. + //! Fincstp/Finit/FldX/Fnclex/Fninit/Fnop/Fpatan/Fprem/Fprem1/Fptan/Frndint/Fscale/Fsin/Fsincos/Fsqrt/Ftst/Fucompp/Fxam/Fxtract/Fyl2x/Fyl2xp1. kInstGroupFpuOp, - //! @brief Fadd/Fdiv/Fdivr/Fmul/Fsub/Fsubr. + //! Fadd/Fdiv/Fdivr/Fmul/Fsub/Fsubr. kInstGroupFpuArith, - //! @brief Fcom/Fcomp. + //! Fcom/Fcomp. kInstGroupFpuCom, - //! @brief Fld/Fst/Fstp. + //! Fld/Fst/Fstp. kInstGroupFpuFldFst, - //! @brief Fiadd/Ficom/Ficomp/Fidiv/Fidivr/Fild/Fimul/Fist/Fistp/Fisttp/Fisub/Fisubr. + //! Fiadd/Ficom/Ficomp/Fidiv/Fidivr/Fild/Fimul/Fist/Fistp/Fisttp/Fisub/Fisubr. kInstGroupFpuM, - //! @brief Fcmov/Fcomi/Fcomip/Ffree/Fucom/Fucomi/Fucomip/Fucomp/Fxch. + //! Fcmov/Fcomi/Fcomip/Ffree/Fucom/Fucomi/Fucomip/Fucomp/Fxch. kInstGroupFpuR, - //! @brief Faddp/Fdivp/Fdivrp/Fmulp/Fsubp/Fsubrp. + //! Faddp/Fdivp/Fdivrp/Fmulp/Fsubp/Fsubrp. kInstGroupFpuRDef, - //! @brief Fnstsw/Fstsw. + //! Fnstsw/Fstsw. kInstGroupFpuStsw, - //! @brief Mm/Xmm instruction. + //! Mm/Xmm instruction. kInstGroupExtRm, - //! @brief Mm/Xmm instruction (propagates 66H if the instruction uses XMM register). + //! Mm/Xmm instruction (propagates 66H if the instruction uses XMM register). kInstGroupExtRm_P, - //! @brief Mm/Xmm instruction (propagates REX.W if GPQ is used). + //! Mm/Xmm instruction (propagates REX.W if GPQ is used). kInstGroupExtRm_Q, - //! @brief Mm/Xmm instruction (propagates 66H and REX.W). + //! Mm/Xmm instruction (propagates 66H and REX.W). kInstGroupExtRm_PQ, - //! @brief Mm/Xmm instruction having Rm/Ri encodings. + //! Mm/Xmm instruction having Rm/Ri encodings. kInstGroupExtRmRi, - //! @brief Mm/Xmm instruction having Rm/Ri encodings (propagates 66H if the instruction uses XMM register). + //! Mm/Xmm instruction having Rm/Ri encodings (propagates 66H if the instruction uses XMM register). kInstGroupExtRmRi_P, - //! @brief Mm/Xmm instruction having Rmi encoding. + //! Mm/Xmm instruction having Rmi encoding. kInstGroupExtRmi, - //! @brief Mm/Xmm instruction having Rmi encoding (propagates 66H if the instruction uses XMM register). + //! Mm/Xmm instruction having Rmi encoding (propagates 66H if the instruction uses XMM register). kInstGroupExtRmi_P, - //! @brief Crc32. + //! Crc32. kInstGroupExtCrc, - //! @brief Pextrb/Pextrw/Pextrd/Pextrq/Extractps. + //! Pextrb/Pextrw/Pextrd/Pextrq/Extractps. kInstGroupExtExtract, - //! @brief Lfence/Mfence/Sfence. + //! Lfence/Mfence/Sfence. kInstGroupExtFence, - //! @brief Mov Mm/Xmm. + //! Mov Mm/Xmm. //! //! 0x66 prefix must be set manually in opcodes. //! //! - Primary opcode is used for instructions in (X)Mm <- (X)Mm/Mem format, //! - Secondary opcode is used for instructions in (X)Mm/Mem <- (X)Mm format. kInstGroupExtMov, - //! @brief Mov Mm/Xmm. + //! Mov Mm/Xmm. kInstGroupExtMovNoRexW, - //! @brief Movbe. + //! Movbe. kInstGroupExtMovBe, - //! @brief Movd. + //! Movd. kInstGroupExtMovD, - //! @brief Movq. + //! Movq. kInstGroupExtMovQ, - //! @brief Prefetch. + //! Prefetch. kInstGroupExtPrefetch, - //! @brief 3dNow instruction. + //! 3dNow instruction. kInstGroup3dNow, - //! @brief AVX instruction without operands. + //! AVX instruction without operands. kInstGroupAvxOp, - //! @brief AVX instruction encoded as 'M'. + //! AVX instruction encoded as 'M'. kInstGroupAvxM, - //! @brief AVX instruction encoded as 'MR'. + //! AVX instruction encoded as 'MR'. kInstGroupAvxMr, - //! @brief AVX instruction encoded as 'MR'. + //! AVX instruction encoded as 'MR'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxMr_P, - //! @brief AVX instruction encoded as 'MRI'. + //! AVX instruction encoded as 'MRI'. kInstGroupAvxMri, - //! @brief AVX instruction encoded as 'MRI'. + //! AVX instruction encoded as 'MRI'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxMri_P, - //! @brief AVX instruction encoded as 'RM'. + //! AVX instruction encoded as 'RM'. kInstGroupAvxRm, - //! @brief AVX instruction encoded as 'RM'. + //! AVX instruction encoded as 'RM'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRm_P, - //! @brief AVX instruction encoded as 'RMI'. + //! AVX instruction encoded as 'RMI'. kInstGroupAvxRmi, - //! @brief AVX instruction encoded as 'RMI'. + //! AVX instruction encoded as 'RMI'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRmi_P, - //! @brief AVX instruction encoded as 'RVM'. + //! AVX instruction encoded as 'RVM'. kInstGroupAvxRvm, - //! @brief AVX instruction encoded as 'RVM'. + //! AVX instruction encoded as 'RVM'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRvm_P, - //! @brief AVX instruction encoded as 'RVMR'. + //! AVX instruction encoded as 'RVMR'. kInstGroupAvxRvmr, - //! @brief AVX instruction encoded as 'RVMR'. + //! AVX instruction encoded as 'RVMR'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRvmr_P, - //! @brief AVX instruction encoded as 'RVMI'. + //! AVX instruction encoded as 'RVMI'. kInstGroupAvxRvmi, - //! @brief AVX instruction encoded as 'RVMI'. + //! AVX instruction encoded as 'RVMI'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRvmi_P, - //! @brief AVX instruction encoded as 'RMV'. + //! AVX instruction encoded as 'RMV'. kInstGroupAvxRmv, - //! @brief AVX instruction encoded as 'RMVI'. + //! AVX instruction encoded as 'RMVI'. kInstGroupAvxRmvi, - //! @brief AVX instruction encoded as 'RM' or 'MR'. + //! AVX instruction encoded as 'RM' or 'MR'. kInstGroupAvxRmMr, - //! @brief AVX instruction encoded as 'RM' or 'MR'. + //! AVX instruction encoded as 'RM' or 'MR'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRmMr_P, - //! @brief AVX instruction encoded as 'RVM' or 'RMI'. + //! AVX instruction encoded as 'RVM' or 'RMI'. kInstGroupAvxRvmRmi, - //! @brief AVX instruction encoded as 'RVM' or 'RMI'. + //! AVX instruction encoded as 'RVM' or 'RMI'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRvmRmi_P, - //! @brief AVX instruction encoded as 'RVM' or 'MR'. + //! AVX instruction encoded as 'RVM' or 'MR'. kInstGroupAvxRvmMr, - //! @brief AVX instruction encoded as 'RVM' or 'MVR'. + //! AVX instruction encoded as 'RVM' or 'MVR'. kInstGroupAvxRvmMvr, - //! @brief AVX instruction encoded as 'RVM' or 'MVR'. + //! AVX instruction encoded as 'RVM' or 'MVR'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRvmMvr_P, - //! @brief AVX instruction encoded as 'RVM' or 'VMI'. + //! AVX instruction encoded as 'RVM' or 'VMI'. kInstGroupAvxRvmVmi, - //! @brief AVX instruction encoded as 'RVM' or 'VMI'. + //! AVX instruction encoded as 'RVM' or 'VMI'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxRvmVmi_P, - //! @brief AVX instruction encoded as 'VM'. + //! AVX instruction encoded as 'VM'. kInstGroupAvxVm, - //! @brief AVX instruction encoded as 'VMI'. + //! AVX instruction encoded as 'VMI'. kInstGroupAvxVmi, - //! @brief AVX instruction encoded as 'VMI'. + //! AVX instruction encoded as 'VMI'. //! //! Propagates AVX.L if the instruction uses YMM register. kInstGroupAvxVmi_P, - //! @brief AVX instruction encoded as 'RVRM' or 'RVMR'. + //! AVX instruction encoded as 'RVRM' or 'RVMR'. kInstGroupAvxRvrmRvmr, - //! @brief AVX instruction encoded as 'RVRM' or 'RVMR'. + //! AVX instruction encoded as 'RVRM' or 'RVMR'. //! //! Propagates AVX.L if the instruction uses YMM register). kInstGroupAvxRvrmRvmr_P, - //! @brief Vmovss/Vmovsd. + //! Vmovss/Vmovsd. kInstGroupAvxMovSsSd, - //! @brief AVX2 gather family instructions (VSIB). + //! AVX2 gather family instructions (VSIB). kInstGroupAvxGather, - //! @brief AVX2 gather family instructions (VSIB), differs only in mem operand. + //! AVX2 gather family instructions (VSIB), differs only in mem operand. kInstGroupAvxGatherEx, - //! @brief FMA4 supporting XMM in form [R, R, R/M, R/M]. + //! FMA4 supporting XMM in form [R, R, R/M, R/M]. kInstGroupFma4, - //! @brief FMA4 supporting XMM/YMM in form [R, R, R/M, R/M]. + //! FMA4 supporting XMM/YMM in form [R, R, R/M, R/M]. kInstGroupFma4_P, - //! @brief XOP instruction encoded as 'RM'. + //! XOP instruction encoded as 'RM'. kInstGroupXopRm, - //! @brief XOP instruction encoded as 'RM'. + //! XOP instruction encoded as 'RM'. //! //! Propagates XOP.L if the instruction uses YMM register). kInstGroupXopRm_P, - //! @brief XOP instruction encoded as 'RVM' or 'RMV'. + //! XOP instruction encoded as 'RVM' or 'RMV'. kInstGroupXopRvmRmv, - //! @brief XOP instruction encoded as 'RVM' or 'RMI'. + //! XOP instruction encoded as 'RVM' or 'RMI'. kInstGroupXopRvmRmi, - //! @brief XOP instruction encoded as 'RVMR'. + //! XOP instruction encoded as 'RVMR'. kInstGroupXopRvmr, - //! @brief XOP instruction encoded as 'RVMR'. + //! XOP instruction encoded as 'RVMR'. //! //! Propagates XOP.L if the instruction uses YMM register. kInstGroupXopRvmr_P, - //! @brief XOP instruction encoded as 'RVMI'. + //! XOP instruction encoded as 'RVMI'. kInstGroupXopRvmi, - //! @brief XOP instruction encoded as 'RVMI'. + //! XOP instruction encoded as 'RVMI'. //! //! Propagates XOP.L if the instruction uses YMM register. kInstGroupXopRvmi_P, - //! @brief XOP instruction encoded as 'RVRM' or 'RVMR'. + //! XOP instruction encoded as 'RVRM' or 'RVMR'. kInstGroupXopRvrmRvmr, - //! @brief XOP instruction encoded as 'RVRM' or 'RVMR'. + //! XOP instruction encoded as 'RVRM' or 'RVMR'. //! //! Propagates XOP.L if the instruction uses YMM register). kInstGroupXopRvrmRvmr_P @@ -1802,7 +1801,9 @@ ASMJIT_ENUM(kInstGroup) { // [asmjit::x86x64::kInstOpCode] // ============================================================================ -//! @brief Instruction OpCode encoding used by asmjit 'InstInfo' table. +//! @internal +//! +//! Instruction OpCode encoding used by asmjit 'InstInfo' table. //! //! The schema was inspired by AVX/AVX2 features. ASMJIT_ENUM(kInstOpCode) { @@ -1845,20 +1846,22 @@ ASMJIT_ENUM(kInstOpCode) { // [asmjit::x86x64::kInstFlags] // ============================================================================ -//! @brief X86/X64 instruction type flags. +//! @internal +//! +//! X86/X64 instruction type flags. ASMJIT_ENUM(kInstFlags) { - //! @brief No flags. + //! No flags. kInstFlagNone = 0x0000, - //! @brief Instruction is a control-flow instruction. + //! Instruction is a control-flow instruction. //! //! Control flow instructions are jmp, jcc, call and ret. kInstFlagFlow = 0x0001, - //! @brief Instruction is a compare/test like instruction. + //! Instruction is a compare/test like instruction. kInstFlagTest = 0x0002, - //! @brief Instruction is a move like instruction. + //! Instruction is a move like instruction. //! //! Move instructions typically overwrite the first operand by the second //! operand. The first operand can be the exact copy of the second operand @@ -1873,50 +1876,50 @@ ASMJIT_ENUM(kInstFlags) { //! the flag accordingly to it. kInstFlagMove = 0x0004, - //! @brief Instruction is an exchange like instruction. + //! Instruction is an exchange like instruction. //! //! Exchange instruction typically overwrite first and second operand. So //! far only the instructions 'xchg' and 'xadd' are considered. kInstFlagXchg = 0x0008, - //! @brief Instruction accesses Fp register(s). + //! Instruction accesses Fp register(s). kInstFlagFp = 0x0010, - //! @brief Instruction can be prefixed by using the LOCK prefix. + //! Instruction can be prefixed by using the LOCK prefix. kInstFlagLock = 0x0020, - //! @brief Instruction is special, this is for @c Compiler. + //! Instruction is special, this is for `BaseCompiler`. kInstFlagSpecial = 0x0040, - //! @brief Instruction always performs memory access. + //! Instruction always performs memory access. //! - //! This flag is always combined with @c kInstFlagSpecial and signalizes + //! This flag is always combined with `kInstFlagSpecial` and signalizes //! that there is an implicit address which is accessed (usually EDI/RDI or //! ESI/EDI). kInstFlagSpecialMem = 0x0080, - //! @brief Instruction memory operand can refer to 16-bit address (used by FPU). + //! Instruction memory operand can refer to 16-bit address (used by FPU). kInstFlagMem2 = 0x0100, - //! @brief Instruction memory operand can refer to 32-bit address (used by FPU). + //! Instruction memory operand can refer to 32-bit address (used by FPU). kInstFlagMem4 = 0x0200, - //! @brief Instruction memory operand can refer to 64-bit address (used by FPU). + //! Instruction memory operand can refer to 64-bit address (used by FPU). kInstFlagMem8 = 0x0400, - //! @brief Instruction memory operand can refer to 80-bit address (used by FPU). + //! Instruction memory operand can refer to 80-bit address (used by FPU). kInstFlagMem10 = 0x0800, - //! @brief Combination of @c kInstFlagMem2 and @c kInstFlagMem4. + //! Combination of `kInstFlagMem2` and `kInstFlagMem4`. kInstFlagMem2_4 = kInstFlagMem2 | kInstFlagMem4, - //! @brief Combination of @c kInstFlagMem2 and @c kInstFlagMem4 and @c kInstFlagMem8. + //! Combination of `kInstFlagMem2` and `kInstFlagMem4` and `kInstFlagMem8`. kInstFlagMem2_4_8 = kInstFlagMem2_4 | kInstFlagMem8, - //! @brief Combination of @c kInstFlagMem4 and @c kInstFlagMem8. + //! Combination of `kInstFlagMem4` and `kInstFlagMem8`. kInstFlagMem4_8 = kInstFlagMem4 | kInstFlagMem8, - //! @brief Combination of @c kInstFlagMem4 and @c kInstFlagMem8 and @c kInstFlagMem10. + //! Combination of `kInstFlagMem4` and `kInstFlagMem8` and `kInstFlagMem10`. kInstFlagMem4_8_10 = kInstFlagMem4_8 | kInstFlagMem10, - //! @brief Zeroes the rest of the register if the source operand is memory. + //! Zeroes the rest of the register if the source operand is memory. kInstFlagZeroIfMem = 0x1000, - //! @brief REX.W/VEX.W by default. + //! REX.W/VEX.W by default. kInstFlagW = 0x8000 }; @@ -1924,7 +1927,9 @@ ASMJIT_ENUM(kInstFlags) { // [asmjit::x86x64::kInstOp] // ============================================================================ -//! @brief X86/X64 instruction operand flags. +//! @internal +//! +//! X86/X64 instruction operand flags. ASMJIT_ENUM(kInstOp) { // Gp, Fp, Mm, Xmm, Ymm, Zmm. kInstOpGb = 0x0001, @@ -1972,7 +1977,7 @@ ASMJIT_ENUM(kInstOp) { // [asmjit::x86x64::kCond] // ============================================================================ -//! @brief X86/X64 Condition codes. +//! X86/X64 Condition codes. ASMJIT_ENUM(kCond) { // Condition codes from processor manuals. kCondA = 0x07, // CF==0 & ZF==0 (unsigned) @@ -2034,7 +2039,7 @@ ASMJIT_ENUM(kCond) { kCondFpuUnordered = 0x10, kCondFpuNotUnordered = 0x11, - //! @brief No condition code. + //! No condition code. kCondNone = 0x12 }; @@ -2042,30 +2047,30 @@ ASMJIT_ENUM(kCond) { // [asmjit::x86x64::kVarType] // ============================================================================ -//! @brief X86/X64 variable type. +//! X86/X64 variable type. ASMJIT_ENUM(kVarType) { - //! @brief Variable is Mm (MMX). + //! Variable is Mm (MMX). kVarTypeMm = 12, - //! @brief Variable is Xmm (SSE/SSE2). + //! Variable is Xmm (SSE/SSE2). kVarTypeXmm, - //! @brief Variable is SSE scalar SP-FP number. + //! Variable is SSE scalar SP-FP number. kVarTypeXmmSs, - //! @brief Variable is SSE packed SP-FP number (4 floats). + //! Variable is SSE packed SP-FP number (4 floats). kVarTypeXmmPs, - //! @brief Variable is SSE2 scalar DP-FP number. + //! Variable is SSE2 scalar DP-FP number. kVarTypeXmmSd, - //! @brief Variable is SSE2 packed DP-FP number (2 doubles). + //! Variable is SSE2 packed DP-FP number (2 doubles). kVarTypeXmmPd, - //! @brief Variable is Ymm (AVX). + //! Variable is Ymm (AVX). kVarTypeYmm, - //! @brief Variable is AVX packed SP-FP number (8 floats). + //! Variable is AVX packed SP-FP number (8 floats). kVarTypeYmmPs, - //! @brief Variable is AVX packed DP-FP number (4 doubles). + //! Variable is AVX packed DP-FP number (4 doubles). kVarTypeYmmPd, - //! @brief Count of variable types. + //! Count of variable types. kVarTypeCount, //! @internal @@ -2088,13 +2093,15 @@ ASMJIT_ENUM(kVarType) { // [asmjit::x86x64::kVarDesc] // ============================================================================ -//! @brief X86/X64 variable description. +//! @internal +//! +//! X86/X64 variable description. ASMJIT_ENUM(kVarDesc) { - //! @brief Variable contains single-precision floating-point(s). + //! Variable contains single-precision floating-point(s). kVarDescSp = 0x10, - //! @brief Variable contains double-precision floating-point(s). + //! Variable contains double-precision floating-point(s). kVarDescDp = 0x20, - //! @brief Variable is packed (for example float4x, double2x, ...). + //! Variable is packed (for example float4x, double2x, ...). kVarDescPacked = 0x40 }; @@ -2102,28 +2109,30 @@ ASMJIT_ENUM(kVarDesc) { // [asmjit::x86x64::InstInfo] // ============================================================================ -//! @brief X86 instruction information. +//! @internal +//! +//! X86 instruction information. struct InstInfo { // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get instruction name string (null terminated string). + //! Get instruction name string - a null terminated string. ASMJIT_INLINE const char* getName() const { return _instName + static_cast(_nameIndex); } - //! @brief Get instruction name index (index to @ref _instName array). + //! Get instruction name index to `_instName` array. ASMJIT_INLINE uint32_t _getNameIndex() const { return _nameIndex; } - //! @brief Get instruction group, see @ref kInstGroup. + //! Get instruction group, see `kInstGroup`. ASMJIT_INLINE uint32_t getGroup() const { return _group; } - //! @brief Get size of move instruction in bytes. + //! Get size of move instruction in bytes. //! //! If zero, the size of MOV instruction is determined by the size of the //! destination register (applies mostly for x86 arithmetic). This value is @@ -2138,12 +2147,12 @@ struct InstInfo { // [Flags] // -------------------------------------------------------------------------- - //! @brief Get instruction flags, see @ref kInstFlags. + //! Get instruction flags, see `kInstFlags`. ASMJIT_INLINE uint32_t getFlags() const { return _flags; } - //! @brief Get whether the instruction is a control-flow intruction. + //! Get whether the instruction is a control-flow intruction. //! //! Control flow instruction is instruction that modifies instruction pointer, //! typically jmp, jcc, call, or ret. @@ -2151,50 +2160,54 @@ struct InstInfo { return (_flags & kInstFlagFlow) != 0; } - //! @brief Get whether the instruction is a compare/test like intruction. + //! Get whether the instruction is a compare/test like intruction. ASMJIT_INLINE bool isTest() const { return (_flags & kInstFlagTest) != 0; } - //! @brief Get whether the instruction is a typical Move instruction. + //! Get whether the instruction is a typical move instruction. //! - //! Move instructions typically overwrite the first operand, so it's an useful - //! hint for @ref Compiler. Applies also to multimedia instruction - MMX, - //! SSE, SSE2 and AVX moves). + //! Move instructions overwrite the first operand or at least part of it, + //! This is a very useful hint that is used by variable liveness analysis + //! and `BaseCompiler` in general to know which variable is completely + //! overwritten. + //! + //! All AVX/XOP instructions that have 3 or more operands are considered to + //! have move semantics move by default. ASMJIT_INLINE bool isMove() const { return (_flags & kInstFlagMove) != 0; } - //! @brief Get whether the instruction is a typical Exchange instruction. + //! Get whether the instruction is a typical Exchange instruction. //! //! Exchange instructios are 'xchg' and 'xadd'. ASMJIT_INLINE bool isXchg() const { return (_flags & kInstFlagXchg) != 0; } - //! @brief Get whether the instruction accesses Fp register(s). + //! Get whether the instruction accesses Fp register(s). ASMJIT_INLINE bool isFp() const { return (_flags & kInstFlagFp) != 0; } - //! @brief Get whether the instruction can be prefixed by LOCK prefix. + //! Get whether the instruction can be prefixed by LOCK prefix. ASMJIT_INLINE bool isLockable() const { return (_flags & kInstFlagLock) != 0; } - //! @brief Get whether the instruction is special type (this is used by - //! @c Compiler to manage additional variables or functionality). + //! Get whether the instruction is special type (this is used by + //! `BaseCompiler` to manage additional variables or functionality). ASMJIT_INLINE bool isSpecial() const { return (_flags & kInstFlagSpecial) != 0; } - //! @brief Get whether the instruction is special type and it performs + //! Get whether the instruction is special type and it performs //! memory access. ASMJIT_INLINE bool isSpecialMem() const { return (_flags & kInstFlagSpecialMem) != 0; } - //! @brief Get whether the move instruction zeroes the rest of the register + //! Get whether the move instruction zeroes the rest of the register //! if the source is memory operand. //! //! Basically flag needed by 'movsd' and 'movss' instructions. @@ -2206,22 +2219,22 @@ struct InstInfo { // [Members] // -------------------------------------------------------------------------- - //! @brief Instruction name index in _instName[] array. + //! Instruction name index in _instName[] array. uint16_t _nameIndex; - //! @brief Instruction flags. + //! Instruction flags. uint16_t _flags; - //! @brief Instruction group, used also by @c Compiler. + //! Instruction group, used by `BaseAssembler`. uint8_t _group; - //! @brief Count of bytes overritten by a move instruction. + //! Count of bytes overritten by a move instruction. //! //! Only used when kInstFlagMove flag is set. If this value is zero move //! depends on the destination register size. uint8_t _moveSize; - //! @brief Reserved for future use. + //! Reserved for future use. uint8_t _reserved[2]; - //! @brief Operands' flags. + //! Operands' flags. uint16_t _opFlags[4]; - //! @brief Primary and secondary opcodes. + //! Primary and secondary opcodes. uint32_t _opCode[2]; }; @@ -2229,36 +2242,38 @@ struct InstInfo { // [asmjit::x86x64::VarInfo] // ============================================================================ -//! @brief X86 variable information. +//! @internal +//! +//! X86 variable information. struct VarInfo { // -------------------------------------------------------------------------- // [Accessors] // -------------------------------------------------------------------------- - //! @brief Get register type, see @ref kRegType. + //! Get register type, see `kRegType`. ASMJIT_INLINE uint32_t getReg() const { return _reg; } - //! @brief Get register size in bytes. + //! Get register size in bytes. ASMJIT_INLINE uint32_t getSize() const { return _size; } - //! @brief Get variable class, see @ref kRegClass. + //! Get variable class, see `kRegClass`. ASMJIT_INLINE uint32_t getClass() const { return _class; } - //! @brief Get variable description, see @ref kVarDesc. + //! Get variable description, see `kVarDesc`. ASMJIT_INLINE uint32_t getDesc() const { return _desc; } - //! @brief Get variable type name. + //! Get variable type name. ASMJIT_INLINE const char* getName() const { return _name; } // -------------------------------------------------------------------------- // [Members] // -------------------------------------------------------------------------- - //! @brief Register type, see @ref kRegType. + //! Register type, see `kRegType`. uint8_t _reg; - //! @brief Register size in bytes. + //! Register size in bytes. uint8_t _size; - //! @brief Register class, see @ref kRegClass. + //! Register class, see `kRegClass`. uint8_t _class; - //! @brief Variable flags, see @ref kVarDesc. + //! Variable flags, see `kVarDesc`. uint8_t _desc; - //! @brief Variable type name. + //! Variable type name. char _name[4]; }; @@ -2266,7 +2281,9 @@ struct VarInfo { // [asmjit::x86x64::RegCount] // ============================================================================ -//! @brief X86/X64 registers count (Gp, Fp, Mm, Xmm). +//! @internal +//! +//! X86/X64 registers count (Gp, Fp, Mm, Xmm). struct RegCount { // -------------------------------------------------------------------------- // [Zero] @@ -2343,7 +2360,9 @@ struct RegCount { // [asmjit::x86x64::RegMask] // ============================================================================ -//! @brief X86/X64 registers mask (Gp, Fp, Mm, Xmm/Ymm/Zmm). +//! @internal +//! +//! X86/X64 registers mask (Gp, Fp, Mm, Xmm/Ymm/Zmm). struct RegMask { // -------------------------------------------------------------------------- // [Zero] @@ -2447,19 +2466,19 @@ struct RegMask { union { struct { - //! @brief Gp registers mask. + //! Gp registers mask. uint16_t _gp; - //! @brief Fp registers mask. + //! Fp registers mask. uint16_t _fp; - //! @brief Mm registers mask. + //! Mm registers mask. uint16_t _mm; - //! @brief Xmm/Ymm registers mask. + //! Xmm/Ymm registers mask. uint16_t _xy; }; uint16_t _regs[4]; - //! @brief All masks as 64-bit integer. + //! All masks as 64-bit integer. UInt64 _packed; }; }; @@ -2468,19 +2487,19 @@ struct RegMask { // [asmjit::x86x64::X86Reg] // ============================================================================ -//! @brief X86/X64 register. +//! X86/X64 register. struct X86Reg : public BaseReg { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a dummy X86 register. + //! Create a dummy X86 register. ASMJIT_INLINE X86Reg() : BaseReg() {} - //! @brief Create a custom X86 register. + //! Create a custom X86 register. ASMJIT_INLINE X86Reg(uint32_t type, uint32_t index, uint32_t size) : BaseReg(type, index, size) {} - //! @brief Create a reference to @a other X86 register. + //! Create a reference to `other` X86 register. ASMJIT_INLINE X86Reg(const X86Reg& other) : BaseReg(other) {} - //! @brief Create non-initialized X86 register. + //! Create non-initialized X86 register. explicit ASMJIT_INLINE X86Reg(const _NoInit&) : BaseReg(NoInit) {} // -------------------------------------------------------------------------- @@ -2489,31 +2508,31 @@ struct X86Reg : public BaseReg { ASMJIT_REG_OP(X86Reg) - //! @brief Get whether the register is Gp register. + //! Get whether the register is Gp register. ASMJIT_INLINE bool isGp() const { return _vreg.type <= kRegTypeGpq; } - //! @brief Get whether the register is Gp byte (8-bit) register. + //! Get whether the register is Gp byte (8-bit) register. ASMJIT_INLINE bool isGpb() const { return _vreg.type <= kRegTypeGpbHi; } - //! @brief Get whether the register is Gp lo-byte (8-bit) register. + //! Get whether the register is Gp lo-byte (8-bit) register. ASMJIT_INLINE bool isGpbLo() const { return _vreg.type == kRegTypeGpbLo; } - //! @brief Get whether the register is Gp hi-byte (8-bit) register. + //! Get whether the register is Gp hi-byte (8-bit) register. ASMJIT_INLINE bool isGpbHi() const { return _vreg.type == kRegTypeGpbHi; } - //! @brief Get whether the register is Gp word (16-bit) register. + //! Get whether the register is Gp word (16-bit) register. ASMJIT_INLINE bool isGpw() const { return _vreg.type == kRegTypeGpw; } - //! @brief Get whether the register is Gp dword (32-bit) register. + //! Get whether the register is Gp dword (32-bit) register. ASMJIT_INLINE bool isGpd() const { return _vreg.type == kRegTypeGpd; } - //! @brief Get whether the register is Gp qword (64-bit) register. + //! Get whether the register is Gp qword (64-bit) register. ASMJIT_INLINE bool isGpq() const { return _vreg.type == kRegTypeGpq; } - //! @brief Get whether the register is Fp register. + //! Get whether the register is Fp register. ASMJIT_INLINE bool isFp() const { return _vreg.type == kRegTypeFp; } - //! @brief Get whether the register is Mm (64-bit) register. + //! Get whether the register is Mm (64-bit) register. ASMJIT_INLINE bool isMm() const { return _vreg.type == kRegTypeMm; } - //! @brief Get whether the register is Xmm (128-bit) register. + //! Get whether the register is Xmm (128-bit) register. ASMJIT_INLINE bool isXmm() const { return _vreg.type == kRegTypeXmm; } - //! @brief Get whether the register is Ymm (256-bit) register. + //! Get whether the register is Ymm (256-bit) register. ASMJIT_INLINE bool isYmm() const { return _vreg.type == kRegTypeYmm; } - //! @brief Get whether the register is a segment. + //! Get whether the register is a segment. ASMJIT_INLINE bool isSeg() const { return _vreg.type == kRegTypeSeg; } }; @@ -2521,19 +2540,19 @@ struct X86Reg : public BaseReg { // [asmjit::x86x64::GpReg] // ============================================================================ -//! @brief X86/X64 Gpb/Gpw/Gpd/Gpq register. +//! X86/X64 Gpb/Gpw/Gpd/Gpq register. struct GpReg : public X86Reg { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a dummy Gp register. + //! Create a dummy Gp register. ASMJIT_INLINE GpReg() : X86Reg() {} - //! @brief Create a reference to @a other Gp register. + //! Create a reference to `other` Gp register. ASMJIT_INLINE GpReg(const GpReg& other) : X86Reg(other) {} - //! @brief Create a custom Gp register. + //! Create a custom Gp register. ASMJIT_INLINE GpReg(uint32_t type, uint32_t index, uint32_t size) : X86Reg(type, index, size) {} - //! @brief Create non-initialized Gp register. + //! Create non-initialized Gp register. explicit ASMJIT_INLINE GpReg(const _NoInit&) : X86Reg(NoInit) {} // -------------------------------------------------------------------------- @@ -2547,19 +2566,19 @@ struct GpReg : public X86Reg { // [asmjit::x86x64::FpReg] // ============================================================================ -//! @brief X86/X64 80-bit Fp register. +//! X86/X64 80-bit Fp register. struct FpReg : public X86Reg { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a dummy Fp register. + //! Create a dummy Fp register. ASMJIT_INLINE FpReg() : X86Reg() {} - //! @brief Create a reference to @a other FPU register. + //! Create a reference to `other` FPU register. ASMJIT_INLINE FpReg(const FpReg& other) : X86Reg(other) {} - //! @brief Create a custom Fp register. + //! Create a custom Fp register. ASMJIT_INLINE FpReg(uint32_t type, uint32_t index, uint32_t size) : X86Reg(type, index, size) {} - //! @brief Create non-initialized Fp register. + //! Create non-initialized Fp register. explicit ASMJIT_INLINE FpReg(const _NoInit&) : X86Reg(NoInit) {} // -------------------------------------------------------------------------- @@ -2573,19 +2592,19 @@ struct FpReg : public X86Reg { // [asmjit::x86x64::MmReg] // ============================================================================ -//! @brief X86/X64 64-bit Mm register. +//! X86/X64 64-bit Mm register. struct MmReg : public X86Reg { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a dummy Mm register. + //! Create a dummy Mm register. ASMJIT_INLINE MmReg() : X86Reg() {} - //! @brief Create a reference to @a other Mm register. + //! Create a reference to `other` Mm register. ASMJIT_INLINE MmReg(const MmReg& other) : X86Reg(other) {} - //! @brief Create a custom Mm register. + //! Create a custom Mm register. ASMJIT_INLINE MmReg(uint32_t type, uint32_t index, uint32_t size) : X86Reg(type, index, size) {} - //! @brief Create non-initialized Mm register. + //! Create non-initialized Mm register. explicit ASMJIT_INLINE MmReg(const _NoInit&) : X86Reg(NoInit) {} // -------------------------------------------------------------------------- @@ -2599,19 +2618,19 @@ struct MmReg : public X86Reg { // [asmjit::x86x64::XmmReg] // ============================================================================ -//! @brief X86/X64 128-bit Xmm register. +//! X86/X64 128-bit Xmm register. struct XmmReg : public X86Reg { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a dummy Xmm register. + //! Create a dummy Xmm register. ASMJIT_INLINE XmmReg() : X86Reg() {} - //! @brief Create a reference to @a other Xmm register. + //! Create a reference to `other` Xmm register. ASMJIT_INLINE XmmReg(const XmmReg& other) : X86Reg(other) {} - //! @brief Create a custom Xmm register. + //! Create a custom Xmm register. ASMJIT_INLINE XmmReg(uint32_t type, uint32_t index, uint32_t size) : X86Reg(type, index, size) {} - //! @brief Create non-initialized Xmm register. + //! Create non-initialized Xmm register. explicit ASMJIT_INLINE XmmReg(const _NoInit&) : X86Reg(NoInit) {} // -------------------------------------------------------------------------- @@ -2625,19 +2644,19 @@ struct XmmReg : public X86Reg { // [asmjit::x86x64::YmmReg] // ============================================================================ -//! @brief X86/X64 256-bit Ymm register. +//! X86/X64 256-bit Ymm register. struct YmmReg : public X86Reg { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a dummy Ymm register. + //! Create a dummy Ymm register. ASMJIT_INLINE YmmReg() : X86Reg() {} - //! @brief Create a reference to @a other Xmm register. + //! Create a reference to `other` Xmm register. ASMJIT_INLINE YmmReg(const YmmReg& other) : X86Reg(other) {} - //! @brief Create a custom Ymm register. + //! Create a custom Ymm register. ASMJIT_INLINE YmmReg(uint32_t type, uint32_t index, uint32_t size) : X86Reg(type, index, size) {} - //! @brief Create non-initialized Ymm register. + //! Create non-initialized Ymm register. explicit ASMJIT_INLINE YmmReg(const _NoInit&) : X86Reg(NoInit) {} // -------------------------------------------------------------------------- @@ -2651,19 +2670,19 @@ struct YmmReg : public X86Reg { // [asmjit::x86x64::SegReg] // ============================================================================ -//! @brief X86/X64 segment register. +//! X86/X64 segment register. struct SegReg : public X86Reg { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a dummy segment register. + //! Create a dummy segment register. ASMJIT_INLINE SegReg() : X86Reg() {} - //! @brief Create a reference to @a other segment register. + //! Create a reference to `other` segment register. ASMJIT_INLINE SegReg(const SegReg& other) : X86Reg(other) {} - //! @brief Create a custom segment register. + //! Create a custom segment register. ASMJIT_INLINE SegReg(uint32_t type, uint32_t index, uint32_t size) : X86Reg(type, index, size) {} - //! @brief Create non-initialized segment register. + //! Create non-initialized segment register. explicit ASMJIT_INLINE SegReg(const _NoInit&) : X86Reg(NoInit) {} // -------------------------------------------------------------------------- @@ -2679,7 +2698,7 @@ struct SegReg : public X86Reg { #define _OP_ID(_Op_) reinterpret_cast(_Op_).getId() -//! @brief X86 memory operand. +//! X86 memory operand. struct Mem : public BaseMem { // -------------------------------------------------------------------------- // [Construction / Destruction] @@ -2823,12 +2842,12 @@ struct Mem : public BaseMem { // [Mem Specific] // -------------------------------------------------------------------------- - //! @brief Clone Mem operand. + //! Clone Mem operand. ASMJIT_INLINE Mem clone() const { return Mem(*this); } - //! @brief Reset Mem operand. + //! Reset Mem operand. ASMJIT_INLINE void reset() { _init_packed_op_sz_b0_b1_id(kOperandTypeMem, 0, kMemTypeBaseIndex, 0, kInvalidValue); _init_packed_d2_d3(kInvalidValue, 0); @@ -2845,24 +2864,24 @@ struct Mem : public BaseMem { // [Segment] // -------------------------------------------------------------------------- - //! @brief Get whether the memory operand has segment override prefix. + //! Get whether the memory operand has segment override prefix. ASMJIT_INLINE bool hasSegment() const { return (_vmem.flags & kMemSegMask) != (kSegDefault << kMemSegIndex); } - //! @brief Get memory operand segment, see @c kSeg. + //! Get memory operand segment, see `kSeg`. ASMJIT_INLINE uint32_t getSegment() const { return (static_cast(_vmem.flags) >> kMemSegIndex) & kMemSegBits; } - //! @brief Set memory operand segment, see @c kSeg. + //! Set memory operand segment, see `kSeg`. ASMJIT_INLINE Mem& setSegment(uint32_t segIndex) { _vmem.flags = static_cast( (static_cast(_vmem.flags) & kMemSegMask) + (segIndex << kMemSegIndex)); return *this; } - //! @brief Set memory operand segment, see @c kSeg. + //! Set memory operand segment, see `kSeg`. ASMJIT_INLINE Mem& setSegment(const SegReg& seg) { return setSegment(seg.getRegIndex()); } @@ -2871,18 +2890,18 @@ struct Mem : public BaseMem { // [Gpd] // -------------------------------------------------------------------------- - //! @brief Get whether the memory operand has 32-bit GP base. + //! Get whether the memory operand has 32-bit GP base. ASMJIT_INLINE bool hasGpdBase() const { return (_packed[0].u32[0] & IntUtil::pack32_4x8(0x00, 0x00, 0x00, kMemGpdMask)) != 0; } - //! @brief Set whether the memory operand has 32-bit GP base. + //! Set whether the memory operand has 32-bit GP base. ASMJIT_INLINE Mem& setGpdBase() { _packed[0].u32[0] |= IntUtil::pack32_4x8(0x00, 0x00, 0x00, kMemGpdMask); return *this; } - //! @brief Set whether the memory operand has 32-bit GP base to @a b. + //! Set whether the memory operand has 32-bit GP base to `b`. ASMJIT_INLINE Mem& setGpdBase(uint32_t b) { _packed[0].u32[0] &=~IntUtil::pack32_4x8(0x00, 0x00, 0x00, kMemGpdMask); _packed[0].u32[0] |= IntUtil::pack32_4x8(0x00, 0x00, 0x00, b << kMemGpdIndex); @@ -2893,12 +2912,12 @@ struct Mem : public BaseMem { // [VSib] // -------------------------------------------------------------------------- - //! @brief Get SIB type. + //! Get SIB type. ASMJIT_INLINE uint32_t getVSib() const { return (static_cast(_vmem.flags) >> kMemVSibIndex) & kMemVSibBits; } - //! @brief Set SIB type. + //! Set SIB type. ASMJIT_INLINE Mem& _setVSib(uint32_t vsib) { _packed[0].u32[0] &=~IntUtil::pack32_4x8(0x00, 0x00, 0x00, kMemVSibMask); _packed[0].u32[0] |= IntUtil::pack32_4x8(0x00, 0x00, 0x00, vsib << kMemVSibIndex); @@ -2909,7 +2928,7 @@ struct Mem : public BaseMem { // [Size] // -------------------------------------------------------------------------- - //! @brief Set memory operand size. + //! Set memory operand size. ASMJIT_INLINE Mem& setSize(uint32_t size) { _vmem.size = static_cast(size); return *this; @@ -2919,17 +2938,17 @@ struct Mem : public BaseMem { // [Base] // -------------------------------------------------------------------------- - //! @brief Get whether the memory operand has base register. + //! Get whether the memory operand has base register. ASMJIT_INLINE bool hasBase() const { return _vmem.base != kInvalidValue; } - //! @brief Get memory operand base register code, variable id, or @ref kInvalidValue. + //! Get memory operand base register code, variable id, or `kInvalidValue`. ASMJIT_INLINE uint32_t getBase() const { return _vmem.base; } - //! @brief Set memory operand base register code, variable id, or @ref kInvalidValue. + //! Set memory operand base register code, variable id, or `kInvalidValue`. ASMJIT_INLINE Mem& setBase(uint32_t base) { _vmem.base = base; return *this; @@ -2939,95 +2958,95 @@ struct Mem : public BaseMem { // [Index] // -------------------------------------------------------------------------- - //! @brief Get whether the memory operand has index. + //! Get whether the memory operand has index. ASMJIT_INLINE bool hasIndex() const { return _vmem.index != kInvalidValue; } - //! @brief Get memory operand index register code, variable id, or @ref kInvalidValue. + //! Get memory operand index register code, variable id, or `kInvalidValue`. ASMJIT_INLINE uint32_t getIndex() const { return _vmem.index; } - //! @brief Set memory operand index register code, variable id, or @ref kInvalidValue. + //! Set memory operand index register code, variable id, or `kInvalidValue`. ASMJIT_INLINE Mem& setIndex(uint32_t index) { _vmem.index = index; return *this; } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const GpReg& index) { _vmem.index = index.getRegIndex(); return _setVSib(kMemVSibGpz); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const GpReg& index, uint32_t shift) { _vmem.index = index.getRegIndex(); return _setVSib(kMemVSibGpz).setShift(shift); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const GpVar& index) { _vmem.index = reinterpret_cast(index).getId(); return _setVSib(kMemVSibGpz); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const GpVar& index, uint32_t shift) { _vmem.index = reinterpret_cast(index).getId(); return _setVSib(kMemVSibGpz).setShift(shift); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const XmmReg& index) { _vmem.index = index.getRegIndex(); return _setVSib(kMemVSibXmm); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const XmmReg& index, uint32_t shift) { _vmem.index = index.getRegIndex(); return _setVSib(kMemVSibXmm).setShift(shift); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const XmmVar& index) { _vmem.index = reinterpret_cast(index).getId(); return _setVSib(kMemVSibXmm); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const XmmVar& index, uint32_t shift) { _vmem.index = reinterpret_cast(index).getId(); return _setVSib(kMemVSibXmm).setShift(shift); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const YmmReg& index) { _vmem.index = index.getRegIndex(); return _setVSib(kMemVSibYmm); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const YmmReg& index, uint32_t shift) { _vmem.index = index.getRegIndex(); return _setVSib(kMemVSibYmm).setShift(shift); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const YmmVar& index) { _vmem.index = reinterpret_cast(index).getId(); return _setVSib(kMemVSibYmm); } - //! @brief Set memory index. + //! Set memory index. ASMJIT_INLINE Mem& setIndex(const YmmVar& index, uint32_t shift) { _vmem.index = reinterpret_cast(index).getId(); return _setVSib(kMemVSibYmm).setShift(shift); } - //! @brief Reset memory index. + //! Reset memory index. ASMJIT_INLINE Mem& resetIndex() { _vmem.index = kInvalidValue; return _setVSib(kMemVSibGpz); @@ -3037,12 +3056,12 @@ struct Mem : public BaseMem { // [Misc] // -------------------------------------------------------------------------- - //! @brief Get whether the memory operand has base and index register. + //! Get whether the memory operand has base and index register. ASMJIT_INLINE bool hasBaseOrIndex() const { return _vmem.base != kInvalidValue || _vmem.index != kInvalidValue; } - //! @brief Get whether the memory operand has base and index register. + //! Get whether the memory operand has base and index register. ASMJIT_INLINE bool hasBaseAndIndex() const { return _vmem.base != kInvalidValue && _vmem.index != kInvalidValue; } @@ -3051,17 +3070,17 @@ struct Mem : public BaseMem { // [Shift] // -------------------------------------------------------------------------- - //! @brief Get whether the memory operand has shift used. + //! Get whether the memory operand has shift used. ASMJIT_INLINE bool hasShift() const { return (_vmem.flags & kMemShiftMask) != 0; } - //! @brief Get memory operand index scale (0, 1, 2 or 3). + //! Get memory operand index scale (0, 1, 2 or 3). ASMJIT_INLINE uint32_t getShift() const { return _vmem.flags >> kMemShiftIndex; } - //! @brief Set memory operand index scale (0, 1, 2 or 3). + //! Set memory operand index scale (0, 1, 2 or 3). ASMJIT_INLINE Mem& setShift(uint32_t shift) { _packed[0].u32[0] &=~IntUtil::pack32_4x8(0x00, 0x00, 0x00, kMemShiftMask); _packed[0].u32[0] |= IntUtil::pack32_4x8(0x00, 0x00, 0x00, shift << kMemShiftIndex); @@ -3072,30 +3091,30 @@ struct Mem : public BaseMem { // [Displacement] // -------------------------------------------------------------------------- - //! @brief Get memory operand relative displacement. + //! Get memory operand relative displacement. ASMJIT_INLINE int32_t getDisplacement() const { return _vmem.displacement; } - //! @brief Set memory operand relative displacement. + //! Set memory operand relative displacement. ASMJIT_INLINE Mem& setDisplacement(int32_t disp) { _vmem.displacement = disp; return *this; } - //! @brief Reset memory operand relative displacement. + //! Reset memory operand relative displacement. ASMJIT_INLINE Mem& resetDisplacement(int32_t disp) { _vmem.displacement = 0; return *this; } - //! @brief Adjust memory operand relative displacement by @a displacement. + //! Adjust memory operand relative displacement by `disp`. ASMJIT_INLINE Mem& adjust(int32_t disp) { _vmem.displacement += disp; return *this; } - //! @brief Get new memory operand adjusted by @a displacement. + //! Get new memory operand adjusted by `disp`. ASMJIT_INLINE Mem adjusted(int32_t disp) const { Mem result(*this); result.adjust(disp); @@ -3134,7 +3153,7 @@ struct Mem : public BaseMem { // [asmjit::x86x64::X86Var] // ============================================================================ -//! @brief Base class for all variables. +//! Base class for all variables. struct X86Var : public BaseVar { // -------------------------------------------------------------------------- // [Construction / Destruction] @@ -3152,12 +3171,12 @@ struct X86Var : public BaseVar { // [X86Var Specific] // -------------------------------------------------------------------------- - //! @brief Clone X86Var operand. + //! Clone X86Var operand. ASMJIT_INLINE X86Var clone() const { return X86Var(*this); } - //! @brief Reset X86Var operand. + //! Reset X86Var operand. ASMJIT_INLINE void reset() { _init_packed_op_sz_b0_b1_id(kOperandTypeVar, 0, kInvalidReg, kInvalidReg, kInvalidValue); _init_packed_d2_d3(kInvalidValue, kInvalidValue); @@ -3170,35 +3189,35 @@ struct X86Var : public BaseVar { ASMJIT_INLINE uint32_t getRegType() const { return _vreg.type; } ASMJIT_INLINE uint32_t getVarType() const { return _vreg.vType; } - //! @brief Get whether the variable is Gpb register. + //! Get whether the variable is Gpb register. ASMJIT_INLINE bool isGp() const { return _vreg.type <= kRegTypeGpq; } - //! @brief Get whether the variable is Gpb register. + //! Get whether the variable is Gpb register. ASMJIT_INLINE bool isGpb() const { return _vreg.type <= kRegTypeGpbHi; } - //! @brief Get whether the variable is Gpb-lo register. + //! Get whether the variable is Gpb-lo register. ASMJIT_INLINE bool isGpbLo() const { return _vreg.type == kRegTypeGpbLo; } - //! @brief Get whether the variable is Gpb-hi register. + //! Get whether the variable is Gpb-hi register. ASMJIT_INLINE bool isGpbHi() const { return _vreg.type == kRegTypeGpbHi; } - //! @brief Get whether the variable is Gpw register. + //! Get whether the variable is Gpw register. ASMJIT_INLINE bool isGpw() const { return _vreg.type == kRegTypeGpw; } - //! @brief Get whether the variable is Gpd register. + //! Get whether the variable is Gpd register. ASMJIT_INLINE bool isGpd() const { return _vreg.type == kRegTypeGpd; } - //! @brief Get whether the variable is Gpq register. + //! Get whether the variable is Gpq register. ASMJIT_INLINE bool isGpq() const { return _vreg.type == kRegTypeGpq; } - //! @brief Get whether the variable is Fp register. + //! Get whether the variable is Fp register. ASMJIT_INLINE bool isFp() const { return _vreg.type == kRegTypeFp; } - //! @brief Get whether the variable is Mm type. + //! Get whether the variable is Mm type. ASMJIT_INLINE bool isMm() const { return _vreg.type == kRegTypeMm; } - //! @brief Get whether the variable is Xmm type. + //! Get whether the variable is Xmm type. ASMJIT_INLINE bool isXmm() const { return _vreg.type == kRegTypeXmm; } - //! @brief Get whether the variable is Ymm type. + //! Get whether the variable is Ymm type. ASMJIT_INLINE bool isYmm() const { return _vreg.type == kRegTypeYmm; } // -------------------------------------------------------------------------- // [Memory Cast] // -------------------------------------------------------------------------- - //! @brief Cast this variable to memory operand. + //! Cast this variable to memory operand. //! //! @note Size of operand depends on native variable type, you can use other //! variants if you want specific one. @@ -3209,7 +3228,7 @@ struct X86Var : public BaseVar { ASMJIT_INLINE Mem m(const GpVar& index, uint32_t shift = 0, int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, index, shift, disp, getSize()); } - //! @brief Cast this variable to 8-bit memory operand. + //! Cast this variable to 8-bit memory operand. ASMJIT_INLINE Mem m8(int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, disp, 1); } @@ -3217,7 +3236,7 @@ struct X86Var : public BaseVar { ASMJIT_INLINE Mem m8(const GpVar& index, uint32_t shift = 0, int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, index, shift, disp, 1); } - //! @brief Cast this variable to 16-bit memory operand. + //! Cast this variable to 16-bit memory operand. ASMJIT_INLINE Mem m16(int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, disp, 2); } @@ -3225,7 +3244,7 @@ struct X86Var : public BaseVar { ASMJIT_INLINE Mem m16(const GpVar& index, uint32_t shift = 0, int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, index, shift, disp, 2); } - //! @brief Cast this variable to 32-bit memory operand. + //! Cast this variable to 32-bit memory operand. ASMJIT_INLINE Mem m32(int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, disp, 4); } @@ -3233,7 +3252,7 @@ struct X86Var : public BaseVar { ASMJIT_INLINE Mem m32(const GpVar& index, uint32_t shift = 0, int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, index, shift, disp, 4); } - //! @brief Cast this variable to 64-bit memory operand. + //! Cast this variable to 64-bit memory operand. ASMJIT_INLINE Mem m64(int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, disp, 8); } @@ -3241,7 +3260,7 @@ struct X86Var : public BaseVar { ASMJIT_INLINE Mem m64(const GpVar& index, uint32_t shift = 0, int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, index, shift, disp, 8); } - //! @brief Cast this variable to 80-bit memory operand (long double). + //! Cast this variable to 80-bit memory operand (long double). ASMJIT_INLINE Mem m80(int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, disp, 10); } @@ -3249,7 +3268,7 @@ struct X86Var : public BaseVar { ASMJIT_INLINE Mem m80(const GpVar& index, uint32_t shift = 0, int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, index, shift, disp, 10); } - //! @brief Cast this variable to 128-bit memory operand. + //! Cast this variable to 128-bit memory operand. ASMJIT_INLINE Mem m128(int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, disp, 16); } @@ -3257,7 +3276,7 @@ struct X86Var : public BaseVar { ASMJIT_INLINE Mem m128(const GpVar& index, uint32_t shift = 0, int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, index, shift, disp, 16); } - //! @brief Cast this variable to 256-bit memory operand. + //! Cast this variable to 256-bit memory operand. ASMJIT_INLINE Mem m256(int32_t disp = 0) const { return Mem(Init, kMemTypeStackIndex, *this, disp, 32); } @@ -3290,40 +3309,36 @@ protected: // [asmjit::x86x64::GpVar] // ============================================================================ -//! @brief Gp variable. +//! Gp variable. struct GpVar : public X86Var { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new uninitialized @c GpVar instance. + //! Create a new uninitialized `GpVar` instance. ASMJIT_INLINE GpVar() : X86Var() {} - //! @brief Create new initialized @c GpVar instance. + //! Create a new initialized `GpVar` instance. ASMJIT_INLINE GpVar(BaseCompiler& c, uint32_t type = kVarTypeIntPtr, const char* name = NULL) : X86Var(NoInit) { c._newVar(this, type, name); } - //! @brief Create new @c GpVar instance using @a other. - //! - //! Note this will not create a different variable, use @c Compiler::newGpVar() - //! if you want to do so. This is only copy-constructor that allows to store - //! the same variable in different places. + //! Create a clone of `other`. ASMJIT_INLINE GpVar(const GpVar& other) : X86Var(other) {} - //! @brief Create new uninitialized @c GpVar instance (internal). + //! Create a new uninitialized `GpVar` instance (internal). explicit ASMJIT_INLINE GpVar(const _NoInit&) : X86Var(NoInit) {} // -------------------------------------------------------------------------- // [GpVar Specific] // -------------------------------------------------------------------------- - //! @brief Clone GpVar operand. + //! Clone GpVar operand. ASMJIT_INLINE GpVar clone() const { return GpVar(*this); } - //! @brief Reset GpVar operand. + //! Reset GpVar operand. ASMJIT_INLINE void reset() { X86Var::reset(); } @@ -3332,18 +3347,18 @@ struct GpVar : public X86Var { // [GpVar Cast] // -------------------------------------------------------------------------- - //! @brief Cast this variable to 8-bit (LO) part of variable + //! Cast this variable to 8-bit (LO) part of variable ASMJIT_INLINE GpVar r8() const { return GpVar(*this, kRegTypeGpbLo, 1); } - //! @brief Cast this variable to 8-bit (LO) part of variable + //! Cast this variable to 8-bit (LO) part of variable ASMJIT_INLINE GpVar r8Lo() const { return GpVar(*this, kRegTypeGpbLo, 1); } - //! @brief Cast this variable to 8-bit (HI) part of variable + //! Cast this variable to 8-bit (HI) part of variable ASMJIT_INLINE GpVar r8Hi() const { return GpVar(*this, kRegTypeGpbHi, 1); } - //! @brief Cast this variable to 16-bit part of variable + //! Cast this variable to 16-bit part of variable ASMJIT_INLINE GpVar r16() const { return GpVar(*this, kRegTypeGpw, 2); } - //! @brief Cast this variable to 32-bit part of variable + //! Cast this variable to 32-bit part of variable ASMJIT_INLINE GpVar r32() const { return GpVar(*this, kRegTypeGpd, 4); } - //! @brief Cast this variable to 64-bit part of variable + //! Cast this variable to 64-bit part of variable ASMJIT_INLINE GpVar r64() const { return GpVar(*this, kRegTypeGpq, 8); } // -------------------------------------------------------------------------- @@ -3367,29 +3382,30 @@ protected: // [asmjit::x86x64::FpVar] // ============================================================================ -//! @brief Fpu variable. +//! Fpu variable. struct FpVar : public X86Var { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new uninitialized @c FpVar instance. + //! Create a new uninitialized `FpVar` instance. ASMJIT_INLINE FpVar() : X86Var() {} + //! Create a new variable that links to `other`. ASMJIT_INLINE FpVar(const FpVar& other) : X86Var(other) {} - //! @brief Create new uninitialized @c FpVar instance (internal). + //! Create a new uninitialized `FpVar` instance (internal). explicit ASMJIT_INLINE FpVar(const _NoInit&) : X86Var(NoInit) {} // -------------------------------------------------------------------------- // [FpVar Specific] // -------------------------------------------------------------------------- - //! @brief Clone FpVar operand. + //! Clone FpVar operand. ASMJIT_INLINE FpVar clone() const { return FpVar(*this); } - //! @brief Reset FpVar operand. + //! Reset FpVar operand. ASMJIT_INLINE void reset() { X86Var::reset(); } @@ -3408,39 +3424,35 @@ struct FpVar : public X86Var { // [asmjit::x86x64::MmVar] // ============================================================================ -//! @brief Mm variable. +//! Mm variable. struct MmVar : public X86Var { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new uninitialized @c MmVar instance. + //! Create a new uninitialized `MmVar` instance. ASMJIT_INLINE MmVar() : X86Var() {} - //! @brief Create new initialized @c MmVar instance. + //! Create a new initialized `MmVar` instance. ASMJIT_INLINE MmVar(BaseCompiler& c, uint32_t type = kVarTypeMm, const char* name = NULL) : X86Var(NoInit) { c._newVar(this, type, name); } - //! @brief Create new @c MmVar instance using @a other. - //! - //! Note this will not create a different variable, use @c Compiler::newMmVar() - //! if you want to do so. This is only copy-constructor that allows to store - //! the same variable in different places. + //! Create a clone of `other`. ASMJIT_INLINE MmVar(const MmVar& other) : X86Var(other) {} - //! @brief Create new uninitialized @c MmVar instance (internal). + //! Create a new uninitialized `MmVar` instance (internal). explicit ASMJIT_INLINE MmVar(const _NoInit&) : X86Var(NoInit) {} // -------------------------------------------------------------------------- // [MmVar Specific] // -------------------------------------------------------------------------- - //! @brief Clone MmVar operand. + //! Clone MmVar operand. ASMJIT_INLINE MmVar clone() const { return MmVar(*this); } - //! @brief Reset MmVar operand. + //! Reset MmVar operand. ASMJIT_INLINE void reset() { X86Var::reset(); } @@ -3459,34 +3471,35 @@ struct MmVar : public X86Var { // [asmjit::x86x64::XmmVar] // ============================================================================ -//! @brief Xmm variable. +//! Xmm variable. struct XmmVar : public X86Var { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new uninitialized @c XmmVar instance. + //! Create a new uninitialized `XmmVar` instance. ASMJIT_INLINE XmmVar() : X86Var() {} - //! @brief Create new initialized @c XmmVar instance. + //! Create a new initialized `XmmVar` instance. ASMJIT_INLINE XmmVar(BaseCompiler& c, uint32_t type = kVarTypeXmm, const char* name = NULL) : X86Var(NoInit) { c._newVar(this, type, name); } + //! Create a clone of `other`. ASMJIT_INLINE XmmVar(const XmmVar& other) : X86Var(other) {} - //! @brief Create new uninitialized @c XmmVar instance (internal). + //! Create a new uninitialized `XmmVar` instance (internal). explicit ASMJIT_INLINE XmmVar(const _NoInit&) : X86Var(NoInit) {} // -------------------------------------------------------------------------- // [XmmVar Specific] // -------------------------------------------------------------------------- - //! @brief Clone XmmVar operand. + //! Clone XmmVar operand. ASMJIT_INLINE XmmVar clone() const { return XmmVar(*this); } - //! @brief Reset XmmVar operand. + //! Reset XmmVar operand. ASMJIT_INLINE void reset() { X86Var::reset(); } @@ -3505,34 +3518,35 @@ struct XmmVar : public X86Var { // [asmjit::x86x64::YmmVar] // ============================================================================ -//! @brief Ymm variable. +//! Ymm variable. struct YmmVar : public X86Var { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create new uninitialized @c YmmVar instance. + //! Create a new uninitialized `YmmVar` instance. ASMJIT_INLINE YmmVar() : X86Var() {} - //! @brief Create new initialized @c YmmVar instance. + //! Create a new initialized `YmmVar` instance. ASMJIT_INLINE YmmVar(BaseCompiler& c, uint32_t type = kVarTypeYmm, const char* name = NULL) : X86Var(NoInit) { c._newVar(this, type, name); } + //! Create a clone of `other`. ASMJIT_INLINE YmmVar(const YmmVar& other) : X86Var(other) {} - //! @brief Create new uninitialized @c YmmVar instance (internal). + //! Create a new uninitialized `YmmVar` instance (internal). explicit ASMJIT_INLINE YmmVar(const _NoInit&) : X86Var(NoInit) {} // -------------------------------------------------------------------------- // [YmmVar Specific] // -------------------------------------------------------------------------- - //! @brief Clone YmmVar operand. + //! Clone YmmVar operand. ASMJIT_INLINE YmmVar clone() const { return YmmVar(*this); } - //! @brief Reset YmmVar operand. + //! Reset YmmVar operand. ASMJIT_INLINE void reset() { X86Var::reset(); } @@ -3551,7 +3565,7 @@ struct YmmVar : public X86Var { // [asmjit::x86x64::Macros] // ============================================================================ -//! @brief Create Shuffle Constant for MMX/SSE shuffle instrutions. +//! Create Shuffle Constant for MMX/SSE shuffle instrutions. //! //! @param z First component position, number at interval [0, 3] inclusive. //! @param x Second component position, number at interval [0, 3] inclusive. @@ -3559,25 +3573,26 @@ struct YmmVar : public X86Var { //! @param w Fourth component position, number at interval [0, 3] inclusive. //! //! Shuffle constants can be used to make immediate value for these intrinsics: -//! - @ref Assembler::pshufw() -//! - @ref Assembler::pshufd() -//! - @ref Assembler::pshufhw() -//! - @ref Assembler::pshuflw() -//! - @ref Assembler::shufps() -static ASMJIT_INLINE uint8_t mm_shuffle(uint8_t z, uint8_t y, uint8_t x, uint8_t w) -{ return (z << 6) | (y << 4) | (x << 2) | w; } +//! - `x86x64::X86X64Assembler::pshufw()` and `x86x64::X86X64Compiler::pshufw()` +//! - `x86x64::X86X64Assembler::pshufd()` and `x86x64::X86X64Compiler::pshufd()` +//! - `x86x64::X86X64Assembler::pshufhw()` and `x86x64::X86X64Compiler::pshufhw()` +//! - `x86x64::X86X64Assembler::pshuflw()` and `x86x64::X86X64Compiler::pshuflw()` +//! - `x86x64::X86X64Assembler::shufps()` and `x86x64::X86X64Compiler::shufps()` +static ASMJIT_INLINE uint8_t mm_shuffle(uint8_t z, uint8_t y, uint8_t x, uint8_t w) { + return (z << 6) | (y << 4) | (x << 2) | w; +} // ============================================================================ // [asmjit::x86x64::Cond - Reverse / Negate] // ============================================================================ -//! @brief Corresponds to transposing the operands of a comparison. +//! Corresponds to transposing the operands of a comparison. static ASMJIT_INLINE uint32_t reverseCond(uint32_t cond) { ASMJIT_ASSERT(cond < ASMJIT_ARRAY_SIZE(_reverseCond)); return _reverseCond[cond]; } -//! @brief Get the equivalent of negated condition code. +//! Get the equivalent of negated condition code. static ASMJIT_INLINE uint32_t negateCond(uint32_t cond) { ASMJIT_ASSERT(cond < ASMJIT_ARRAY_SIZE(_reverseCond)); return static_cast(cond ^ static_cast(cond < kCondNone)); @@ -3587,22 +3602,22 @@ static ASMJIT_INLINE uint32_t negateCond(uint32_t cond) { // [asmjit::x86x64::Cond - ToJcc / ToMovcc / ToSetcc] // ============================================================================ -//! @brief Translate condition code @a cc to cmovcc instruction code. -//! @sa @c kInstCode, @c _kInstCmovcc. +//! Translate condition code `cc` to cmovcc instruction code. +//! @sa `kInstCode`, `_kInstCmovcc`. static ASMJIT_INLINE uint32_t condToCmovcc(uint32_t cond) { ASMJIT_ASSERT(static_cast(cond) < ASMJIT_ARRAY_SIZE(_condToCmovcc)); return _condToCmovcc[cond]; } -//! @brief Translate condition code @a cc to jcc instruction code. -//! @sa @c kInstCode, @c _kInstJcc. +//! Translate condition code `cc` to jcc instruction code. +//! @sa `kInstCode`, `_kInstJcc`. static ASMJIT_INLINE uint32_t condToJcc(uint32_t cond) { ASMJIT_ASSERT(static_cast(cond) < ASMJIT_ARRAY_SIZE(_condToJcc)); return _condToJcc[cond]; } -//! @brief Translate condition code @a cc to setcc instruction code. -//! @sa @c kInstCode, @c _kInstSetcc. +//! Translate condition code `cc` to setcc instruction code. +//! @sa `kInstCode`, `_kInstSetcc`. static ASMJIT_INLINE uint32_t condToSetcc(uint32_t cond) { ASMJIT_ASSERT(static_cast(cond) < ASMJIT_ARRAY_SIZE(_condToSetcc)); return _condToSetcc[cond]; @@ -3612,469 +3627,469 @@ static ASMJIT_INLINE uint32_t condToSetcc(uint32_t cond) { // [asmjit::x86x64::Registers] // ============================================================================ -//! @brief No register, can be used only within @c Mem operand. +//! No register, can be used only within `Mem` operand. ASMJIT_VAR const GpReg noGpReg; -//! @brief Gpb-lo register. +//! Gpb-lo register. ASMJIT_VAR const GpReg al; -//! @brief Gpb-lo register. +//! Gpb-lo register. ASMJIT_VAR const GpReg cl; -//! @brief Gpb-lo register. +//! Gpb-lo register. ASMJIT_VAR const GpReg dl; -//! @brief Gpb-lo register. +//! Gpb-lo register. ASMJIT_VAR const GpReg bl; -//! @brief Gpb-hi register. +//! Gpb-hi register. ASMJIT_VAR const GpReg ah; -//! @brief Gpb-hi register. +//! Gpb-hi register. ASMJIT_VAR const GpReg ch; -//! @brief Gpb-hi register. +//! Gpb-hi register. ASMJIT_VAR const GpReg dh; -//! @brief Gpb-hi register. +//! Gpb-hi register. ASMJIT_VAR const GpReg bh; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg ax; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg cx; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg dx; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg bx; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg sp; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg bp; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg si; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg di; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg eax; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg ecx; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg edx; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg ebx; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg esp; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg ebp; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg esi; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg edi; -//! @brief Fp register. +//! Fp register. ASMJIT_VAR const FpReg fp0; -//! @brief Fp register. +//! Fp register. ASMJIT_VAR const FpReg fp1; -//! @brief Fp register. +//! Fp register. ASMJIT_VAR const FpReg fp2; -//! @brief Fp register. +//! Fp register. ASMJIT_VAR const FpReg fp3; -//! @brief Fp register. +//! Fp register. ASMJIT_VAR const FpReg fp4; -//! @brief Fp register. +//! Fp register. ASMJIT_VAR const FpReg fp5; -//! @brief Fp register. +//! Fp register. ASMJIT_VAR const FpReg fp6; -//! @brief Fp register. +//! Fp register. ASMJIT_VAR const FpReg fp7; -//! @brief Mm register. +//! Mm register. ASMJIT_VAR const MmReg mm0; -//! @brief Mm register. +//! Mm register. ASMJIT_VAR const MmReg mm1; -//! @brief Mm register. +//! Mm register. ASMJIT_VAR const MmReg mm2; -//! @brief Mm register. +//! Mm register. ASMJIT_VAR const MmReg mm3; -//! @brief Mm register. +//! Mm register. ASMJIT_VAR const MmReg mm4; -//! @brief Mm register. +//! Mm register. ASMJIT_VAR const MmReg mm5; -//! @brief Mm register. +//! Mm register. ASMJIT_VAR const MmReg mm6; -//! @brief Mm register. +//! Mm register. ASMJIT_VAR const MmReg mm7; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm0; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm1; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm2; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm3; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm4; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm5; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm6; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm7; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm0; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm1; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm2; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm3; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm4; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm5; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm6; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm7; -//! @brief Cs segment register. +//! Cs segment register. ASMJIT_VAR const SegReg cs; -//! @brief Ss segment register. +//! Ss segment register. ASMJIT_VAR const SegReg ss; -//! @brief Ds segment register. +//! Ds segment register. ASMJIT_VAR const SegReg ds; -//! @brief Es segment register. +//! Es segment register. ASMJIT_VAR const SegReg es; -//! @brief Fs segment register. +//! Fs segment register. ASMJIT_VAR const SegReg fs; -//! @brief Gs segment register. +//! Gs segment register. ASMJIT_VAR const SegReg gs; -//! @brief Get Gpb-lo register. +//! Get Gpb-lo register. static ASMJIT_INLINE GpReg gpb_lo(uint32_t index) { return GpReg(kRegTypeGpbLo, index, 1); } -//! @brief Get Gpb-hi register. +//! Get Gpb-hi register. static ASMJIT_INLINE GpReg gpb_hi(uint32_t index) { return GpReg(kRegTypeGpbHi, index, 1); } -//! @brief Get Gpw register. +//! Get Gpw register. static ASMJIT_INLINE GpReg gpw(uint32_t index) { return GpReg(kRegTypeGpw, index, 2); } -//! @brief Get Gpd register. +//! Get Gpd register. static ASMJIT_INLINE GpReg gpd(uint32_t index) { return GpReg(kRegTypeGpd, index, 4); } -//! @brief Get Fp register. +//! Get Fp register. static ASMJIT_INLINE FpReg fp(uint32_t index) { return FpReg(kRegTypeFp, index, 10); } -//! @brief Get Mm register. +//! Get Mm register. static ASMJIT_INLINE MmReg mm(uint32_t index) { return MmReg(kRegTypeMm, index, 8); } -//! @brief Get Xmm register. +//! Get Xmm register. static ASMJIT_INLINE XmmReg xmm(uint32_t index) { return XmmReg(kRegTypeXmm, index, 16); } -//! @brief Get Xmm register. +//! Get Xmm register. static ASMJIT_INLINE YmmReg ymm(uint32_t index) { return YmmReg(kRegTypeYmm, index, 32); } // ============================================================================ // [asmjit::x86x64::Mem - ptr[base + disp]] // ============================================================================ -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const GpReg& base, int32_t disp = 0, uint32_t size = 0) { return Mem(base, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, kSizeYWord); } -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const GpVar& base, int32_t disp = 0, uint32_t size = 0) { return Mem(base, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, kSizeYWord); } // ============================================================================ // [asmjit::x86x64::Mem - ptr[base + (index << shift) + disp]] // ============================================================================ -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0) { return Mem(base, index, shift, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeYWord); } -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0) { return Mem(base, index, shift, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeYWord); } // ============================================================================ // [asmjit::x86x64::Mem - ptr[base + (vex << shift) + disp]] // ============================================================================ -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const GpReg& base, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0) { return Mem(base, index, shift, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const GpReg& base, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const GpReg& base, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const GpReg& base, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const GpReg& base, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const GpReg& base, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const GpReg& base, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const GpReg& base, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeYWord); } -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const GpReg& base, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0) { return Mem(base, index, shift, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const GpReg& base, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const GpReg& base, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const GpReg& base, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const GpReg& base, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const GpReg& base, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const GpReg& base, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const GpReg& base, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeYWord); } -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const GpVar& base, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0) { return Mem(base, index, shift, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const GpVar& base, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const GpVar& base, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const GpVar& base, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const GpVar& base, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const GpVar& base, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const GpVar& base, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const GpVar& base, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeYWord); } -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const GpVar& base, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0) { return Mem(base, index, shift, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const GpVar& base, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const GpVar& base, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const GpVar& base, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const GpVar& base, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const GpVar& base, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const GpVar& base, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const GpVar& base, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, kSizeYWord); } // ============================================================================ // [asmjit::x86x64::Mem - [label + disp]] // ============================================================================ -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const Label& label, int32_t disp = 0, uint32_t size = 0) { return Mem(label, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, kSizeYWord); } // ============================================================================ // [asmjit::x86x64::Mem - [label + index << shift + disp]] // ============================================================================ -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0, uint32_t size = 0) { return Mem(label, index, shift, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeYWord); } -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. static ASMJIT_INLINE Mem ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0, uint32_t size = 0) { return Mem(label, index, shift, disp, size); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, kSizeYWord); } // ============================================================================ // [asmjit::x86x64::Mem - [ptr + disp] // ============================================================================ -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. ASMJIT_API Mem ptr_abs(Ptr pAbs, int32_t disp = 0, uint32_t size = 0); -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, kSizeQWord); } -//! @brief Create a tword pointer operand (used for 80-bit floating points). +//! Create a tword pointer operand (used for 80-bit floating points). static ASMJIT_INLINE Mem tword_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, kSizeYWord); } // ============================================================================ // [asmjit::x86x64::Mem - [pAbs + index << shift + disp] // ============================================================================ -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. ASMJIT_API Mem ptr_abs(Ptr pAbs, const X86Reg& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0); -//! @brief Create a custom pointer operand. +//! Create a custom pointer operand. ASMJIT_API Mem ptr_abs(Ptr pAbs, const X86Var& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0); -//! @brief Create a Byte pointer operand. +//! Create a Byte pointer operand. static ASMJIT_INLINE Mem byte_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeYWord); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr_abs(Ptr pAbs, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr_abs(Ptr pAbs, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr_abs(Ptr pAbs, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr_abs(Ptr pAbs, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr_abs(Ptr pAbs, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr_abs(Ptr pAbs, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr_abs(Ptr pAbs, const XmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeYWord); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr_abs(Ptr pAbs, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr_abs(Ptr pAbs, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr_abs(Ptr pAbs, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr_abs(Ptr pAbs, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr_abs(Ptr pAbs, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr_abs(Ptr pAbs, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr_abs(Ptr pAbs, const YmmReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeYWord); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr_abs(Ptr pAbs, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr_abs(Ptr pAbs, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr_abs(Ptr pAbs, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr_abs(Ptr pAbs, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr_abs(Ptr pAbs, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr_abs(Ptr pAbs, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr_abs(Ptr pAbs, const XmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeYWord); } -//! @brief Create a byte pointer operand. +//! Create a byte pointer operand. static ASMJIT_INLINE Mem byte_ptr_abs(Ptr pAbs, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeByte); } -//! @brief Create a word pointer operand. +//! Create a word pointer operand. static ASMJIT_INLINE Mem word_ptr_abs(Ptr pAbs, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeWord); } -//! @brief Create a dword pointer operand. +//! Create a dword pointer operand. static ASMJIT_INLINE Mem dword_ptr_abs(Ptr pAbs, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeDWord); } -//! @brief Create a qword pointer operand. +//! Create a qword pointer operand. static ASMJIT_INLINE Mem qword_ptr_abs(Ptr pAbs, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeQWord); } -//! @brief Create a tword pointer operand. +//! Create a tword pointer operand. static ASMJIT_INLINE Mem tword_ptr_abs(Ptr pAbs, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeTWord); } -//! @brief Create a oword pointer operand. +//! Create a oword pointer operand. static ASMJIT_INLINE Mem oword_ptr_abs(Ptr pAbs, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeOWord); } -//! @brief Create a yword pointer operand. +//! Create a yword pointer operand. static ASMJIT_INLINE Mem yword_ptr_abs(Ptr pAbs, const YmmVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, kSizeYWord); } // ============================================================================ @@ -4118,8 +4133,9 @@ using namespace ::asmjit::x86x64; // [asmjit::x86::kRegType] // ============================================================================ +//! @internal ASMJIT_ENUM(kRegType) { - //! @brief Gpd register. + //! Gpd register. kRegTypeGpz = kRegTypeGpd }; @@ -4127,15 +4143,15 @@ ASMJIT_ENUM(kRegType) { // [asmjit::x86::kRegCount] // ============================================================================ -//! @brief X86 registers count per class. +//! X86 registers count per class. ASMJIT_ENUM(kRegCount) { - //! @brief Base count of registers (8). + //! Base count of registers (8). kRegCountBase = 8, - //! @brief Count of Gp registers (8). + //! Count of Gp registers (8). kRegCountGp = kRegCountBase, - //! @brief Count of Xmm registers (8). + //! Count of Xmm registers (8). kRegCountXmm = kRegCountBase, - //! @brief Count of Ymm registers (8). + //! Count of Ymm registers (8). kRegCountYmm = kRegCountBase }; @@ -4145,62 +4161,64 @@ ASMJIT_ENUM(kRegCount) { //! @internal //! -//! @brief Mapping of x64 variables into their real IDs. +//! Mapping of x86 variables into their real IDs. //! //! This mapping translates the following: -//! - @c kVarTypeIntPtr to @c kVarTypeInt32. -//! - @c kVarTypeUIntPtr to @c kVarTypeUInt32. +//! - `kVarTypeInt64` to `kVarTypeInvalid`. +//! - `kVarTypeUInt64` to `kVarTypeInvalid`. +//! - `kVarTypeIntPtr` to `kVarTypeInt32`. +//! - `kVarTypeUIntPtr` to `kVarTypeUInt32`. ASMJIT_VAR const uint8_t _varMapping[kVarTypeCount]; // ============================================================================ // [asmjit::x86::Registers] // ============================================================================ -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg zax; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg zcx; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg zdx; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg zbx; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg zsp; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg zbp; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg zsi; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg zdi; -//! @brief Get Gp qword register. +//! Get Gp qword register. static ASMJIT_INLINE GpReg gpz(uint32_t index) { return GpReg(kRegTypeGpd, index, 4); } // ============================================================================ // [asmjit::x86::Mem] // ============================================================================ -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, 4); } -//! @brief Create an intptr_t 32-bit pointer operand. +//! Create an intptr_t 32-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr_abs(Ptr pAbs, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, 4); } //! @} @@ -4229,8 +4247,9 @@ using namespace ::asmjit::x86x64; // [asmjit::x64::kRegType] // ============================================================================ +//! @internal ASMJIT_ENUM(kRegType) { - //! @brief Gpq register. + //! Gpq register. kRegTypeGpz = kRegTypeGpq }; @@ -4238,15 +4257,15 @@ ASMJIT_ENUM(kRegType) { // [asmjit::x64::kRegCount] // ============================================================================ -//! @brief X86 registers count per class. +//! X86 registers count per class. ASMJIT_ENUM(kRegCount) { - //! @brief Base count of registers (16). + //! Base count of registers (16). kRegCountBase = 16, - //! @brief Count of Gp registers (16). + //! Count of Gp registers (16). kRegCountGp = kRegCountBase, - //! @brief Count of Xmm registers (16). + //! Count of Xmm registers (16). kRegCountXmm = kRegCountBase, - //! @brief Count of Ymm registers (16). + //! Count of Ymm registers (16). kRegCountYmm = kRegCountBase }; @@ -4256,191 +4275,191 @@ ASMJIT_ENUM(kRegCount) { //! @internal //! -//! @brief Mapping of x64 variables into their real IDs. +//! Mapping of x64 variables into their real IDs. //! //! This mapping translates the following: -//! - @c kVarTypeIntPtr to @c kVarTypeInt64. -//! - @c kVarTypeUIntPtr to @c kVarTypeUInt64. +//! - `kVarTypeIntPtr` to `kVarTypeInt64`. +//! - `kVarTypeUIntPtr` to `kVarTypeUInt64`. ASMJIT_VAR const uint8_t _varMapping[kVarTypeCount]; // ============================================================================ // [asmjit::x64::Registers] // ============================================================================ -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg spl; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg bpl; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg sil; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg dil; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg r8b; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg r9b; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg r10b; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg r11b; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg r12b; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg r13b; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg r14b; -//! @brief Gpb register. +//! Gpb register. ASMJIT_VAR const GpReg r15b; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg r8w; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg r9w; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg r10w; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg r11w; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg r12w; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg r13w; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg r14w; -//! @brief Gpw register. +//! Gpw register. ASMJIT_VAR const GpReg r15w; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg r8d; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg r9d; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg r10d; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg r11d; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg r12d; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg r13d; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg r14d; -//! @brief Gpd register. +//! Gpd register. ASMJIT_VAR const GpReg r15d; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg rax; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg rcx; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg rdx; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg rbx; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg rsp; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg rbp; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg rsi; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg rdi; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg r8; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg r9; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg r10; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg r11; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg r12; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg r13; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg r14; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg r15; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg zax; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg zcx; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg zdx; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg zbx; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg zsp; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg zbp; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg zsi; -//! @brief Gpq register. +//! Gpq register. ASMJIT_VAR const GpReg zdi; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm8; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm9; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm10; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm11; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm12; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm13; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm14; -//! @brief Xmm register. +//! Xmm register. ASMJIT_VAR const XmmReg xmm15; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm8; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm9; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm10; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm11; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm12; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm13; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm14; -//! @brief Ymm register. +//! Ymm register. ASMJIT_VAR const YmmReg ymm15; -//! @brief Get Gpq register. +//! Get Gpq register. static ASMJIT_INLINE GpReg gpq(uint32_t index) { return GpReg(kRegTypeGpq, index, 8); } -//! @brief Get Gpq register. +//! Get Gpq register. static ASMJIT_INLINE GpReg gpz(uint32_t index) { return GpReg(kRegTypeGpq, index, 8); } // ============================================================================ // [asmjit::x64::Mem] // ============================================================================ -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const Label& label, int32_t disp = 0) { return ptr(label, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const Label& label, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const Label& label, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr(label, index, shift, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr_abs(Ptr pAbs, int32_t disp = 0) { return ptr_abs(pAbs, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr_abs(Ptr pAbs, const GpReg& index, uint32_t shift, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr_abs(Ptr pAbs, const GpVar& index, uint32_t shift, int32_t disp = 0) { return ptr_abs(pAbs, index, shift, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const GpReg& base, int32_t disp = 0) { return ptr(base, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const GpVar& base, int32_t disp = 0) { return ptr(base, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const GpReg& base, const GpReg& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, 8); } -//! @brief Create an intptr_t 64-bit pointer operand. +//! Create an intptr_t 64-bit pointer operand. static ASMJIT_INLINE Mem intptr_ptr(const GpVar& base, const GpVar& index, uint32_t shift = 0, int32_t disp = 0) { return ptr(base, index, shift, disp, 8); } //! @} diff --git a/src/asmjit/x86/x86func.cpp b/src/asmjit/x86/x86func.cpp index f8a46af..cc17086 100644 --- a/src/asmjit/x86/x86func.cpp +++ b/src/asmjit/x86/x86func.cpp @@ -52,8 +52,6 @@ static ASMJIT_INLINE uint32_t x86ArgTypeToXmmType(uint32_t aType) { #define R(_Index_) kRegIndex##_Index_ static uint32_t X86X64FuncDecl_initConv(X86X64FuncDecl* self, uint32_t arch, uint32_t conv) { - uint32_t i; - // Setup defaults. self->_argStackSize = 0; self->_redZoneSize = 0; @@ -66,13 +64,8 @@ static uint32_t X86X64FuncDecl_initConv(X86X64FuncDecl* self, uint32_t arch, uin self->_passed.reset(); self->_preserved.reset(); - for (i = 0; i < ASMJIT_ARRAY_SIZE(self->_passedOrderGp); i++) { - self->_passedOrderGp[i] = kInvalidReg; - } - - for (i = 0; i < ASMJIT_ARRAY_SIZE(self->_passedOrderXmm); i++) { - self->_passedOrderXmm[i] = kInvalidReg; - } + ::memset(self->_passedOrderGp, kInvalidReg, ASMJIT_ARRAY_SIZE(self->_passedOrderGp)); + ::memset(self->_passedOrderXmm, kInvalidReg, ASMJIT_ARRAY_SIZE(self->_passedOrderXmm)); // -------------------------------------------------------------------------- // [X86 Support] @@ -328,10 +321,14 @@ static Error X86X64FuncDecl_initFunc(X86X64FuncDecl* self, uint32_t arch, FuncInOut& arg = self->getArg(i); uint32_t varType = varMapping[arg.getVarType()]; - if (x86ArgIsInt(varType) && gpPos < 16 && self->_passedOrderGp[gpPos] != kInvalidReg) { - arg._regIndex = self->_passedOrderGp[gpPos++]; - self->_used.add(kRegClassGp, IntUtil::mask(arg.getRegIndex())); - } + if (!x86ArgIsInt(varType) || gpPos >= ASMJIT_ARRAY_SIZE(self->_passedOrderGp)) + continue; + + if (self->_passedOrderGp[gpPos] == kInvalidReg) + continue; + + arg._regIndex = self->_passedOrderGp[gpPos++]; + self->_used.add(kRegClassGp, IntUtil::mask(arg.getRegIndex())); } // Stack arguments. @@ -375,11 +372,13 @@ static Error X86X64FuncDecl_initFunc(X86X64FuncDecl* self, uint32_t arch, FuncInOut& arg = self->getArg(i); uint32_t varType = varMapping[arg.getVarType()]; - if (x86ArgIsInt(varType)) { + if (x86ArgIsInt(varType) && i < ASMJIT_ARRAY_SIZE(self->_passedOrderGp)) { arg._regIndex = self->_passedOrderGp[i]; self->_used.add(kRegClassGp, IntUtil::mask(arg.getRegIndex())); + continue; } - else if (x86ArgIsFp(varType)) { + + if (x86ArgIsFp(varType) && i < ASMJIT_ARRAY_SIZE(self->_passedOrderXmm)) { arg._varType = static_cast(x86ArgTypeToXmmType(varType)); arg._regIndex = self->_passedOrderXmm[i]; self->_used.add(kRegClassXy, IntUtil::mask(arg.getRegIndex())); @@ -413,10 +412,14 @@ static Error X86X64FuncDecl_initFunc(X86X64FuncDecl* self, uint32_t arch, FuncInOut& arg = self->getArg(i); uint32_t varType = varMapping[arg.getVarType()]; - if (x86ArgIsInt(varType) && gpPos < 32 && self->_passedOrderGp[gpPos] != kInvalidReg) { - arg._regIndex = self->_passedOrderGp[gpPos++]; - self->_used.add(kRegClassGp, IntUtil::mask(arg.getRegIndex())); - } + if (!x86ArgIsInt(varType) || gpPos >= ASMJIT_ARRAY_SIZE(self->_passedOrderGp)) + continue; + + if (self->_passedOrderGp[gpPos] == kInvalidReg) + continue; + + arg._regIndex = self->_passedOrderGp[gpPos++]; + self->_used.add(kRegClassGp, IntUtil::mask(arg.getRegIndex())); } // Register arguments (Xmm), always left-to-right. @@ -523,13 +526,8 @@ void X86X64FuncDecl::reset() { _passed.reset(); _preserved.reset(); - for (i = 0; i < ASMJIT_ARRAY_SIZE(_passedOrderGp); i++) { - _passedOrderGp[i] = kInvalidReg; - } - - for (i = 0; i < ASMJIT_ARRAY_SIZE(_passedOrderXmm); i++) { - _passedOrderXmm[i] = kInvalidReg; - } + ::memset(_passedOrderGp, kInvalidReg, ASMJIT_ARRAY_SIZE(_passedOrderGp)); + ::memset(_passedOrderXmm, kInvalidReg, ASMJIT_ARRAY_SIZE(_passedOrderXmm)); } } // x86x64 namespace diff --git a/src/asmjit/x86/x86func.h b/src/asmjit/x86/x86func.h index 2ce3a57..a8ee948 100644 --- a/src/asmjit/x86/x86func.h +++ b/src/asmjit/x86/x86func.h @@ -19,14 +19,14 @@ namespace asmjit { namespace x86x64 { -//! @addtogroup asmjit_x86x64 +//! @addtogroup asmjit_x86x64_codegen //! @{ // ============================================================================ // [asmjit::x86x64::kFuncConv] // ============================================================================ -//! @brief X86 function calling conventions. +//! X86 function calling conventions. //! //! Calling convention is scheme how function arguments are passed into //! function and how functions returns values. In assembler programming @@ -34,33 +34,32 @@ namespace x86x64 { //! even small inconsistency can cause undefined behavior or crash. //! //! List of calling conventions for 32-bit x86 mode: -//! - @c kFuncConvCDecl - Calling convention for C runtime. -//! - @c kFuncConvStdCall - Calling convention for WinAPI functions. -//! - @c kFuncConvMsThisCall - Calling convention for C++ members under -//! Windows (produced by MSVC and all MSVC compatible compilers). -//! - @c kFuncConvMsFastCall - Fastest calling convention that can be used -//! by MSVC compiler. -//! - @c kFuncConv_BORNANDFASTCALL - Borland fastcall convention. -//! - @c kFuncConvGccFastCall - GCC fastcall convention (2 register arguments). -//! - @c kFuncConvGccRegParm1 - GCC regparm(1) convention. -//! - @c kFuncConvGccRegParm2 - GCC regparm(2) convention. -//! - @c kFuncConvGccRegParm3 - GCC regparm(3) convention. +//! - `kFuncConvCDecl` - Calling convention for C runtime. +//! - `kFuncConvStdCall` - Calling convention for WinAPI functions. +//! - `kFuncConvMsThisCall` - Calling convention for C++ members under +//! Windows (produced by MSVC and all MSVC compatible compilers). +//! - `kFuncConvMsFastCall` - Fastest calling convention that can be used +//! by MSVC compiler. +//! - `kFuncConvBorlandFastCall` - Borland fastcall convention. +//! - `kFuncConvGccFastCall` - GCC fastcall convention (2 register arguments). +//! - `kFuncConvGccRegParm1` - GCC regparm(1) convention. +//! - `kFuncConvGccRegParm2` - GCC regparm(2) convention. +//! - `kFuncConvGccRegParm3` - GCC regparm(3) convention. //! //! List of calling conventions for 64-bit x86 mode (x64): -//! - @c kFuncConvX64W - Windows 64-bit calling convention (WIN64 ABI). -//! - @c kFuncConvX64U - Unix 64-bit calling convention (AMD64 ABI). +//! - `kFuncConvX64W` - Windows 64-bit calling convention (WIN64 ABI). +//! - `kFuncConvX64U` - Unix 64-bit calling convention (AMD64 ABI). //! -//! There is also @c kFuncConvHost that is defined to fit best to your -//! compiler. +//! There is also `kFuncConvHost` that is defined to fit the host calling +//! convention. //! -//! These types are used together with @c asmjit::Compiler::addFunc() -//! method. +//! These types are used together with `BaseCompiler::addFunc()` method. ASMJIT_ENUM(kFuncConv) { // -------------------------------------------------------------------------- // [X64] // -------------------------------------------------------------------------- - //! @brief X64 calling convention for Windows platform (WIN64 ABI). + //! X64 calling convention for Windows platform (WIN64 ABI). //! //! For first four arguments are used these registers: //! - 1. 32/64-bit integer or floating point argument - rcx/xmm0 @@ -93,7 +92,7 @@ ASMJIT_ENUM(kFuncConv) { //! http://msdn.microsoft.com/en-us/library/9b372w95.aspx . kFuncConvX64W = 1, - //! @brief X64 calling convention for Unix platforms (AMD64 ABI). + //! X64 calling convention for Unix platforms (AMD64 ABI). //! //! First six 32 or 64-bit integer arguments are passed in rdi, rsi, rdx, //! rcx, r8, r9 registers. First eight floating point or Xmm arguments @@ -120,7 +119,7 @@ ASMJIT_ENUM(kFuncConv) { // [X86] // -------------------------------------------------------------------------- - //! @brief Cdecl calling convention (used by C runtime). + //! Cdecl calling convention (used by C runtime). //! //! Compatible across MSVC and GCC. //! @@ -131,7 +130,7 @@ ASMJIT_ENUM(kFuncConv) { //! - Caller. kFuncConvCDecl = 3, - //! @brief Stdcall calling convention (used by WinAPI). + //! Stdcall calling convention (used by WinAPI). //! //! Compatible across MSVC and GCC. //! @@ -146,7 +145,7 @@ ASMJIT_ENUM(kFuncConv) { //! - Floating points - fp0 register. kFuncConvStdCall = 4, - //! @brief MSVC specific calling convention used by MSVC/Intel compilers + //! MSVC specific calling convention used by MSVC/Intel compilers //! for struct/class methods. //! //! This is MSVC (and Intel) only calling convention used in Windows @@ -170,7 +169,7 @@ ASMJIT_ENUM(kFuncConv) { //! it's implicit and there is no way how to override it. kFuncConvMsThisCall = 5, - //! @brief MSVC specific fastcall. + //! MSVC specific fastcall. //! //! Two first parameters (evaluated from left-to-right) are in ECX:EDX //! registers, all others on the stack in right-to-left order. @@ -189,7 +188,7 @@ ASMJIT_ENUM(kFuncConv) { //! mechanism. kFuncConvMsFastCall = 6, - //! @brief Borland specific fastcall with 2 parameters in registers. + //! Borland specific fastcall with 2 parameters in registers. //! //! Two first parameters (evaluated from left-to-right) are in ECX:EDX //! registers, all others on the stack in left-to-right order. @@ -208,7 +207,7 @@ ASMJIT_ENUM(kFuncConv) { //! to other fastcall conventions used in different compilers. kFuncConvBorlandFastCall = 7, - //! @brief GCC specific fastcall convention. + //! GCC specific fastcall convention. //! //! Two first parameters (evaluated from left-to-right) are in ECX:EDX //! registers, all others on the stack in right-to-left order. @@ -223,11 +222,10 @@ ASMJIT_ENUM(kFuncConv) { //! - Integer types - EAX:EDX registers. //! - Floating points - fp0 register. //! - //! @note This calling convention should be compatible with - //! @c kFuncConvMsFastCall. + //! @note This calling convention should be compatible with `kFuncConvMsFastCall`. kFuncConvGccFastCall = 8, - //! @brief GCC specific regparm(1) convention. + //! GCC specific regparm(1) convention. //! //! The first parameter (evaluated from left-to-right) is in EAX register, //! all others on the stack in right-to-left order. @@ -243,7 +241,7 @@ ASMJIT_ENUM(kFuncConv) { //! - Floating points - fp0 register. kFuncConvGccRegParm1 = 9, - //! @brief GCC specific regparm(2) convention. + //! GCC specific regparm(2) convention. //! //! Two first parameters (evaluated from left-to-right) are in EAX:EDX //! registers, all others on the stack in right-to-left order. @@ -259,7 +257,7 @@ ASMJIT_ENUM(kFuncConv) { //! - Floating points - fp0 register. kFuncConvGccRegParm2 = 10, - //! @brief GCC specific fastcall with 3 parameters in registers. + //! GCC specific fastcall with 3 parameters in registers. //! //! Three first parameters (evaluated from left-to-right) are in //! EAX:EDX:ECX registers, all others on the stack in right-to-left order. @@ -277,7 +275,7 @@ ASMJIT_ENUM(kFuncConv) { //! @internal //! - //! @brief Count of function calling conventions. + //! Count of function calling conventions. _kFuncConvCount = 12, // -------------------------------------------------------------------------- @@ -285,24 +283,24 @@ ASMJIT_ENUM(kFuncConv) { // -------------------------------------------------------------------------- //! @def kFuncConvHost - //! @brief Default calling convention for current platform / operating system. + //! Default calling convention for current platform / operating system. //! @def kFuncConvHostCDecl - //! @brief Default C calling convention based on current compiler's settings. + //! Default C calling convention based on current compiler's settings. //! @def kFuncConvHostStdCall - //! @brief Compatibility for __stdcall calling convention. + //! Compatibility for `__stdcall` calling convention. //! //! @note This enumeration is always set to a value which is compatible with //! current compilers __stdcall calling convention. In 64-bit mode the value - //! is compatible with @ref kFuncConvX64W or @ref kFuncConvX64U. + //! is compatible with `kFuncConvX64W` or `kFuncConvX64U`. //! @def kFuncConvHostFastCall - //! @brief Compatibility for __fastcall calling convention. + //! Compatibility for `__fastcall` calling convention. //! //! @note This enumeration is always set to a value which is compatible with - //! current compilers __fastcall calling convention. In 64-bit mode the value - //! is compatible with @ref kFuncConvX64W or @ref kFuncConvX64U. + //! current compilers `__fastcall` calling convention. In 64-bit mode the value + //! is compatible with `kFuncConvX64W` or `kFuncConvX64U`. #if defined(ASMJIT_HOST_X86) @@ -339,16 +337,16 @@ ASMJIT_ENUM(kFuncConv) { // [asmjit::x86x64::kFuncHint] // ============================================================================ -//! @brief X86 function hints. +//! X86 function hints. ASMJIT_ENUM(kFuncHint) { - //! @brief Use push/pop sequences instead of mov sequences in function prolog + //! Use push/pop sequences instead of mov sequences in function prolog //! and epilog. kFuncHintPushPop = 16, - //! @brief Add emms instruction to the function epilog. + //! Add emms instruction to the function epilog. kFuncHintEmms = 17, - //! @brief Add sfence instruction to the function epilog. + //! Add sfence instruction to the function epilog. kFuncHintSFence = 18, - //! @brief Add lfence instruction to the function epilog. + //! Add lfence instruction to the function epilog. kFuncHintLFence = 19 }; @@ -356,36 +354,34 @@ ASMJIT_ENUM(kFuncHint) { // [asmjit::x86x64::kFuncFlags] // ============================================================================ -//! @brief X86 function flags. +//! X86 function flags. ASMJIT_ENUM(kFuncFlags) { - //! @brief Whether to emit register load/save sequence using push/pop pairs. + //! Whether to emit register load/save sequence using push/pop pairs. kFuncFlagPushPop = 0x00010000, - //! @brief Whether to emit "enter" instead of three instructions in case + //! Whether to emit `enter` instead of three instructions in case //! that the function is not naked or misaligned. kFuncFlagEnter = 0x00020000, - //! @brief Whether to emit "leave" instead of two instructions in case + //! Whether to emit `leave` instead of two instructions in case //! that the function is not naked or misaligned. kFuncFlagLeave = 0x00040000, - //! @brief Whether it's required to move arguments to a new stack location, + //! Whether it's required to move arguments to a new stack location, //! because of manual aligning. kFuncFlagMoveArgs = 0x00080000, - //! @brief Whether to emit EMMS instruction in epilog (auto-detected). + //! Whether to emit `emms` instruction in epilog (auto-detected). kFuncFlagEmms = 0x01000000, - //! @brief Whether to emit SFence instruction in epilog (auto-detected). + //! Whether to emit `sfence` instruction in epilog (auto-detected). //! - //! @note @ref kFuncFlagSFence and @ref kFuncFlagLFence - //! combination will result in emitting mfence. + //! `kFuncFlagSFence` with `kFuncFlagLFence` results in emitting `mfence`. kFuncFlagSFence = 0x02000000, - //! @brief Whether to emit LFence instruction in epilog (auto-detected). + //! Whether to emit `lfence` instruction in epilog (auto-detected). //! - //! @note @ref kFuncFlagSFence and @ref kFuncFlagLFence - //! combination will result in emitting mfence. + //! `kFuncFlagSFence` with `kFuncFlagLFence` results in emitting `mfence`. kFuncFlagLFence = 0x04000000 }; @@ -393,6 +389,9 @@ ASMJIT_ENUM(kFuncFlags) { // [asmjit::x86x64::x86GetArchFromCConv] // ============================================================================ +//! Get architecture by a calling convention. +//! +//! Returns `kArchX86` or `kArchX64` depending on `conv`. static ASMJIT_INLINE uint32_t x86GetArchFromCConv(uint32_t conv) { return IntUtil::inInterval(conv, kFuncConvX64W, kFuncConvX64U) ? kArchX64 : kArchX86; } @@ -401,56 +400,68 @@ static ASMJIT_INLINE uint32_t x86GetArchFromCConv(uint32_t conv) { // [asmjit::x86x64::X86X64FuncDecl] // ============================================================================ -//! @brief X86 function, including calling convention, arguments and their +//! X86 function, including calling convention, arguments and their //! register indices or stack positions. struct X86X64FuncDecl : public FuncDecl { // -------------------------------------------------------------------------- // [Construction / Destruction] // -------------------------------------------------------------------------- - //! @brief Create a new @ref X86X64FuncDecl instance. - ASMJIT_INLINE X86X64FuncDecl() { reset(); } + //! Create a new `X86X64FuncDecl` instance. + ASMJIT_INLINE X86X64FuncDecl() { + reset(); + } // -------------------------------------------------------------------------- // [Accessors - X86] // -------------------------------------------------------------------------- - //! @brief Get used registers (mask). + //! Get used registers (mask). //! //! @note The result depends on the function calling convention AND the //! function prototype. Returned mask contains only registers actually used //! to pass function arguments. - ASMJIT_INLINE uint32_t getUsed(uint32_t c) const { return _used.get(c); } + ASMJIT_INLINE uint32_t getUsed(uint32_t c) const { + return _used.get(c); + } - //! @brief Get passed registers (mask). + //! Get passed registers (mask). //! //! @note The result depends on the function calling convention used; the //! prototype of the function doesn't affect the mask returned. - ASMJIT_INLINE uint32_t getPassed(uint32_t c) const { return _passed.get(c); } + ASMJIT_INLINE uint32_t getPassed(uint32_t c) const { + return _passed.get(c); + } - //! @brief Get preserved registers (mask). + //! Get preserved registers (mask). //! //! @note The result depends on the function calling convention used; the //! prototype of the function doesn't affect the mask returned. - ASMJIT_INLINE uint32_t getPreserved(uint32_t c) const { return _preserved.get(c); } + ASMJIT_INLINE uint32_t getPreserved(uint32_t c) const { + return _preserved.get(c); + } - //! @brief Get ther order of passed registers (Gp). + //! Get ther order of passed registers (Gp). //! //! @note The result depends on the function calling convention used; the //! prototype of the function doesn't affect the mask returned. - ASMJIT_INLINE const uint8_t* getPassedOrderGp() const { return _passedOrderGp; } + ASMJIT_INLINE const uint8_t* getPassedOrderGp() const { + return _passedOrderGp; + } - //! @brief Get ther order of passed registers (Xmm). + //! Get ther order of passed registers (Xmm). //! //! @note The result depends on the function calling convention used; the //! prototype of the function doesn't affect the mask returned. - ASMJIT_INLINE const uint8_t* getPassedOrderXmm() const { return _passedOrderXmm; } + ASMJIT_INLINE const uint8_t* getPassedOrderXmm() const { + return _passedOrderXmm; + } // -------------------------------------------------------------------------- // [SetPrototype] // -------------------------------------------------------------------------- - //! @brief Set function prototype. + //! Set function prototype. //! //! This will set function calling convention and setup arguments variables. //! @@ -467,18 +478,18 @@ struct X86X64FuncDecl : public FuncDecl { // [Members] // -------------------------------------------------------------------------- - //! @brief Used registers . + //! Used registers. RegMask _used; - //! @brief Passed registers (defined by the calling convention). + //! Passed registers (defined by the calling convention). RegMask _passed; - //! @brief Preserved registers (defined by the calling convention). + //! Preserved registers (defined by the calling convention). RegMask _preserved; - //! @brief Order of registers defined to pass function arguments (Gp). - uint8_t _passedOrderGp[kFuncArgCount]; - //! @brief Order of registers defined to pass function arguments (Xmm). - uint8_t _passedOrderXmm[kFuncArgCount]; + //! Order of registers defined to pass function arguments (Gp). + uint8_t _passedOrderGp[8]; + //! Order of registers defined to pass function arguments (Xmm). + uint8_t _passedOrderXmm[8]; }; //! @} diff --git a/tools/Doxyfile b/tools/Doxyfile new file mode 100644 index 0000000..cb94031 --- /dev/null +++ b/tools/Doxyfile @@ -0,0 +1,408 @@ +# Doxyfile 1.8.7 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +DOXYFILE_ENCODING = UTF-8 + +PROJECT_NAME = "AsmJit" +PROJECT_NUMBER = "1.1" +PROJECT_BRIEF = "Complete Remote and JIT Assembler for x86/x64" + +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 2 +MARKDOWN_SUPPORT = YES +AUTOLINK_SUPPORT = NO +IDL_PROPERTY_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_PACKAGE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO + +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = YES +HIDE_IN_BODY_DOCS = YES + +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = NO + +SHOW_GROUPED_MEMB_INC = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = YES +STRICT_PROTO_MATCHING = NO + +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= NO + +MAX_INITIALIZER_LINES = 0 +SHOW_USED_FILES = NO +SHOW_FILES = NO +SHOW_NAMESPACES = NO + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +INPUT = ../src/asmjit +INPUT_ENCODING = UTF-8 +RECURSIVE = YES +EXCLUDE = +USE_MDFILE_AS_MAINPAGE = ../README.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +SOURCE_TOOLTIPS = YES +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +ALPHABETICAL_INDEX = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +GENERATE_HTML = YES +GENERATE_LATEX = NO +GENERATE_RTF = NO +GENERATE_MAN = NO + +HTML_OUTPUT = doc +HTML_FILE_EXTENSION = .html + +LAYOUT_FILE = doc-layout.xml +HTML_HEADER = doc-header.html +HTML_FOOTER = doc-footer.html +HTML_STYLESHEET = doc-style.css +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = + +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = NO + +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 0 +SEARCHENGINE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the CHM output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 0 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +PREDEFINED = ASMJIT_DOCGEN=1 +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +CLASS_DIAGRAMS = NO +CLASS_GRAPH = NO diff --git a/tools/doc-footer.html b/tools/doc-footer.html new file mode 100644 index 0000000..152f668 --- /dev/null +++ b/tools/doc-footer.html @@ -0,0 +1,21 @@ + + + + + + + + + + diff --git a/tools/doc-header.html b/tools/doc-header.html new file mode 100644 index 0000000..a34c17b --- /dev/null +++ b/tools/doc-header.html @@ -0,0 +1,37 @@ + + + + + + $projectname: $title + + + $treeview + $search + + $extrastylesheet + + + + + +
+ + +
+ + + + + + + + + + +
+
$projectname $projectnumber API
+
$projectbrief
+
+
+ diff --git a/tools/doc-layout.xml b/tools/doc-layout.xml new file mode 100644 index 0000000..f92c72b --- /dev/null +++ b/tools/doc-layout.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/doc-style.css b/tools/doc-style.css new file mode 100644 index 0000000..f2ba7a3 --- /dev/null +++ b/tools/doc-style.css @@ -0,0 +1,1399 @@ +body { + font: 14px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 4px 6px; + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: bold; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #9CAFD4; + border-bottom: 1px solid #9CAFD4; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +.arrow { + color: #9CAFD4; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial, Helvetica; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #728DC1; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('ftv2folderopen.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('ftv2folderclosed.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('ftv2doc.png'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +table.directory { + font: 400 14px Roboto,sans-serif; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul { + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li { + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a { + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover { + color:#6884BD; +} + +.navpath li.footer { + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + +div.summary { + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a { + white-space: nowrap; +} + +div.ingroups { + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a { + white-space: nowrap; +} + +div.header { + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle { + padding: 5px 5px 5px 10px; +} + +dl { + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.note { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + +#titlearea { + width: 100%; + + border-bottom: 1px solid #AFAFAF; + margin: 0; + padding: 0; + + background: #F8F8F8; + font: 20px Tahoma, Arial, sans-serif; +} + +#projectname { + margin: 0; + padding: 2px 0px; +} + +#projectbrief { + margin: 0; + padding: 0; + + font-size: 80%; +} + +#projectnumber { + margin: 0px; + padding: 0px; +} + +.image { + text-align: center; +} + +.caption { + font-weight: bold; +} + +div.zoom { + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 20px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +/* Tabs */ + +.tabs, .tabs2, .tabs3 { + width: 100%; + font-size: 13px; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + z-index: 101; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +/* PowerTip */ + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print { + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} diff --git a/tools/doxygen.conf b/tools/doxygen.conf deleted file mode 100644 index 6ba327b..0000000 --- a/tools/doxygen.conf +++ /dev/null @@ -1,1634 +0,0 @@ -# Doxyfile 1.7.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = AsmJit - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 1.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = . - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = YES - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = YES - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = NO - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = NO - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = NO - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= NO - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 0 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = NO - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = NO - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../../src/asmjit - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.c \ - *.cpp \ - *.h - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = NO - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = doxygen.css - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = YES - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = ../AsmJit.chm - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = "C:/Program Files/HTML Help Workshop/hhc.exe" - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = YES - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 1 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = ASMJIT_NODOC=1 \ - ASMJIT_X86=1 - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = NO - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = NO - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans.ttf - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = NO - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = NO - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = YES - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = NO - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/tools/doxygen.css b/tools/doxygen.css deleted file mode 100644 index c534d2b..0000000 --- a/tools/doxygen.css +++ /dev/null @@ -1,405 +0,0 @@ -body, table, div, p, dl { - font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; - font-size: 12px; -} - -/* @group Heading Levels */ - -h1 { - text-align: center; - font-size: 150%; -} - -h2 { - font-size: 120%; -} - -h3 { - font-size: 100%; -} - -/* @end */ - -caption { - font-weight: bold; -} - -div.qindex, div.navtab{ - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; -} - -div.qindex, div.navpath { - width: 100%; - line-height: 140%; -} - -div.navtab { - margin-right: 15px; -} - -/* @group Link Styling */ - -a { - color: #153788; - font-weight: normal; - text-decoration: none; -} - -.contents a:visited { - color: #1b77c5; -} - -a:hover { - text-decoration: underline; -} - -a.qindex { - font-weight: bold; -} - -a.qindexHL { - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - border: 1px double #9295C2; -} - -.contents a.qindexHL:visited { - color: #ffffff; -} - -a.el { - font-weight: bold; -} - -a.elRef { -} - -a.code { -} - -a.codeRef { -} - -/* @end */ - -dl.el { - margin-left: -1cm; -} - -.fragment { - font-family: monospace, fixed; - font-size: 105%; -} - -pre.fragment { - border: 1px dotted #CCCCFF; - padding: 4px 6px; - margin: 4px 8px 4px 2px; -} - -div.ah { - background-color: black; - font-weight: bold; - color: #ffffff; - margin-bottom: 3px; - margin-top: 3px -} - -div.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: bold; -} - -div.groupText { - margin-left: 16px; - font-style: italic; -} - -body { - background: white; - color: black; - margin-right: 20px; - margin-left: 20px; -} - -td.indexkey { - background-color: #e8eef2; - font-weight: bold; - border: 1px solid #CCCCCC; - margin: 2px 0px 2px 0; - padding: 2px 10px; -} - -td.indexvalue { - background-color: #e8eef2; - border: 1px solid #CCCCCC; - padding: 2px 10px; - margin: 2px 0px; -} - -tr.memlist { - background-color: #f0f0f0; -} - -p.formulaDsp { - text-align: center; -} - -img.formulaDsp { - -} - -img.formulaInl { - vertical-align: middle; -} - -/* @group Code Colorization */ - -span.keyword { - color: #008000 -} - -span.keywordtype { - color: #604020 -} - -span.keywordflow { - color: #e08000 -} - -span.comment { - color: #800000 -} - -span.preprocessor { - color: #806020 -} - -span.stringliteral { - color: #002080 -} - -span.charliteral { - color: #008080 -} - -/* @end */ - -td.tiny { - font-size: 75%; -} - -.dirtab { - padding: 4px; - border-collapse: collapse; - border: 1px solid #84b0c7; -} - -th.dirtab { - background: #e8eef2; - font-weight: bold; -} - -hr { - height: 0; - border: none; - border-top: 1px solid #666; -} - -/* @group Member Descriptions */ - -.mdescLeft, .mdescRight, -.memItemLeft, .memItemRight, -.memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #FFFFFF; - border: none; - margin: 4px; - padding: 1px 0 0 8px; -} - -.mdescLeft, .mdescRight { - padding: 0px 8px 4px 8px; - color: #555; -} - -.memItemLeft, .memItemRight { - padding-top: 4px; - padding-bottom: 4px; - border-top: 1px solid #CCCCFF; -} - -.mdescLeft, .mdescRight { -} - -.memTemplParams { - color: #606060; -} - -/* @end */ - -/* @group Member Details */ - -/* Styles for detailed member documentation */ - -.memtemplate { - margin-left: 3px; - font-weight: normal; - font-size: 80%; - color: #606060; -} - -.memnav { - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - -.memitem { - padding: 0; -} - -.memname { - white-space: nowrap; - font-weight: bold; -} - -.memproto, .memdoc { -} - -.memproto { - padding: 0; - background-color: #EEEEFF; - border: 1px solid #CCCCFF; -} - -.memdoc { - padding: 2px 5px; - border-left: 1px solid #CCCCFF; - border-right: 1px solid #CCCCFF; - border-bottom: 1px solid #CCCCFF; -} - -.paramkey { - text-align: right; -} - -.paramtype { - white-space: nowrap; -} - -.paramname { - color: #606060; - font-weight: normal; - white-space: nowrap; -} -.paramname em { - font-style: normal; -} - -/* @end */ - -/* @group Directory (tree) */ - -/* for the tree view */ - -.ftvtree { - font-family: sans-serif; - margin: 0.5em; -} - -/* these are for tree view when used as main index */ - -.directory { - font-size: 9pt; - font-weight: bold; -} - -.directory h3 { - margin: 0px; - margin-top: 1em; - font-size: 11pt; -} - -/* -The following two styles can be used to replace the root node title -with an image of your choice. Simply uncomment the next two styles, -specify the name of your image and be sure to set 'height' to the -proper pixel height of your image. -*/ - -/* -.directory h3.swap { - height: 61px; - background-repeat: no-repeat; - background-image: url("yourimage.gif"); -} -.directory h3.swap span { - display: none; -} -*/ - -.directory > h3 { - margin-top: 0; -} - -.directory p { - margin: 0px; - white-space: nowrap; -} - -.directory div { - display: none; - margin: 0px; -} - -.directory img { - vertical-align: -30%; -} - -/* these are for tree view when not used as main index */ - -.directory-alt { - font-size: 100%; - font-weight: bold; -} - -.directory-alt h3 { - margin: 0px; - margin-top: 1em; - font-size: 11pt; -} - -.directory-alt > h3 { - margin-top: 0; -} - -.directory-alt p { - margin: 0px; - white-space: nowrap; -} - -.directory-alt div { - display: none; - margin: 0px; -} - -.directory-alt img { - vertical-align: -30%; -} - -/* @end */ - -address { - font-style: normal; - color: #333; -}