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 Thu, 13 Sep 2012, Vincent Lefevre wrote:

> But if you want an example, I don't think that the formatOf
> arithmetic operations (IEEE 754-2008 §5.4.1 -- that's a "shall")
> are implemented by GCC, either for binary or for decimal, say
> add two _Decimal128 numbers and round to _Decimal64 directly
> (with a single rounding).

For binary floating point, the draft C bindings (I'm looking at WG14 
N1605, which is just a draft of the first part of what's supposed to end 
up as a five-part document) defines such operations as library operations 
(e.g. float fadd(double x, double y);) rather than compiler ones (although 
of course the compiler might have corresponding built-in functions).  
N1582 indicates that names such as _Float32 f32addf64(_Float64 x, _Float64 
y); would be used for the functions with specific IEEE types - so I guess 
d64addd128 for the example you give.

The draft C bindings for IEEE 754-2008 are at a sufficiently early stage 
that before putting anything in mainline glibc it would be important to 
look carefully at how likely any incompatible changes would be (more 
likely for some functions than for others, I expect).  Of course they will 
only go in (for either GCC or glibc) if someone contributes 
implementations, and they would be a sufficiently large project that they 
aren't particularly likely to be done as a spare-time project.

(Implementing fadd itself probably isn't hard; given exception and 
rounding mode support you should be able to do it with round-to-odd as 
described by Boldo and Melquiond - and some processors (ia64?) may have 
direct support for it.  But there are lots of new functions, that's just 
one.)

-- 
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]