Re: Floating point in kernel

From: Rogier Wolff (R.E.Wolff@BitWizard.nl)
Date: Sat May 06 2000 - 01:40:14 EST


Alan Cox wrote:
> > unsigned long foo = some_other_ulong * 1.234;
> >
> > This code has apparently been working for some time. According to C rules
> > of type promotion, "some_other_ulong" should be promoted to a double to
> > store the result of the expression, before discarding the fraction and
> > assigning to foo.
> >
> > My question is, what are the likely problems to expect from this when
> > running in kernel-space (on x86 w/FPU)?
>
> Random floating point corruption on applications calling it. If its in an
> IRQ random FPU corruption for all processes

I've been watching this from the sideline for a while, but why doesn't
gcc have an option that says: this CPU doesn't have an FPU. That flag
should be on for i386 kernel compiles, and if gcc can't handle FP
without an FPU, it should just bail out when it finds some.

                                Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
*       Common sense is the collection of                                *
******  prejudices acquired by age eighteen.   -- Albert Einstein ********

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:19 EST