mpir/mpn/x86w/longlong_inc.h

42 lines
1.1 KiB
C
Raw Normal View History

2011-04-27 20:27:14 -04:00
#ifdef _MSC_VER
2011-04-11 03:41:43 -04:00
# include <intrin.h>
# define COUNT_LEADING_ZEROS_NEED_CLZ_TAB
2011-04-11 03:41:43 -04:00
# if !defined( _WIN64 )
2011-04-11 03:41:43 -04:00
# pragma intrinsic(_BitScanForward)
# pragma intrinsic(_BitScanReverse)
# pragma intrinsic(__emulu)
# pragma intrinsic(_bswap)
2011-04-11 03:41:43 -04:00
# define count_leading_zeros(c,x) \
do { unsigned long _z; \
ASSERT ((x) != 0); \
_BitScanReverse(&_z, (x)); \
c = 31 - _z; \
} while (0)
# define count_trailing_zeros(c,x) \
do { unsigned long _z; \
ASSERT ((x) != 0); \
_BitScanForward(&_z, (x)); \
c = _z; \
} while (0)
# define umul_ppmm(xh, xl, m0, m1) \
do { unsigned __int64 _t; \
_t = __emulu( (m0), (m1)); \
xl = _t & 0xffffffff; \
xh = _t >> 32; \
} while (0)
2011-04-27 20:27:14 -04:00
# if !defined( BSWAP_LIMB )
# define BSWAP_LIMB
# define BSWAP_LIMB(dst, src) dst = _bswap(src)
# endif
# endif /* _WIN64 */
#endif /* _MSC_VER */