about summary refs log tree commit diff
path: root/src/math/mips/fabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/mips/fabs.c')
-rw-r--r--src/math/mips/fabs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/math/mips/fabs.c b/src/math/mips/fabs.c
new file mode 100644
index 00000000..0a5aa3b1
--- /dev/null
+++ b/src/math/mips/fabs.c
@@ -0,0 +1,16 @@
+#if !defined(__mips_soft_float) && defined(__mips_abs2008)
+
+#include <math.h>
+
+double fabs(double x)
+{
+	double r;
+	__asm__("abs.d %0,%1" : "=f"(r) : "f"(x));
+	return r;
+}
+
+#else
+
+#include "../fabs.c"
+
+#endif