Subject: Re: port-i386/6986: FPU emulation problems
To: Dave Huang <khym@bga.com>
From: Krister Walfridsson <cato@df.lth.se>
List: port-i386
Date: 03/28/1999 15:58:15
On Sun, 21 Mar 1999, Dave Huang wrote:

> 3 packets transmitted, 3 packets received, 0.0% packet loss
> math_emulate: 0xd9fa not implemented
> Illegal instruction

This is due to some changes in gcc/egcs. NetBSD has always defined
TARGER_NO_FANCY_MATH_387 in TARGET_CPU_DEFAULT to prevent gcc from
generating the instructions the kernel don't emulate. But there has
been some changes in egcs, so it's the TARGET_DEFAULT define that
controls this behaivour nowadays.

The patch below takes back the old behaviour.

I guess it's up to the portmaster and/or releng to decide if we
should apply this to our egcs, or fix the kernel...

   /Krister


--- dist/gcc/config/i386/netbsd.h.bak   Thu Feb  4 13:07:59 1999
+++ dist/gcc/config/i386/netbsd.h       Sun Mar 28 15:41:48 1999
@@ -1,6 +1,3 @@
-/* This goes away when the math-emulator is fixed */
-#define TARGET_CPU_DEFAULT 0400                /* TARGET_NO_FANCY_MATH_387 */
-
 /* This is tested by i386gas.h.  */
 #define YES_UNDERSCORES
 
@@ -11,6 +8,11 @@
 
 /* Get generic NetBSD definitions.  */
 #include <netbsd.h>
+
+/* This goes away when the math-emulator is fixed */
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT \
+  (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
 
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "-Di386 -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__ -Asystem(unix) -Asystem(NetBSD) -Acpu(i386) -Amachine(i386)"