Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/fpu Return +INF without exception for +INF,...



details:   https://anonhg.NetBSD.org/src/rev/38d5adeb8d09
branches:  trunk
changeset: 935180:38d5adeb8d09
user:      rin <rin%NetBSD.org@localhost>
date:      Sat Jun 27 04:29:27 2020 +0000

description:
Return +INF without exception for +INF, as required by the architecture.
Also, avoid NULL dereference for fpu_dumpfpn() aka DUMPFPN().

Taken from (remaining part of) FreeBSD Revision 343078:
https://svnweb.freebsd.org/base?view=revision&revision=343078

diffstat:

 sys/arch/powerpc/fpu/fpu_sqrt.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r bbb08d3e9e50 -r 38d5adeb8d09 sys/arch/powerpc/fpu/fpu_sqrt.c
--- a/sys/arch/powerpc/fpu/fpu_sqrt.c   Sat Jun 27 04:24:08 2020 +0000
+++ b/sys/arch/powerpc/fpu/fpu_sqrt.c   Sat Jun 27 04:29:27 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_sqrt.c,v 1.8 2020/06/27 04:17:51 rin Exp $ */
+/*     $NetBSD: fpu_sqrt.c,v 1.9 2020/06/27 04:29:27 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_sqrt.c,v 1.8 2020/06/27 04:17:51 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_sqrt.c,v 1.9 2020/06/27 04:29:27 rin Exp $");
 
 #include <sys/types.h>
 #if defined(DIAGNOSTIC)||defined(DEBUG)
@@ -230,9 +230,8 @@
                return (fpu_newnan(fe));
        }
        if (ISINF(x)) {
-               fe->fe_cx |= FPSCR_VXSQRT;
-               DUMPFPN(FPE_REG, 0);
-               return (0);
+               DUMPFPN(FPE_REG, x);
+               return (x);
        }
 
        /*



Home | Main Index | Thread Index | Old Index