From 8d0957f9ed2350c34f128299def0b70b16a7026c Mon Sep 17 00:00:00 2001 From: asmodai Date: Fri, 22 Apr 2016 01:18:20 +0300 Subject: [PATCH] Fixed Q_sqrt with long double --- rehlds/engine/mathlib_e.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rehlds/engine/mathlib_e.h b/rehlds/engine/mathlib_e.h index 9f44f18..0a02545 100644 --- a/rehlds/engine/mathlib_e.h +++ b/rehlds/engine/mathlib_e.h @@ -67,16 +67,13 @@ inline float M_sqrt(float value) { inline double M_sqrt(double value) { double ret; auto v = _mm_load_sd(&value); - _mm_store_pd(&ret, _mm_sqrt_sd(v, v)); + _mm_store_sd(&ret, _mm_sqrt_sd(v, v)); return ret; } inline double M_sqrt(long double value) { - double ret; - auto v = _mm_load_sd((double *)&value); - _mm_store_pd(&ret, _mm_sqrt_sd(v, v)); - return ret; + return M_sqrt(double(value)); } float anglemod(float a);