*BSD News Article 48891


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!swidir.switch.ch!scsing.switch.ch!news.belwue.de!fu-berlin.de!zrz.TU-Berlin.DE!zib-berlin.de!news.tu-chemnitz.de!irz401!uriah.heep!bonnie.heep!not-for-mail
From: j@bonnie.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Packages on a 386?
Date: 17 Aug 1995 10:48:57 +0200
Organization: Private U**x site, Dresden.
Lines: 34
Message-ID: <40uvpp$8sc@bonnie.tcd-dresden.de>
References: <3vv184$qou@cronkite.cisco.com> <40pb71$jut@cronkite.cisco.com> <DDE4yM.9G1@theatre.pandora.sax.de> <4kAPL1W00YUpA15HMG@andrew.cmu.edu>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Matthew Jason White  <mwhite+@CMU.EDU> wrote:

>> I may be wrong, but as I remember, the way a CPU without co-processor
>> works is this: if there appears a floating point instruction and there
>> is no FPU, the CPU generates that ``floating exception'' to leave the
>> possibility to the software to get around that.

No, no floating point exception, it raises a (sort-of, forgot the
actual name) ``emulator trap''.  On the PDP-11, it's really been
called by this name, and you can still find a SIGEMT in the list of
signals... ever been wondering why? :-)

>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).

The floating point code in FreeBSD is not IEEE compliant.  Period.

You might work^H^H^H^Hhack around this by

#include <machine/floatingpoint.h>

...
	fpsetmask(0);
...

if your application is properly handling the special conditions.
-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)