From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 21857 invoked from network); 29 Jun 1998 18:16:32 -0000 Received: from mail13.digital.com (192.208.46.30) by mail2.redhat.com with SMTP; 29 Jun 1998 18:16:32 -0000 Received: from us1rmc.bb.dec.com (us1rmc.bb.dec.com [16.57.16.6]) by mail13.digital.com (8.8.8/8.8.8/WV1.0f) with SMTP id OAA14569 for ; Mon, 29 Jun 1998 14:16:30 -0400 (EDT) Received: from linux01.hlo.dec.com by us1rmc.bb.dec.com (5.65/rmc-17Jan97) id AA21502; Mon, 29 Jun 98 14:13:28 -0400 Received: (from paradis@localhost) by linux01.hlo.dec.com (8.8.7/8.8.7) id OAA07775 for axp-list@redhat.com; Mon, 29 Jun 1998 14:11:29 -0400 From: Jim Paradis Message-Id: <199806291811.OAA07775@linux01.hlo.dec.com> Subject: Re: Performance measurements To: axp-list@redhat.com Date: Mon, 29 Jun 1998 14:11:29 -0400 (EDT) In-Reply-To: from "Volker Barthelmann" at Jun 29, 98 01:01:57 am X-Mailer: ELM [version 2.4 PL25] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > Alpha offers several versions of fp-instructions. When you want full > IEEE-compliance you have to choose the ones that trap on certain > situations, so that the trap-handler can emulate it in software. > > If you compile with gcc without -mieee it simply uses instructions that > don't trap, AFAIK. Not entirely true. Some exceptions (e.g. underflow, inexact) can be enabled or disabled on a per-instruction basis. Others (e.g. overflow, invalid operation) cannot; they're always enabled. In fact, the vast majority of the problems that require -mieee involve "invalid operation" traps. These occur when you attempt to perform an arithmetic operation involving a NaN ("Not a Number"), a denormal number, or an infinity. The IEEE spec provides mechanisms whereby these can be handled "quietly"; rather than signalling a program exception, they can indicate the exception in their results. So, for example, if you do an "add" operation and one of the operands is a NaN, the floating-point implementation can produce a NaN in the result rather than interrupting program execution. If an architecture (e.g. MIPS) provides precise floating-point traps, then it's fairly cheap to trap the exception and either pass it up as a SIGFPE or handle it quietly according to the IEEE spec. The imprecise traps on Alpha make this somewhat more costly. Often, I find I have to resort to -mieee when porting sloppy code. For example, a denorm is used where the programmer really meant to use zero. Since IEEE's quiet behavior is to treat the denorm as zero, this code "works" on other architectures even if it's technically incorrect. Because it causes no failure, the programmer is not inclined to fix it. -- Jim Paradis (paradis@linux01.hlo.dec.com) "The early bird gets the worm. Digital Equipment Corporation If you want something else for (508)841-3243 breakfast, get up later." http://www.tiac.net/users/jrp/index.html