diff options
| author | a1xd <[email protected]> | 2020-07-31 05:12:04 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-07-31 05:12:04 -0400 |
| commit | d5c012bcd5b7321671f9591a3e58d0b2c9507467 (patch) | |
| tree | fe64110f7678607947d19c5ba0b46ea2b15d69c4 /common/x64-util.hpp | |
| parent | Merge pull request #5 from JacobPalecki/WrapperAndGrapher (diff) | |
| parent | update grapher/wrapper for st-refactor (diff) | |
| download | rawaccel-d5c012bcd5b7321671f9591a3e58d0b2c9507467.tar.xz rawaccel-d5c012bcd5b7321671f9591a3e58d0b2c9507467.zip | |
Merge pull request #6 from a1xd/st-refactor
Refactor
Diffstat (limited to 'common/x64-util.hpp')
| -rw-r--r-- | common/x64-util.hpp | 10 |
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; } |