Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Jim Paradis <paradis@linux01.hlo.dec.com>
To: axp-list@redhat.com
Subject: Re: Performance measurements
Date: Mon, 29 Jun 1998 14:11:29 -0400 (EDT)	[thread overview]
Message-ID: <199806291811.OAA07775@linux01.hlo.dec.com> (raw)
In-Reply-To: <Pine.LNX.3.95.980629004842.19353A-100000@vb.franken.de> from "Volker Barthelmann" at Jun 29, 98 01:01:57 am

> 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


  reply	other threads:[~1998-06-29 18:16 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-24  8:51 Performance measurements Martin Kahlert
1998-06-24  9:34 ` Robert Wilhelm
1998-06-24 19:54   ` Xsuse (Gloria X Server) Gavin
1998-06-24 20:50     ` B. James Phillippe
1998-06-24 23:29       ` Chris Ingrassia
1998-06-24 10:32 ` Performance measurements Stefan Schroepfer
1998-06-24 10:48   ` Martin Kahlert
1998-06-24 11:06     ` Martin Høy
1998-06-24 13:46     ` Stefan Schroepfer
1998-06-24 15:00       ` Robert Wilhelm
1998-06-24 15:16         ` Stefan Schroepfer
1998-06-25  7:46         ` Performance measurements (thanks and conclusion) Martin Kahlert
1998-06-24 15:25       ` Performance measurements Fabio Perroni
1998-06-24 15:28     ` Jeff Sturm
1998-06-24 15:59       ` Christopher C Chimelis
1998-06-24 17:19         ` Jeff Sturm
1998-06-24 18:12           ` Christopher C Chimelis
1998-06-24 19:05             ` Jeff Sturm
1998-06-24 20:38             ` Wes Bauske
1998-06-24 22:30               ` Jeff Sturm
1998-06-25  1:42               ` Richard Henderson
1998-06-25  1:48             ` Richard Henderson
1998-06-25 14:00               ` Jeff Sturm
1998-06-25 16:17                 ` Richard Henderson
1998-06-27 14:30             ` Volker Barthelmann
1998-06-28 16:41               ` Jeff Sturm
1998-06-28 23:01                 ` Volker Barthelmann
1998-06-29 18:11                   ` Jim Paradis [this message]
1998-06-29  5:14                 ` jrp
1998-06-24 16:05       ` Stefan Schroepfer
1998-06-24 16:58     ` Wes Bauske
1998-06-24 15:49 ` David S. Miller
     [not found] ` <Pine.GSO.3.96.980624190510.27225p-100000@markab.dbai.tuwien.ac.at>
1998-06-25  7:59   ` Martin Kahlert
1998-06-26  1:26 ` Ryan Kirkpatrick
1998-06-26 14:45   ` Chris Ingrassia
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox