Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/include fesetexceptflag(): Set FE_ALL_INVAL...



details:   https://anonhg.NetBSD.org/src/rev/4a66b20112db
branches:  trunk
changeset: 370029:4a66b20112db
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Sep 13 01:22:12 2022 +0000

description:
fesetexceptflag(): Set FE_ALL_INVALID instead of FE_ALL_EXCEPT for
FE_INVALID. Taken from FreeBSD:

https://cgit.freebsd.org/src/commit/lib/msun/powerpc/fenv.h?id=e7bd4f846f0c9185aebfd3d116bb78ab137280fa

> [POWERPC] msun: fix incorrect flag in fesetexceptflag
> Fix incorrect mask being used when FE_INVALID bit is wanted by user.
> The problem was noticed thanks to msun fenv tests.
>
> Reviewed by:  jhibbits, luporl
> Sponsored by: Eldorado Research Institute (eldorado.org.br)
> Differential Revision:        https://reviews.freebsd.org/D27201

No regression for full ATF on both real and emulated FPU.

XXX
Import some tests from FreeBSD's lib/msun/tests.

diffstat:

 sys/arch/powerpc/include/fenv.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r d3da3efc2720 -r 4a66b20112db sys/arch/powerpc/include/fenv.h
--- a/sys/arch/powerpc/include/fenv.h   Mon Sep 12 15:10:31 2022 +0000
+++ b/sys/arch/powerpc/include/fenv.h   Tue Sep 13 01:22:12 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fenv.h,v 1.6 2019/10/30 02:44:29 christos Exp $        */
+/*     $NetBSD: fenv.h,v 1.7 2022/09/13 01:22:12 rin Exp $     */
 
 /*-
  * Copyright (c) 2004-2005 David Schultz <das%FreeBSD.ORG@localhost>
@@ -177,7 +177,7 @@
        union __fpscr __r;
 
        if (__excepts & FE_INVALID)
-               __excepts |= FE_ALL_EXCEPT;
+               __excepts |= FE_ALL_INVALID;
        __mffs(&__r.__d);
        __r.__bits.__reg &= ~__excepts;
        __r.__bits.__reg |= *__flagp & __excepts;



Home | Main Index | Thread Index | Old Index