Source-Changes-HG archive

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

[src/trunk]: src/lib/libm Hook to the build.



details:   https://anonhg.NetBSD.org/src/rev/7430eeab7d20
branches:  trunk
changeset: 784797:7430eeab7d20
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 09 22:33:13 2013 +0000

description:
Hook to the build.

diffstat:

 lib/libm/Makefile      |   4 ++--
 lib/libm/src/s_rintl.c |  34 +++++++++++++++++-----------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diffs (94 lines):

diff -r ac3be91e93fa -r 7430eeab7d20 lib/libm/Makefile
--- a/lib/libm/Makefile Sat Feb 09 22:32:47 2013 +0000
+++ b/lib/libm/Makefile Sat Feb 09 22:33:13 2013 +0000
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.127 2013/02/09 20:19:13 christos Exp $
+#  $NetBSD: Makefile,v 1.128 2013/02/09 22:33:13 christos Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -67,7 +67,7 @@
 .PATH: ${.CURDIR}/arch/i387
 
 COMMON_SRCS+= fenv.c s_nextafterl.c s_nexttoward.c s_nexttowardf.c \
-       s_nearbyint.c # s_nan.c
+       s_nearbyint.c s_rintl.c # s_nan.c
 ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_expf.S e_fmod.S e_log.S \
            e_logf.S e_log10.S e_log10f.S e_log2.S e_log2f.S e_remainder.S \
            e_remainderf.S e_scalb.S e_scalbf.S e_sqrt.S e_sqrtf.S s_atan.S \
diff -r ac3be91e93fa -r 7430eeab7d20 lib/libm/src/s_rintl.c
--- a/lib/libm/src/s_rintl.c    Sat Feb 09 22:32:47 2013 +0000
+++ b/lib/libm/src/s_rintl.c    Sat Feb 09 22:33:13 2013 +0000
@@ -1,3 +1,5 @@
+/*     $NetBSD: s_rintl.c,v 1.2 2013/02/09 22:33:13 christos Exp $     */
+
 /*-
  * Copyright (c) 2008 David Schultz <das%FreeBSD.ORG@localhost>
  * All rights reserved.
@@ -25,25 +27,21 @@
  */
 
 #include <sys/cdefs.h>
+#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 $");
+#endif
 
 #include <float.h>
 #include <math.h>
 
-#include "fpmath.h"
-
-#if LDBL_MAX_EXP != 0x4000
-/* We also require the usual bias, min exp and expsign packing. */
-#error "Unsupported long double format"
-#endif
-
-#define        BIAS    (LDBL_MAX_EXP - 1)
-
+#ifdef EXT_EXP_BIAS
 static const float
 shift[2] = {
-#if LDBL_MANT_DIG == 64
+#if EXT_FRACBITS == 64
        0x1.0p63, -0x1.0p63
-#elif LDBL_MANT_DIG == 113
+#elif EXT_FRACBITS == 113
        0x1.0p112, -0x1.0p112
 #else
 #error "Unsupported long double format"
@@ -54,16 +52,17 @@
 long double
 rintl(long double x)
 {
-       union IEEEl2bits u;
+       union ieee_ext_u u;
        uint32_t expsign;
        int ex, sign;
 
-       u.e = x;
-       expsign = u.xbits.expsign;
+       u.extu_ld = x;
+       u.extu_ext.ext_frach &= ~0x80000000;
+       expsign = u.extu_ext.ext_sign;
        ex = expsign & 0x7fff;
 
-       if (ex >= BIAS + LDBL_MANT_DIG - 1) {
-               if (ex == BIAS + LDBL_MAX_EXP)
+       if (ex >= EXT_EXP_BIAS + EXT_FRACBITS - 1) {
+               if (ex == EXT_EXP_BIAS + EXT_FRACBITS)
                        return (x + x); /* Inf, NaN, or unsupported format */
                return (x);             /* finite and already an integer */
        }
@@ -83,8 +82,9 @@
         * If the result is +-0, then it must have the same sign as x, but
         * the above calculation doesn't always give this.  Fix up the sign.
         */
-       if (ex < BIAS && x == 0.0L)
+       if (ex < EXT_EXP_BIAS && x == 0.0L)
                return (zero[sign]);
 
        return (x);
 }
+#endif



Home | Main Index | Thread Index | Old Index