[PATCH] D15120: Add support for __float128 type to be used by targets that support it
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 3 14:50:03 PST 2016
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
Comment at: lib/Sema/SemaOverload.cpp:1966-1967
@@ -1955,4 +1965,4 @@
// C99 184.108.40.206p1:
// When a float is promoted to double or long double, or a
// double is promoted to long double [...].
if (!getLangOpts().CPlusPlus &&
> nemanjai wrote:
> > hubert.reinterpretcast wrote:
> > > @rsmith; this is the discussion on floating-point "promotions" in "C" that I was asking you about.
> > I can certainly remove this if the agreement is that I should do so.
> Richard had requested to allow "promoting" `long double` to `__float128`, and at the time, implicitly converting from `long double` to `__float128` was something I was not convinced we should do at the time. At this time, I believe that adding this "promotion" is consistent with the rest of the patch; however, I am still not sure what this code is meant to implement (again, C11 does not have floating-point promotions).
I think our justification for allowing this promotion in C doesn't make any sense. The C wording is just trying to give slightly different rules for the "type gets bigger" and "type gets smaller" case and "promotion" here is an unfortunate choice of words. C99 didn't have floating point promotions.
I'm inclined to think we should remove this special case entirely. Does that cause any test failures?
More information about the cfe-commits