Re: Kernels 2.1 with 386DX/387 IRQ13 PC boxes

Gabriel Paubert (paubert@iram.es)
Thu, 30 Oct 1997 06:01:12 +0100 (MET)


On Wed, 29 Oct 1997, Richard B. Johnson wrote:

> On Thu, 30 Oct 1997, Gabriel Paubert wrote:
> >
> > Initial FPU CW: 37f
> >
> You are right. Question: Is linux right? I just tried do a FP div by 0
> and the machine quietly did it! The same happends on my Sun. I don't
> have a compiler on the SGIs so I can't check them. My VAXen will
> produce FP errors as will our Alpha when attempting to divide by zero.
>
I don't know if POSIX says anything about it. Most FPU start with
all exceptions masked. For Alpha, which OS are you referring to ?
Under HP-UX divisions by zero are also "allowed" by default, but you can
change the behaviour of a program with linker options. Nice for
portability since you do not need to deal with machine specific routines.
Would it be possible to have a field somewhere in an elf section
to have something similar ?

> I think that I just discovered some bad_news(tm) because we have a lot
> of mathematicians writing code for image processing and bugs are not
> going to be discovered.
>

For image processing, you hopefully do not need the dynamic range of
astrophysical conditions, time and size scales. But you are right
(although in the end any error will propagate and more likely spread
inifinities or NaNs in the results on IEEE compliant machines), at the
very least overflows, invalid operations and divisions by zero should be
caught. Underflows are more problematic, silently zeroing the result
may be the right thing to do in production, but never for debugging.

Gabriel.