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

Richard B. Johnson (root@chaos.analogic.com)
Wed, 29 Oct 1997 22:31:26 -0500 (EST)


On Thu, 30 Oct 1997, Gabriel Paubert wrote:
> On Wed, 29 Oct 1997, Richard B. Johnson wrote:
> > On Wed, 29 Oct 1997, C. Scott Ananian wrote:
> > > On Tue, 28 Oct 1997 root <root@mangue.ibm.net> wrote:
> > > > Now my question : How to test it? How to generate an IRQ13 interrupt?
> >
> > main() { double zero=0.0 ; double one=1.0; one /= zero; }
>
> You first have to unmask FP exceptions. By default they are all masked,
> and you will never get any interrupt, as you can check with the following
> simple code:
>
> main() {
> unsigned short cw;
> asm("fstcw %0": "=m" (cw):);
> printf("Initial FPU CW:%x\n", cw);
> }
>
> gives:
>
> Initial FPU CW: 37f
>
> Gabriel.
>
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 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.

Cheers,
Dick Johnson

Richard B. Johnson
Project Engineer
Analogic Corporation
Penguin : Linux version 2.1.60 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.