Skip to content
Snippets Groups Projects
Commit 1de78adf authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

More ABI shenanigans for linking havok

parent 4dda1211
No related branches found
No related tags found
No related merge requests found
......@@ -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!!!
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment