summaryrefslogtreecommitdiff
path: root/include/JSystem/JMath
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2022-12-19 11:06:32 -0800
committerGitHub <noreply@github.com>2022-12-19 12:06:32 -0700
commitca71275bbecc7db9a4eeca3a6ac4215b66de4318 (patch)
treec2851f8cec211216fe0cb6a31a0260a62fc3bf53 /include/JSystem/JMath
parent1114b13da81ab0b52fd4bb56a32f32331a21e581 (diff)
big d_a_alink pass (#214)
* d_a_alink pass1 wip * more d_a_alink work * remove asm * more daalink work * 20% dol code decompiled * fixed some nonmatchings for building * a few daalink functions and labeling some HIO data
Diffstat (limited to 'include/JSystem/JMath')
-rw-r--r--include/JSystem/JMath/JMath.h12
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;