Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amiga/amiga can't use fnop directly now, explain why.



details:   https://anonhg.NetBSD.org/src/rev/212901a01094
branches:  trunk
changeset: 830335:212901a01094
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 05 02:39:06 2018 +0000

description:
can't use fnop directly now, explain why.

diffstat:

 sys/arch/amiga/amiga/machdep.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 601c2e5b3dc8 -r 212901a01094 sys/arch/amiga/amiga/machdep.c
--- a/sys/arch/amiga/amiga/machdep.c    Mon Mar 05 01:00:12 2018 +0000
+++ b/sys/arch/amiga/amiga/machdep.c    Mon Mar 05 02:39:06 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.248 2017/08/15 09:51:43 maya Exp $       */
+/*     $NetBSD: machdep.c,v 1.249 2018/03/05 02:39:06 christos Exp $   */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -50,7 +50,7 @@
 #include "empm.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.248 2017/08/15 09:51:43 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.249 2018/03/05 02:39:06 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -721,8 +721,20 @@
                        /*
                         * in this case, we're about to switch the FPU off;
                         * do a FNOP to avoid stray FP traps later
+                        *
+                        * But we can't use fnop directly anymore as of
+                        * gcc-6 because it passes -mno-float to the assembler
+                        * because of -msoft-float and the assembler refuses
+                        * to assemble the instruction; adding -Wa,-mfloat
+                        * does not work either because the assembler then
+                        * complains about feature being turned off and on
+                        * so we just put in the opcode directly.
                         */
+#if 0
                        __asm("fnop");
+#else
+                       __asm(".word 0xf280,0x0000");
+#endif
                        /* ... and mark FPU as absent for identifyfpu() */
                        machineid &= ~(AMIGA_FPU40|AMIGA_68882|AMIGA_68881);
                }



Home | Main Index | Thread Index | Old Index