summaryrefslogtreecommitdiffhomepage
path: root/compat/arch.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-09 12:18:46 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-09 12:18:46 +0200
commitb581b559fe426f39b1d548ca27f03cb22dd2ed22 (patch)
treee43be0a41f0e3d8908fd24a1122bbc81d895230d /compat/arch.hpp
parent9c9f083b8130c13c4e861f8e876c618e1eab38e8 (diff)
.
Diffstat (limited to 'compat/arch.hpp')
-rw-r--r--compat/arch.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/compat/arch.hpp b/compat/arch.hpp
new file mode 100644
index 00000000..0b58b65a
--- /dev/null
+++ b/compat/arch.hpp
@@ -0,0 +1,45 @@
+#pragma once
+
+#if defined _MSC_VER
+# ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wreserved-id-macro"
+# pragma clang diagnostic ignored "-Wunused-macros"
+# endif
+
+# if defined _M_AMD64
+# undef __x86_64__
+# define __x86_64__ 1
+# elif defined _M_IX86
+# undef __i386__
+# define __i386__ 1
+# endif
+
+# if defined __AVX__ || defined __x86_64__ || \
+ defined _M_IX86 && _M_IX86_FP >= 2
+# undef __SSE__
+# undef __SSE2__
+# undef __SSE3__
+# define __SSE__ 1
+# define __SSE2__ 1
+# define __SSE3__ 1
+# endif
+
+# ifdef __clang__
+# pragma clang diagnostic pop
+# endif
+#endif
+
+#if defined __SSE3__
+# define FLOORMAT_ARCH_DENORM_DAZ
+# include <pmmintrin.h>
+#elif defined __SSE2__
+# define FLOORMAT_ARCH_DENORM_FTZ
+# include <emmintrin.h>
+#endif
+
+#if defined __SSE2__
+# define FLOORMAT_ARCH_FPU_MASK
+# include <xmmintrin.h>
+#endif
+