summaryrefslogtreecommitdiff
path: root/common/x64-util.hpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-07-31 12:20:11 -0700
committerJacob Palecki <[email protected]>2020-07-31 12:20:11 -0700
commit6537db04f7e717eda2f21e007cdba7e13b7f559e (patch)
treeefb65bf3f305f376ea75f4f687b08bf8998c020f /common/x64-util.hpp
parentAdd class for storing settings from file (diff)
parentMerge pull request #6 from a1xd/st-refactor (diff)
downloadrawaccel-6537db04f7e717eda2f21e007cdba7e13b7f559e.tar.xz
rawaccel-6537db04f7e717eda2f21e007cdba7e13b7f559e.zip
Show no settings for off, remove unused class for PR
Diffstat (limited to 'common/x64-util.hpp')
-rw-r--r--common/x64-util.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/x64-util.hpp b/common/x64-util.hpp
index 2fb61bb..40bc7c4 100644
--- a/common/x64-util.hpp
+++ b/common/x64-util.hpp
@@ -1,7 +1,13 @@
#pragma once
-#include <emmintrin.h>
+#ifdef _MANAGED
+
+#include <math.h>
+inline double sqrtsd(double val) { return sqrt(val); }
+
+#else
+#include <emmintrin.h>
inline double sqrtsd(double val) {
__m128d src = _mm_load_sd(&val);
__m128d dst = _mm_sqrt_sd(src, src);
@@ -9,6 +15,8 @@ inline double sqrtsd(double val) {
return val;
}
+#endif
+
inline constexpr double minsd(double a, double b) {
return (a < b) ? a : b;
}