Subject: FP emulation patch available

From: "Andrew R. Baker" <[email-masked]>
Date: Mon, 6 Mar 2000 22:12:24 -0600 (CST)

I have made a patch against the 2.2.13 CVS kernel from the patch that
Kevin Kissell (sp?) put out earlier.  This patch is a subset of Kevin's
patch.  It includes the following pieces:

1) FPU emulation support
2) removal of the MIPS instruction bitfields (replaced with macros)
3) mips_cpu stucture and C based cpu identification

I think a gdb segment snuck in there too.

The patch is available at:
http://www.dpo.uab.edu/~andrewb/2.2.diff.2000.03.06

Could interested parties please look at it and provide more testing than
me and my Indigo2.  My next goal is to intergrate the FP unimplemented
exception code into the FPU emulation framework.  I then shall see about
moving it all to 2.3 (I may move parts sooner if necessary).  

Comments appreciated,

Andrew

P.S.  Ralf & others, since I keep changing desktop machines I do not
believe I have submit access to CVS anymore.  If this patch is
satisfactory, could one of you submit it to the archive for me?

---

From: "Jay Carlson" <[email-masked]>
Date: Tue, 7 Mar 2000 07:08:23 -0500

> Bradley D. LaRonde ([email-masked]) writes (re the FPA emulator out of
> Algorithmics via Kevin Kissell):
>
> > I would jump right on this but I really need it for 2.3.47+.
>
> It's good to see our donation to the Linux project being taken up
> enthusiastically , but didn't SGI have some code like this?  I mean,
> you can't have a serious MIPS run-time system without an FP emulator,
> can you?

quoting from softftp.S from 2.3.19:

 * For now it's just a crude hack good enough to run certain fp programs
like
 * Mozilla.

It's just dealing with denorms, NaNs, etc as inputs.  AFAIK NetBSD was no
better until pretty recently.

Whether Linux or NetBSD, as systems, were ever serious MIPS run-time
systems---well, you wrote the book, so I'm inclined to get out of the
argument.

>From my LinuxCE perspective, a full FP emu is fairly important for getting
binary compatibility back with mainline Linux/MIPS---we've been in the
softfp ghetto.  But most of what we do with FP is, uh, keep /bin/df happy
when it tries to calculate the percentage of free disk space, and the like.
And dropping softfp means we don't *have* to maintain a forked
toolchain/libc.

(of course, getting rid of softfp makes mips16 more...interesting...)

Jay

---

From: "Andrew R. Baker" <[email-masked]>
Date: Tue, 7 Mar 2000 12:54:24 -0600 (CST)

On Tue, 7 Mar 2000, Gleb O. Raiko wrote:
> "Bradley D. LaRonde" wrote:
> > 
> > Regards,
> > Brad
> I vote for 2.3 too. It seems 2.2 will vanish soon anyway.

Working on it.

-Andrew

---

From: Harald Koerfgen <[email-masked]>
Date: Tue, 07 Mar 2000 20:43:43 +0100 (MET)

>> I vote for 2.3 too. It seems 2.2 will vanish soon anyway.

Me too. Compiles and links but doesn't work. I guess the cpu detection doesn't
work properly for my Mobilon yet. I am actually compiling it for a DECstation
:-)

-- 
Regards,
Harald

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 8 Mar 2000 13:11:05 -0300

> I vote for 2.3 too. It seems 2.2 will vanish soon anyway.

Size, stability and existing drivers are arguments for 2.2 that will stay
valid for quite some time.

  Ralf

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 8 Mar 2000 13:25:05 -0300

> And dropping softfp means we don't *have* to maintain a forked

Have you considered contribution of the softfp code to GNU libc or
packaging it as a glibc addon?  For small embedded systems it seems to
be the better tradeoff than the kernel emulator and for these systems
nobody cares very much about binary compatibility with something else.

  Ralf

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 8 Mar 2000 13:18:05 -0300

On Tue, Mar 07, 2000 at 10:22:22AM +0000, Dominic Sweetman wrote:

> enthusiastically , but didn't SGI have some code like this?

They even have two emulators, an old one written in assembler and a newer
one written in C.  I haven't looked more closely but I think that they're
both full emulators and the (C) situation would allow me to reuse the
code for Linux.  In any case, it's a non-trivial piece of code, so I want
to double check with them.

> I mean, you can't have a serious MIPS run-time system without an FP
> emulator, can you?

Depends.  After a few years without this FPU stuff we've found only a
surprisingly small number of applications that run into problems.  After
all the only FPU instruction many programs execute is $fcr31.  Just
configuring all the kernel FPU code away therefore is a good thing
for many embedded configurations.

  Ralf