Browse Source

add m68k sqrtl using native instruction

this is actually a functional fix at present, since the C sqrtl does
not support ld80 and just wraps double sqrt. once that's fixed it will
just be an optimization.
Rich Felker 3 years ago
parent
commit
845e4f6692
1 changed files with 15 additions and 0 deletions
  1. 15 0
      src/math/m68k/sqrtl.c

+ 15 - 0
src/math/m68k/sqrtl.c

@@ -0,0 +1,15 @@
+#include <math.h>
+
+#if __HAVE_68881__
+
+long double sqrtl(long double x)
+{
+	__asm__ ("fsqrt.x %1,%0" : "=f"(x) : "fm"(x));
+	return x;
+}
+
+#else
+
+#include "../sqrtl.c"
+
+#endif