Subject: Re: FPU Emulator

From: Philip Blundell <[email-masked]>
Date: Mon, 25 May 1998 00:34:09 +0100

>I understand there isn't OPEN SOURCE for the ARM FPU emulator.
>Apparently it is available as a module only, as it was ported
>from Acorn code(?)

That's correct, yes.  It's a pretty unhappy state of affairs.  I have a 
working-but-inefficient soft-float library (based on Neil's efforts for 
NetBSD) but a proper emulator would be good to have as well.

>I'm interested in writing OPEN SOURCE for such a beast.

Excellent.  I was planning to do that myself (in fact I was thinking about it 
again only this afternoon). 

>outputs.  So far looking at ARM kernel source hasn't been too
>helpful.

It wouldn't be; the kernel has very little to do with the FP emulator.  What 
exactly do you mean by the expected inputs and outputs?

>I've also been told that the current FPU emulator has a problem
>with byte ordering.  Could someone enlighten me if this is the
>case.

I hadn't heard that.  You're likely to come unstuck on big-endian systems with 
it, but that's as much as a result of simply not being able to rebuild the 
thing as any inherent limitation of the code (I haven't seen the source, so I 
can't comment on how easy it would be to make it work with big-endian 
machines).

I _have_ heard rumours that the ARM emulator has problems with accuracy.  
Certainly the glibc math library fails `make check' when run under it.  I 
haven't tried this test with my soft library so I can't say if that's any 
better.

p.

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: "Neil A. Carson" <[email-masked]>
Date: Sun, 24 May 1998 22:42:06 +0100

[email-masked] wrote:

> Any suggestions, or advice on how to proceed?

I don't know if that's a problem with the emulator. The ARM and FPA as a
whole has, for double-precision words, the bytes within a word in little
endian form, but the two 32-bit words that make up the 64-bit one in big
endian form! This is bizarre but it's the standard.

Your best bet if you want to write a new one will be to get a copy of
the ARM FPA data sheet, from your local ARM office or distributor.

	Regards,

	Neil

---

From: "Neil A. Carson" <[email-masked]>
Date: Mon, 25 May 1998 00:51:54 +0100

> NetBSD) but a proper emulator would be good to have as well.

I didn't find that code was too bad. It still ran better than the FPE
did, in any case. I'm planning to do a version of NetBSD's libc with the
ARM soft float library (I can only redistribute this in binary form
though) and Linux is welcome to do the same if it wishes. Doesn't help
the open source thing though.

Actually back last year I got a new version of the SoftFloat (v2)
library, but I've not got round to doing it yet. Fixed a few bugs but
performance didn't seem much better. The main thing is it's free :-)

> haven't tried this test with my soft library so I can't say if that's any

Blimey. That may have been fixed in a more recent version {than the one
Acorn use}.

	N.

---

From: Philip Blundell <[email-masked]>
Date: Mon, 25 May 1998 01:47:47 +0100

>endian form! This is bizarre but it's the standard.

Now you mention it I remember having a problem related to this with the 
soft-float stuff.  I think gcc was getting the two words of a double backwards 
some of the time.

p.

---

From: Philip Blundell <[email-masked]>
Date: Mon, 25 May 1998 01:51:34 +0100

>though) and Linux is welcome to do the same if it wishes. Doesn't help

That might be a nice idea.  We wouldn't actually put it into the Linux C 
library, for all sorts of reasons (not least the GPL doesn't allow it) but 
distributing it as a separate library shouldn't be a problem.

>Blimey. That may have been fixed in a more recent version {than the one

To be fair I can't quite remember what the problems were.  It's possible the 
fault doesn't lie entirely with the emulator, though it did look like it at 
the time.

p.

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Mon, 25 May 1998 10:48:25 +0100 (BST)

> Blimey. That may have been fixed in a more recent version {than the one

Phil, you're probably using 2.87, which does have accuracy problems.  4.07
is apparantly ok, but that's for 32-bit machines.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.uk.linux.org/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

---

From: Philip Blundell <[email-masked]>
Date: Mon, 25 May 1998 13:13:10 +0100

>is apparantly ok, but that's for 32-bit machines.

That's true - I was using my A5000 at the time.  I haven't tried the 400 
version yet.

p.