1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Optimizer IM_FIXNORMAL2F.

This commit is contained in:
Bartosz Taudul
2021-05-01 17:30:34 +02:00
parent 630615c6c2
commit 0bd6479f85
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -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)