diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2021-05-01 18:30:34 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2021-05-01 19:10:29 +0300 |
commit | 0bd6479f854e7a2faf8f36428099c2473e175b9d (patch) | |
tree | 71e95b29646c48454cbc0c36974405e830f44f90 /imgui/imgui_internal.h | |
parent | 630615c6c2005f1df7d72b0d838800c0b5dbbc7e (diff) |
Optimizer IM_FIXNORMAL2F.
Diffstat (limited to 'imgui/imgui_internal.h')
-rw-r--r-- | imgui/imgui_internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/imgui/imgui_internal.h b/imgui/imgui_internal.h index a5503374..b012eedd 100644 --- a/imgui/imgui_internal.h +++ b/imgui/imgui_internal.h @@ -396,6 +396,12 @@ static inline float ImRsqrt(float x) { return _mm_cvtss_f32(_mm_rsqrt static inline float ImRsqrt(float x) { return 1.0f / sqrtf(x); } #endif static inline double ImRsqrt(double x) { return 1.0 / sqrt(x); } +#if defined __SSE__ || defined __x86_64__ || defined _M_X64 +static inline float ImRecip(float x) { return _mm_cvtss_f32(_mm_rcp_ps(_mm_set_ss(x))); } +#else +static inline float ImRecip(float x) { return 1.0f / x; } +#endif +static inline double ImRecip(double x) { return 1.0 / x; } #endif // - ImMin/ImMax/ImClamp/ImLerp/ImSwap are used by widgets which support variety of types: signed/unsigned int/long long float/double // (Exceptionally using templates here but we could also redefine them for those types) |