Re: Why all glibc2 programs are FPU programs

Adam J. Richter (adam@yggdrasil.com)
Wed, 27 May 1998 18:36:23 -0700


>> = Adam Richter
> = Ulrich Drepper

>> No. The glibc code would look like this:
>>
>> personality(<current_libc6_personality_including_mask>);

>See above why this isn't possible. It must be possible for the user
>to decide about the mode. It must not be manifested in the libc.
>There are lots of programs which require, e.g., 53bit mantissa on
>Intel. Without selecting the correct mode you'll end up with lots of
>wrong results (see SPECS). As I wrote in the other mail, the value
>used in the setfpucw() call by the libc is a variable, no constant.

The personality system call would only set the *initial*
value of the FPU control word before any floating point instructions
had been executed. Programs could then change it in the usual way.
It is impossible to write any program that produces different output
under the status quo and under my proposal (well, aside from
disassemlbing the .o file or noticing the infinitesmal time savings
in exec'ing the program).

The issue of your proposal being ELF specific is more a matter
of leaving the door open for future binary formats than it is about
existing a.out format executables.

I started writing some code to emulate the version of the FPU
set control word instruction that glibc uses. This emulation has the
advantage of fixing old binaries and all binary formats, but I am
concerned that it lengthens the code paths for math emulation (and for
loading a hardware math context if you want to do then too to fix the
problem of lazy FPU). The change also would have to be implemented separately
for each hardware platform. Finally, numeric comparisons of opcodes
are a pain to debug and maintain. It seems like a lot of complexity
and execution time to add for an operation that currently serves no
purpose whatsoever.

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 205
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."

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