summaryrefslogtreecommitdiff
path: root/lib/libc/arch/m68k
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2008-12-09 19:52:35 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2008-12-09 19:52:35 +0000
commit9e5337fc957e6c7535daf2a109184402a542f1ec (patch)
tree84cad8df1ca61a3ef08f4c6720f1d9f771a6fd1d /lib/libc/arch/m68k
parenteeeafb12487449aefa05ef31aa83d0b6e24b8a8f (diff)
- add long double signbit
- make long double versions weak aliases to double versions, on archs where long doubles are 64 bits - no need to have two finites. finite() and finitef() are non-standard 3BSD obsolete versions of isfinite. remove from libm. make them weak_alias in libc to __isfinite and __isfinitef instead. similarly make 3BSD obsolete versions of isinf, isinff, isnan, isnanf weak_aliases to C99's __isinf, __isinff, __isnan, __isnanf - bump major ok millert@
Diffstat (limited to 'lib/libc/arch/m68k')
-rw-r--r--lib/libc/arch/m68k/gen/Makefile.inc4
-rw-r--r--lib/libc/arch/m68k/gen/isfinitel.c3
-rw-r--r--lib/libc/arch/m68k/gen/isinfl.c3
-rw-r--r--lib/libc/arch/m68k/gen/isnanl.c3
-rw-r--r--lib/libc/arch/m68k/gen/isnormall.c3
-rw-r--r--lib/libc/arch/m68k/gen/signbitl.c28
6 files changed, 38 insertions, 6 deletions
diff --git a/lib/libc/arch/m68k/gen/Makefile.inc b/lib/libc/arch/m68k/gen/Makefile.inc
index ae4b21ae368..53ebb5d3df3 100644
--- a/lib/libc/arch/m68k/gen/Makefile.inc
+++ b/lib/libc/arch/m68k/gen/Makefile.inc
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile.inc,v 1.7 2008/09/07 20:36:07 martynas Exp $
+# $OpenBSD: Makefile.inc,v 1.8 2008/12/09 19:52:33 martynas Exp $
SRCS+= _setjmp.S fabs.S infinity.c ldexp.S \
modf.S nan.c setjmp.S sigsetjmp.S
SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \
fpsetround.S fpsetsticky.S
-SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c
+SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c
SRCS+= adddf3.S addsf3.S ashlsi3.S ashrsi3.S cmpdf2.S cmpsf2.S divdf3.S \
divsf3.S divsi3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S \
floatsidf.S lshlsi3.S lshrsi3.S modsi3.S muldf3.S mulsf3.S mulsi3.S \
diff --git a/lib/libc/arch/m68k/gen/isfinitel.c b/lib/libc/arch/m68k/gen/isfinitel.c
index c86b9309da4..02a5602ea84 100644
--- a/lib/libc/arch/m68k/gen/isfinitel.c
+++ b/lib/libc/arch/m68k/gen/isfinitel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isfinitel.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
@@ -17,6 +17,7 @@
#include <sys/types.h>
#include <machine/ieee.h>
+#include <math.h>
int
__isfinitel(long double e)
diff --git a/lib/libc/arch/m68k/gen/isinfl.c b/lib/libc/arch/m68k/gen/isinfl.c
index 862c82f97e7..eab84e50759 100644
--- a/lib/libc/arch/m68k/gen/isinfl.c
+++ b/lib/libc/arch/m68k/gen/isinfl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isinfl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
@@ -17,6 +17,7 @@
#include <sys/types.h>
#include <machine/ieee.h>
+#include <math.h>
int
__isinfl(long double e)
diff --git a/lib/libc/arch/m68k/gen/isnanl.c b/lib/libc/arch/m68k/gen/isnanl.c
index 4db08d62be6..0fbecf2efcc 100644
--- a/lib/libc/arch/m68k/gen/isnanl.c
+++ b/lib/libc/arch/m68k/gen/isnanl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isnanl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
@@ -17,6 +17,7 @@
#include <sys/types.h>
#include <machine/ieee.h>
+#include <math.h>
int
__isnanl(long double e)
diff --git a/lib/libc/arch/m68k/gen/isnormall.c b/lib/libc/arch/m68k/gen/isnormall.c
index a8b4314afc9..97ce382671b 100644
--- a/lib/libc/arch/m68k/gen/isnormall.c
+++ b/lib/libc/arch/m68k/gen/isnormall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isnormall.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
@@ -17,6 +17,7 @@
#include <sys/types.h>
#include <machine/ieee.h>
+#include <math.h>
int
__isnormall(long double e)
diff --git a/lib/libc/arch/m68k/gen/signbitl.c b/lib/libc/arch/m68k/gen/signbitl.c
new file mode 100644
index 00000000000..1f9f7ab332d
--- /dev/null
+++ b/lib/libc/arch/m68k/gen/signbitl.c
@@ -0,0 +1,28 @@
+/* $OpenBSD: signbitl.c,v 1.1 2008/12/09 19:52:33 martynas Exp $ */
+/*
+ * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+#include <machine/ieee.h>
+#include <math.h>
+
+int
+__signbitl(long double e)
+{
+ struct ieee_ext *p = (struct ieee_ext *)&e;
+
+ return p->ext_sign;
+}