Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libm/src make these only work for things that have EXT_ ...



details:   https://anonhg.NetBSD.org/src/rev/0eefaed5164f
branches:  trunk
changeset: 784800:0eefaed5164f
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 09 23:14:44 2013 +0000

description:
make these only work for things that have EXT_ foo definitions.

diffstat:

 lib/libm/src/s_nearbyint.c   |   7 +++++--
 lib/libm/src/s_nexttowardf.c |  14 +++++++-------
 lib/libm/src/s_rintl.c       |   9 ++++++---
 3 files changed, 18 insertions(+), 12 deletions(-)

diffs (104 lines):

diff -r 42f51ace3b63 -r 0eefaed5164f lib/libm/src/s_nearbyint.c
--- a/lib/libm/src/s_nearbyint.c        Sat Feb 09 22:56:20 2013 +0000
+++ b/lib/libm/src/s_nearbyint.c        Sat Feb 09 23:14:44 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: s_nearbyint.c,v 1.1 2013/02/09 19:37:48 christos Exp $ */
+/*     $NetBSD: s_nearbyint.c,v 1.2 2013/02/09 23:14:44 christos Exp $ */
 
 /*-
  * Copyright (c) 2004 David Schultz <das%FreeBSD.ORG@localhost>
@@ -30,9 +30,10 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_nearbyint.c,v 1.2 2008/01/14 02:12:06 das Exp $");
 #else
-__RCSID("$NetBSD: s_nearbyint.c,v 1.1 2013/02/09 19:37:48 christos Exp $");
+__RCSID("$NetBSD: s_nearbyint.c,v 1.2 2013/02/09 23:14:44 christos Exp $");
 #endif
 
+#include <machine/ieee.h>
 #include <fenv.h>
 #include <math.h>
 
@@ -58,4 +59,6 @@
 
 DECL(double, nearbyint, rint)
 DECL(float, nearbyintf, rintf)
+#ifdef EXT_FRACBITS
 DECL(long double, nearbyintl, rintl)
+#endif
diff -r 42f51ace3b63 -r 0eefaed5164f lib/libm/src/s_nexttowardf.c
--- a/lib/libm/src/s_nexttowardf.c      Sat Feb 09 22:56:20 2013 +0000
+++ b/lib/libm/src/s_nexttowardf.c      Sat Feb 09 23:14:44 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: s_nexttowardf.c,v 1.2 2013/02/09 20:19:13 christos Exp $       */
+/*     $NetBSD: s_nexttowardf.c,v 1.3 2013/02/09 23:14:44 christos Exp $       */
 
 /*
  * ====================================================
@@ -15,10 +15,12 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_nexttowardf.c,v 1.3 2011/02/10 07:38:38 das Exp $");
 #else
-__RCSID("$NetBSD: s_nexttowardf.c,v 1.2 2013/02/09 20:19:13 christos Exp $");
+__RCSID("$NetBSD: s_nexttowardf.c,v 1.3 2013/02/09 23:14:44 christos Exp $");
 #endif
 
+#include <string.h>
 #include <float.h>
+#include <machine/ieee.h>
 
 #include "math.h"
 #include "math_private.h"
@@ -34,15 +36,13 @@
        GET_FLOAT_WORD(hx,x);
        ix = hx&0x7fffffff;             /* |x| */
 
-       memset(&u, 0, sizeof u);
+       memset(&uy, 0, sizeof(uy));
        uy.extu_ld = y;
        uy.extu_ext.ext_frach &= ~0x80000000;
 
-        union ieee_single_u u[2];
-
        if((ix>0x7f800000) ||
           (uy.extu_ext.ext_exp == EXT_EXP_INFNAN &&
-           (uy.extu_ext.ext_frach | uy.extu_ext.ext_fracl) != 0)
+           (uy.extu_ext.ext_frach | uy.extu_ext.ext_fracl) != 0))
           return x+y;  /* x or y is nan */
        if(x==y) return (float)y;               /* x=y, return y */
        if(ix==0) {                             /* x == 0 */
@@ -50,7 +50,7 @@
            t = x*x;
            if(t==x) return t; else return x;   /* raise underflow flag */
        }
-       if(hx>=0 ^ x < y)                       /* x -= ulp */
+       if((hx >= 0) ^ (x < y))                 /* x -= ulp */
            hx -= 1;
        else                                    /* x += ulp */
            hx += 1;
diff -r 42f51ace3b63 -r 0eefaed5164f lib/libm/src/s_rintl.c
--- a/lib/libm/src/s_rintl.c    Sat Feb 09 22:56:20 2013 +0000
+++ b/lib/libm/src/s_rintl.c    Sat Feb 09 23:14:44 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: s_rintl.c,v 1.2 2013/02/09 22:33:13 christos Exp $     */
+/*     $NetBSD: s_rintl.c,v 1.3 2013/02/09 23:14:44 christos Exp $     */
 
 /*-
  * Copyright (c) 2008 David Schultz <das%FreeBSD.ORG@localhost>
@@ -30,11 +30,14 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_rintl.c,v 1.5 2008/02/22 11:59:05 bde Exp $");
 #else
-__RCSID("$NetBSD: s_rintl.c,v 1.2 2013/02/09 22:33:13 christos Exp $");
+__RCSID("$NetBSD: s_rintl.c,v 1.3 2013/02/09 23:14:44 christos Exp $");
 #endif
 
 #include <float.h>
-#include <math.h>
+#include <machine/ieee.h>
+
+#include "math.h"
+#include "math_private.h"
 
 #ifdef EXT_EXP_BIAS
 static const float



Home | Main Index | Thread Index | Old Index