Mail Archives: pgcc/1998/03/14/03:37:21
On Fri, Mar 13, 1998 at 01:43:54PM +0200, Tuukka Toivonen wrote:
> On Thu, 12 Mar 1998, Marc Lehmann wrote:
>
> >> There seems to be annother way, but involes the unducumented functions
> >> __getfpucw and __setfpucw.
>
> Undocumented????
Please quote correctly! I didn't write this!
> Those functions has nothing to do with the _hardware_ -> they are some
> OS/GCC thingies I don't know about -> GCC/OS is undocumented
> -> GCC/OS is broken (not really... with GNU software they're documented in
> source code, at least)
>
> These functions probably use FPU instructions fstenv/fldenv
fnstcw, fnldcw
> true. Does anyone _know_ what IEEE says? It's difficult for me to believe
> that if IEEE would actually require it, Intel wouldn't honor them _even if_
> they honor them with add/sub/div/mul etc...
the problem is that implementing this in the compiler will
generate far too many instruction. gcc already does this
on occasion:
double x;
int i = x;
will (correctly) generate:
fldl 16(%esp)
fnstcw 8(%esp)
movl 8(%esp),%edx
movb $12,%dh
movl %edx,(%esp)
fldcw (%esp)
fistpl (%esp)
movl (%esp),%eax
fldcw 8(%esp)
I don't understand how people can publicly state that this is a __compiler__
problem....
> >- the compiler cannot know when to set it, i.e. the same fundamental problem
> > than with mmx, the compiler had to set the cw on almost every procedure
> > entry etc...
>
> Yep, the user must tell it.
>
> >x86 fpu = hopelessly broken. by design.
>
> Except for maybe transcendental instructions, it is not. Just set low
> precision at bootup and don't change it later -> you'll have IEEE
I have to set low precision on almost every statement involving floats,
since the intructions don't encode a size. Sure, you can ONLY
use floats, or ONLY use double, or ONLY use long double, but
the compiler CANNOT know this.
What you are saying is that forcing the user to tell the compiler wether
he intends to use some datatypes (where the hardware should provide it)
is NOT broken. This might be your opinion, but it definitely isn't mine.
If anybody wants it, no problem, hacking an fpu-soft emulator
into libgcc is no problem. The compiler then solves it's
problems by simply not using the fpu at all.
I don't think this is sane.
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg AT goof DOT com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|
- Raw text -