Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src C99: Define a NAN macro in <math.h> which evaulates to a con...
details: https://anonhg.NetBSD.org/src/rev/fddb03660ff3
branches: trunk
changeset: 479844:fddb03660ff3
user: kleink <kleink%NetBSD.org@localhost>
date: Thu Dec 23 10:15:05 1999 +0000
description:
C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
diffstat:
include/math.h | 3 ++-
lib/libc/arch/alpha/gen/Makefile.inc | 4 ++--
lib/libc/arch/alpha/gen/nanf.c | 13 +++++++++++++
lib/libc/arch/arm32/gen/Makefile.inc | 4 ++--
lib/libc/arch/arm32/gen/nanf.c | 13 +++++++++++++
lib/libc/arch/i386/gen/Makefile.inc | 4 ++--
lib/libc/arch/i386/gen/nanf.c | 13 +++++++++++++
lib/libc/arch/m68k/gen/Makefile.inc | 4 ++--
lib/libc/arch/m68k/gen/nanf.c | 13 +++++++++++++
lib/libc/arch/mips/gen/Makefile.inc | 4 ++--
lib/libc/arch/mips/gen/nanf.c | 18 ++++++++++++++++++
lib/libc/arch/ns32k/gen/Makefile.inc | 3 ++-
lib/libc/arch/ns32k/gen/nanf.c | 13 +++++++++++++
lib/libc/arch/powerpc/gen/Makefile.inc | 4 ++--
lib/libc/arch/powerpc/gen/nanf.c | 13 +++++++++++++
lib/libc/arch/sparc/gen/Makefile.inc | 4 ++--
lib/libc/arch/sparc/gen/nanf.c | 13 +++++++++++++
lib/libc/arch/sparc64/gen/Makefile.inc | 4 ++--
lib/libc/arch/sparc64/gen/nanf.c | 13 +++++++++++++
sys/arch/alpha/include/Makefile | 4 ++--
sys/arch/alpha/include/math.h | 10 ++++++++++
sys/arch/amiga/include/Makefile | 4 ++--
sys/arch/amiga/include/math.h | 3 +++
sys/arch/arm32/include/Makefile | 4 ++--
sys/arch/arm32/include/math.h | 10 ++++++++++
sys/arch/atari/include/Makefile | 4 ++--
sys/arch/atari/include/math.h | 3 +++
sys/arch/bebox/include/Makefile | 6 +++---
sys/arch/bebox/include/math.h | 3 +++
sys/arch/hp300/include/Makefile | 8 ++++----
sys/arch/hp300/include/math.h | 3 +++
sys/arch/hpcmips/include/Makefile | 6 +++---
sys/arch/hpcmips/include/math.h | 3 +++
sys/arch/i386/include/Makefile | 4 ++--
sys/arch/i386/include/math.h | 10 ++++++++++
sys/arch/m68k/include/Makefile | 4 ++--
sys/arch/m68k/include/math.h | 10 ++++++++++
sys/arch/mac68k/include/Makefile | 6 +++---
sys/arch/mac68k/include/math.h | 3 +++
sys/arch/macppc/include/Makefile | 4 ++--
sys/arch/macppc/include/math.h | 3 +++
sys/arch/mips/include/Makefile | 4 ++--
sys/arch/mips/include/math.h | 10 ++++++++++
sys/arch/mvme68k/include/Makefile | 4 ++--
sys/arch/mvme68k/include/math.h | 3 +++
sys/arch/news68k/include/Makefile | 4 ++--
sys/arch/news68k/include/math.h | 3 +++
sys/arch/newsmips/include/Makefile | 4 ++--
sys/arch/newsmips/include/math.h | 3 +++
sys/arch/next68k/include/Makefile | 8 ++++----
sys/arch/next68k/include/math.h | 3 +++
sys/arch/ofppc/include/Makefile | 8 ++++----
sys/arch/ofppc/include/math.h | 3 +++
sys/arch/pc532/include/Makefile | 8 ++++----
sys/arch/pc532/include/math.h | 10 ++++++++++
sys/arch/pica/include/Makefile | 10 +++++-----
sys/arch/pica/include/math.h | 3 +++
sys/arch/pmax/include/Makefile | 4 ++--
sys/arch/pmax/include/math.h | 3 +++
sys/arch/powerpc/include/Makefile | 4 ++--
sys/arch/powerpc/include/math.h | 10 ++++++++++
sys/arch/sparc/include/Makefile | 6 +++---
sys/arch/sparc/include/math.h | 10 ++++++++++
sys/arch/sparc64/include/Makefile | 6 +++---
sys/arch/sparc64/include/math.h | 10 ++++++++++
sys/arch/sun3/include/Makefile | 10 +++++-----
sys/arch/sun3/include/math.h | 3 +++
sys/arch/vax/include/Makefile | 12 ++++++------
sys/arch/vax/include/math.h | 2 ++
sys/arch/x68k/include/Makefile | 10 +++++-----
sys/arch/x68k/include/math.h | 3 +++
71 files changed, 360 insertions(+), 96 deletions(-)
diffs (truncated from 1050 to 300 lines):
diff -r 8625ebc02b8e -r fddb03660ff3 include/math.h
--- a/include/math.h Thu Dec 23 09:23:48 1999 +0000
+++ b/include/math.h Thu Dec 23 10:15:05 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: math.h,v 1.19 1999/08/16 18:57:57 kleink Exp $ */
+/* $NetBSD: math.h,v 1.20 1999/12/23 10:15:05 kleink Exp $ */
/*
* ====================================================
@@ -19,6 +19,7 @@
#define _MATH_H_
#include <sys/featuretest.h>
+#include <machine/math.h>
/*
* ANSI/POSIX
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/alpha/gen/Makefile.inc
--- a/lib/libc/arch/alpha/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/alpha/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile.inc,v 1.6 1999/08/29 18:08:27 mycroft Exp $
+# $NetBSD: Makefile.inc,v 1.7 1999/12/23 10:15:06 kleink Exp $
-SRCS+= fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.c modf.c
+SRCS+= fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.c modf.c nanf.c
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
fpsetround.c fpsetsticky.c
SRCS+= _setjmp.S
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/alpha/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/alpha/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:06 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:06 kleink Exp $");
+#endif /* not lint */
+
+/* nanf.c */
+
+#include <math.h>
+
+/* bytes for quiet NaN on an Alpha (IEEE single precision) */
+const char __nanf[] = { 0, 0, (char)0xc0, 0x7f };
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/arm32/gen/Makefile.inc
--- a/lib/libc/arch/arm32/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/arm32/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile.inc,v 1.7 1999/08/29 18:08:29 mycroft Exp $
+# $NetBSD: Makefile.inc,v 1.8 1999/12/23 10:15:06 kleink Exp $
SRCS+= alloca.S byte_swap_2.S byte_swap_4.S bswap64.c divsi3.S \
fabs.c flt_rounds.c fpgetround.c fpsetround.c \
fpgetmask.S fpsetmask.S fpgetsticky.S fpsetsticky.S \
- infinity.c isinf.c isnan.c frexp.c ldexp.c modf.c
+ infinity.c isinf.c isnan.c frexp.c ldexp.c modf.c nanf.c
SRCS+= setjmp.S __setjmp14.S
SRCS+= _setjmp.S
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/arm32/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/arm32/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:06 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:06 kleink Exp $");
+#endif /* not lint */
+
+/* nanf.c */
+
+#include <math.h>
+
+/* bytes for quiet NaN on an arm32 (IEEE single precision) */
+const char __nanf[] = { 0, 0, (char)0xc0, 0x7f };
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/i386/gen/Makefile.inc
--- a/lib/libc/arch/i386/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/i386/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.8 1999/08/29 18:08:30 mycroft Exp $
+# $NetBSD: Makefile.inc,v 1.9 1999/12/23 10:15:07 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 \
@@ -10,7 +10,7 @@
SRCS+= sigsetjmp.S __sigsetjmp14.S
# objects built from C sources
-SRCS+= bswap64.c frexp.c infinity.c isinf.c isnan.c ldexp.c
+SRCS+= bswap64.c frexp.c infinity.c isinf.c isnan.c ldexp.c nanf.c
# "internal" objects (don't provide part of the user-visible API)
SRCS+= divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/i386/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/i386/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:07 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:07 kleink Exp $");
+#endif /* not lint */
+
+/* nanf.c */
+
+#include <math.h>
+
+/* bytes for quiet NaN on a 387 (IEEE single precision) */
+const char __nanf[] = { 0, 0, (char)0xc0, 0x7f };
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/m68k/gen/Makefile.inc
--- a/lib/libc/arch/m68k/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/m68k/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile.inc,v 1.11 1999/08/29 19:41:53 mycroft Exp $
+# $NetBSD: Makefile.inc,v 1.12 1999/12/23 10:15:07 kleink Exp $
-SRCS+= alloca.S fabs.S frexp.c infinity.c isinf.c isnan.c modf.S
+SRCS+= alloca.S fabs.S frexp.c infinity.c isinf.c isnan.c modf.S nanf.c
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 \
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/m68k/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/m68k/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:07 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:07 kleink Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+/* nanf.c */
+
+#include <math.h>
+
+/* bytes for quiet NaN on a m68k (IEEE single precision) */
+const char __nanf[] = { 0x7f, (char)0xc0, 0, 0 };
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/mips/gen/Makefile.inc
--- a/lib/libc/arch/mips/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/mips/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile.inc,v 1.10 1999/09/29 13:19:16 takemura Exp $
+# $NetBSD: Makefile.inc,v 1.11 1999/12/23 10:15:07 kleink Exp $
.if (${MACHINE} == "hpcmips")
SRCS+= sf_fabs.c frexp.c infinity.c sf_isinf.c sf_ldexp.c sf_modf.c
SRCS+= sf_flt_rounds.c sf_fpgetmask.c sf_fpgetround.c sf_fpgetsticky.c \
sf_fpsetmask.c sf_fpsetround.c sf_fpsetsticky.c
.else
-SRCS+= fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.S modf.S
+SRCS+= fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.S modf.S nanf.c
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
fpsetround.c fpsetsticky.c
.endif
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/mips/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/mips/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,18 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:07 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:07 kleink Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+/* nanf.c */
+
+#include <math.h>
+#include <machine/endian.h>
+
+/* bytes for quiet NaN on a MIPS (IEEE single precision) */
+#if BYTE_ORDER == BIG_ENDIAN
+const char __nanf[] = { 0x7f, (char)0xc0, 0, 0 };
+#else
+const char __nanf[] = { 0, 0, (char)0xc0, 0x7f };
+#endif
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/ns32k/gen/Makefile.inc
--- a/lib/libc/arch/ns32k/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/ns32k/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.12 1999/08/29 19:08:44 mycroft Exp $
+# $NetBSD: Makefile.inc,v 1.13 1999/12/23 10:15:07 kleink Exp $
# objects built from assembler sources (need lint stubs)
ASSRCS+=alloca.S fabs.S modf.S
@@ -13,4 +13,5 @@
# objects built from C sources
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
fpsetround.c fpsetsticky.c infinity.c frexp.c isinf.c isnan.c ldexp.c \
+ nanf.c \
bswap64.c
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/ns32k/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/ns32k/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:07 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:07 kleink Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+/* nanf.c */
+
+#include <math.h>
+
+/* bytes for quiet NaN on a ns32k (IEEE single precision) */
+const char __nanf[] = { 0, 0, (char)0xc0, 0x7f };
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/powerpc/gen/Makefile.inc
--- a/lib/libc/arch/powerpc/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/powerpc/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.6 1999/07/07 01:55:07 danw Exp $
+# $NetBSD: Makefile.inc,v 1.7 1999/12/23 10:15:08 kleink Exp $
SRCS+= _setjmp.S setjmp.S sigsetjmp.S __setjmp14.S __sigsetjmp14.S
-SRCS+= isinf.c isnan.c ldexp.c fabs.S flt_rounds.c infinity.c
+SRCS+= isinf.c isnan.c ldexp.c fabs.S flt_rounds.c infinity.c nanf.c
SRCS+= bswap16.c bswap32.c bswap64.c
SRCS+= frexp.c modf.c
SRCS+= syncicache.c
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/powerpc/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/powerpc/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:09 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:09 kleink Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+/* nanf.c */
+
+#include <math.h>
+
+/* bytes for quiet NaN on a PowerPC (IEEE single precision) */
+const char __nanf[] = { 0x7f, (char)0xc0, 0, 0 };
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/sparc/gen/Makefile.inc
--- a/lib/libc/arch/sparc/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/sparc/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile.inc,v 1.5 1999/01/15 13:31:20 bouyer Exp $
+# $NetBSD: Makefile.inc,v 1.6 1999/12/23 10:15:09 kleink Exp $
-SRCS+= fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.c modf.S
+SRCS+= fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.c modf.S nanf.c
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
fpsetround.c fpsetsticky.c
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/sparc/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sparc/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:09 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:09 kleink Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+/* nanf.c */
+
+#include <math.h>
+
+/* bytes for quiet NaN on a SPARC (IEEE single precision) */
+const char __nanf[] = { 0x7f, (char)0xc0, 0, 0 };
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/sparc64/gen/Makefile.inc
--- a/lib/libc/arch/sparc64/gen/Makefile.inc Thu Dec 23 09:23:48 1999 +0000
+++ b/lib/libc/arch/sparc64/gen/Makefile.inc Thu Dec 23 10:15:05 1999 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile.inc,v 1.3 1999/01/15 13:31:20 bouyer Exp $
+# $NetBSD: Makefile.inc,v 1.4 1999/12/23 10:15:09 kleink Exp $
-SRCS+= fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.c modf.S
+SRCS+= fabs.S frexp.c infinity.c isinf.c isnan.c ldexp.c modf.S nanf.c
SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
fpsetround.c fpsetsticky.c
diff -r 8625ebc02b8e -r fddb03660ff3 lib/libc/arch/sparc64/gen/nanf.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sparc64/gen/nanf.c Thu Dec 23 10:15:05 1999 +0000
@@ -0,0 +1,13 @@
+/* $NetBSD: nanf.c,v 1.1 1999/12/23 10:15:09 kleink Exp $ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: nanf.c,v 1.1 1999/12/23 10:15:09 kleink Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+/* nanf.c */
+
+#include <math.h>
+
+/* bytes for quiet NaN on a SPARC (IEEE single precision) */
Home |
Main Index |
Thread Index |
Old Index