Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Janne Sinkkonen <janne@nnets.fi>
Subject: Re: Floating exceptions on Compaq XP1000 ev6
Date: 1999/10/26	[thread overview]
Message-ID: <m3r9iiuep5.fsf@kinos.nnets.fi> (raw)
In-Reply-To: nNkR3.1588$LR3.275382@news.shore.net

"Carl B. Quillen" <cbq@shore.net> writes:

> Hi.  I'm running Redhat 6.0 with a 2.2.12 kernel on a Compaq XP1000,
> and there doesn't seem to be any way to turn off floating point
> exceptions.  The machine runs by default with them all turned on
> (except maybe underflow).  Playing around with the osf_getsysinfo()
> and osf_setsysinfo() system calls, the machine claims that it is
> running int the default IEEE mode (with everything off).  But that's
> not what happens in practice.  I can change the reported state with
> osf_setsysinfo(), but not the behavior.
> 
> Anyone know what's going on?

I'm in no way an expert in this (experts, please correct me if I'm
wrong), but as a person who has 'been there': 

Maybe the exceptions can be turned off, maybe not, but without
exceptions you need to use IEEE floating points, for otherwise you can
get silently wrong results. Alpha doesn't directly support IEEE in the
sense that an instruction would produce NaN or some such. Instead,
kind of software emulation is used. You can turn it on at the compile
time, for example with the -mieee option of gcc, but that kills
performance (especially with gcc?), because the compiler puts trap
instructions here and there, in the worst case after every floating
point operation. Each trap waits for the pipelines to become
empty. So, IEEE floating points and Alpha really doesn't fit well
together.

The best option would be to write code which does not generate
exceptions, or, if you already has code too cumbersome to modify,
compile only the problematic files with IEEE floats turned on.

I have a feeling that you can also get floating point exceptions by
reading floats from a text file produced by a Pentium (for
example). Maybe that's because of the non-normalized floats which have
zeros at the beginning of the mantissa (they are too small to be
represented in the normalized form.

Hopefully this helps,

-- 
Janne



      reply	other threads:[~1999-10-26  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-26  4:00 Floating exceptions on Compaq XP1000 ev6 Carl B. Quillen
1999-10-26  4:00 ` Janne Sinkkonen [this message]
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