summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64
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/libc/amd64
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/libc/amd64')
-rw-r--r--lib/libc/amd64/gen/Makefile.inc3
-rw-r--r--lib/libc/amd64/gen/frexp.c67
2 files changed, 1 insertions, 69 deletions
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);
- }
-}
OpenPOWER on IntegriCloud