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 Do not raise SNaN exception for QNaN.



details:   https://anonhg.NetBSD.org/src/rev/63f848858589
branches:  trunk
changeset: 369789:63f848858589
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Sep 01 06:10:58 2022 +0000

description:
Do not raise SNaN exception for QNaN.

diffstat:

 sys/arch/powerpc/fpu/fpu_add.c  |  7 ++++---
 sys/arch/powerpc/fpu/fpu_div.c  |  7 ++++---
 sys/arch/powerpc/fpu/fpu_mul.c  |  7 ++++---
 sys/arch/powerpc/fpu/fpu_sqrt.c |  7 ++++---
 sys/arch/powerpc/fpu/fpu_subr.c |  5 ++---
 5 files changed, 18 insertions(+), 15 deletions(-)

diffs (138 lines):

diff -r d006cdcce40e -r 63f848858589 sys/arch/powerpc/fpu/fpu_add.c
--- a/sys/arch/powerpc/fpu/fpu_add.c    Thu Sep 01 06:08:16 2022 +0000
+++ b/sys/arch/powerpc/fpu/fpu_add.c    Thu Sep 01 06:10:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_add.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
+/*     $NetBSD: fpu_add.c,v 1.6 2022/09/01 06:10:58 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_add.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_add.c,v 1.6 2022/09/01 06:10:58 rin Exp $");
 
 #include <sys/types.h>
 #if defined(DIAGNOSTIC)||defined(DEBUG)
@@ -95,7 +95,8 @@
        DPRINTF(FPE_REG, ("=>\n"));
        ORDER(x, y);
        if (ISNAN(y)) {
-               fe->fe_cx |= FPSCR_VXSNAN;
+               if (ISSNAN(y))
+                       fe->fe_cx |= FPSCR_VXSNAN;
                DUMPFPN(FPE_REG, y);
                return (y);
        }
diff -r d006cdcce40e -r 63f848858589 sys/arch/powerpc/fpu/fpu_div.c
--- a/sys/arch/powerpc/fpu/fpu_div.c    Thu Sep 01 06:08:16 2022 +0000
+++ b/sys/arch/powerpc/fpu/fpu_div.c    Thu Sep 01 06:10:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_div.c,v 1.6 2020/07/15 07:47:27 rin Exp $ */
+/*     $NetBSD: fpu_div.c,v 1.7 2022/09/01 06:10:58 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_div.c,v 1.6 2020/07/15 07:47:27 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_div.c,v 1.7 2022/09/01 06:10:58 rin Exp $");
 
 #include <sys/types.h>
 #if defined(DIAGNOSTIC)||defined(DEBUG)
@@ -183,7 +183,8 @@
        DPRINTF(FPE_REG, ("=>\n"));
        if (ISNAN(x) || ISNAN(y)) {
                ORDER(x, y);
-               fe->fe_cx |= FPSCR_VXSNAN;
+               if (ISSNAN(x) || ISSNAN(y))
+                       fe->fe_cx |= FPSCR_VXSNAN;
                DUMPFPN(FPE_REG, y);
                return (y);
        }
diff -r d006cdcce40e -r 63f848858589 sys/arch/powerpc/fpu/fpu_mul.c
--- a/sys/arch/powerpc/fpu/fpu_mul.c    Thu Sep 01 06:08:16 2022 +0000
+++ b/sys/arch/powerpc/fpu/fpu_mul.c    Thu Sep 01 06:10:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_mul.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
+/*     $NetBSD: fpu_mul.c,v 1.6 2022/09/01 06:10:58 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_mul.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_mul.c,v 1.6 2022/09/01 06:10:58 rin Exp $");
 
 #include <sys/types.h>
 #if defined(DIAGNOSTIC)||defined(DEBUG)
@@ -134,7 +134,8 @@
        ORDER(x, y);
        if (ISNAN(y)) {
                y->fp_sign ^= x->fp_sign;
-               fe->fe_cx |= FPSCR_VXSNAN;
+               if (ISSNAN(y))
+                       fe->fe_cx |= FPSCR_VXSNAN;
                DUMPFPN(FPE_REG, y);
                return (y);
        }
diff -r d006cdcce40e -r 63f848858589 sys/arch/powerpc/fpu/fpu_sqrt.c
--- a/sys/arch/powerpc/fpu/fpu_sqrt.c   Thu Sep 01 06:08:16 2022 +0000
+++ b/sys/arch/powerpc/fpu/fpu_sqrt.c   Thu Sep 01 06:10:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_sqrt.c,v 1.10 2022/05/24 20:00:49 andvar Exp $ */
+/*     $NetBSD: fpu_sqrt.c,v 1.11 2022/09/01 06:10:58 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_sqrt.c,v 1.10 2022/05/24 20:00:49 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_sqrt.c,v 1.11 2022/09/01 06:10:58 rin Exp $");
 
 #include <sys/types.h>
 #if defined(DIAGNOSTIC)||defined(DEBUG)
@@ -215,7 +215,8 @@
        DUMPFPN(FPE_REG, x);
        DPRINTF(FPE_REG, ("=>\n"));
        if (ISNAN(x)) {
-               fe->fe_cx |= FPSCR_VXSNAN;
+               if (ISSNAN(x))
+                       fe->fe_cx |= FPSCR_VXSNAN;
                DUMPFPN(FPE_REG, x);
                return (x);
        }
diff -r d006cdcce40e -r 63f848858589 sys/arch/powerpc/fpu/fpu_subr.c
--- a/sys/arch/powerpc/fpu/fpu_subr.c   Thu Sep 01 06:08:16 2022 +0000
+++ b/sys/arch/powerpc/fpu/fpu_subr.c   Thu Sep 01 06:10:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_subr.c,v 1.5 2020/06/27 03:07:57 rin Exp $ */
+/*     $NetBSD: fpu_subr.c,v 1.6 2022/09/01 06:10:58 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_subr.c,v 1.5 2020/06/27 03:07:57 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_subr.c,v 1.6 2022/09/01 06:10:58 rin Exp $");
 
 #include <sys/types.h>
 #if defined(DIAGNOSTIC)||defined(DEBUG)
@@ -213,7 +213,6 @@
 {
        struct fpn *fp;
 
-       fe->fe_cx |= FPSCR_VXSNAN;
        fp = &fe->fe_f3;
        fp->fp_class = FPC_QNAN;
        fp->fp_sign = 0;



Home | Main Index | Thread Index | Old Index