mirror of
https://github.com/g-truc/glm.git
synced 2024-09-20 08:22:17 +00:00
Merge pull request #306 from jcajka/master
Fixed (u)int64 MSB/LSB handling on BE archs #306
This commit is contained in:
commit
05eac3c8b2
@ -248,10 +248,8 @@ namespace detail
|
|||||||
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
||||||
|
|
||||||
uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
|
uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
|
||||||
uint32* PointerMSB = (reinterpret_cast<uint32*>(&Value64) + 1);
|
msb = Value64 >> 32;
|
||||||
msb = *PointerMSB;
|
lsb = Value64;
|
||||||
uint32* PointerLSB = (reinterpret_cast<uint32*>(&Value64) + 0);
|
|
||||||
lsb = *PointerLSB;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <precision P, template <typename, precision> class vecType>
|
template <precision P, template <typename, precision> class vecType>
|
||||||
@ -270,10 +268,8 @@ namespace detail
|
|||||||
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
|
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
|
||||||
|
|
||||||
int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
|
int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
|
||||||
int32* PointerMSB = (reinterpret_cast<int32*>(&Value64) + 1);
|
msb = Value64 >> 32;
|
||||||
msb = *PointerMSB;
|
lsb = Value64;
|
||||||
int32* PointerLSB = (reinterpret_cast<int32*>(&Value64));
|
|
||||||
lsb = *PointerLSB;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <precision P, template <typename, precision> class vecType>
|
template <precision P, template <typename, precision> class vecType>
|
||||||
|
Loading…
Reference in New Issue
Block a user