Moved _umul128 to precompiled.h

This commit is contained in:
Tom Lally 2022-08-27 20:30:56 +01:00
parent 9810c36287
commit ad1b38c3a9
2 changed files with 6 additions and 9 deletions

View file

@ -5,15 +5,6 @@
#include "util/helpers/fspinlock.h" #include "util/helpers/fspinlock.h"
#include "util/highresolutiontimer/HighResolutionTimer.h" #include "util/highresolutiontimer/HighResolutionTimer.h"
#if BOOST_OS_LINUX || BOOST_OS_MACOS
static __inline__
uint64 _umul128(uint64 multiplier, uint64 multiplicand, uint64 *highProduct) {
unsigned __int128 x = (unsigned __int128)multiplier * (unsigned __int128)multiplicand;
*highProduct = (x >> 64);
return x & 0xFFFFFFFFFFFFFFFF;
}
#endif
uint64 _rdtscLastMeasure = 0; uint64 _rdtscLastMeasure = 0;
uint64 _rdtscFrequency = 0; uint64 _rdtscFrequency = 0;

View file

@ -186,6 +186,12 @@ inline uint64 _rotr64 (uint64 x, sint8 r)
return (x >> r) | (x << (64 - r)); return (x >> r) | (x << (64 - r));
} }
inline uint64 _umul128(uint64 multiplier, uint64 multiplicand, uint64 *highProduct) {
unsigned __int128 x = (unsigned __int128)multiplier * (unsigned __int128)multiplicand;
*highProduct = (x >> 64);
return x & 0xFFFFFFFFFFFFFFFF;
}
typedef uint8_t BYTE; typedef uint8_t BYTE;
typedef uint32_t DWORD; typedef uint32_t DWORD;
typedef int32_t LONG; typedef int32_t LONG;