Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add NAN constant glue for sh3.



details:   https://anonhg.NetBSD.org/src/rev/c3a677dd4782
branches:  trunk
changeset: 480674:c3a677dd4782
user:      kleink <kleink%NetBSD.org@localhost>
date:      Mon Jan 17 16:27:53 2000 +0000

description:
Add NAN constant glue for sh3.

diffstat:

 lib/libc/arch/sh3/gen/Makefile.inc |   4 ++--
 lib/libc/arch/sh3/gen/nanf.c       |  18 ++++++++++++++++++
 sys/arch/evbsh3/include/Makefile   |   4 ++--
 sys/arch/evbsh3/include/math.h     |   3 +++
 sys/arch/mmeye/include/Makefile    |   6 +++---
 sys/arch/mmeye/include/math.h      |   3 +++
 sys/arch/sh3/include/Makefile      |   4 ++--
 sys/arch/sh3/include/math.h        |  10 ++++++++++
 8 files changed, 43 insertions(+), 9 deletions(-)

diffs (122 lines):

diff -r df964cdc28e7 -r c3a677dd4782 lib/libc/arch/sh3/gen/Makefile.inc
--- a/lib/libc/arch/sh3/gen/Makefile.inc        Mon Jan 17 16:21:36 2000 +0000
+++ b/lib/libc/arch/sh3/gen/Makefile.inc        Mon Jan 17 16:27:53 2000 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: Makefile.inc,v 1.1 2000/01/05 14:07:30 msaitoh Exp $
+#      $NetBSD: Makefile.inc,v 1.2 2000/01/17 16:27:53 kleink Exp $
 
 SRCS+= _setjmp.S setjmp.S sigsetjmp.S __setjmp14.S __sigsetjmp14.S
 
 SRCS+= fabs.c flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c \
        fpsetmask.c fpsetround.c fpsetsticky.c frexp.c infinity.c \
-       isinf.c isnan.c ldexp.c modf.c \
+       isinf.c isnan.c ldexp.c modf.c nanf.c \
        bswap16.c bswap32.c bswap64.c
 
 SRCS+= ashiftrt.S ashlsi3.S ashrsi3.S lshrsi3.S movstr.S mulsi3.S \
diff -r df964cdc28e7 -r c3a677dd4782 lib/libc/arch/sh3/gen/nanf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sh3/gen/nanf.c      Mon Jan 17 16:27:53 2000 +0000
@@ -0,0 +1,18 @@
+/*     $NetBSD: nanf.c,v 1.1 2000/01/17 16:27:53 kleink Exp $  */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: nanf.c,v 1.1 2000/01/17 16:27:53 kleink Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+/* nanf.c */
+
+#include <math.h>
+#include <machine/endian.h>
+
+/* bytes for quiet NaN on a SH3 (IEEE single precision) */
+#if BYTE_ORDER == LITTLE_ENDIAN
+const char __nanf[] = { 0, 0, (char)0xc0, 0x7f };
+#else
+const char __nanf[] = { 0x7f, (char)0xc0, 0, 0 };
+#endif
diff -r df964cdc28e7 -r c3a677dd4782 sys/arch/evbsh3/include/Makefile
--- a/sys/arch/evbsh3/include/Makefile  Mon Jan 17 16:21:36 2000 +0000
+++ b/sys/arch/evbsh3/include/Makefile  Mon Jan 17 16:27:53 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 2000/01/07 09:40:33 msaitoh Exp $
+#      $NetBSD: Makefile,v 1.3 2000/01/17 16:27:53 kleink Exp $
 
 KDIR=  /sys/arch/evbsh3/include
 INCSDIR= /usr/include/evbsh3
@@ -6,7 +6,7 @@
 INCS=  ansi.h aout_machdep.h asm.h bootinfo.h bswap.h bus.h cdefs.h \
        coff_machdep.h conf.h cpu.h cpufunc.h cputypes.h db_machdep.h \
        disklabel.h elf_machdep.h endian.h float.h frame.h \
-       ieee.h ieeefp.h intr.h limits.h mmeye.h param.h pcb.h \
+       ieee.h ieeefp.h intr.h limits.h math.h mmeye.h param.h pcb.h \
        pio.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h segments.h \
        setjmp.h sh3.h shbvar.h signal.h stdarg.h \
        trap.h types.h varargs.h vmparam.h
diff -r df964cdc28e7 -r c3a677dd4782 sys/arch/evbsh3/include/math.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbsh3/include/math.h    Mon Jan 17 16:27:53 2000 +0000
@@ -0,0 +1,3 @@
+/*     $NetBSD: math.h,v 1.1 2000/01/17 16:27:53 kleink Exp $  */
+
+#include <sh3/math.h>
diff -r df964cdc28e7 -r c3a677dd4782 sys/arch/mmeye/include/Makefile
--- a/sys/arch/mmeye/include/Makefile   Mon Jan 17 16:21:36 2000 +0000
+++ b/sys/arch/mmeye/include/Makefile   Mon Jan 17 16:27:53 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 2000/01/07 09:40:34 msaitoh Exp $
+#      $NetBSD: Makefile,v 1.3 2000/01/17 16:27:53 kleink Exp $
 
 KDIR=  /sys/arch/mmeye/include
 INCSDIR= /usr/include/mmeye
@@ -6,8 +6,8 @@
 INCS=  ansi.h aout_machdep.h asm.h bootinfo.h bswap.h bus.h cdefs.h \
        coff_machdep.h conf.h cpu.h cpufunc.h cputypes.h db_machdep.h \
        disklabel.h elf_machdep.h endian.h float.h frame.h \
-       ieee.h ieeefp.h intr.h limits.h loadfile_machdep.h mmeye.h param.h \
-       pcb.h pio.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
+       ieee.h ieeefp.h intr.h limits.h loadfile_machdep.h math.h mmeye.h \
+       param.h pcb.h pio.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
        segments.h setjmp.h sh3.h shbvar.h signal.h stdarg.h \
        trap.h types.h varargs.h vmparam.h
 
diff -r df964cdc28e7 -r c3a677dd4782 sys/arch/mmeye/include/math.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mmeye/include/math.h     Mon Jan 17 16:27:53 2000 +0000
@@ -0,0 +1,3 @@
+/*     $NetBSD: math.h,v 1.1 2000/01/17 16:27:53 kleink Exp $  */
+
+#include <sh3/math.h>
diff -r df964cdc28e7 -r c3a677dd4782 sys/arch/sh3/include/Makefile
--- a/sys/arch/sh3/include/Makefile     Mon Jan 17 16:21:36 2000 +0000
+++ b/sys/arch/sh3/include/Makefile     Mon Jan 17 16:27:53 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.3 2000/01/14 13:58:06 msaitoh Exp $
+#      $NetBSD: Makefile,v 1.4 2000/01/17 16:27:53 kleink Exp $
 
 KDIR=  /sys/arch/sh3/include
 INCSDIR= /usr/include/sh3
@@ -6,7 +6,7 @@
 INCS=  ansi.h aout_machdep.h asm.h bootinfo.h bscreg.h bswap.h bus.h \
        ccrreg.h cdefs.h coff_machdep.h cpgreg.h cpu.h cpufunc.h cputypes.h \
        db_disasm.h db_machdep.h disklabel.h elf_machdep.h endian.h \
-       float.h frame.h ieee.h ieeefp.h intcreg.h intr.h limits.h \
+       float.h frame.h ieee.h ieeefp.h intcreg.h intr.h limits.h math.h \
        mmureg.h param.h pcb.h pfcreg.h pio.h pmap.h proc.h profile.h psl.h \
        pte.h ptrace.h reg.h rtcreg.h scifreg.h scireg.h segments.h setjmp.h \
        sh_opcode.h shbvar.h signal.h stdarg.h tmureg.h \
diff -r df964cdc28e7 -r c3a677dd4782 sys/arch/sh3/include/math.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sh3/include/math.h       Mon Jan 17 16:27:53 2000 +0000
@@ -0,0 +1,10 @@
+/*     $NetBSD: math.h,v 1.1 2000/01/17 16:27:53 kleink Exp $  */
+
+/*
+ * ISO C99
+ */
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+    !defined(_XOPEN_SOURCE) || defined(_ISOC99_SOURCE)
+extern __const char    __nanf[];
+#define        NAN             (*(__const float *)(__const void *)__nanf)
+#endif



Home | Main Index | Thread Index | Old Index