This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: expand and truncate and 387


> On Thu, Nov 26, 1998 at 09:51:40AM -0500, Stephen L Moshier wrote:
> > > I believe extensions to be a no-op.
> > 
> > IEEE does not agree.  The reason is that a format conversion is an
> > "operation" which among other things means that the "exception" flags
> > can change as a result.  Suppose you have a value in single precision
> > that is marked with the "inexact" flag.  After extending to double it
> > is no longer inexact, because IEEE 754 para 5.3 says "Conversion to a
> > wider precision is exact."  So to make IEEE happy your no-op would
> > have to clear the inexact flag.
> 
> What?  The accrued exception bits are just that -- accrued.
> Only the user clears them.  Ever.
> 
> Moreover, that "inexact" flag means that some _calculation_
> was inexact.  It says _nothing_ about whether the resulting
> value is denormal or whatnot.
This brings question: is "inexact" flag exact? I don't think so,
since calculations are done in higher precisity. So probably applications
relying on "inexact" flag will not work correctly.

I am now IEEE 754 expert. Can someone tell me, how far is i386.md from
ieee compliance? I387 control word lets specify precisity. Maybe we should
introduce some switch (-mieee-math like on alpha have I believe), that will
set control word to precisity it needs. Extenstions should be done by changing control word
and adding 0 I believe. Maybe it will be more reliable and bring less penalties
than current approach using -ffloat-store.
Once control word handling is implemented using LCM (as was suggested for the
fp->int conversion problem) it should be quite fast (not much since changing
control word is one of the slowest operations.
Will be i386.md ieee 754 compliant then? (or is this step in right direction?)

Can someone point me to source of IEEE 754 specification? Does anyone know
how other compilers behave?

Honza
> 
> 
> r~

-- 
                       OK. Lets make a signature file.
+-------------------------------------------------------------------------+
|        Jan Hubicka (Jan Hubi\v{c}ka in TeX) hubicka@freesoft.cz         |
|         Czech free software foundation: http://www.freesoft.cz          |
|AA project - the new way for computer graphics - http://www.ta.jcu.cz/aa |
|  homepage: http://www.paru.cas.cz/~hubicka/, games koules, Xonix, fast  |
|  fractal zoomer XaoS, index of Czech GNU/Linux/UN*X documentation etc.  | 
+-------------------------------------------------------------------------+


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]