Re: Intel floating-point initialization

H. Peter Anvin (hpa@transmeta.com)
19 May 1998 10:36:11 GMT


Followup to: <19980519101452.11458@pauillac.inria.fr>
By author: Xavier Leroy <Xavier.Leroy@inria.fr>
In newsgroup: linux.dev.kernel
>
> I beg to disagree with Linus. The parent process/thread may have set
> the FPU control word to a non-default value (i.e. change rounding
> modes, etc). The programmer legitimely expects the child process to
> inherit those settings (just like it inherits pretty much everything
> else from its parent).
>

If the FPU registers are otherwise preserved across a system call,
they should be copied by fork(). Otherwise it will not work properly
if you use floating point in the same routine that does a fork()
(remember, to the C compiler, fork() is just another function.)

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu