-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMSVC_Fixes.patch
More file actions
54 lines (51 loc) · 1.16 KB
/
MSVC_Fixes.patch
File metadata and controls
54 lines (51 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/ProcessRGB.cpp b/ProcessRGB.cpp
index 4dc3bf2..95806fe 100644
--- a/ProcessRGB.cpp
+++ b/ProcessRGB.cpp
@@ -12,9 +12,13 @@
#include "ProcessRGB.hpp"
#include "Tables.hpp"
#include "Vector.hpp"
+#if defined(__AVX2__) && defined _MSC_VER
+#define __SSE4_1__
+#endif
#if defined __SSE4_1__ || defined __AVX2__ || defined _MSC_VER
# ifdef _MSC_VER
# include <intrin.h>
+#define NOMINMAX
# include <Windows.h>
# define _bswap(x) _byteswap_ulong(x)
# define _bswap64(x) _byteswap_uint64(x)
diff --git a/Tables.cpp b/Tables.cpp
index 5c7fd9c..2fd23d5 100644
--- a/Tables.cpp
+++ b/Tables.cpp
@@ -1,4 +1,17 @@
#include "Tables.hpp"
+#if defined _MSC_VER
+#define __SSE4_1__
+#endif
+
+#ifdef __AVX2__
+# include <immintrin.h>
+#endif
+#ifdef __SSE4_1__
+# include <smmintrin.h>
+#endif
+#ifdef __ARM_NEON
+# include <arm_neon.h>
+#endif
const int32_t g_table[8][4] = {
{ 2, 8, -2, -8 },
diff --git a/Tables.hpp b/Tables.hpp
index 69d7e8a..a6aa476 100644
--- a/Tables.hpp
+++ b/Tables.hpp
@@ -2,6 +2,9 @@
#define __TABLES_HPP__
#include <stdint.h>
+#if defined _MSC_VER
+#define __SSE4_1__
+#endif
#ifdef __AVX2__
# include <immintrin.h>