Re: Use of floating point in the kernel

From: Linus Torvalds
Date: Wed Jan 07 2004 - 22:53:50 EST




On Wed, 7 Jan 2004, H. Peter Anvin wrote:
>
> Pekka Pietikainen wrote:
> >
> > There are a few instances of use of floating point in 2.6,
>
> Has anyone considered asking the gcc people to add an -fno-fpu (or
> -mno-fpu) option, throwing an error if any FP instructions are used?

We really should, but there really are some rare cases where it is
actually ok.

In particular, you _can_ do math, if you just do the proper
"kernel_fpu_begin()"/"kernel_fpu_end()" around it, and you have reason to
believe that you can assume a math processor exists.

Is it needed? I dunno. I'd frown on it in general, but I don't see it
being fundamentally wrong under the rigth circumstances.

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