Subject: devel-digest V2 #194
From: [email-masked] (devel-digest)
To: [email-masked]

devel-digest           Friday, June 11 1999           Volume 02 : Number 194

In this issue:

    Re: floatlib.c
    Re: floatlib.c
    Re: floatlib.c
    Re: floatlib.c

See the end of this digest for information about devel-digest.

----------------------------------------------------------------------

Date: 10 Jun 1999 17:12:45 GMT
From: "Andrew Coles" <[email-masked]>
Subject: Re: floatlib.c

Thanks to everyone who's helped / offered to join in.

Does the code produced by egcs use the softfloat library or does it just
use fp-bit.c etc.? The other thing I must do is see how similar the FP code
in the nw-fpe library is to the NetBSD-arm32 library, which is what I
develop on, to see if my efforts can be easily ported / worked on by people
using Linux. AFAICT softfloat.c (the library itself with the stuff that
could be improved in) should be portable across the two platforms.

Comments?

Andrew

- ---
This message processed by the Netwinder.Org news2mail gateway.

- --
This list is run automagically by Majordomo 1.94.4
Please send email questions to [email-masked]
To UNSUBSCRIBE: email [email-masked] with
"unsubscribe devel" as the body of your message.

------------------------------

Date: Thu, 10 Jun 1999 18:51:16 +0100
From: Philip Blundell <[email-masked]>
Subject: Re: floatlib.c

In article <01beb363$a6c4c480$LocalHost@a> you write:
>Does the code produced by egcs use the softfloat library or does it just
>use fp-bit.c etc.?

Neither, really.

Unlike NetBSD, Linux doesn't use soft-float as its default code
generation model; instead it just generates FPA instructions which are
emulated by the kernel.  (My personal opinion is that it would probably
have been better to go with soft-float but for a variety of reasons
this didn't happen.)

The emulator in the kernel ("NWFPE") is based on the SoftFloat
library.  I'm not aware of anything in a Linux system that uses
GCC's fp-bit.c or floatlib.c.

>AFAICT softfloat.c (the library itself with the stuff that
>could be improved in) should be portable across the two platforms.

It should indeed.  Last time I looked, NetBSD was using SoftFloat
release 1, whereas Linux uses SoftFloat 2.  The differences aren't
large enough to cause too much grief though.

p.
- --
This list is run automagically by Majordomo 1.94.4
Please send email questions to [email-masked]
To UNSUBSCRIBE: email [email-masked] with
"unsubscribe devel" as the body of your message.

------------------------------

Date: Thu, 10 Jun 1999 17:25:18 -0400
From: Scott Bambrough <[email-masked]>
Subject: Re: floatlib.c

This is a multi-part message in MIME format.
- --------------7D41C321E186F59237F63526
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Philip Blundell wrote:
> 
> Andrew Coles wrote:
> 
> > I was going to look at the code and see if there are any bits of C code
> > which could benefit from assembler code making full use of the ARM
> > instruction set (like, combining shifts & adds etc.) as the gcc optimizer,
> > although quite good, is still not as good as hand-written optimized
> > assembler. I was going to focus on the core functions that were called a
> > lot - stripping out the mantissa / exponent,
> > addition/subtraction/multiplication/division.
> 
> Yes, this would be a good thing to look at.  It should be possible to do the
> easy cases for the simple operations like add and subtract in far fewer
> instructions than gcc currently emits.  If you compile softfloat.c with -S
> the results aren't all that pretty.
> 
> p.

I'm not sure about that.  Much of the code in functions is normalization and
IEEE exception checking.  If we could ensure all numbers are normalized we could
get rid of that.  The exception checks would have to remain.  The only other
improvements would be to use the ARMv4 instructions, but then this would lead to
problems on ARMv3 and earlier machines.
- --------------7D41C321E186F59237F63526
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Scott Bambrough
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Scott Bambrough
n:              Bambrough;Scott
org:            Rebel.com
adr:            150 Isabella St.;;;Ottawa;Ontario;K1S 1V7;Canada
email;internet: [email-masked]
title:          Software Engineer
tel;work:       (613) 788-6000 x6116
tel;fax:        (613) 230-8300
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard

- --------------7D41C321E186F59237F63526--

- ---
This message processed by the Netwinder.Org news2mail gateway.

- --
This list is run automagically by Majordomo 1.94.4
Please send email questions to [email-masked]
To UNSUBSCRIBE: email [email-masked] with
"unsubscribe devel" as the body of your message.

------------------------------

Date: Thu, 10 Jun 1999 17:26:46 -0400
From: Scott Bambrough <[email-masked]>
Subject: Re: floatlib.c

This is a multi-part message in MIME format.
- --------------49241E6FA3BD76C2FEFBE230
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Andrew Coles wrote:
> 
> Thanks to everyone who's helped / offered to join in.
> 
> Does the code produced by egcs use the softfloat library or does it just
> use fp-bit.c etc.?

The FP code generated by default is opcodes for the FPA11 floating point
hardware on the ARM7500FE chip.  NetBSD and ARMLinux use a software emulator to
emulate the floating point unit.  If you use the -msoft-float flag when
compiling, the compiler generates function calls for the floating point
operations.  You must then supply a library implementing those functions (EGCS
doesn't by default).  This is what libfloat is.  libfloat makes use of the
softfloat library by John Hauser.

> The other thing I must do is see how similar the FP code
> in the nw-fpe library is to the NetBSD-arm32 library, which is what I
> develop on, to see if my efforts can be easily ported / worked on by people
> using Linux.

NetBSD contains no source code for the floating point emulator to my knowledge. 
It seems that the someone converted the object modules from the ARM SDT to a
sequence of hex numbers.  They then use a little assembler magic to convert the
sequence back to an object module.  I could find no readable C or assembler
source.

> AFAICT softfloat.c (the library itself with the stuff that
> could be improved in) should be portable across the two platforms.

It is.  It is used on both the ARM versions of Linux and NetBSD.

Scott
- --------------49241E6FA3BD76C2FEFBE230
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Scott Bambrough
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Scott Bambrough
n:              Bambrough;Scott
org:            Rebel.com
adr:            150 Isabella St.;;;Ottawa;Ontario;K1S 1V7;Canada
email;internet: [email-masked]
title:          Software Engineer
tel;work:       (613) 788-6000 x6116
tel;fax:        (613) 230-8300
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard

- --------------49241E6FA3BD76C2FEFBE230--

- ---
This message processed by the Netwinder.Org news2mail gateway.

- --
This list is run automagically by Majordomo 1.94.4
Please send email questions to [email-masked]
To UNSUBSCRIBE: email [email-masked] with
"unsubscribe devel" as the body of your message.

------------------------------

End of devel-digest V2 #194
***************************

--
This list is run automagically by Majordomo 1.94.4
Please send email questions to [email-masked]
To UNSUBSCRIBE: email [email-masked] with
"unsubscribe devel-digest" as the body of your message.