diff --git a/src/asmjit/asmjit.h b/src/asmjit/asmjit.h index baf1c6c..81f567e 100644 --- a/src/asmjit/asmjit.h +++ b/src/asmjit/asmjit.h @@ -56,11 +56,11 @@ //! //! @section AsmJit_Main_CodeGeneration Code Generation //! -//! - @ref asmjit_base_general "Assembler core" - Operands, intrinsics and low-level assembler. -//! - @ref asmjit_compiler "Compiler" - High level code generation. -//! - @ref asmjit_cpuinfo "Cpu Information" - Get information about host processor. -//! - @ref asmjit_logging "Logging" - Logging and error handling. -//! - @ref AsmJit_MemoryManagement "Memory Management" - Virtual memory management. +//! - \ref asmjit_base_general "Assembler core" - Operands, intrinsics and low-level assembler. +//! - \ref asmjit_compiler "Compiler" - High level code generation. +//! - \ref asmjit_cpuinfo "Cpu Information" - Get information about host processor. +//! - \ref asmjit_logging "Logging" - Logging and error handling. +//! - \ref AsmJit_MemoryManagement "Memory Management" - Virtual memory management. //! //! @section AsmJit_Main_HomePage AsmJit Homepage //! diff --git a/src/asmjit/base/constpool.cpp b/src/asmjit/base/constpool.cpp index 93c3091..55ef26a 100644 --- a/src/asmjit/base/constpool.cpp +++ b/src/asmjit/base/constpool.cpp @@ -33,10 +33,12 @@ const ConstPoolNode ConstPoolTree::_sentinel = { { //! //! Remove left horizontal links. static ASMJIT_INLINE ConstPoolNode* ConstPoolTree_skewNode(ConstPoolNode* node) { - if (node->_link[0]->_level == node->_level && node->_level != 0 ) { + if (node->_link[0]->_level == node->_level && node->_level != 0) { ConstPoolNode *save = node->_link[0]; + node->_link[0] = save->_link[1]; save->_link[1] = node; + node = save; } @@ -49,8 +51,10 @@ static ASMJIT_INLINE ConstPoolNode* ConstPoolTree_skewNode(ConstPoolNode* node) 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]; + node->_link[1] = save->_link[0]; save->_link[0] = node; + node = save; node->_level++; } diff --git a/src/asmjit/x86/x86util.h b/src/asmjit/x86/x86util.h index 42724a5..eb5c0e1 100644 --- a/src/asmjit/x86/x86util.h +++ b/src/asmjit/x86/x86util.h @@ -341,7 +341,18 @@ struct X86Util { return (op._packed[0].u32[0] & mask) == IntUtil::pack32_2x8_1x16(kOperandTypeReg, 1, 0x0000); } - //! Pack a shuffle constant to be used with multimedia instrutions. + //! Pack a shuffle constant to be used with multimedia instrutions (2 values). + //! + //! \param x First component position, number at interval [0, 1] inclusive. + //! \param y Second component position, number at interval [0, 1] inclusive. + //! + //! Shuffle constants can be used to make immediate value for these intrinsics: + //! - `X86X64Assembler::shufpd()` and `X86X64Compiler::shufpd()` + static ASMJIT_INLINE uint32_t mmShuffle(uint32_t x, uint32_t y) { + return (x << 1) | y; + } + + //! Pack a shuffle constant to be used with multimedia instrutions (4 values). //! //! \param z First component position, number at interval [0, 3] inclusive. //! \param x Second component position, number at interval [0, 3] inclusive.