Skip to content

Commit

Permalink
Fix compile guards around r128__umul64 and r128__udiv64
Browse files Browse the repository at this point in the history
  • Loading branch information
fahickman committed Sep 12, 2020
1 parent 423f693 commit d846223
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions r128.h
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ static R128_U32 r128__udiv64(R128_U32 nlo, R128_U32 nhi, R128_U32 d, R128_U32 *r
return (R128_U32)(n64 / d);
# endif
}
#elif !defined(_M_X64) || defined(R128_STDC_ONLY)
#elif defined(R128_STDC_ONLY) || !R128_INTEL
#define r128__umul64(a, b) ((a) * (R128_U64)(b))
static R128_U32 r128__udiv64(R128_U32 nlo, R128_U32 nhi, R128_U32 d, R128_U32 *rem)
{
Expand Down Expand Up @@ -799,7 +799,7 @@ static void r128__umul128(R128 *dst, R128_U64 a, R128_U64 b)
// 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")
__declspec(allocate(".text")) static const unsigned char r128__udiv128Code[] = {
__declspec(allocate(".text") align(16)) static const unsigned char r128__udiv128Code[] = {
0x48, 0x8B, 0xC1, //mov rax, rcx
0x49, 0xF7, 0xF0, //div rax, r8
0x49, 0x89, 0x11, //mov qword ptr [r9], rdx
Expand Down

0 comments on commit d846223

Please sign in to comment.