summaryrefslogtreecommitdiff
path: root/include/JSystem/JMath/JMath.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/JSystem/JMath/JMath.h')
-rw-r--r--include/JSystem/JMath/JMath.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h
index 5b6b2c5978..d9fb055f24 100644
--- a/include/JSystem/JMath/JMath.h
+++ b/include/JSystem/JMath/JMath.h
@@ -21,12 +21,16 @@ inline float __frsqrtes(register double f) {
return out;
}
-inline f32 JMAFastSqrt(f32 input) {
+inline f32 JMAFastSqrt(register f32 input) {
if (input > 0.0f) {
- f32 tmp = __frsqrtes(input);
- return tmp * input;
+ register f32 out;
+ asm {
+ frsqrte out, input
+ }
+ return out * input;
+ } else {
+ return input;
}
- return input;
}
namespace JMath {