Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Mar 2000 10:28:43 +0100
From:      Martin Cracauer <cracauer@cons.org>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        Martin Cracauer <cracauer@cons.org>, current@FreeBSD.ORG
Subject:   Re: Floating point exceptions.
Message-ID:  <20000321102843.A1455@cons.org>
In-Reply-To: <200003210924.aa02305@salmon.maths.tcd.ie>; from dwmalone@maths.tcd.ie on Tue, Mar 21, 2000 at 09:24:09AM %2B0000
References:  <20000321095024.A1011@cons.org> <200003210924.aa02305@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
In <200003210924.aa02305@salmon.maths.tcd.ie>, David Malone wrote: 
> > > There was a discussion on one of the list about what to do for
> > > floating point excpetions recently, and I thought people decided
> > > that causing a signal by default was a right thing?
> > 
> > The outcome was that applications that care must set the control word
> > themself and that we go the way of least resistance for the rest.
> 
> OK - I just did a quick scout around. Digital Unix gives a SIGFPE;
> Solaris, AIX and Redhat print some captalisation of "Inf"; HP/UX
> prints "++.000000" ;-)
> 
> Is there a way of setting the control word which is in any sense
> portable? 

It is an i386 assembler instruction. Obviously, operating system
vendors thought it's not their business, but the compiler's.
Unfortunately, gcc doesn't care (although most other native compilers
like SRC m3, CMUCL, SML/NJ do).

FreeBSD's fpsetmask(3) stuff is simple inline assembler that I
personally used in Linux, it should be relativly easy to carry it
around with your application on i386 machines.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer/
  Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000321102843.A1455>