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/s_cosl.c b/libm/upstream-freebsd/lib/msun/src/s_cosl.c
index 46a2e86..3d06648 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_cosl.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_cosl.c
@@ -39,12 +39,17 @@
#include <ieeefp.h>
#endif
+#include "fpmath.h"
#include "math.h"
#include "math_private.h"
#if LDBL_MANT_DIG == 64
#include "../ld80/e_rem_pio2l.h"
+static const union IEEEl2bits
+pio4u = LD80C(0xc90fdaa22168c235, -00001, 7.85398163397448309628e-01L);
+#define pio4 (pio4u.e)
#elif LDBL_MANT_DIG == 113
#include "../ld128/e_rem_pio2l.h"
+long double pio4 = 7.85398163397448309615660845819875721e-1L;
#else
#error "Unsupported long double format"
#endif
@@ -71,7 +76,7 @@
ENTERI();
/* Optimize the case where x is already within range. */
- if (z.e < M_PI_4)
+ if (z.e < pio4)
RETURNI(__kernel_cosl(z.e, 0));
e0 = __ieee754_rem_pio2l(x, y);