summaryrefslogtreecommitdiff
path: root/src/math/powerpc/sqrtf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/powerpc/sqrtf.c')
-rw-r--r--src/math/powerpc/sqrtf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/math/powerpc/sqrtf.c b/src/math/powerpc/sqrtf.c
new file mode 100644
index 00000000..3431b672
--- /dev/null
+++ b/src/math/powerpc/sqrtf.c
@@ -0,0 +1,15 @@
+#include <math.h>
+
+#if !defined _SOFT_FLOAT && defined _ARCH_PPCSQ
+
+float sqrtf(float x)
+{
+ __asm__ ("fsqrts %0, %1\n" : "=f" (x) : "f" (x));
+ return x;
+}
+
+#else
+
+#include "../sqrtf.c"
+
+#endif