diff options
Diffstat (limited to 'lib/libc/arch')
-rw-r--r-- | lib/libc/arch/alpha/gen/Makefile.inc | 5 | ||||
-rw-r--r-- | lib/libc/arch/alpha/gen/isinf.c | 72 | ||||
-rw-r--r-- | lib/libc/arch/alpha/gen/isnan.c | 55 | ||||
-rw-r--r-- | lib/libc/arch/hppa/gen/isinf.c | 6 | ||||
-rw-r--r-- | lib/libc/arch/hppa/gen/isnan.c | 6 | ||||
-rw-r--r-- | lib/libc/arch/i386/gen/Makefile.inc | 6 | ||||
-rw-r--r-- | lib/libc/arch/i386/gen/isinf.c | 39 | ||||
-rw-r--r-- | lib/libc/arch/i386/gen/isnan.c | 55 | ||||
-rw-r--r-- | lib/libc/arch/m68k/gen/Makefile.inc | 7 | ||||
-rw-r--r-- | lib/libc/arch/m68k/gen/isinf.c | 39 | ||||
-rw-r--r-- | lib/libc/arch/m68k/gen/isnan.c | 55 | ||||
-rw-r--r-- | lib/libc/arch/m88k/gen/isinf.c | 40 | ||||
-rw-r--r-- | lib/libc/arch/m88k/gen/isnan.c | 10 | ||||
-rw-r--r-- | lib/libc/arch/powerpc/gen/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/arch/powerpc/gen/isinf.c | 39 | ||||
-rw-r--r-- | lib/libc/arch/powerpc/gen/isnan.c | 55 | ||||
-rw-r--r-- | lib/libc/arch/sparc/gen/isinf.c | 6 | ||||
-rw-r--r-- | lib/libc/arch/sparc/gen/isnan.c | 6 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/gen/isinf.c | 9 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/gen/isnan.c | 9 | ||||
-rw-r--r-- | lib/libc/arch/vax/gen/isinf.c | 4 |
21 files changed, 356 insertions, 169 deletions
diff --git a/lib/libc/arch/alpha/gen/Makefile.inc b/lib/libc/arch/alpha/gen/Makefile.inc index d6e3cbffa44..b9df181ef49 100644 --- a/lib/libc/arch/alpha/gen/Makefile.inc +++ b/lib/libc/arch/alpha/gen/Makefile.inc @@ -1,7 +1,8 @@ -# $OpenBSD: Makefile.inc,v 1.3 1996/11/13 21:20:07 niklas Exp $ +# $OpenBSD: Makefile.inc,v 1.4 2001/09/10 22:38:11 millert Exp $ # $NetBSD: Makefile.inc,v 1.3 1995/04/29 05:09:14 cgd Exp $ -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 isinf.c isnan.c ldexp.c modf.c \ + setjmp.S SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ fpsetround.c fpsetsticky.c SRCS+= sigsetjmp.S diff --git a/lib/libc/arch/alpha/gen/isinf.c b/lib/libc/arch/alpha/gen/isinf.c index 23e45a0580e..35898dc011f 100644 --- a/lib/libc/arch/alpha/gen/isinf.c +++ b/lib/libc/arch/alpha/gen/isinf.c @@ -1,57 +1,55 @@ -/* $OpenBSD: isinf.c,v 1.3 1996/11/13 21:20:19 niklas Exp $ */ -/* $NetBSD: isinf.c,v 1.1 1995/02/10 17:50:23 cgd Exp $ */ +/* $OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $ */ /* - * Copyright (c) 1994, 1995 Carnegie-Mellon University. - * All rights reserved. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. 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 + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 + * 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. * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. + * 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: isinf.c,v 1.3 1996/11/13 21:20:19 niklas Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> #include <machine/ieee.h> -#include <math.h> - -int -isnan(d) - double d; -{ - register struct ieee_double *p = (struct ieee_double *)&d; - - return (p->dbl_exp == DBL_EXP_INFNAN && - (p->dbl_frach || p->dbl_fracl)); -} int isinf(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && - !p->dbl_frach && !p->dbl_fracl); + p->dbl_frach == 0 && p->dbl_fracl == 0); } diff --git a/lib/libc/arch/alpha/gen/isnan.c b/lib/libc/arch/alpha/gen/isnan.c new file mode 100644 index 00000000000..4e980431dec --- /dev/null +++ b/lib/libc/arch/alpha/gen/isnan.c @@ -0,0 +1,55 @@ +/* $OpenBSD: isnan.c,v 1.1 2001/09/10 22:38:11 millert Exp $ */ + +/* + * 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: isnan.c,v 1.1 2001/09/10 22:38:11 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <machine/ieee.h> + +int +isnan(d) + double d; +{ + struct ieee_double *p = (struct ieee_double *)&d; + + return (p->dbl_exp == DBL_EXP_INFNAN && + (p->dbl_frach != 0 || p->dbl_fracl != 0)); +} diff --git a/lib/libc/arch/hppa/gen/isinf.c b/lib/libc/arch/hppa/gen/isinf.c index 3b89f9d5198..1bd6b1d4e92 100644 --- a/lib/libc/arch/hppa/gen/isinf.c +++ b/lib/libc/arch/hppa/gen/isinf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinf.c,v 1.1 1999/09/14 00:21:15 mickey Exp $ */ +/* $OpenBSD: isinf.c,v 1.2 2001/09/10 22:38:11 millert Exp $ */ /* * Copyright (c) 1992, 1993 @@ -38,7 +38,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isinf.c,v 1.1 1999/09/14 00:21:15 mickey Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.2 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -48,7 +48,7 @@ int isinf(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && p->dbl_frach == 0 && p->dbl_fracl == 0); diff --git a/lib/libc/arch/hppa/gen/isnan.c b/lib/libc/arch/hppa/gen/isnan.c index 2e3fd51a876..93dc7187c3e 100644 --- a/lib/libc/arch/hppa/gen/isnan.c +++ b/lib/libc/arch/hppa/gen/isnan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnan.c,v 1.1 1999/09/14 00:21:15 mickey Exp $ */ +/* $OpenBSD: isnan.c,v 1.2 2001/09/10 22:38:11 millert Exp $ */ /* * Copyright (c) 1992, 1993 @@ -38,7 +38,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isnan.c,v 1.1 1999/09/14 00:21:15 mickey Exp $"; +static char rcsid[] = "$OpenBSD: isnan.c,v 1.2 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -48,7 +48,7 @@ int isnan(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && (p->dbl_frach != 0 || p->dbl_fracl != 0)); diff --git a/lib/libc/arch/i386/gen/Makefile.inc b/lib/libc/arch/i386/gen/Makefile.inc index 3ff40d5307f..b8b14e53258 100644 --- a/lib/libc/arch/i386/gen/Makefile.inc +++ b/lib/libc/arch/i386/gen/Makefile.inc @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile.inc,v 1.2 1996/08/19 08:12:13 tholo Exp $ +# $OpenBSD: Makefile.inc,v 1.3 2001/09/10 22:38:11 millert Exp $ -SRCS+= _setjmp.S alloca.S fabs.S frexp.c infinity.c isinf.c ldexp.c modf.S \ - setjmp.S sigsetjmp.S +SRCS+= _setjmp.S alloca.S fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.c \ + modf.S setjmp.S sigsetjmp.S SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \ fpsetround.S fpsetsticky.S SRCS+= divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S diff --git a/lib/libc/arch/i386/gen/isinf.c b/lib/libc/arch/i386/gen/isinf.c index 02128987bce..35898dc011f 100644 --- a/lib/libc/arch/i386/gen/isinf.c +++ b/lib/libc/arch/i386/gen/isinf.c @@ -1,6 +1,12 @@ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. +/* $OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $ */ + +/* + * 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 @@ -32,35 +38,18 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 1996/08/19 08:12:31 tholo Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #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)); -} +#include <machine/ieee.h> 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; + struct ieee_double *p = (struct ieee_double *)&d; - return(p->exp == 2047 && !p->manh && !p->manl); + return (p->dbl_exp == DBL_EXP_INFNAN && + p->dbl_frach == 0 && p->dbl_fracl == 0); } diff --git a/lib/libc/arch/i386/gen/isnan.c b/lib/libc/arch/i386/gen/isnan.c new file mode 100644 index 00000000000..4e980431dec --- /dev/null +++ b/lib/libc/arch/i386/gen/isnan.c @@ -0,0 +1,55 @@ +/* $OpenBSD: isnan.c,v 1.1 2001/09/10 22:38:11 millert Exp $ */ + +/* + * 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: isnan.c,v 1.1 2001/09/10 22:38:11 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <machine/ieee.h> + +int +isnan(d) + double d; +{ + struct ieee_double *p = (struct ieee_double *)&d; + + return (p->dbl_exp == DBL_EXP_INFNAN && + (p->dbl_frach != 0 || p->dbl_fracl != 0)); +} diff --git a/lib/libc/arch/m68k/gen/Makefile.inc b/lib/libc/arch/m68k/gen/Makefile.inc index 0be72b80351..7a58c3e63ae 100644 --- a/lib/libc/arch/m68k/gen/Makefile.inc +++ b/lib/libc/arch/m68k/gen/Makefile.inc @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile.inc,v 1.2 1996/08/19 08:13:53 tholo Exp $ +# $OpenBSD: Makefile.inc,v 1.3 2001/09/10 22:38:11 millert Exp $ -SRCS+= _setjmp.S alloca.S fabs.S frexp.c infinity.c isinf.c ldexp.S modf.S \ - setjmp.S sigsetjmp.S +SRCS+= _setjmp.S alloca.S fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.S \ + modf.S setjmp.S sigsetjmp.S SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \ fpsetround.S fpsetsticky.S SRCS+= adddf3.S addsf3.S ashlsi3.S ashrsi3.S cmpdf2.S cmpsf2.S divdf3.S \ @@ -9,4 +9,3 @@ SRCS+= adddf3.S addsf3.S ashlsi3.S ashrsi3.S cmpdf2.S cmpsf2.S divdf3.S \ floatsidf.S lshlsi3.S lshrsi3.S modsi3.S muldf3.S mulsf3.S mulsi3.S \ negdf2.S negsf2.S saveregs.c subdf3.S subsf3.S truncdfsf2.S udivsi3.S \ umodsi3.S umulsi3.S - diff --git a/lib/libc/arch/m68k/gen/isinf.c b/lib/libc/arch/m68k/gen/isinf.c index aca71684d29..35898dc011f 100644 --- a/lib/libc/arch/m68k/gen/isinf.c +++ b/lib/libc/arch/m68k/gen/isinf.c @@ -1,6 +1,12 @@ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. +/* $OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $ */ + +/* + * 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 @@ -32,35 +38,18 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 1996/08/19 08:14:25 tholo Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> - -int -isnan(d) - double d; -{ - register struct IEEEdp { - u_int sign : 1; - u_int exp : 11; - u_int manh : 20; - u_int manl : 32; - } *p = (struct IEEEdp *)&d; - - return(p->exp == 2047 && (p->manh || p->manl)); -} +#include <machine/ieee.h> int isinf(d) double d; { - register struct IEEEdp { - u_int sign : 1; - u_int exp : 11; - u_int manh : 20; - u_int manl : 32; - } *p = (struct IEEEdp *)&d; + struct ieee_double *p = (struct ieee_double *)&d; - return(p->exp == 2047 && !p->manh && !p->manl); + return (p->dbl_exp == DBL_EXP_INFNAN && + p->dbl_frach == 0 && p->dbl_fracl == 0); } diff --git a/lib/libc/arch/m68k/gen/isnan.c b/lib/libc/arch/m68k/gen/isnan.c new file mode 100644 index 00000000000..4e980431dec --- /dev/null +++ b/lib/libc/arch/m68k/gen/isnan.c @@ -0,0 +1,55 @@ +/* $OpenBSD: isnan.c,v 1.1 2001/09/10 22:38:11 millert Exp $ */ + +/* + * 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: isnan.c,v 1.1 2001/09/10 22:38:11 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <machine/ieee.h> + +int +isnan(d) + double d; +{ + struct ieee_double *p = (struct ieee_double *)&d; + + return (p->dbl_exp == DBL_EXP_INFNAN && + (p->dbl_frach != 0 || p->dbl_fracl != 0)); +} diff --git a/lib/libc/arch/m88k/gen/isinf.c b/lib/libc/arch/m88k/gen/isinf.c index d935c1f4c68..9cd731ae0d8 100644 --- a/lib/libc/arch/m88k/gen/isinf.c +++ b/lib/libc/arch/m88k/gen/isinf.c @@ -1,8 +1,12 @@ -/* $OpenBSD: isinf.c,v 1.2 2000/03/01 17:31:20 todd Exp $ */ +/* $OpenBSD: isinf.c,v 1.3 2001/09/10 22:38:11 millert Exp $ */ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. +/* + * 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 @@ -34,34 +38,18 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -/*static char sccsid[] = "from: @(#)isinf.c 5.1 (Berkeley) 3/18/91";*/ -static char rcsid[] = "$OpenBSD: isinf.c,v 1.2 2000/03/01 17:31:20 todd Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> +#include <machine/ieee.h> -isnan(d) - double d; -{ - register struct IEEEdp { - u_int sign : 1; - u_int exp : 11; - u_int manh : 20; - u_int manl : 32; - } *p = (struct IEEEdp *)&d; - - return(p->exp == 2047 && (p->manh || p->manl)); -} - +int isinf(d) double d; { - register struct IEEEdp { - u_int sign : 1; - u_int exp : 11; - u_int manh : 20; - u_int manl : 32; - } *p = (struct IEEEdp *)&d; + struct ieee_double *p = (struct ieee_double *)&d; - return(p->exp == 2047 && !p->manh && !p->manl); + return (p->dbl_exp == DBL_EXP_INFNAN && + p->dbl_frach == 0 && p->dbl_fracl == 0); } diff --git a/lib/libc/arch/m88k/gen/isnan.c b/lib/libc/arch/m88k/gen/isnan.c index 5360c779456..a84ace4511c 100644 --- a/lib/libc/arch/m88k/gen/isnan.c +++ b/lib/libc/arch/m88k/gen/isnan.c @@ -1,4 +1,5 @@ -/* $OpenBSD: isnan.c,v 1.2 2000/03/01 17:31:20 todd Exp $ */ +/* $OpenBSD: isnan.c,v 1.3 2001/09/10 22:38:11 millert Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -34,21 +35,20 @@ * 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. - * - * from: Header: isnan.c,v 1.1 91/07/08 19:03:34 torek Exp */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)isnan.c 8.1 (Berkeley) 6/4/93"; +static char rcsid[] = "$OpenBSD: isnan.c,v 1.3 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> #include <machine/ieee.h> +int isnan(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && (p->dbl_frach != 0 || p->dbl_fracl != 0)); diff --git a/lib/libc/arch/powerpc/gen/Makefile.inc b/lib/libc/arch/powerpc/gen/Makefile.inc index 1aeb2065cd4..3e0e5091c31 100644 --- a/lib/libc/arch/powerpc/gen/Makefile.inc +++ b/lib/libc/arch/powerpc/gen/Makefile.inc @@ -1,4 +1,4 @@ -SRCS+= isinf.c infinity.c setjmp.S sigsetjmp.S flt_rounds.c modf.c +SRCS+= isinf.c isnan.c infinity.c setjmp.S sigsetjmp.S flt_rounds.c modf.c SRCS+= ldexp.c fabs.c frexp.c SRCS+= fpgetmask.c fpsetmask.c SRCS+= fpgetround.c fpsetround.c diff --git a/lib/libc/arch/powerpc/gen/isinf.c b/lib/libc/arch/powerpc/gen/isinf.c index 6667cb90a28..35898dc011f 100644 --- a/lib/libc/arch/powerpc/gen/isinf.c +++ b/lib/libc/arch/powerpc/gen/isinf.c @@ -1,8 +1,12 @@ -/* $OpenBSD: isinf.c,v 1.3 2001/05/11 21:40:00 drahn Exp $ */ +/* $OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $ */ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. +/* + * 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 @@ -34,35 +38,18 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 2001/05/11 21:40:00 drahn Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> - -int -isnan(d) - double d; -{ - register struct IEEEdp { - u_int sign : 1; - u_int exp : 11; - u_int manh : 20; - u_int manl : 32; - } *p = (struct IEEEdp *)&d; - - return(p->exp == 2047 && (p->manh || p->manl)); -} +#include <machine/ieee.h> int isinf(d) double d; { - register struct IEEEdp { - u_int sign : 1; - u_int exp : 11; - u_int manh : 20; - u_int manl : 32; - } *p = (struct IEEEdp *)&d; + struct ieee_double *p = (struct ieee_double *)&d; - return(p->exp == 2047 && !p->manh && !p->manl); + return (p->dbl_exp == DBL_EXP_INFNAN && + p->dbl_frach == 0 && p->dbl_fracl == 0); } diff --git a/lib/libc/arch/powerpc/gen/isnan.c b/lib/libc/arch/powerpc/gen/isnan.c new file mode 100644 index 00000000000..4e980431dec --- /dev/null +++ b/lib/libc/arch/powerpc/gen/isnan.c @@ -0,0 +1,55 @@ +/* $OpenBSD: isnan.c,v 1.1 2001/09/10 22:38:11 millert Exp $ */ + +/* + * 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: isnan.c,v 1.1 2001/09/10 22:38:11 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <machine/ieee.h> + +int +isnan(d) + double d; +{ + struct ieee_double *p = (struct ieee_double *)&d; + + return (p->dbl_exp == DBL_EXP_INFNAN && + (p->dbl_frach != 0 || p->dbl_fracl != 0)); +} diff --git a/lib/libc/arch/sparc/gen/isinf.c b/lib/libc/arch/sparc/gen/isinf.c index 7103bbb9f1c..35898dc011f 100644 --- a/lib/libc/arch/sparc/gen/isinf.c +++ b/lib/libc/arch/sparc/gen/isinf.c @@ -1,3 +1,5 @@ +/* $OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -36,7 +38,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 1996/08/19 08:17:38 tholo Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -46,7 +48,7 @@ int isinf(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && p->dbl_frach == 0 && p->dbl_fracl == 0); diff --git a/lib/libc/arch/sparc/gen/isnan.c b/lib/libc/arch/sparc/gen/isnan.c index 15725959bfe..31a7dfec8f6 100644 --- a/lib/libc/arch/sparc/gen/isnan.c +++ b/lib/libc/arch/sparc/gen/isnan.c @@ -1,3 +1,5 @@ +/* $OpenBSD: isnan.c,v 1.4 2001/09/10 22:38:11 millert Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -36,7 +38,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isnan.c,v 1.3 1996/08/19 08:17:39 tholo Exp $"; +static char rcsid[] = "$OpenBSD: isnan.c,v 1.4 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -46,7 +48,7 @@ int isnan(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && (p->dbl_frach != 0 || p->dbl_fracl != 0)); diff --git a/lib/libc/arch/sparc64/gen/isinf.c b/lib/libc/arch/sparc64/gen/isinf.c index 2bdf5bda0fa..1bd6b1d4e92 100644 --- a/lib/libc/arch/sparc64/gen/isinf.c +++ b/lib/libc/arch/sparc64/gen/isinf.c @@ -1,4 +1,5 @@ -/* $OpenBSD: isinf.c,v 1.1 2001/08/29 01:41:29 art Exp $ */ +/* $OpenBSD: isinf.c,v 1.2 2001/09/10 22:38:11 millert Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -36,6 +37,10 @@ * SUCH DAMAGE. */ +#if defined(LIBC_SCCS) && !defined(lint) +static char rcsid[] = "$OpenBSD: isinf.c,v 1.2 2001/09/10 22:38:11 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + #include <sys/types.h> #include <machine/ieee.h> @@ -43,7 +48,7 @@ int isinf(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && p->dbl_frach == 0 && p->dbl_fracl == 0); diff --git a/lib/libc/arch/sparc64/gen/isnan.c b/lib/libc/arch/sparc64/gen/isnan.c index d793b1b7008..93dc7187c3e 100644 --- a/lib/libc/arch/sparc64/gen/isnan.c +++ b/lib/libc/arch/sparc64/gen/isnan.c @@ -1,4 +1,5 @@ -/* $OpenBSD: isnan.c,v 1.1 2001/08/29 01:41:29 art Exp $ */ +/* $OpenBSD: isnan.c,v 1.2 2001/09/10 22:38:11 millert Exp $ */ + /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -36,6 +37,10 @@ * SUCH DAMAGE. */ +#if defined(LIBC_SCCS) && !defined(lint) +static char rcsid[] = "$OpenBSD: isnan.c,v 1.2 2001/09/10 22:38:11 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + #include <sys/types.h> #include <machine/ieee.h> @@ -43,7 +48,7 @@ int isnan(d) double d; { - register struct ieee_double *p = (struct ieee_double *)&d; + struct ieee_double *p = (struct ieee_double *)&d; return (p->dbl_exp == DBL_EXP_INFNAN && (p->dbl_frach != 0 || p->dbl_fracl != 0)); diff --git a/lib/libc/arch/vax/gen/isinf.c b/lib/libc/arch/vax/gen/isinf.c index 61d2355167d..b46519d67d3 100644 --- a/lib/libc/arch/vax/gen/isinf.c +++ b/lib/libc/arch/vax/gen/isinf.c @@ -1,3 +1,5 @@ +/* $OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $ */ + /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -32,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: isinf.c,v 1.3 1996/08/19 08:18:26 tholo Exp $"; +static char rcsid[] = "$OpenBSD: isinf.c,v 1.4 2001/09/10 22:38:11 millert Exp $"; #endif /* LIBC_SCCS and not lint */ /* ARGSUSED */ |