File indexing completed on 2026-11-07 10:15:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef LONGLONG_MSC_H
0013 #define LONGLONG_MSC_H
0014
0015 #include <stdlib.h>
0016 #include <intrin.h>
0017 #include <immintrin.h>
0018
0019
0020 # define flint_clz _CountLeadingZeros64
0021 # define flint_ctz flint_ctz
0022 static inline int flint_ctz(ulong x)
0023 {
0024 unsigned long int index;
0025 _BitScanForward64(&index, x);
0026 return index;
0027 }
0028
0029
0030 #define umul_ppmm(r1, r0, u, v) \
0031 do \
0032 { \
0033 (r0) = (u) * (v); \
0034 (r1) = __umulh(u, v); \
0035 } while (0)
0036
0037 #define smul_ppmm(r1, r0, u, v) \
0038 do \
0039 { \
0040 (r0) = (u) * (v); \
0041 (r1) = __mulh(u, v); \
0042 } while (0)
0043
0044 #endif