summaryrefslogtreecommitdiff
path: root/include/JSystem/JMath
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2023-03-14 15:27:46 -0700
committerGitHub <noreply@github.com>2023-03-14 15:27:46 -0700
commita01d65b0b99400f62d93eee28475872b641cfd50 (patch)
treeabea30ef7e6fb74a9468770371d9217fa43b4b9d /include/JSystem/JMath
parent500d079c40b17e52abf40ec32ad9457d384ce921 (diff)
d_ky_thunder done / d_scope wip / m_Do_graphic wip (#308)
* d_ky_thunder OK + misc build fixes * d_scope mostly done * some m_Do_graphic wip * remove asm
Diffstat (limited to 'include/JSystem/JMath')
-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 {