diff options
Diffstat (limited to 'include/JSystem/JMath')
| -rw-r--r-- | include/JSystem/JMath/JMath.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index 71bad19d43..5b6b2c5978 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -11,9 +11,19 @@ inline f32 JMAFastReciprocal(f32 value) { return __fres(value); } +inline float __frsqrtes(register double f) { + register float out; + // clang-format off + asm { + frsqrte out, f + } + // clang-format on + return out; +} + inline f32 JMAFastSqrt(f32 input) { if (input > 0.0f) { - f64 tmp = __frsqrte(input); + f32 tmp = __frsqrtes(input); return tmp * input; } return input; |
