diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-03-01 00:19:10 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-03-01 00:19:10 +0000 |
commit | 8bdc5996ee66394d9cb5a88d0780c0eea08d5bdb (patch) | |
tree | b22c6058560c4ed5d3fce844a5ca33b8b45372ee /lib/libc/arch | |
parent | 8c0480dc0285a91e5a5d6a66a22fd761f28ec005 (diff) |
Provide real ieee fp*() functions; from NetBSD.
ok millert@
Diffstat (limited to 'lib/libc/arch')
-rw-r--r-- | lib/libc/arch/alpha/gen/divrem.m4 | 4 | ||||
-rw-r--r-- | lib/libc/arch/alpha/gen/fpgetmask.c | 18 | ||||
-rw-r--r-- | lib/libc/arch/alpha/gen/fpgetsticky.c | 48 | ||||
-rw-r--r-- | lib/libc/arch/alpha/gen/fpsetmask.c | 17 | ||||
-rw-r--r-- | lib/libc/arch/alpha/gen/fpsetsticky.c | 17 |
5 files changed, 56 insertions, 48 deletions
diff --git a/lib/libc/arch/alpha/gen/divrem.m4 b/lib/libc/arch/alpha/gen/divrem.m4 index b8b49a2bffe..94ec9201379 100644 --- a/lib/libc/arch/alpha/gen/divrem.m4 +++ b/lib/libc/arch/alpha/gen/divrem.m4 @@ -1,4 +1,4 @@ -/* $OpenBSD: divrem.m4,v 1.3 1996/11/13 21:20:09 niklas Exp $ */ +/* $OpenBSD: divrem.m4,v 1.4 2003/03/01 00:19:08 miod Exp $ */ /* $NetBSD: divrem.m4,v 1.7 1996/10/17 03:08:04 cgd Exp $ */ /* @@ -172,7 +172,7 @@ ifelse(OP, `div', ifelse(S, `true', ` /* Check to see if we should negate it. */ - subqv zero, RESULT, T_0 + subq zero, RESULT, T_0 cmovlbs NEG, T_0, RESULT ') diff --git a/lib/libc/arch/alpha/gen/fpgetmask.c b/lib/libc/arch/alpha/gen/fpgetmask.c index 10d763f6ade..1cb07fca0c2 100644 --- a/lib/libc/arch/alpha/gen/fpgetmask.c +++ b/lib/libc/arch/alpha/gen/fpgetmask.c @@ -1,8 +1,8 @@ -/* $OpenBSD: fpgetmask.c,v 1.3 1996/11/13 21:20:12 niklas Exp $ */ -/* $NetBSD: fpgetmask.c,v 1.1 1995/04/29 05:10:55 cgd Exp $ */ +/* $OpenBSD: fpgetmask.c,v 1.4 2003/03/01 00:19:08 miod Exp $ */ +/* $NetBSD: fpgetmask.c,v 1.4 2002/01/13 21:45:39 thorpej Exp $ */ /* - * Copyright (c) 1995 Christopher G. Demetriou + * Copyright (c) 1999 Ross Harvey * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -15,7 +15,7 @@ * 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 Christopher G. Demetriou + * This product includes software developed by Ross Harvey * for the NetBSD Project. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission @@ -33,15 +33,15 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: fpgetmask.c,v 1.3 1996/11/13 21:20:12 niklas Exp $"; +static char *rcsid = "$OpenBSD: fpgetmask.c,v 1.4 2003/03/01 00:19:08 miod Exp $"; #endif /* LIBC_SCCS and not lint */ +#include <sys/types.h> #include <ieeefp.h> +#include <machine/sysarch.h> fp_except -fpgetmask() +fpgetmask(void) { - - /* XXX */ - abort(); + return sysarch(ALPHA_FPGETMASK, 0L); } diff --git a/lib/libc/arch/alpha/gen/fpgetsticky.c b/lib/libc/arch/alpha/gen/fpgetsticky.c index f51f31efb27..eaf0f8ff9ea 100644 --- a/lib/libc/arch/alpha/gen/fpgetsticky.c +++ b/lib/libc/arch/alpha/gen/fpgetsticky.c @@ -1,8 +1,8 @@ -/* $OpenBSD: fpgetsticky.c,v 1.3 1996/11/13 21:20:14 niklas Exp $ */ -/* $NetBSD: fpgetsticky.c,v 1.1 1995/04/29 05:10:59 cgd Exp $ */ +/* $OpenBSD: fpgetsticky.c,v 1.4 2003/03/01 00:19:08 miod Exp $ */ +/* $NetBSD: fpgetsticky.c,v 1.6 2002/01/13 21:45:39 thorpej Exp $ */ -/* - * Copyright (c) 1995 Christopher G. Demetriou +/*- + * Copyright (c) 2001 Ross Harvey * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -15,33 +15,35 @@ * 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 Christopher G. Demetriou - * for the NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission + * 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 AUTHOR ``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 AUTHOR 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. + * 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. */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: fpgetsticky.c,v 1.3 1996/11/13 21:20:14 niklas Exp $"; +static char *rcsid = "$OpenBSD: fpgetsticky.c,v 1.4 2003/03/01 00:19:08 miod Exp $"; #endif /* LIBC_SCCS and not lint */ +#include <sys/types.h> #include <ieeefp.h> +#include <machine/sysarch.h> fp_except -fpgetsticky() +fpgetsticky(void) { - - /* XXX */ - abort(); + return sysarch(ALPHA_FPGETSTICKY, 0L); } diff --git a/lib/libc/arch/alpha/gen/fpsetmask.c b/lib/libc/arch/alpha/gen/fpsetmask.c index c1497e51ead..e0548955192 100644 --- a/lib/libc/arch/alpha/gen/fpsetmask.c +++ b/lib/libc/arch/alpha/gen/fpsetmask.c @@ -1,8 +1,8 @@ -/* $OpenBSD: fpsetmask.c,v 1.3 1996/11/13 21:20:15 niklas Exp $ */ -/* $NetBSD: fpsetmask.c,v 1.1 1995/04/29 05:11:01 cgd Exp $ */ +/* $OpenBSD: fpsetmask.c,v 1.4 2003/03/01 00:19:08 miod Exp $ */ +/* $NetBSD: fpsetmask.c,v 1.3 2002/01/13 21:45:40 thorpej Exp $ */ /* - * Copyright (c) 1995 Christopher G. Demetriou + * Copyright (c) 1995 Ross Harvey * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -15,7 +15,7 @@ * 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 Christopher G. Demetriou + * This product includes software developed by Ross Harvey * for the NetBSD Project. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission @@ -33,16 +33,19 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: fpsetmask.c,v 1.3 1996/11/13 21:20:15 niklas Exp $"; +static char *rcsid = "$OpenBSD: fpsetmask.c,v 1.4 2003/03/01 00:19:08 miod Exp $"; #endif /* LIBC_SCCS and not lint */ +#include <sys/types.h> #include <ieeefp.h> +#include <machine/sysarch.h> fp_except fpsetmask(mask) fp_except mask; { + struct alpha_fp_except_args a; - /* XXX */ - abort(); + a.mask = mask; + return sysarch(ALPHA_FPSETMASK, &a); } diff --git a/lib/libc/arch/alpha/gen/fpsetsticky.c b/lib/libc/arch/alpha/gen/fpsetsticky.c index 97a3d2ab942..24d7fc6d422 100644 --- a/lib/libc/arch/alpha/gen/fpsetsticky.c +++ b/lib/libc/arch/alpha/gen/fpsetsticky.c @@ -1,8 +1,8 @@ -/* $OpenBSD: fpsetsticky.c,v 1.3 1996/11/13 21:20:16 niklas Exp $ */ -/* $NetBSD: fpsetsticky.c,v 1.1 1995/04/29 05:11:04 cgd Exp $ */ +/* $OpenBSD: fpsetsticky.c,v 1.4 2003/03/01 00:19:08 miod Exp $ */ +/* $NetBSD: fpsetsticky.c,v 1.3 2002/01/13 21:45:40 thorpej Exp $ */ /* - * Copyright (c) 1995 Christopher G. Demetriou + * Copyright (c) 1999 Ross Harvey * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -15,7 +15,7 @@ * 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 Christopher G. Demetriou + * This product includes software developed by Ross Harvey * for the NetBSD Project. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission @@ -33,16 +33,19 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: fpsetsticky.c,v 1.3 1996/11/13 21:20:16 niklas Exp $"; +static char *rcsid = "$OpenBSD: fpsetsticky.c,v 1.4 2003/03/01 00:19:08 miod Exp $"; #endif /* LIBC_SCCS and not lint */ +#include <sys/types.h> #include <ieeefp.h> +#include <machine/sysarch.h> fp_except fpsetsticky(sticky) fp_except sticky; { + struct alpha_fp_except_args a; - /* XXX */ - abort(); + a.mask = sticky; + return sysarch(ALPHA_FPSETSTICKY, &a); } |