Module Name: src
Committed By: christos
Date: Mon Feb 11 01:47:04 UTC 2013
Modified Files:
src/lib/libm: Makefile
src/lib/libm/src: s_frexpl.c s_scalbln.c
Log Message:
add more functions required by fma
To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/lib/libm/Makefile
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_frexpl.c \
src/lib/libm/src/s_scalbln.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.129 src/lib/libm/Makefile:1.130
--- src/lib/libm/Makefile:1.129 Sun Feb 10 20:29:58 2013
+++ src/lib/libm/Makefile Sun Feb 10 20:47:04 2013
@@ -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 @@ COMMON_SRCS+= fenv.c
.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 \
Index: src/lib/libm/src/s_frexpl.c
diff -u src/lib/libm/src/s_frexpl.c:1.1 src/lib/libm/src/s_frexpl.c:1.2
--- src/lib/libm/src/s_frexpl.c:1.1 Sun Feb 10 20:38:10 2013
+++ src/lib/libm/src/s_frexpl.c Sun Feb 10 20:47:04 2013
@@ -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 <[email protected]>
* 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
Index: src/lib/libm/src/s_scalbln.c
diff -u src/lib/libm/src/s_scalbln.c:1.1 src/lib/libm/src/s_scalbln.c:1.2
--- src/lib/libm/src/s_scalbln.c:1.1 Sun Feb 10 20:38:10 2013
+++ src/lib/libm/src/s_scalbln.c Sun Feb 10 20:47:04 2013
@@ -1,3 +1,5 @@
+/* $NetBSD: s_scalbln.c,v 1.2 2013/02/11 01:47:04 christos Exp $ */
+
/*-
* Copyright (c) 2004 David Schultz <[email protected]>
* 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>