summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2004-07-18 21:23:39 +0000
committerdas <das@FreeBSD.org>2004-07-18 21:23:39 +0000
commit1a69fc33708b18800fc764be0248de78b4bc35c0 (patch)
treeeb35ae876a43222fec2d90dbf20674666f760ca7 /lib
parent8fe12ef8db88fe5b261b6c7b14bbc330def59245 (diff)
downloadFreeBSD-src-1a69fc33708b18800fc764be0248de78b4bc35c0.zip
FreeBSD-src-1a69fc33708b18800fc764be0248de78b4bc35c0.tar.gz
Replace seven nominally MD implementations of frexp() that are broken
for subnormals with one implementation that works.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/alpha/gen/Makefile.inc2
-rw-r--r--lib/libc/alpha/gen/frexp.c56
-rw-r--r--lib/libc/amd64/gen/Makefile.inc3
-rw-r--r--lib/libc/amd64/gen/frexp.c67
-rw-r--r--lib/libc/arm/gen/Makefile.inc2
-rw-r--r--lib/libc/arm/gen/frexp.c67
-rw-r--r--lib/libc/gen/Makefile.inc2
-rw-r--r--lib/libc/gen/frexp.c57
-rw-r--r--lib/libc/i386/gen/Makefile.inc2
-rw-r--r--lib/libc/i386/gen/frexp.c67
-rw-r--r--lib/libc/ia64/gen/Makefile.inc2
-rw-r--r--lib/libc/ia64/gen/frexp.c56
-rw-r--r--lib/libc/powerpc/gen/Makefile.inc2
-rw-r--r--lib/libc/powerpc/gen/frexp.c56
-rw-r--r--lib/libc/sparc64/gen/Makefile.inc2
-rw-r--r--lib/libc/sparc64/gen/frexp.c78
16 files changed, 65 insertions, 456 deletions
diff --git a/lib/libc/alpha/gen/Makefile.inc b/lib/libc/alpha/gen/Makefile.inc
index 11950b2..8f69274 100644
--- a/lib/libc/alpha/gen/Makefile.inc
+++ b/lib/libc/alpha/gen/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-SRCS+= _setjmp.S fabs.S frexp.c infinity.c ldexp.c modf.c setjmp.S
+SRCS+= _setjmp.S fabs.S infinity.c ldexp.c modf.c setjmp.S
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
fpsetround.c fpsetsticky.c
diff --git a/lib/libc/alpha/gen/frexp.c b/lib/libc/alpha/gen/frexp.c
deleted file mode 100644
index 386c36b..0000000
--- a/lib/libc/alpha/gen/frexp.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1994, 1995 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $NetBSD: frexp.c,v 1.1 1995/02/10 17:50:22 cgd Exp $
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/ieee.h>
-#include <math.h>
-
-double
-frexp(value, eptr)
- double value;
- int *eptr;
-{
- union doub {
- double v;
- struct ieee_double s;
- } u;
-
- if (value) {
- u.v = value;
- *eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1);
- u.s.dbl_exp = DBL_EXP_BIAS - 1;
- return(u.v);
- } else {
- *eptr = 0;
- return((double)0);
- }
-}
diff --git a/lib/libc/amd64/gen/Makefile.inc b/lib/libc/amd64/gen/Makefile.inc
index 2caa178..9f559e6 100644
--- a/lib/libc/amd64/gen/Makefile.inc
+++ b/lib/libc/amd64/gen/Makefile.inc
@@ -3,7 +3,6 @@
SRCS+= _setjmp.S rfork_thread.S setjmp.S sigsetjmp.S \
fabs.S modf.S \
- frexp.c infinity.c ldexp.c \
- makecontext.c signalcontext.c \
+ infinity.c ldexp.c makecontext.c signalcontext.c \
fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \
fpgetround.c fpsetround.c fpgetsticky.c fpsetsticky.c
diff --git a/lib/libc/amd64/gen/frexp.c b/lib/libc/amd64/gen/frexp.c
deleted file mode 100644
index 37f6a57..0000000
--- a/lib/libc/amd64/gen/frexp.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <math.h>
-
-double
-frexp(value, eptr)
- double value;
- int *eptr;
-{
- union {
- double v;
- struct {
- u_int u_mant2 : 32;
- u_int u_mant1 : 20;
- u_int u_exp : 11;
- u_int u_sign : 1;
- } s;
- } u;
-
- if (value) {
- u.v = value;
- *eptr = u.s.u_exp - 1022;
- u.s.u_exp = 1022;
- return(u.v);
- } else {
- *eptr = 0;
- return((double)0);
- }
-}
diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc
index e598d34..dd9270e 100644
--- a/lib/libc/arm/gen/Makefile.inc
+++ b/lib/libc/arm/gen/Makefile.inc
@@ -1,6 +1,6 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-SRCS+= _ctx_start.S _setjmp.S alloca.S fabs.c frexp.c \
+SRCS+= _ctx_start.S _setjmp.S alloca.S fabs.c \
infinity.c ldexp.c makecontext.c modf.c \
setjmp.S signalcontext.c sigsetjmp.S divsi3.S
diff --git a/lib/libc/arm/gen/frexp.c b/lib/libc/arm/gen/frexp.c
deleted file mode 100644
index 37f6a57..0000000
--- a/lib/libc/arm/gen/frexp.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <math.h>
-
-double
-frexp(value, eptr)
- double value;
- int *eptr;
-{
- union {
- double v;
- struct {
- u_int u_mant2 : 32;
- u_int u_mant1 : 20;
- u_int u_exp : 11;
- u_int u_sign : 1;
- } s;
- } u;
-
- if (value) {
- u.v = value;
- *eptr = u.s.u_exp - 1022;
- u.s.u_exp = 1022;
- return(u.v);
- } else {
- *eptr = 0;
- return((double)0);
- }
-}
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 3f71b98..14b56ce 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -10,7 +10,7 @@ SRCS+= __xuname.c _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \
crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \
dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c errno.c \
exec.c fmtcheck.c fmtmsg.c fnmatch.c \
- fpclassify.c fstab.c ftok.c fts.c ftw.c \
+ fpclassify.c frexp.c fstab.c ftok.c fts.c ftw.c \
getbootfile.c getbsize.c \
getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \
gethostname.c getloadavg.c getlogin.c getmntinfo.c getnetgrent.c \
diff --git a/lib/libc/gen/frexp.c b/lib/libc/gen/frexp.c
new file mode 100644
index 0000000..53483da
--- /dev/null
+++ b/lib/libc/gen/frexp.c
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <math.h>
+
+#include "fpmath.h"
+
+double
+frexp(double d, int *ex)
+{
+ union IEEEd2bits u;
+
+ u.d = d;
+ switch (u.bits.exp) {
+ case 0: /* 0 or subnormal */
+ if ((u.bits.manl | u.bits.manh) == 0) {
+ *ex = 0;
+ } else {
+ u.d *= 0x1.0p514;
+ *ex = u.bits.exp - 1536;
+ u.bits.exp = 1022;
+ }
+ break;
+ case 2047: /* infinity or NaN; value of *ex is unspecified */
+ break;
+ default: /* normal */
+ *ex = u.bits.exp - 1022;
+ u.bits.exp = 1022;
+ break;
+ }
+ return (u.d);
+}
diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc
index 624ec54..fcfc9ec 100644
--- a/lib/libc/i386/gen/Makefile.inc
+++ b/lib/libc/i386/gen/Makefile.inc
@@ -1,6 +1,6 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-SRCS+= _ctx_start.S _setjmp.S alloca.S fabs.S frexp.c \
+SRCS+= _ctx_start.S _setjmp.S alloca.S fabs.S \
infinity.c ldexp.c makecontext.c modf.S \
rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S
diff --git a/lib/libc/i386/gen/frexp.c b/lib/libc/i386/gen/frexp.c
deleted file mode 100644
index 37f6a57..0000000
--- a/lib/libc/i386/gen/frexp.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)frexp.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <math.h>
-
-double
-frexp(value, eptr)
- double value;
- int *eptr;
-{
- union {
- double v;
- struct {
- u_int u_mant2 : 32;
- u_int u_mant1 : 20;
- u_int u_exp : 11;
- u_int u_sign : 1;
- } s;
- } u;
-
- if (value) {
- u.v = value;
- *eptr = u.s.u_exp - 1022;
- u.s.u_exp = 1022;
- return(u.v);
- } else {
- *eptr = 0;
- return((double)0);
- }
-}
diff --git a/lib/libc/ia64/gen/Makefile.inc b/lib/libc/ia64/gen/Makefile.inc
index 3f68eeb..30bb45e 100644
--- a/lib/libc/ia64/gen/Makefile.inc
+++ b/lib/libc/ia64/gen/Makefile.inc
@@ -2,7 +2,7 @@
SRCS+= __divdf3.S __divdi3.S __divsf3.S __divsi3.S __moddi3.S __modsi3.S \
__udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S _setjmp.S fabs.S \
- fpgetmask.c fpgetround.c fpsetmask.c fpsetround.c frexp.c infinity.c \
+ fpgetmask.c fpgetround.c fpsetmask.c fpsetround.c infinity.c \
ldexp.c makecontext.c modf.c setjmp.S signalcontext.c sigsetjmp.S
# The following may go away if function _Unwind_FindTableEntry()
diff --git a/lib/libc/ia64/gen/frexp.c b/lib/libc/ia64/gen/frexp.c
deleted file mode 100644
index d4f5139..0000000
--- a/lib/libc/ia64/gen/frexp.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* $NetBSD: frexp.c,v 1.1 1995/02/10 17:50:22 cgd Exp $ */
-
-/*
- * Copyright (c) 1994, 1995 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/ieee.h>
-#include <math.h>
-
-double
-frexp(value, eptr)
- double value;
- int *eptr;
-{
- union doub {
- double v;
- struct ieee_double s;
- } u;
-
- if (value) {
- u.v = value;
- *eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1);
- u.s.dbl_exp = DBL_EXP_BIAS - 1;
- return(u.v);
- } else {
- *eptr = 0;
- return((double)0);
- }
-}
diff --git a/lib/libc/powerpc/gen/Makefile.inc b/lib/libc/powerpc/gen/Makefile.inc
index 22689d7..2257e56 100644
--- a/lib/libc/powerpc/gen/Makefile.inc
+++ b/lib/libc/powerpc/gen/Makefile.inc
@@ -1,7 +1,7 @@
# $FreeBSD$
SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
- fpgetsticky.c fpsetmask.c fpsetround.c fpsetsticky.c frexp.c \
+ fpgetsticky.c fpsetmask.c fpsetround.c fpsetsticky.c \
infinity.c ldexp.c makecontext.c modf.c _setjmp.S \
setjmp.S sigsetjmp.S syncicache.c
diff --git a/lib/libc/powerpc/gen/frexp.c b/lib/libc/powerpc/gen/frexp.c
deleted file mode 100644
index 386c36b..0000000
--- a/lib/libc/powerpc/gen/frexp.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1994, 1995 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- * $NetBSD: frexp.c,v 1.1 1995/02/10 17:50:22 cgd Exp $
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/ieee.h>
-#include <math.h>
-
-double
-frexp(value, eptr)
- double value;
- int *eptr;
-{
- union doub {
- double v;
- struct ieee_double s;
- } u;
-
- if (value) {
- u.v = value;
- *eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1);
- u.s.dbl_exp = DBL_EXP_BIAS - 1;
- return(u.v);
- } else {
- *eptr = 0;
- return((double)0);
- }
-}
diff --git a/lib/libc/sparc64/gen/Makefile.inc b/lib/libc/sparc64/gen/Makefile.inc
index 789f95ac..022a4a3e 100644
--- a/lib/libc/sparc64/gen/Makefile.inc
+++ b/lib/libc/sparc64/gen/Makefile.inc
@@ -2,5 +2,5 @@
SRCS+= _ctx_start.S _setjmp.S fabs.S fixunsdfsi.S flt_rounds.c fpgetmask.c \
fpgetround.c fpgetsticky.c fpsetmask.c fpsetround.c fpsetsticky.c \
- frexp.c infinity.c ldexp.c makecontext.c modf.S \
+ infinity.c ldexp.c makecontext.c modf.S \
signalcontext.c setjmp.S sigsetjmp.S
diff --git a/lib/libc/sparc64/gen/frexp.c b/lib/libc/sparc64/gen/frexp.c
deleted file mode 100644
index e31a1c8..0000000
--- a/lib/libc/sparc64/gen/frexp.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: frexp.c,v 1.2 2001/09/10 22:37:06 millert Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/ieee.h>
-
-/*
- * Split the given value into a fraction in the range [0.5, 1.0) and
- * an exponent, such that frac * (2^exp) == value. If value is 0,
- * return 0.
- */
-double
-frexp(value, eptr)
- double value;
- int *eptr;
-{
- union {
- double v;
- struct ieee_double s;
- } u;
-
- if (value) {
- /*
- * Fractions in [0.5..1.0) have an exponent of 2^-1.
- * Leave Inf and NaN alone, however.
- * WHAT ABOUT DENORMS?
- */
- u.v = value;
- if (u.s.dbl_exp != DBL_EXP_INFNAN) {
- *eptr = u.s.dbl_exp - (DBL_EXP_BIAS - 1);
- u.s.dbl_exp = DBL_EXP_BIAS - 1;
- }
- return (u.v);
- } else {
- *eptr = 0;
- return ((double)0);
- }
-}
OpenPOWER on IntegriCloud