Subject: Re: mysterious problems from floating-point emulation?
To: None <port-mac68k@netbsd.org>
From: J. MacPhail <jrm@kw.igs.net>
List: port-mac68k
Date: 02/27/2004 02:21:10
On Thu, Feb 26, 2004 at 04:02:51PM +0100, Bruce ONeel wrote:
> Hi,
> 
> I think my patches (from http://edoneel.chaosnet.org/Downloads.html)
> work on other systems other than mac68k.  I know they (at least)
> work on Amigas.  The patches change the m68k code not the mac68k
> code so other 68k systems should work as well.
> 
> If I didn't make a mistake, setting MKSOFTFLOAT to "yes" before 
> building will make the softfloat build, and, probably best,
> unsetenv MKSOFTFLOAT and then the regular fpu build is done.
> 
> I've only really tested the MKSOFTFLOAT to yes option.
> 
> If someone would like to dig into the fpe code that would
> be great.  I tried to figure out why my (theoritically) not
> broken LC040 system seemed to get a randomally trashed stack
> when it hit an F instruction but I was never sucessful.  My
> basically 0 knowledge of the 68k arch was probably to blame.

Well, the FPE code should be better documented, IMHO.

My original post was induced by the frequent errors -- which may have
been mostly from random stack trashing -- with 1.6.1 on my PowerBook
160 (68030, no FPU).  Having been given a hint, I tried 1.5.3, and
most of the obvious problems are gone!  It looks as though the FPE
code has a very big flaw that was hidden in the GENERIC 1.5.3 kernel
but showed up in 1.6.1.  Maybe the move to ELF was a factor.

If a 1.6 kernel is compiled to be a.out, does the stack trashing stop?

What about recompiling with various other compiler options?

-- 
John