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]
Other format: [Raw text]

Re: Are Decimal operations are fully implemented/tested ?


On Mon, 17 Sep 2012, Vincent Lefevre wrote:

> Then, between implementing round-to-odd and implementing a direct
> formatOf operation, I don't think there is much difference concerning
> the work to do (I would even say that round-to-odd could require more
> work).

The difference would probably be that round-to-odd involves a temporary 
(and probably expensive) change to the rounding mode to round towards zero 
- whereas other approaches (one of which might be using Dekker's / Knuth's 
algorithms to compute an exact sum or product, then using the low part of 
that to adjust the high part before rounding to the desired format) could 
be done without such a change.

(With direct software floating-point implementations on a processor that 
has hardware floating point, you also need to ensure that the final result 
is rounded according to the current rounding direction and that 
appropriate exceptions are raised - maybe through using the software 
floating point to produce directly the adjusted value in a wider format, 
then the hardware floating point to round that to the narrower format.)

-- 
Joseph S. Myers
joseph@codesourcery.com


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