Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/m68k/fpe Remove incorrect byte and word conversions...



details:   https://anonhg.NetBSD.org/src/rev/044e7318c568
branches:  trunk
changeset: 960112:044e7318c568
user:      isaki <isaki%NetBSD.org@localhost>
date:      Mon Mar 08 14:37:55 2021 +0000

description:
Remove incorrect byte and word conversions from fpu_explode.
The correct operation here is arithmetic right shift, but nobody calls it.

diffstat:

 sys/arch/m68k/fpe/fpu_explode.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (41 lines):

diff -r f2cbe08a3f29 -r 044e7318c568 sys/arch/m68k/fpe/fpu_explode.c
--- a/sys/arch/m68k/fpe/fpu_explode.c   Mon Mar 08 14:27:45 2021 +0000
+++ b/sys/arch/m68k/fpe/fpu_explode.c   Mon Mar 08 14:37:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_explode.c,v 1.15 2015/02/05 12:23:27 isaki Exp $ */
+/*     $NetBSD: fpu_explode.c,v 1.16 2021/03/08 14:37:55 isaki Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_explode.c,v 1.15 2015/02/05 12:23:27 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_explode.c,v 1.16 2021/03/08 14:37:55 isaki Exp $");
 
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -230,11 +230,6 @@
        fp->fp_sign = s >> 31;
        fp->fp_sticky = 0;
        switch (type) {
-
-       case FTYPE_BYT:
-               s >>= 8;
-       case FTYPE_WRD:
-               s >>= 16;
        case FTYPE_LNG:
                s = fpu_itof(fp, s);
                break;
@@ -251,6 +246,10 @@
                s = fpu_xtof(fp, s, space[1], space[2]);
                break;
 
+       case FTYPE_BYT:
+       case FTYPE_WRD:
+               /* Caller must cast it to signed LNG instead of calling this */
+               /* FALLTHROUGH */
        default:
                panic("fpu_explode");
        }



Home | Main Index | Thread Index | Old Index