Subject: Re: mac68k on Duo series Laptops?
To: None <abs@anim.dreamworks.com>
From: Ken Nakata <ksn@tkf.att.ne.jp>
List: port-mac68k
Date: 06/25/1999 10:45:49
On Thu, 24 Jun 1999 15:24:43 -0700 (PDT), David Brownlee <abs@anim.dreamworks.com> wrote:
> On Fri, 25 Jun 1999, Ken Nakata wrote:
> 
> > The biggest problem right now is the 68LC040.  Floating point
> > emulation doesn't work on the LC040 chip for some unknown reason.
> > I've been investigating this on and off for a few years now with no
> > avail. :-(
> > 
> > If you could replace the CPU with a full 68040...
> 
> 	What would happen if you compiled the complete distribution
> 	with -soft-float? Would it work on 68LC040 machines?

It's not likely that it'll "Just Work."

Last when I checked, FPU instructions were used anyway even if
-msoft-float is used (surprise!).  Actually, I checked it again just
now, and it still seems to be the case.

Details:

When -msoft-floats is specified, gcc generates calls to subroutines
like ___addsf3 (add floats), ___subdf3 (subtract doubles), ___muldf3
(multiply doubles), etc. instead of generating FPU instructions, to do
floating point operations.  But unfortunately on NetBSD/m68k, those
routines are implemented by FPU instructions (see
src/lib/libc/arch/m68k/gen/*.S).  They have been in this way at least
on m68k arch since the days of 4.2 or 4.3BSD, it seems.

So, until somebody replaces those routines with truly soft-float
versions, FPU instructions will be linked to your binary anytime you
try to do some floating point math.

However, gcc doesn't generate the fmovem instruction, the source of
most FPE-related core dumps on the LC040 boxes, if -msoft-float is
specified.  So, things might be a little better.

Actually, it'd be interesting if anybody could build an entirely
soft-float-ized userland and run it on an LC040 box.  I could build a
snapshot if anybody wants to try but can't build by themselves.

Ken