From 1de78adf7a51e5ef81979143e4941464526b1d6b Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 17 Dec 2022 19:57:47 -0500 Subject: [PATCH] More ABI shenanigans for linking havok --- indra/llcommon/lluuid.cpp | 32 ++++++++++++++++++++++++++++++++ indra/llcommon/lluuid.h | 23 +++++------------------ 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 42f4a4d2727..6172d28d026 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -49,6 +49,38 @@ const LLUUID LLUUID::null; const LLTransactionID LLTransactionID::tnull; +LLUUID::LLUUID() +{ +} + +LLUUID::LLUUID(const LLUUID& rhs) +{ + std::memcpy(mData, rhs.mData, sizeof(mData)); +} + +LLUUID::LLUUID(LLUUID&& rhs) noexcept +{ + std::memmove(mData, rhs.mData, sizeof(mData)); +} + +LLUUID::~LLUUID() +{ +} + +bool LLUUID::operator==(const LLUUID& rhs) const +{ + __m128i mm_left = load_unaligned_si128(mData); + __m128i mm_right = load_unaligned_si128(rhs.mData); + +#if defined(__SSE4_1__) + __m128i mm = _mm_xor_si128(mm_left, mm_right); + return _mm_test_all_zeros(mm, mm) != 0; +#else + __m128i mm_cmp = _mm_cmpeq_epi32(mm_left, mm_right); + return _mm_movemask_epi8(mm_cmp) == 0xFFFF; +#endif +} + /* NOT DONE YET!!! diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 70e620130bb..3f4a0eb4b12 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -54,10 +54,10 @@ class LL_COMMON_API LLUUID // // CREATORS // - LLUUID() = default; - LLUUID(const LLUUID& rhs) { std::memcpy(mData, rhs.mData, sizeof(mData)); } - LLUUID(LLUUID&& rhs) { std::memmove(mData, rhs.mData, sizeof(mData)); } - ~LLUUID() {} + LLUUID(); + LLUUID(const LLUUID& rhs); + LLUUID(LLUUID&& rhs) noexcept; + ~LLUUID(); LLUUID& operator=(const LLUUID& rhs) { std::memcpy(mData, rhs.mData, sizeof(mData)); return *this;} LLUUID& operator=(LLUUID&& rhs) noexcept { std::memmove(mData, rhs.mData, sizeof(mData)); return *this;} @@ -133,20 +133,7 @@ class LL_COMMON_API LLUUID // JC: These must return real bool's (not BOOLs) or else use of the STL // will generate bool-to-int performance warnings. - bool operator==(const LLUUID& rhs) const - { - __m128i mm_left = load_unaligned_si128(mData); - __m128i mm_right = load_unaligned_si128(rhs.mData); - -#if defined(__SSE4_1__) - __m128i mm = _mm_xor_si128(mm_left, mm_right); - return _mm_test_all_zeros(mm, mm) != 0; -#else - __m128i mm_cmp = _mm_cmpeq_epi32(mm_left, mm_right); - return _mm_movemask_epi8(mm_cmp) == 0xFFFF; -#endif - } - + bool operator==(const LLUUID& rhs) const; bool operator!=(const LLUUID& rhs) const { return !((*this) == rhs); -- GitLab