diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/alpha/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/alpha/gen/isinf.c | 68 | ||||
-rw-r--r-- | lib/libc/amd64/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/amd64/gen/isinf.c | 75 | ||||
-rw-r--r-- | lib/libc/arm/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/arm/gen/isinf.c | 70 | ||||
-rw-r--r-- | lib/libc/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/gen/isinf.c | 66 | ||||
-rw-r--r-- | lib/libc/gen/isnan.c | 67 | ||||
-rw-r--r-- | lib/libc/i386/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/i386/gen/isinf.c | 75 | ||||
-rw-r--r-- | lib/libc/ia64/gen/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/libc/ia64/gen/isinf.c | 68 | ||||
-rw-r--r-- | lib/libc/powerpc/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/powerpc/gen/isinf.c | 67 | ||||
-rw-r--r-- | lib/libc/sparc64/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/sparc64/gen/isinf.c | 69 |
17 files changed, 141 insertions, 501 deletions
diff --git a/lib/libc/alpha/gen/Makefile.inc b/lib/libc/alpha/gen/Makefile.inc index 39292c4..11950b2 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 isinf.c ldexp.c modf.c setjmp.S +SRCS+= _setjmp.S fabs.S frexp.c 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/isinf.c b/lib/libc/alpha/gen/isinf.c deleted file mode 100644 index df6ac96..0000000 --- a/lib/libc/alpha/gen/isinf.c +++ /dev/null @@ -1,68 +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: isinf.c,v 1.1 1995/02/10 17:50:23 cgd Exp $ - */ - -/* For binary compat; to be removed in FreeBSD 6.0. */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -#undef isnan -#undef isinf - -int -isnan(d) - double d; -{ - union { - double v; - struct ieee_double s; - } u; - - u.v = d; - return (u.s.dbl_exp == DBL_EXP_INFNAN && - (u.s.dbl_frach || u.s.dbl_fracl)); -} - -int -isinf(d) - double d; -{ - union { - double v; - struct ieee_double s; - } u; - - u.v = d; - return (u.s.dbl_exp == DBL_EXP_INFNAN && - !u.s.dbl_frach && !u.s.dbl_fracl); -} diff --git a/lib/libc/amd64/gen/Makefile.inc b/lib/libc/amd64/gen/Makefile.inc index 053c9c9..2caa178 100644 --- a/lib/libc/amd64/gen/Makefile.inc +++ b/lib/libc/amd64/gen/Makefile.inc @@ -3,7 +3,7 @@ SRCS+= _setjmp.S rfork_thread.S setjmp.S sigsetjmp.S \ fabs.S modf.S \ - frexp.c infinity.c isinf.c ldexp.c \ + frexp.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/isinf.c b/lib/libc/amd64/gen/isinf.c deleted file mode 100644 index a5e9dec..0000000 --- a/lib/libc/amd64/gen/isinf.c +++ /dev/null @@ -1,75 +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. - */ - -/* For binary compat; to be removed in FreeBSD 6.0. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> - -struct IEEEdp { - u_int manl : 32; - u_int manh : 20; - u_int exp : 11; - u_int sign : 1; -}; - -int -isnan(d) - double d; -{ - union { - double v; - struct IEEEdp s; - } u; - - u.v = d; - return(u.s.exp == 2047 && (u.s.manh || u.s.manl)); -} - -int -isinf(d) - double d; -{ - union { - double v; - struct IEEEdp s; - } u; - - u.v = d; - return(u.s.exp == 2047 && !u.s.manh && !u.s.manl); -} diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc index d34fcf7..e598d34 100644 --- a/lib/libc/arm/gen/Makefile.inc +++ b/lib/libc/arm/gen/Makefile.inc @@ -2,5 +2,5 @@ # $FreeBSD$ SRCS+= _ctx_start.S _setjmp.S alloca.S fabs.c frexp.c \ - infinity.c isinf.c ldexp.c makecontext.c modf.c \ + infinity.c ldexp.c makecontext.c modf.c \ setjmp.S signalcontext.c sigsetjmp.S divsi3.S diff --git a/lib/libc/arm/gen/isinf.c b/lib/libc/arm/gen/isinf.c deleted file mode 100644 index d894b4f..0000000 --- a/lib/libc/arm/gen/isinf.c +++ /dev/null @@ -1,70 +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. - */ - -/* For binary compat; to be removed in FreeBSD 6.0. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> - -int -isnan(d) - double d; -{ - register struct IEEEdp { - u_int manl : 32; - u_int manh : 20; - u_int exp : 11; - u_int sign : 1; - } *p = (struct IEEEdp *)&d; - - return(p->exp == 2047 && (p->manh || p->manl)); -} - -int -isinf(d) - double d; -{ - register struct IEEEdp { - u_int manl : 32; - u_int manh : 20; - u_int exp : 11; - u_int sign : 1; - } *p = (struct IEEEdp *)&d; - - return(p->exp == 2047 && !p->manh && !p->manl); -} diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index a7d164b..3f71b98 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -17,7 +17,7 @@ SRCS+= __xuname.c _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \ getobjformat.c getosreldate.c getpagesize.c \ getpeereid.c getprogname.c getpwent.c getttyent.c \ getusershell.c getvfsbyname.c glob.c \ - initgroups.c isatty.c jrand48.c lcong48.c \ + initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ lockf.c lrand48.c mrand48.c nice.c \ nlist.c nrand48.c ntp_gettime.c opendir.c \ pause.c pmadvise.c popen.c posixshm.c pselect.c \ diff --git a/lib/libc/gen/isinf.c b/lib/libc/gen/isinf.c new file mode 100644 index 0000000..248fc93 --- /dev/null +++ b/lib/libc/gen/isinf.c @@ -0,0 +1,66 @@ +/*- + * 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" + +/* + * XXX These routines belong in libm, but they must remain in libc for + * binary compat until we can bump libm's major version number. + */ + +__weak_reference(__isinf, isinf); + +int +__isinf(double d) +{ + union IEEEd2bits u; + + u.d = d; + return (u.bits.exp == 2047 && u.bits.manl == 0 && u.bits.manh == 0); +} + +int +__isinff(float f) +{ + union IEEEf2bits u; + + u.f = f; + return (u.bits.exp == 255 && u.bits.man == 0); +} + +int +__isinfl(long double e) +{ + union IEEEl2bits u; + + u.e = e; + mask_nbit_l(u); + return (u.bits.exp == 32767 && u.bits.manl == 0 && u.bits.manh == 0); +} diff --git a/lib/libc/gen/isnan.c b/lib/libc/gen/isnan.c new file mode 100644 index 0000000..52cec1b --- /dev/null +++ b/lib/libc/gen/isnan.c @@ -0,0 +1,67 @@ +/*- + * 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" + +/* + * XXX These routines belong in libm, but they must remain in libc for + * binary compat until we can bump libm's major version number. + */ + +__weak_reference(__isnan, isnan); +__weak_reference(__isnanf, isnanf); + +int +__isnan(double d) +{ + union IEEEd2bits u; + + u.d = d; + return (u.bits.exp == 2047 && (u.bits.manl != 0 || u.bits.manh != 0)); +} + +int +__isnanf(float f) +{ + union IEEEf2bits u; + + u.f = f; + return (u.bits.exp == 255 && u.bits.man != 0); +} + +int +__isnanl(long double e) +{ + union IEEEl2bits u; + + u.e = e; + mask_nbit_l(u); + return (u.bits.exp == 32767 && (u.bits.manl != 0 || u.bits.manh != 0)); +} diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc index 2761608..624ec54 100644 --- a/lib/libc/i386/gen/Makefile.inc +++ b/lib/libc/i386/gen/Makefile.inc @@ -2,5 +2,5 @@ # $FreeBSD$ SRCS+= _ctx_start.S _setjmp.S alloca.S fabs.S frexp.c \ - infinity.c isinf.c ldexp.c makecontext.c modf.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/isinf.c b/lib/libc/i386/gen/isinf.c deleted file mode 100644 index 0d9cd86..0000000 --- a/lib/libc/i386/gen/isinf.c +++ /dev/null @@ -1,75 +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. - */ - -/* For binary compat; to be removed in FreeBSD 6.0. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> - -struct IEEEdp { - u_int manl : 32; - u_int manh : 20; - u_int exp : 11; - u_int sign : 1; -}; - -int -isnan(d) - double d; -{ - union { - double v; - struct IEEEdp s; - } u; - - u.v = d; - return (u.s.exp == 2047 && (u.s.manh || u.s.manl)); -} - -int -isinf(d) - double d; -{ - union { - double v; - struct IEEEdp s; - } u; - - u.v = d; - return (u.s.exp == 2047 && !u.s.manh && !u.s.manl); -} diff --git a/lib/libc/ia64/gen/Makefile.inc b/lib/libc/ia64/gen/Makefile.inc index 91d54fd..3f68eeb 100644 --- a/lib/libc/ia64/gen/Makefile.inc +++ b/lib/libc/ia64/gen/Makefile.inc @@ -3,8 +3,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 \ - isinf.c ldexp.c makecontext.c modf.c setjmp.S signalcontext.c \ - sigsetjmp.S + ldexp.c makecontext.c modf.c setjmp.S signalcontext.c sigsetjmp.S # The following may go away if function _Unwind_FindTableEntry() # will be part of GCC. diff --git a/lib/libc/ia64/gen/isinf.c b/lib/libc/ia64/gen/isinf.c deleted file mode 100644 index 8f346f3..0000000 --- a/lib/libc/ia64/gen/isinf.c +++ /dev/null @@ -1,68 +0,0 @@ -/* $NetBSD: isinf.c,v 1.1 1995/02/10 17:50:23 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. - */ - -/* For binary compat; to be removed in FreeBSD 6.0. */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -#undef isnan -#undef isinf - -int -isnan(d) - double d; -{ - union { - double v; - struct ieee_double s; - } u; - - u.v = d; - return (u.s.dbl_exp == DBL_EXP_INFNAN && - (u.s.dbl_frach || u.s.dbl_fracl)); -} - -int -isinf(d) - double d; -{ - union { - double v; - struct ieee_double s; - } u; - - u.v = d; - return (u.s.dbl_exp == DBL_EXP_INFNAN && - !u.s.dbl_frach && !u.s.dbl_fracl); -} diff --git a/lib/libc/powerpc/gen/Makefile.inc b/lib/libc/powerpc/gen/Makefile.inc index 8a431da..22689d7 100644 --- a/lib/libc/powerpc/gen/Makefile.inc +++ b/lib/libc/powerpc/gen/Makefile.inc @@ -2,7 +2,7 @@ SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ fpgetsticky.c fpsetmask.c fpsetround.c fpsetsticky.c frexp.c \ - infinity.c isinf.c ldexp.c makecontext.c modf.c _setjmp.S \ + infinity.c ldexp.c makecontext.c modf.c _setjmp.S \ setjmp.S sigsetjmp.S syncicache.c diff --git a/lib/libc/powerpc/gen/isinf.c b/lib/libc/powerpc/gen/isinf.c deleted file mode 100644 index 0b9ef6c..0000000 --- a/lib/libc/powerpc/gen/isinf.c +++ /dev/null @@ -1,67 +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: isinf.c,v 1.1 1995/02/10 17:50:23 cgd Exp $ - * from: FreeBSD: src/lib/libc/alpha/gen/isinf.c,v 1.2 2000/05/10 - */ - -/* For binary compat; to be removed in FreeBSD 6.0. */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -#undef isnan -#undef isinf - -int -isnan(double d) -{ - union { - double v; - struct ieee_double s; - } u; - - u.v = d; - return (u.s.dbl_exp == DBL_EXP_INFNAN && - (u.s.dbl_frach || u.s.dbl_fracl)); -} - -int -isinf(double d) -{ - union { - double v; - struct ieee_double s; - } u; - - u.v = d; - return (u.s.dbl_exp == DBL_EXP_INFNAN && - !u.s.dbl_frach && !u.s.dbl_fracl); -} diff --git a/lib/libc/sparc64/gen/Makefile.inc b/lib/libc/sparc64/gen/Makefile.inc index 265f3c0..789f95ac 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 isinf.c ldexp.c makecontext.c modf.S \ + frexp.c infinity.c ldexp.c makecontext.c modf.S \ signalcontext.c setjmp.S sigsetjmp.S diff --git a/lib/libc/sparc64/gen/isinf.c b/lib/libc/sparc64/gen/isinf.c deleted file mode 100644 index 0cbdfff..0000000 --- a/lib/libc/sparc64/gen/isinf.c +++ /dev/null @@ -1,69 +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: isinf.c,v 1.1 1995/02/10 17:50:23 cgd Exp $ - * from: FreeBSD: src/lib/libc/alpha/gen/isinf.c,v 1.2 2000/05/10 - */ - -/* For binary compat; to be removed in FreeBSD 6.0. */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -#undef isnan -#undef isinf - -int -isnan(d) - double d; -{ - union { - double v; - struct ieee_double s; - } u; - - u.v = d; - return (u.s.dbl_exp == DBL_EXP_INFNAN && - (u.s.dbl_frach || u.s.dbl_fracl)); -} - -int -isinf(d) - double d; -{ - union { - double v; - struct ieee_double s; - } u; - - u.v = d; - return (u.s.dbl_exp == DBL_EXP_INFNAN && - !u.s.dbl_frach && !u.s.dbl_fracl); -} |