Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libm/arch/alpha Fix usage of sysarch(ALPHA_FPGETMASK)
details: https://anonhg.NetBSD.org/src/rev/81ce5c90dc01
branches: trunk
changeset: 358454:81ce5c90dc01
user: martin <martin%NetBSD.org@localhost>
date: Sat Dec 30 17:59:24 2017 +0000
description:
Fix usage of sysarch(ALPHA_FPGETMASK)
diffstat:
lib/libm/arch/alpha/fenv.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diffs (64 lines):
diff -r e42e4cb40095 -r 81ce5c90dc01 lib/libm/arch/alpha/fenv.c
--- a/lib/libm/arch/alpha/fenv.c Sat Dec 30 17:06:27 2017 +0000
+++ b/lib/libm/arch/alpha/fenv.c Sat Dec 30 17:59:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fenv.c,v 1.2 2017/03/22 23:11:08 chs Exp $ */
+/* $NetBSD: fenv.c,v 1.3 2017/12/30 17:59:24 martin Exp $ */
/*-
* Copyright (c) 2004-2005 David Schultz <das%FreeBSD.ORG@localhost>
@@ -28,7 +28,7 @@
* $FreeBSD: src/lib/msun/alpha/fenv.c,v 1.2 2005/03/16 19:03:44 das Exp $
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: fenv.c,v 1.2 2017/03/22 23:11:08 chs Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.3 2017/12/30 17:59:24 martin Exp $");
#include "namespace.h"
@@ -63,7 +63,7 @@
* only need to issue an excb after the mf_fpcr to ensure that
* the read is executed before any subsequent FP ops.
*/
- sysarch(ALPHA_FPGETMASK, (char *)&p);
+ p.mask = sysarch(ALPHA_FPGETMASK, 0);
__mf_fpcr(&r.__d);
*envp = r.__bits | p.mask;
__excb();
@@ -76,7 +76,7 @@
struct alpha_fp_except_args p;
union __fpcr r;
- sysarch(ALPHA_FPGETMASK, (char *)&p);
+ p.mask = sysarch(ALPHA_FPGETMASK, 0);
__mf_fpcr(&r.__d);
*envp = r.__bits | p.mask;
r.__bits &= ~((fenv_t)FE_ALL_EXCEPT << _FPUSW_SHIFT);
@@ -124,7 +124,7 @@
{
struct alpha_fp_except_args p;
- sysarch(ALPHA_FPGETMASK, &p);
+ p.mask = sysarch(ALPHA_FPGETMASK, 0);
p.mask |= (mask & FE_ALL_EXCEPT);
sysarch(ALPHA_FPSETMASK, &p);
return p.mask;
@@ -135,7 +135,7 @@
{
struct alpha_fp_except_args p;
- sysarch(ALPHA_FPGETMASK, &p);
+ p.mask = sysarch(ALPHA_FPGETMASK, 0);
p.mask &= ~(mask & FE_ALL_EXCEPT);
sysarch(ALPHA_FPSETMASK, &p);
return p.mask;
@@ -144,8 +144,6 @@
int
fegetexcept(void)
{
- struct alpha_fp_except_args p;
- sysarch(ALPHA_FPGETMASK, &p);
- return p.mask;
+ return sysarch(ALPHA_FPGETMASK, 0);
}
Home |
Main Index |
Thread Index |
Old Index