Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libm add more functions required by fma
details: https://anonhg.NetBSD.org/src/rev/693d97a65b1d
branches: trunk
changeset: 784843:693d97a65b1d
user: christos <christos%NetBSD.org@localhost>
date: Mon Feb 11 01:47:04 2013 +0000
description:
add more functions required by fma
diffstat:
lib/libm/Makefile | 6 ++++--
lib/libm/src/s_frexpl.c | 30 +++++++++++++++++++-----------
lib/libm/src/s_scalbln.c | 6 ++++++
3 files changed, 29 insertions(+), 13 deletions(-)
diffs (105 lines):
diff -r 8765807c79da -r 693d97a65b1d lib/libm/Makefile
--- a/lib/libm/Makefile Mon Feb 11 01:38:10 2013 +0000
+++ b/lib/libm/Makefile Mon Feb 11 01:47:04 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.129 2013/02/11 01:29:58 christos Exp $
+# $NetBSD: Makefile,v 1.130 2013/02/11 01:47:04 christos Exp $
#
# @(#)Makefile 5.1beta 93/09/24
#
@@ -67,7 +67,9 @@
.PATH: ${.CURDIR}/arch/i387
COMMON_SRCS+= fenv.c s_nextafterl.c s_nexttoward.c s_nexttowardf.c \
- s_nearbyint.c s_rintl.c s_fma.c s_fmaf.c s_fmal.c # s_nan.c
+ s_nearbyint.c s_rintl.c s_fma.c s_fmaf.c s_fmal.c \
+ s_scalbln.c s_frexpl.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 8765807c79da -r 693d97a65b1d lib/libm/src/s_frexpl.c
--- a/lib/libm/src/s_frexpl.c Mon Feb 11 01:38:10 2013 +0000
+++ b/lib/libm/src/s_frexpl.c Mon Feb 11 01:47:04 2013 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: s_frexpl.c,v 1.2 2013/02/11 01:47:04 christos Exp $ */
+
/*-
* Copyright (c) 2004-2005 David Schultz <das%FreeBSD.ORG@localhost>
* All rights reserved.
@@ -26,11 +28,16 @@
* $FreeBSD: src/lib/msun/src/s_frexpl.c,v 1.1 2005/03/07 04:54:51 das Exp $
*/
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: s_frexpl.c,v 1.2 2013/02/11 01:47:04 christos Exp $");
+
+#include <machine/ieee.h>
#include <float.h>
#include <math.h>
-#include "fpmath.h"
+#include "math_private.h"
+#ifdef EXT_EXPBITS
#if LDBL_MAX_EXP != 0x4000
#error "Unsupported long double format"
#endif
@@ -38,25 +45,26 @@
long double
frexpl(long double x, int *ex)
{
- union IEEEl2bits u;
+ union ieee_ext_u u;
- u.e = x;
- switch (u.bits.exp) {
+ u.extu_ld = x;
+ switch (u.extu_ext.ext_exp) {
case 0: /* 0 or subnormal */
- if ((u.bits.manl | u.bits.manh) == 0) {
+ if ((u.extu_ext.ext_fracl | u.extu_ext.ext_frach) == 0) {
*ex = 0;
} else {
- u.e *= 0x1.0p514;
- *ex = u.bits.exp - 0x4200;
- u.bits.exp = 0x3ffe;
+ u.extu_ld *= 0x1.0p514;
+ *ex = u.extu_ext.ext_exp - 0x4200;
+ u.extu_ext.ext_exp = 0x3ffe;
}
break;
case 0x7fff: /* infinity or NaN; value of *ex is unspecified */
break;
default: /* normal */
- *ex = u.bits.exp - 0x3ffe;
- u.bits.exp = 0x3ffe;
+ *ex = u.extu_ext.ext_exp - 0x3ffe;
+ u.extu_ext.ext_exp = 0x3ffe;
break;
}
- return (u.e);
+ return (u.extu_ld);
}
+#endif
diff -r 8765807c79da -r 693d97a65b1d lib/libm/src/s_scalbln.c
--- a/lib/libm/src/s_scalbln.c Mon Feb 11 01:38:10 2013 +0000
+++ b/lib/libm/src/s_scalbln.c Mon Feb 11 01:47:04 2013 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: s_scalbln.c,v 1.2 2013/02/11 01:47:04 christos Exp $ */
+
/*-
* Copyright (c) 2004 David Schultz <das%FreeBSD.ORG@localhost>
* All rights reserved.
@@ -25,7 +27,11 @@
*/
#include <sys/cdefs.h>
+#if 0
__FBSDID("$FreeBSD: src/lib/msun/src/s_scalbln.c,v 1.2 2005/03/07 04:57:50 das Exp $");
+#else
+__RCSID("$NetBSD: s_scalbln.c,v 1.2 2013/02/11 01:47:04 christos Exp $");
+#endif
#include <limits.h>
#include <math.h>
Home |
Main Index |
Thread Index |
Old Index