diff options
author | das <das@FreeBSD.org> | 2004-07-18 21:23:39 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2004-07-18 21:23:39 +0000 |
commit | 1a69fc33708b18800fc764be0248de78b4bc35c0 (patch) | |
tree | eb35ae876a43222fec2d90dbf20674666f760ca7 /lib/libc/powerpc | |
parent | 8fe12ef8db88fe5b261b6c7b14bbc330def59245 (diff) | |
download | FreeBSD-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/powerpc')
-rw-r--r-- | lib/libc/powerpc/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/powerpc/gen/frexp.c | 56 |
2 files changed, 1 insertions, 57 deletions
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); - } -} |