Manuel Bouyer | 9 Oct 2010 19:18

floating point emulation broken

Hello,
the in-kernel floating point emulation seems seriously broken.
Running pkgsrc/benchmarks/paranoia on a mips system without FPU (userland
*not* compiled -msoft-float) gives:
The number of  FAILUREs  encountered =       3.
The number of  SERIOUS DEFECTs  discovered = 1.
The number of  DEFECTs  discovered =         4.
The number of  FLAWs  discovered =           2.

Even printf seems to have problems. I'm seeing e.g.:
What the machine gets for (Z + Z) / Z is  2.Døÿÿÿÿÿÿÿÿÿÿÿÿÿÿe+00 .

anyone familiar with mips floating point ?

--

-- 
Manuel Bouyer <bouyer <at> antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

FedEx | 12 Oct 2010 14:41

Contact FedEx


DO NOT REPLY IF YOU ARE NOT THE ORIGINAL OWNER OF THIS EMAIL
Greetings!
This mail is to inform you of your registered package. CONTENT: Bank Draft 
of $750, 000.00 USD registered by the United Nations Organisation. The Fund 
is a donation to you from the U.N through e-mails balloting in affiliation 
with commonwealth poverty eradication program. For your information the VAT 
and COD have been paid and the only money you will have to pay is the 
security keeping fee which is $125.00. To FedEx for the delivery of your 
Bank Draft to you contact the FEDEX Delivery Service with the following 
details. 

===================
Name
Age
Telephone
Delivery address
===================== 

Contact FEDEX Delivery Service via e-mail (fedixptch25 <at> yahoo.com.hk)
For claims of your Bank Draft the person in charge of the delivery of your 
Bank Draft to you is (Mr. Mark Winston). Contact him via e-mail with your 
full details below. 

===================
Mr. Mark Winston
Email: fedixptch25 <at> yahoo.com.hk
===================== 

Contact FedEx Delivery Service dispatch Department agent Mr. Mark Winston 
(Continue reading)

Toru Nishimura | 21 Oct 2010 03:31

Re: floating point emulation broken

Manuel Bouyer said;

> the in-kernel floating point emulation seems seriously broken.
> ...
> anyone familiar with mips floating point ?

fp.S was inherited from pre-NetBSD project and the maintainance has
been in abandoned state for many years.  The assembler implementation
is unlikely fixable, better to replace with fresh code with softfloat mathlib,
as well as xfer between 32x 64bit FP number and 64bit GP for MIPS64.
matt <at>  has some progress in insn emul, I suppose.

Toru Nishimura / ALKYL Technology

Toru Nishimura | 21 Oct 2010 13:13

Re: floating point emulation broken

Paul Koning said;

>> fp.S was inherited from pre-NetBSD project and the maintainance has
>> been in abandoned state for many years. The assembler implementation
> is unlikely fixable, 
>
> I agree.  fp.S emulates MIPS-2 float, which means that it doesn't do
> any good for anything compiled to a newer target.

In fact, fp.S itself is a sort of an archaic heritage.  It emulates R2010, the
original MIPS FPU as a standalone math coprocessor.  fp.S was written
for DECstaiton 3100.

> In our case here, we dropped it 3-4 years ago and switched to 
> a NOFLOAT kernel with soft-float in userland.  For an embedded
> system that's a much cleaner solution and it avoids having to fight
> with the compiler when you want a newer integer instruction set.

Quite reasonable since the main stream has been FPU-less MIPS32.  Note
that full scale FPemul is *mandatory* even for FPU-equipped processors
since FP circuit potentially emits exceptions when it detects imprecise
math condition to ask SW intervention for recovery... 

Toru Nishimura / ALKYL Technology

Paul Koning | 21 Oct 2010 12:46
Picon
Favicon

Re: floating point emulation broken


On Oct 20, 2010, at 9:31 PM, Toru Nishimura wrote:

> Manuel Bouyer said;
> 
>> the in-kernel floating point emulation seems seriously broken.
>> ...
>> anyone familiar with mips floating point ?
> 
> fp.S was inherited from pre-NetBSD project and the maintainance has
> been in abandoned state for many years.  The assembler implementation
> is unlikely fixable, better to replace with fresh code with softfloat mathlib,
> as well as xfer between 32x 64bit FP number and 64bit GP for MIPS64.
> matt <at>  has some progress in insn emul, I suppose.

I agree.  fp.S emulates MIPS-2 float, which means that it doesn't do any good for anything compiled to a newer target.

In our case here, we dropped it 3-4 years ago and switched to a NOFLOAT kernel with soft-float in userland. 
For an embedded system that's a much cleaner solution and it avoids having to fight with the compiler when
you want a newer integer instruction set.

	paul


Gmane