rjmccall added a comment.

In http://reviews.llvm.org/D15120#336776, @hubert.reinterpretcast wrote:

> In http://reviews.llvm.org/D15120#336430, @rjmccall wrote:
>
> > As I understand it, PPC's long-double (~103 bits of precision) is still 
> > strictly less precise than float128_t (113 bits of precision), so it ought 
> > to be have lower rank.  Is there actually a supported platform where this 
> > is not true?  If not, we should just add this as another type with higher 
> > rank.
>
>
> PPC's long-double has variable precision. It is not strictly less precise 
> than float128_t.


Ah, right.  I was thinking of it as if the lower double were pegged to 1/2 an 
ulp of the higher double, but it isn't; it can be variably lower.

Here's the thing, though: I don't think there's a reasonable language solution 
here besides saying that float128_t has higher rank.  You can't make the types 
incompatible, because it's clearly reasonable to simply convert one to the 
other.  What you're trying to say is that they don't have a common type, but 
it's a novel concept in C/C++ to have two arithmetic types that don't have a 
common type and therefore cannot be added / compared / ternary'd together.  In 
contrast, it is not a novel concept to have a type that implicitly promotes to 
another type but potentially loses precision, because all the integer types 
will happily convert to float/double.

This patch will be much simpler, and you will get a better language design, if 
you simply make float128_t a new FP type with a higher rank than long double.


Repository:
  rL LLVM

http://reviews.llvm.org/D15120



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to