From owner-cvs-all Fri Mar 10 13:56:56 2000 Delivered-To: cvs-all@freebsd.org Received: from knight.cons.org (knight.cons.org [194.233.237.86]) by hub.freebsd.org (Postfix) with ESMTP id 82D2637BD8A; Fri, 10 Mar 2000 13:56:36 -0800 (PST) (envelope-from cracauer@knight.cons.org) Received: (from cracauer@localhost) by knight.cons.org (8.9.3/8.9.3) id WAA21127; Fri, 10 Mar 2000 22:56:21 +0100 (CET) Date: Fri, 10 Mar 2000 22:56:21 +0100 From: Martin Cracauer To: Jeroen Ruigrok van der Werven Cc: Garrett Wollman , Alfred Perlstein , Doug Rabson , Martin Cracauer , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/i386/include npx.h Message-ID: <20000310225621.C20522@cons.org> References: <200003101756.JAA90710@freefall.freebsd.org> <20000310133936.B14279@fw.wintelcom.net> <200003102122.QAA18594@khavrinen.lcs.mit.edu> <20000310224053.B4626@lucifer.bart.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000310224053.B4626@lucifer.bart.nl>; from asmodai@bart.nl on Fri, Mar 10, 2000 at 10:40:53PM +0100 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In <20000310224053.B4626@lucifer.bart.nl>, Jeroen Ruigrok van der Werven wrote: > -On [20000310 22:30], Garrett Wollman (wollman@khavrinen.lcs.mit.edu) wrote: > >< said: > > > >> Is there any reason for doing this other than so we can emulate > >> linux's bog^H^H^H nifty ability to divide by zero? > > > >The fact that the IEEE standard says this is the default state. > > My, does the IEEE encourage bad coding practices then. If I understood > the commit correctly. The only good coding is to set the mask explicitly to what you need. The default one is only for those applications that don't care. If you know what you do, using the exceptional values is not "bad". It can be faster (no checking), save space (no additonal status indicators attached to FP values) and is very well defined by IEEE. The only problem are bugs in gcc, math libraries and maybe the FPU, so the real paranoid one should still prefer to test themself. For generations of market researchers and scientists the behaviour of the existing tools is good enough. > Just for the less kernelsavvy types under us, > > this commit make sures that my app won't segfault due to a division by > zero, right? Yes, plus underflow, overflow, illegal operations. Unfortunatly, some serious errors (i.e. conversion to integer when the source FP value is too big) are now also masked because the i387 FPU doesn't allow the programmer to control them seperatly from "real" FP operations that are caught softly due to the IEEE standard. Do not ever convert a double/float to integer without a range check. Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message