Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc C99 7.12.3.2: add library portions of isfinite, but...
details: https://anonhg.NetBSD.org/src/rev/a28fa66100f9
branches: trunk
changeset: 554548:a28fa66100f9
user: kleink <kleink%NetBSD.org@localhost>
date: Wed Oct 29 20:03:51 2003 +0000
description:
C99 7.12.3.2: add library portions of isfinite, but don't build these just
yet.
diffstat:
lib/libc/arch/hppa/gen/isfinitel.c | 62 ++++++++++++++++++++++++++++++++
lib/libc/arch/i386/gen/isfinitel.c | 65 ++++++++++++++++++++++++++++++++++
lib/libc/arch/m68k/gen/isfinitel.c | 65 ++++++++++++++++++++++++++++++++++
lib/libc/arch/sparc64/gen/isfinitel.c | 62 ++++++++++++++++++++++++++++++++
lib/libc/arch/vax/gen/isfinited.c | 66 +++++++++++++++++++++++++++++++++++
lib/libc/arch/vax/gen/isfinitef.c | 65 ++++++++++++++++++++++++++++++++++
lib/libc/arch/x86_64/gen/isfinitel.c | 65 ++++++++++++++++++++++++++++++++++
lib/libc/gen/isfinited_ieee754.c | 62 ++++++++++++++++++++++++++++++++
lib/libc/gen/isfinitef_ieee754.c | 62 ++++++++++++++++++++++++++++++++
9 files changed, 574 insertions(+), 0 deletions(-)
diffs (truncated from 610 to 300 lines):
diff -r 3787fca20214 -r a28fa66100f9 lib/libc/arch/hppa/gen/isfinitel.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/hppa/gen/isfinitel.c Wed Oct 29 20:03:51 2003 +0000
@@ -0,0 +1,62 @@
+/* $NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $ */
+
+/*-
+ * Copyright (c) 2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * 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 NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $");
+#endif
+
+#include <machine/ieee.h>
+#include <math.h>
+
+/*
+ * 7.12.3.2 isfinite - determine whether an argument has finite value
+ * IEEE 754 compatible 128-bit extended-precision version
+ */
+int
+__isfinitel(long double x)
+{
+ union ieee_ext_u u;
+
+ u.extu_ld = x;
+
+ if (u.extu_ext.ext_exp == EXT_EXP_INFNAN)
+ return 0;
+
+ return 1;
+}
diff -r 3787fca20214 -r a28fa66100f9 lib/libc/arch/i386/gen/isfinitel.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/i386/gen/isfinitel.c Wed Oct 29 20:03:51 2003 +0000
@@ -0,0 +1,65 @@
+/* $NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $ */
+
+/*-
+ * Copyright (c) 2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * 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 NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $");
+#endif
+
+#include <machine/ieee.h>
+#include <assert.h>
+#include <math.h>
+
+/*
+ * 7.12.3.2 isfinite - determine whether an argument has finite value
+ * IEEE 754 compatible 80-bit extended-precision Intel 386 version
+ */
+int
+__isfinitel(long double x)
+{
+ union ieee_ext_u u;
+
+ u.extu_ld = x;
+
+ _DIAGASSERT(u.extu_ext.ext_exp == 0 || u.extu_ext.ext_int == 1);
+
+ if (u.extu_ext.ext_exp == EXT_EXP_INFNAN)
+ return 0;
+
+ return 1;
+}
diff -r 3787fca20214 -r a28fa66100f9 lib/libc/arch/m68k/gen/isfinitel.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/m68k/gen/isfinitel.c Wed Oct 29 20:03:51 2003 +0000
@@ -0,0 +1,65 @@
+/* $NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $ */
+
+/*-
+ * Copyright (c) 2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * 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 NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $");
+#endif
+
+#include <machine/ieee.h>
+#include <assert.h>
+#include <math.h>
+
+/*
+ * 7.12.3.2 isfinite - determine whether an argument has finite value
+ * IEEE 754 compatible 80-bit extended-precision Motorola 68k version
+ */
+int
+__isfinitel(long double x)
+{
+ union ieee_ext_u u;
+
+ u.extu_ld = x;
+
+ _DIAGASSERT(u.extu_ext.ext_zero == 0);
+
+ if (u.extu_ext.ext_exp == EXT_EXP_INFNAN)
+ return 0;
+
+ return 1;
+}
diff -r 3787fca20214 -r a28fa66100f9 lib/libc/arch/sparc64/gen/isfinitel.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/sparc64/gen/isfinitel.c Wed Oct 29 20:03:51 2003 +0000
@@ -0,0 +1,62 @@
+/* $NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $ */
+
+/*-
+ * Copyright (c) 2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * 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 NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: isfinitel.c,v 1.1 2003/10/29 20:03:51 kleink Exp $");
+#endif
+
+#include <machine/ieee.h>
+#include <math.h>
+
+/*
+ * 7.12.3.2 isfinite - determine whether an argument has finite value
+ * IEEE 754 compatible 128-bit extended-precision version
+ */
+int
+__isfinitel(long double x)
+{
+ union ieee_ext_u u;
+
+ u.extu_ld = x;
+
+ if (u.extu_ext.ext_exp == EXT_EXP_INFNAN)
+ return 0;
+
+ return 1;
+}
diff -r 3787fca20214 -r a28fa66100f9 lib/libc/arch/vax/gen/isfinited.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/vax/gen/isfinited.c Wed Oct 29 20:03:51 2003 +0000
@@ -0,0 +1,66 @@
+/* $NetBSD: isfinited.c,v 1.1 2003/10/29 20:03:51 kleink Exp $ */
+
+/*-
+ * Copyright (c) 2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * 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 NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
Home |
Main Index |
Thread Index |
Old Index