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 Fix inverted logic; cr was completely b...



details:   https://anonhg.NetBSD.org/src/rev/faf9fd64457b
branches:  trunk
changeset: 368671:faf9fd64457b
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Jul 26 16:07:55 2022 +0000

description:
Fix inverted logic; cr was completely broken by FPU insn with Rc == 1.

Why haven't we noticed this so far...

diffstat:

 sys/arch/powerpc/fpu/fpu_emu.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 76c3f23ea271 -r faf9fd64457b sys/arch/powerpc/fpu/fpu_emu.c
--- a/sys/arch/powerpc/fpu/fpu_emu.c    Tue Jul 26 14:53:12 2022 +0000
+++ b/sys/arch/powerpc/fpu/fpu_emu.c    Tue Jul 26 16:07:55 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_emu.c,v 1.33 2020/07/15 09:42:43 rin Exp $ */
+/*     $NetBSD: fpu_emu.c,v 1.34 2022/07/26 16:07:55 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.33 2020/07/15 09:42:43 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.34 2022/07/26 16:07:55 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -808,7 +808,7 @@
                /* Isolate condition codes */
                cond >>= 28;
                /* Move fpu condition codes to cr[1] */
-               tf->tf_cr &= (0x0f000000);
+               tf->tf_cr &= ~(0x0f000000);
                tf->tf_cr |= (cond<<24);
                DPRINTF(FPE_INSN, ("fpu_execute: cr[1] <= %x\n", cond));
        }



Home | Main Index | Thread Index | Old Index