*BSD News Article 48747


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yarrina.connect.com.au!warrane.connect.com.au!gamera.zeta.org.au!godzilla.zeta.org.au!not-for-mail
From: bde@zeta.org.au (Bruce Evans)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Packages on a 386?
Date: 17 Aug 1995 21:23:41 +1000
Organization: Kralizec Dialup Unix Sydney - +61-2-837-1183, v.32bis v.42bis
Lines: 31
Message-ID: <40v8rt$qeo@godzilla.zeta.org.au>
References: <3vv184$qou@cronkite.cisco.com> <40pb71$jut@cronkite.cisco.com> <DDE4yM.9G1@theatre.pandora.sax.de> <4kAPL1W00YUpA15HMG@andrew.cmu.edu>
NNTP-Posting-Host: godzilla.zeta.org.au

In article <4kAPL1W00YUpA15HMG@andrew.cmu.edu>,
Matthew Jason White  <mwhite+@CMU.EDU> wrote:
>
>That raises an interesting point.  Some neural net code I've been
>developing is getting floating point exceptions due to a divide by zero
>(the program has a bug).  What bothers me is that divide by zero should
>not cause a floating point exception in an IEEE compliant system (the
>correct answer should be +/-Inf).  Similarly, I seem to be getting an
>exception due to floating point overflows (I'm not positive about this,
>it may just be an unseen divide by zero...in any case, that should
>return NaNQ).

FreeBSD isn't an IEEE conformant system.  It generates a SIGFPE for
division by zero, overflow and invalid operand exceptions.

>So, the question is: does the FreeBSD emulator handle these situations
>correctly?  If I enable the emulator at compile time, will floating
>point math still go to the FPU, and then to the software if the FPU
>flames out?

The default FreeBSD emulator is very buggy.  In particular, it ignores
the control word and never generates an IEEE exception or a SIGFPE.
The GPL'ed emulator is much better, and should produce the same or
more accurate results that a 486 in all cases where the 486's behaviour
behaviour is documented.

If you enable the emulator at compile time, then floating point arithmetic
will go to the FPU if an FPU exists and is detected.  Otherwise it will
go to the emulator.  "Flamed out" FPUs are only detected at boot time.
-- 
Bruce Evans  bde@zeta.org.au