We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 656236c commit 2ac4e72Copy full SHA for 2ac4e72
src/simd/x86/sse_ops.c
@@ -21,6 +21,22 @@
21
22
#ifdef _MSC_VER
23
#include <intrin.h>
24
+
25
+/* MSVC doesn't have __builtin_prefetch, use _mm_prefetch instead */
26
+#define __builtin_prefetch(addr, rw, locality) \
27
+ _mm_prefetch((const char*)(addr), _MM_HINT_T0)
28
29
+/* MSVC doesn't have __builtin_ctz (count trailing zeros) */
30
+static inline int msvc_ctz(unsigned int x) {
31
+ unsigned long index;
32
+ _BitScanForward(&index, x);
33
+ return (int)index;
34
+}
35
+#define __builtin_ctz(x) msvc_ctz(x)
36
37
+/* MSVC doesn't have __builtin_popcount */
38
+#define __builtin_popcount(x) __popcnt(x)
39
40
#endif
41
#include <smmintrin.h>
42
#include <nmmintrin.h>
0 commit comments