summaryrefslogtreecommitdiff
path: root/thirdparty/misc
diff options
context:
space:
mode:
authorMarcel Admiraal <madmiraal@users.noreply.github.com>2020-05-16 09:59:56 +0100
committerMarcel Admiraal <madmiraal@users.noreply.github.com>2020-05-16 10:30:51 +0100
commit8efd1ca9f7ea58758e0f33db20411a36e21500e1 (patch)
tree8257319dd1a323c41476c0cb048a9a41eef20aa0 /thirdparty/misc
parent24275b26b82bf262dc48715ed5a3b11066f5dec4 (diff)
Update r128.h to include latest fix for mingw-64 32 bit builds.
Diffstat (limited to 'thirdparty/misc')
-rw-r--r--thirdparty/misc/r128.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/thirdparty/misc/r128.h b/thirdparty/misc/r128.h
index be7cd3024d..1f7aab78fb 100644
--- a/thirdparty/misc/r128.h
+++ b/thirdparty/misc/r128.h
@@ -665,7 +665,7 @@ static int r128__clz64(R128_U64 x)
// 32*32->64
static R128_U64 r128__umul64(R128_U32 a, R128_U32 b)
{
-# if defined(_M_IX86) && !defined(R128_STDC_ONLY)
+# if defined(_M_IX86) && !defined(R128_STDC_ONLY) && !defined(__MINGW32__)
return __emulu(a, b);
# elif defined(_M_ARM) && !defined(R128_STDC_ONLY)
return _arm_umull(a, b);
@@ -680,7 +680,7 @@ static R128_U32 r128__udiv64(R128_U32 nlo, R128_U32 nhi, R128_U32 d, R128_U32 *r
# if defined(_M_IX86) && (_MSC_VER >= 1920) && !defined(R128_STDC_ONLY)
unsigned __int64 n = ((unsigned __int64)nhi << 32) | nlo;
return _udiv64(n, d, rem);
-# elif defined(_M_IX86) && !defined(R128_STDC_ONLY)
+# elif defined(_M_IX86) && !defined(R128_STDC_ONLY) && !defined(__MINGW32__)
__asm {
mov eax, nlo
mov edx, nhi
@@ -795,7 +795,7 @@ static void r128__umul128(R128 *dst, R128_U64 a, R128_U64 b)
}
// 128/64->64
-#if defined(_M_X64) && (_MSC_VER < 1920) && !defined(R128_STDC_ONLY)
+#if defined(_M_X64) && (_MSC_VER < 1920) && !defined(R128_STDC_ONLY) && !defined(__MINGW32__)
// MSVC x64 provides neither inline assembly nor (pre-2019) a div intrinsic, so we do fake
// "inline assembly" to avoid long division or outline assembly.
#pragma code_seg(".text")
@@ -810,7 +810,7 @@ static const r128__udiv128Proc r128__udiv128 = (r128__udiv128Proc)(void*)r128__u
#else
static R128_U64 r128__udiv128(R128_U64 nlo, R128_U64 nhi, R128_U64 d, R128_U64 *rem)
{
-#if defined(_M_X64) && !defined(R128_STDC_ONLY)
+#if defined(_M_X64) && !defined(R128_STDC_ONLY) && !defined(__MINGW32__)
return _udiv128(nhi, nlo, d, rem);
#elif defined(__x86_64__) && !defined(R128_STDC_ONLY)
R128_U64 q, r;
@@ -1602,7 +1602,7 @@ void r128Shl(R128 *dst, const R128 *src, int amount)
R128_ASSERT(dst != NULL);
R128_ASSERT(src != NULL);
-#if defined(_M_IX86) && !defined(R128_STDC_ONLY)
+#if defined(_M_IX86) && !defined(R128_STDC_ONLY) && !defined(__MINGW32__)
__asm {
// load src
mov edx, dword ptr[src]
@@ -1664,7 +1664,7 @@ void r128Shr(R128 *dst, const R128 *src, int amount)
R128_ASSERT(dst != NULL);
R128_ASSERT(src != NULL);
-#if defined(_M_IX86) && !defined(R128_STDC_ONLY)
+#if defined(_M_IX86) && !defined(R128_STDC_ONLY) && !defined(__MINGW32__)
__asm {
// load src
mov edx, dword ptr[src]
@@ -1726,7 +1726,7 @@ void r128Sar(R128 *dst, const R128 *src, int amount)
R128_ASSERT(dst != NULL);
R128_ASSERT(src != NULL);
-#if defined(_M_IX86) && !defined(R128_STDC_ONLY)
+#if defined(_M_IX86) && !defined(R128_STDC_ONLY) && !defined(__MINGW32__)
__asm {
// load src
mov edx, dword ptr[src]