From cbd9f9e6b757476dd38135def619ec640087c5a5 Mon Sep 17 00:00:00 2001 From: kargl Date: Sat, 22 Sep 2012 15:38:29 +0000 Subject: * Use ENTERI() and RETURNI() to toggle the rounding precision if necessary, so that cosl(), sinl() and tanl() work on i386 even for naive callers. Suggested by: bde Reviewed by: bde Approved by: das (mentor) --- lib/msun/src/s_sinl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/msun/src/s_sinl.c') diff --git a/lib/msun/src/s_sinl.c b/lib/msun/src/s_sinl.c index 919deb9..f454f8f 100644 --- a/lib/msun/src/s_sinl.c +++ b/lib/msun/src/s_sinl.c @@ -28,6 +28,9 @@ __FBSDID("$FreeBSD$"); #include +#ifdef __i386__ +#include +#endif #include "math.h" #include "math_private.h" @@ -59,10 +62,12 @@ sinl(long double x) if (z.bits.exp == 32767) return ((x - x) / (x - x)); + ENTERI(); + /* Optimize the case where x is already within range. */ if (z.e < M_PI_4) { hi = __kernel_sinl(z.e, 0, 0); - return (s ? -hi : hi); + RETURNI(s ? -hi : hi); } e0 = __ieee754_rem_pio2l(x, y); @@ -84,5 +89,5 @@ sinl(long double x) break; } - return (hi); + RETURNI(hi); } -- cgit v1.1