diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-05-20 22:25:58 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-05-20 23:24:04 +0200 |
commit | b57d9c8005067d149fe34392b19a0520352cd5c6 (patch) | |
tree | 269b04e8f92f8d011dc022393eeb8ea0dc62d61a /core/math/math_funcs.h | |
parent | 78d85de13be383b24252a38e42bec5be81721ea7 (diff) |
Remove `#ifdef` catering to MSVC 2012 and earlier in `math_funcs.h`
For the `master` branch, the minimum supported MSVC version is now
MSVC 2017 (with MSVC 2019 being recommended).
Diffstat (limited to 'core/math/math_funcs.h')
-rw-r--r-- | core/math/math_funcs.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index 40234f6ae5..ec56f4c50a 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -384,28 +384,10 @@ public: return u.d; } - //this function should be as fast as possible and rounding mode should not matter + // This function should be as fast as possible and rounding mode should not matter. static _ALWAYS_INLINE_ int fast_ftoi(float a) { - static int b; - -#if (defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0603) || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP // windows 8 phone? - b = (int)((a > 0.0) ? (a + 0.5) : (a - 0.5)); - -#elif defined(_MSC_VER) && _MSC_VER < 1800 - __asm fld a __asm fistp b - /*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) - // use AT&T inline assembly style, document that - // we use memory as output (=m) and input (m) - __asm__ __volatile__ ( - "flds %1 \n\t" - "fistpl %0 \n\t" - : "=m" (b) - : "m" (a));*/ - -#else - b = lrintf(a); //assuming everything but msvc 2012 or earlier has lrint -#endif - return b; + // Assuming every supported compiler has `lrint()`. + return lrintf(a); } static _ALWAYS_INLINE_ uint32_t halfbits_to_floatbits(uint16_t h) { |