* Since there is no single portable IEEE 754 format for a long double,

keep a common implementation of isinfl() and isnanl() to be used by
  platforms where `long double' == `double'; move others into
  machine-dependent code.
* In due course, consider __VFP_FP__ on arm.
This commit is contained in:
kleink 2003-10-24 00:58:01 +00:00
parent 3f32c6ab70
commit 712c8de209
27 changed files with 914 additions and 61 deletions

View File

@ -1,11 +1,11 @@
# $NetBSD: Makefile.inc,v 1.13 2003/08/01 17:03:46 lukem Exp $
# $NetBSD: Makefile.inc,v 1.14 2003/10/24 00:58:01 kleink Exp $
SRCS+= fabs.S
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c ldexp_ieee754.c modf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_dbl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_dbl_ieee754.c ldexp_ieee754.c modf_ieee754.c
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
fpsetround.c fpsetsticky.c

View File

@ -1,13 +1,14 @@
# $NetBSD: Makefile.inc,v 1.6 2003/08/01 17:03:47 lukem Exp $
# $NetBSD: Makefile.inc,v 1.7 2003/10/24 00:58:01 kleink Exp $
SRCS+= alloca.S byte_swap_2.S byte_swap_4.S bswap64.c divsi3.S \
fabs.c flt_rounds.c \
infinity.c
infinity.c \
isinfl.c isnanl.c
# Common ieee754 constants and functions
SRCS+= nanf_ieee754.c # infinity is ``different'' on arm, use local version
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c ldexp_ieee754.c modf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isnan_ieee754.c
SRCS+= ldexp_ieee754.c modf_ieee754.c
SRCS+= setjmp.S __setjmp14.S
SRCS+= _setjmp.S

View File

@ -0,0 +1,81 @@
/* $NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isinfl,_isinfl)
#endif
#endif
int
isinfl(long double ld)
{
#ifndef __VFP_FP__
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_frach == 0 && u.ldbl.ext_frachm == 0 &&
u.ldbl.ext_fraclm == 0 && u.ldbl.ext_fracl == 0));
#else
union {
long double ld;
struct ieee_double dbl;
} u;
u.ld = ld;
return (u.dbl.dbl_exp == DBL_EXP_INFNAN &&
(u.dbl.dbl_frach == 0 && u.dbl.dbl_fracl == 0));
#endif /* !__VFP_FP__ */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: isnanl_ieee754.c,v 1.4 2003/10/23 00:04:57 kleink Exp $ */
/* $NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $ */
/*
* Copyright (c) 1992, 1993
@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isnanl_ieee754.c,v 1.4 2003/10/23 00:04:57 kleink Exp $");
__RCSID("$NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -49,10 +49,6 @@ __RCSID("$NetBSD: isnanl_ieee754.c,v 1.4 2003/10/23 00:04:57 kleink Exp $");
#include <machine/ieee.h>
#include <math.h>
#if !defined(EXT_EXP_INFNAN)
#include <assert.h>
#endif
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isnanl,_isnanl)
@ -62,7 +58,7 @@ __weak_alias(isnanl,_isnanl)
int
isnanl(long double ld)
{
#if defined(EXT_EXP_INFNAN)
#ifndef __VFP_FP__
union {
long double ld;
struct ieee_ext ldbl;
@ -73,7 +69,13 @@ isnanl(long double ld)
(u.ldbl.ext_frach != 0 || u.ldbl.ext_frachm != 0 ||
u.ldbl.ext_fraclm != 0 || u.ldbl.ext_fracl != 0));
#else
_DIAGASSERT(sizeof(double) == sizeof(long double));
return (isnan((double) ld));
#endif /* EXT_EXP_INFNAN */
union {
long double ld;
struct ieee_double dbl;
} u;
u.ld = ld;
return (u.dbl.dbl_exp == DBL_EXP_INFNAN &&
(u.dbl.dbl_frach != 0 || u.dbl.dbl_fracl != 0));
#endif /* !__VFP_FP__ */
}

View File

@ -1,14 +1,16 @@
# $NetBSD: Makefile.inc,v 1.5 2003/05/17 15:05:53 thorpej Exp $
# $NetBSD: Makefile.inc,v 1.6 2003/10/24 00:58:01 kleink Exp $
SRCS+= bswap16.c bswap32.c bswap64.c __sigsetjmp14.S __setjmp14.S _setjmp.S
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c ldexp_ieee754.c
SRCS+= isinf_ieee754.c isinfl_ieee754.c
SRCS+= isnan_ieee754.c isnanl_ieee754.c
SRCS+= isinf_ieee754.c
SRCS+= isnan_ieee754.c
SRCS+= modf_ieee754.c
SRCS+= isinfl.c isnanl.c
# XXX Missing:
# fabs, flt_rounds, fpgetmask, fpgetround, fpgetsticky
# fpsetmask, fpsetround, fpsetsticky

View File

@ -1,4 +1,4 @@
/* $NetBSD: isinfl_ieee754.c,v 1.2 2003/08/07 16:42:52 agc Exp $ */
/* $NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $ */
/*
* Copyright (c) 1992, 1993
@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD");
__RCSID("$NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -49,10 +49,6 @@ __RCSID("$NetBSD");
#include <machine/ieee.h>
#include <math.h>
#if !defined(EXT_EXP_INFNAN)
#include <assert.h>
#endif
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isinfl,_isinfl)
@ -62,7 +58,6 @@ __weak_alias(isinfl,_isinfl)
int
isinfl(long double ld)
{
#if defined(EXT_EXP_INFNAN)
union {
long double ld;
struct ieee_ext ldbl;
@ -72,8 +67,4 @@ isinfl(long double ld)
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_frach == 0 && u.ldbl.ext_frachm == 0 &&
u.ldbl.ext_fraclm == 0 && u.ldbl.ext_fracl == 0));
#else
_DIAGASSERT(sizeof(double) == sizeof(long double));
return (isinf((double) ld));
#endif /* EXT_EXP_INFNAN */
}

View File

@ -0,0 +1,70 @@
/* $NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isnanl,_isnanl)
#endif
#endif
int
isnanl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_frach != 0 || u.ldbl.ext_frachm != 0 ||
u.ldbl.ext_fraclm != 0 || u.ldbl.ext_fracl != 0));
}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.16 2003/08/01 17:03:47 lukem Exp $
# $NetBSD: Makefile.inc,v 1.17 2003/10/24 00:58:01 kleink Exp $
# objects built from assembler sources (need lint stubs)
SRCS+= alloca.S byte_swap_2.S byte_swap_4.S fabs.S modf.S \
@ -16,9 +16,9 @@ SRCS+= bswap64.c ldexp.c _lwp.c makecontext.c
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isnan_ieee754.c
SRCS+= isinfl.c isnanl.c
# "internal" objects (don't provide part of the user-visible API)
SRCS+= divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S

View File

@ -0,0 +1,69 @@
/* $NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isinfl,_isinfl)
#endif
#endif
int
isinfl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_frach == 0x80000000 && u.ldbl.ext_fracl == 0));
}

View File

@ -0,0 +1,70 @@
/* $NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isnanl,_isnanl)
#endif
#endif
int
isnanl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
((u.ldbl.ext_frach & 0x80000000) != 0) &&
(((u.ldbl.ext_frach & ~0x80000000) != 0) || u.ldbl.ext_fracl != 0));
}

View File

@ -1,11 +1,12 @@
# $NetBSD: Makefile.inc,v 1.18 2003/08/01 17:03:48 lukem Exp $
# $NetBSD: Makefile.inc,v 1.19 2003/10/24 00:58:01 kleink Exp $
SRCS+= alloca.S fabs.S
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isnan_ieee754.c
SRCS+= isinfl.c isnanl.c
SRCS+= ashlsi3.S ashrsi3.S \
lshlsi3.S lshrsi3.S \

View File

@ -0,0 +1,70 @@
/* $NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isinfl,_isinfl)
#endif
#endif
int
isinfl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
/* Note: the explicit integer bit is "don't care". */
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_frach == 0 && u.ldbl.ext_fracl == 0));
}

View File

@ -0,0 +1,70 @@
/* $NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isnanl,_isnanl)
#endif
#endif
int
isnanl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_int != 0 ||
u.ldbl.ext_frach != 0 || u.ldbl.ext_fracl != 0));
}

View File

@ -1,11 +1,11 @@
# $NetBSD: Makefile.inc,v 1.17 2003/08/01 17:03:49 lukem Exp $
# $NetBSD: Makefile.inc,v 1.18 2003/10/24 00:58:01 kleink Exp $
SRCS+= fabs.S ldexp.S modf.S
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c
SRCS+= isnan_dbl_ieee754.c
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
fpsetround.c fpsetsticky.c

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.18 2003/08/01 17:03:52 lukem Exp $
# $NetBSD: Makefile.inc,v 1.19 2003/10/24 00:58:01 kleink Exp $
# objects built from assembler sources (need lint stubs)
ASSRCS+=alloca.S fabs.S modf.S
@ -19,8 +19,8 @@ SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
# Common ieee754 constants and functions
SRCS+= nanf_ieee754.c infinity_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c ldexp_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_dbl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_dbl_ieee754.c ldexp_ieee754.c
SRCS+= makecontext.c

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.13 2003/08/01 17:03:53 lukem Exp $
# $NetBSD: Makefile.inc,v 1.14 2003/10/24 00:58:01 kleink Exp $
SRCS+= _setjmp.S setjmp.S sigsetjmp.S __setjmp14.S __sigsetjmp14.S
SRCS+= bswap16.c bswap32.c bswap64.c
@ -10,8 +10,8 @@ SRCS+= _lwp.c makecontext.c resumecontext.c swapcontext.S
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c ldexp_ieee754.c modf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_dbl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_dbl_ieee754.c ldexp_ieee754.c modf_ieee754.c
SRCS.powerpc.gen=Lint_swapcontext.c
LSRCS+= ${SRCS.powerpc.gen}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.11 2003/08/01 17:03:54 lukem Exp $
# $NetBSD: Makefile.inc,v 1.12 2003/10/24 00:58:01 kleink Exp $
SRCS+= _setjmp.S setjmp.S sigsetjmp.S __setjmp14.S __sigsetjmp14.S
@ -10,8 +10,8 @@ SRCS+= fabs.c flt_rounds.c bswap16.c bswap32.c bswap64.c
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c ldexp_ieee754.c modf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_dbl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_dbl_ieee754.c ldexp_ieee754.c modf_ieee754.c
SRCS+= ashiftrt.S ashlsi3.S ashrsi3.S lshrsi3.S movstr.S movstr_i4.S \
movstrSI.S mulsi3.S sdivsi3.S udivsi3.S

View File

@ -1,13 +1,13 @@
# $NetBSD: Makefile.inc,v 1.9 2003/08/01 17:03:54 lukem Exp $
# $NetBSD: Makefile.inc,v 1.10 2003/10/24 00:58:01 kleink Exp $
SRCS+= __setjmp14.S __sigsetjmp14.S _setjmp.S \
alloca.S \
byte_swap_2.S byte_swap_4.S byte_swap_8.S \
fabs.S flt_rounds.S \
SRCS+= frexp_ieee754.c infinity_ieee754.c isinf_ieee754.c isinfl_ieee754.c \
isnan_ieee754.c isnanl_ieee754.c ldexp_ieee754.c modf_ieee754.c \
nanf_ieee754.c
SRCS+= frexp_ieee754.c infinity_ieee754.c isinf_ieee754.c
isinfl_dbl_ieee754.c isnan_ieee754.c isnanl_dbl_ieee754.c \
ldexp_ieee754.c modf_ieee754.c nanf_ieee754.c
SRCS+= fpgetmask.S fpgetround.S fpgetsticky.S \
fpsetmask.S fpsetround.S fpsetsticky.S

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.12 2003/08/01 17:03:55 lukem Exp $
# $NetBSD: Makefile.inc,v 1.13 2003/10/24 00:58:01 kleink Exp $
SRCS+= fabs.S modf.S
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
@ -6,8 +6,8 @@ SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c ldexp_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_dbl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_dbl_ieee754.c ldexp_ieee754.c
SRCS+= setjmp.S __setjmp14.S
SRCS+= _setjmp.S

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.9 2003/08/01 17:03:55 lukem Exp $
# $NetBSD: Makefile.inc,v 1.10 2003/10/24 00:58:01 kleink Exp $
SRCS+= fabs.S modf.S
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
@ -6,8 +6,10 @@ SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c ldexp_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isnan_ieee754.c
SRCS+= ldexp_ieee754.c
SRCS+= isinfl.c isnanl.c
SRCS+= bswap16.c bswap32.c bswap64.c
SRCS+= setjmp.S __setjmp14.S

View File

@ -0,0 +1,70 @@
/* $NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isinfl,_isinfl)
#endif
#endif
int
isinfl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_frach == 0 && u.ldbl.ext_frachm == 0 &&
u.ldbl.ext_fraclm == 0 && u.ldbl.ext_fracl == 0));
}

View File

@ -0,0 +1,70 @@
/* $NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isnanl,_isnanl)
#endif
#endif
int
isnanl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_frach != 0 || u.ldbl.ext_frachm != 0 ||
u.ldbl.ext_fraclm != 0 || u.ldbl.ext_fracl != 0));
}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.6 2003/08/01 17:03:56 lukem Exp $
# $NetBSD: Makefile.inc,v 1.7 2003/10/24 00:58:01 kleink Exp $
# objects built from assembler sources (need lint stubs)
SRCS+= alloca.S bswap64.S byte_swap_2.S byte_swap_4.S fabs.S modf.S \
@ -16,8 +16,9 @@ SRCS+= ldexp.c _lwp.c makecontext.c
# Common ieee754 constants and functions
SRCS+= infinity_ieee754.c nanf_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isinfl_ieee754.c isnan_ieee754.c
SRCS+= isnanl_ieee754.c
SRCS+= frexp_ieee754.c isinf_ieee754.c isnan_ieee754.c
SRCS+= isinfl.c isnanl.c
SRCS.x86_64.gen=\
Lint__setjmp.c Lint_alloca.c Lint_bswap16.c Lint_bswap32.c \

View File

@ -0,0 +1,69 @@
/* $NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isinfl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isinfl,_isinfl)
#endif
#endif
int
isinfl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
(u.ldbl.ext_frach == 0x80000000 && u.ldbl.ext_fracl == 0));
}

View File

@ -0,0 +1,70 @@
/* $NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isnanl.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isnanl,_isnanl)
#endif
#endif
int
isnanl(long double ld)
{
union {
long double ld;
struct ieee_ext ldbl;
} u;
u.ld = ld;
return (u.ldbl.ext_exp == EXT_EXP_INFNAN &&
((u.ldbl.ext_frach & 0x80000000) != 0) &&
(((u.ldbl.ext_frach & ~0x80000000) != 0) || u.ldbl.ext_fracl != 0));
}

View File

@ -0,0 +1,72 @@
/* $NetBSD: isinfl_dbl_ieee754.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isinfl_dbl_ieee754.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isinfl,_isinfl)
#endif
#endif
/*
* isinfl() for platforms where long double == double.
*/
int
isinfl(long double ld)
{
union {
long double ld;
struct ieee_double dbl;
} u;
u.ld = ld;
return (u.dbl.dbl_exp == DBL_EXP_INFNAN &&
(u.dbl.dbl_frach == 0 && u.dbl.dbl_fracl == 0));
}

View File

@ -0,0 +1,72 @@
/* $NetBSD: isnanl_dbl_ieee754.c,v 1.1 2003/10/24 00:58:01 kleink 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. 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.
*
* from: Header: isinf.c,v 1.1 91/07/08 19:03:34 torek Exp
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: isnanl_dbl_ieee754.c,v 1.1 2003/10/24 00:58:01 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <machine/ieee.h>
#include <math.h>
#if 0 /* XXX Currently limited to internal use. */
#ifdef __weak_alias
__weak_alias(isnanl,_isnanl)
#endif
#endif
/*
* isnanl() for platforms where long double == double.
*/
int
isnanl(long double ld)
{
union {
long double ld;
struct ieee_double dbl;
} u;
u.ld = ld;
return (u.dbl.dbl_exp == DBL_EXP_INFNAN &&
(u.dbl.dbl_frach != 0 || u.dbl.dbl_fracl != 0));
}