libm: sync with upstream.
There's potential here to maybe lose some/all of builtins.cpp, but I'll
look at that separately later.
Test: treehugger
Change-Id: I2c2bc1d0753affdd214daeb09fa1ac7cd73db347
diff --git a/libm/upstream-freebsd/lib/msun/src/e_sqrt.c b/libm/upstream-freebsd/lib/msun/src/e_sqrt.c
index 12fb56e..37351a4 100644
--- a/libm/upstream-freebsd/lib/msun/src/e_sqrt.c
+++ b/libm/upstream-freebsd/lib/msun/src/e_sqrt.c
@@ -14,6 +14,18 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <float.h>
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef USE_BUILTIN_SQRT
+double
+__ieee754_sqrt(double x)
+{
+ return (__builtin_sqrt(x));
+}
+#else
/* __ieee754_sqrt(x)
* Return correctly rounded sqrt.
* ------------------------------------------
@@ -84,11 +96,6 @@
*---------------
*/
-#include <float.h>
-
-#include "math.h"
-#include "math_private.h"
-
static const double one = 1.0, tiny=1.0e-300;
double
@@ -187,6 +194,7 @@
INSERT_WORDS(z,ix0,ix1);
return z;
}
+#endif
#if (LDBL_MANT_DIG == 53)
__weak_reference(sqrt, sqrtl);