Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gen Make ext_fraclm and ext_frachm parts of the lon...
details: https://anonhg.NetBSD.org/src/rev/d39625f1528e
branches: trunk
changeset: 791500:d39625f1528e
user: martin <martin%NetBSD.org@localhost>
date: Thu Nov 21 14:14:13 2013 +0000
description:
Make ext_fraclm and ext_frachm parts of the long double mantissa optional
in generic code
diffstat:
lib/libc/gen/fpclassifyl_ieee754.c | 24 ++++++++++++++++++------
lib/libc/gen/isinfl_ieee754.c | 14 ++++++++++----
lib/libc/gen/isnanl_ieee754.c | 14 ++++++++++----
3 files changed, 38 insertions(+), 14 deletions(-)
diffs (117 lines):
diff -r b29863e4e8ad -r d39625f1528e lib/libc/gen/fpclassifyl_ieee754.c
--- a/lib/libc/gen/fpclassifyl_ieee754.c Thu Nov 21 14:03:02 2013 +0000
+++ b/lib/libc/gen/fpclassifyl_ieee754.c Thu Nov 21 14:14:13 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fpclassifyl_ieee754.c,v 1.1 2011/01/17 23:53:03 matt Exp $ */
+/* $NetBSD: fpclassifyl_ieee754.c,v 1.2 2013/11/21 14:14:13 martin Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpclassifyl_ieee754.c,v 1.1 2011/01/17 23:53:03 matt Exp $");
+__RCSID("$NetBSD: fpclassifyl_ieee754.c,v 1.2 2013/11/21 14:14:13 martin Exp $");
#endif
#include <machine/ieee.h>
@@ -50,14 +50,26 @@
u.extu_ld = x;
if (u.extu_ext.ext_exp == 0) {
- if (u.extu_ext.ext_frach == 0 && u.extu_ext.ext_frachm == 0
- && u.extu_ext.ext_fraclm == 0 && u.extu_ext.ext_fracl == 0)
+ if (u.extu_ext.ext_frach == 0
+#if EXT_FRACHMBITS
+ && u.extu_ext.ext_frachm == 0
+#endif
+#if EXT_FRACLMBITS
+ && u.extu_ext.ext_fraclm == 0
+#endif
+ && u.extu_ext.ext_fracl == 0)
return FP_ZERO;
else
return FP_SUBNORMAL;
} else if (u.extu_ext.ext_exp == EXT_EXP_INFNAN) {
- if (u.extu_ext.ext_frach == 0 && u.extu_ext.ext_frachm == 0
- && u.extu_ext.ext_fraclm == 0 && u.extu_ext.ext_fracl == 0)
+ if (u.extu_ext.ext_frach == 0
+#f EXT_FRACHMBITS
+ && u.extu_ext.ext_frachm == 0
+#endif
+#if EXT_FRACLMBITS
+ && u.extu_ext.ext_fraclm == 0
+#endif
+ && u.extu_ext.ext_fracl == 0)
return FP_INFINITE;
else
return FP_NAN;
diff -r b29863e4e8ad -r d39625f1528e lib/libc/gen/isinfl_ieee754.c
--- a/lib/libc/gen/isinfl_ieee754.c Thu Nov 21 14:03:02 2013 +0000
+++ b/lib/libc/gen/isinfl_ieee754.c Thu Nov 21 14:14:13 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isinfl_ieee754.c,v 1.4 2011/01/17 23:53:03 matt Exp $ */
+/* $NetBSD: isinfl_ieee754.c,v 1.5 2013/11/21 14:14:13 martin 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: isinfl_ieee754.c,v 1.4 2011/01/17 23:53:03 matt Exp $");
+__RCSID("$NetBSD: isinfl_ieee754.c,v 1.5 2013/11/21 14:14:13 martin Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -60,7 +60,13 @@
u.extu_ld = x;
return u.extu_ext.ext_exp == EXT_EXP_INFNAN
- && u.extu_ext.ext_frach == 0 && u.extu_ext.ext_frachm == 0
- && u.extu_ext.ext_fraclm == 0 && u.extu_ext.ext_fracl == 0;
+ && u.extu_ext.ext_frach == 0
+#if EXT_FRACHMBITS
+ && u.extu_ext.ext_frachm == 0
+#endif
+#if EXT_FRACLMBITS
+ && u.extu_ext.ext_fraclm == 0
+#endif
+ && u.extu_ext.ext_fracl == 0;
}
#endif /* __HAVE_LONG_DOUBLE */
diff -r b29863e4e8ad -r d39625f1528e lib/libc/gen/isnanl_ieee754.c
--- a/lib/libc/gen/isnanl_ieee754.c Thu Nov 21 14:03:02 2013 +0000
+++ b/lib/libc/gen/isnanl_ieee754.c Thu Nov 21 14:14:13 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isnanl_ieee754.c,v 1.6 2011/01/17 23:53:03 matt Exp $ */
+/* $NetBSD: isnanl_ieee754.c,v 1.7 2013/11/21 14:14:13 martin 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.6 2011/01/17 23:53:03 matt Exp $");
+__RCSID("$NetBSD: isnanl_ieee754.c,v 1.7 2013/11/21 14:14:13 martin Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -60,7 +60,13 @@
u.extu_ld = x;
return u.extu_ext.ext_exp == EXT_EXP_INFNAN
- && (u.extu_ext.ext_frach != 0 || u.extu_ext.ext_frachm != 0
- || u.extu_ext.ext_fraclm != 0 || u.extu_ext.ext_fracl != 0);
+ && (u.extu_ext.ext_frach != 0
+#if EXT_FRACHMBITS
+ || u.extu_ext.ext_frachm != 0
+#endif
+#if EXT_FRACLMBITS
+ || u.extu_ext.ext_fraclm != 0
+#endif
+ || u.extu_ext.ext_fracl != 0);
}
#endif /* __HAVE_LONG_DOUBLE */
Home |
Main Index |
Thread Index |
Old Index