Linux: FPU control word not set when __fpu_control == _dl_fpu_control.

Jakub Jelinek jakub@redhat.com
Thu Mar 9 12:47:00 GMT 2000


> > For static binaries, we don't get AT_FPUCW and therefore always call
> > __setfpucw.  But for shared binaries we can be clever and avoid the
> > initilisation.
> 
> Why would you care to avoid this initialization?  It seems like a one time thing
> with very little cost.

The cost is pretty high. It means any program no matter if it will use FPU
or not actually touches the FPU unit. On many machines this means a trap
into the kernel which has to initialize the whole FPU and give it to the
application and on several archs on the next context switch you have no way
to find out nothing else in the FPU state was modified, so you have to save
it.

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.47 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________


More information about the Libc-hacker mailing list