[PATCH] D15120: Add support for __float128 type to be used by targets that support it

Nemanja Ivanovic via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 2 04:51:26 PST 2016


nemanjai added inline comments.

================
Comment at: lib/Sema/SemaOverload.cpp:1658
@@ -1657,1 +1657,3 @@
   } else if (FromType->isRealFloatingType() && ToType->isRealFloatingType()) {
+    // FIXME: disable conversions between long double and __float128 if
+    // their representation is different until there is back end support
----------------
hubert.reinterpretcast wrote:
> The update to check the case where the representation of `long double` is the same as that of `double` is missing.
Yes, I missed this. Thanks for noticing. I'll update the comment and change the body of the if to:

    if (&S.Context.getFloatTypeSemantics(FromType) !=
        &S.Context.getFloatTypeSemantics(ToType)) {
      bool Float128AndLongDouble = ((FromType == S.Context.Float128Ty &&
                                    ToType == S.Context.LongDoubleTy) ||
                                   (FromType == S.Context.LongDoubleTy &&
                                    ToType == S.Context.Float128Ty));
      if (Float128AndLongDouble &&
          (&S.Context.getFloatTypeSemantics(S.Context.LongDoubleTy) !=
           &llvm::APFloat::IEEEdouble))
        return false;
    }

================
Comment at: lib/Sema/SemaOverload.cpp:1966-1967
@@ -1955,4 +1965,4 @@
       // C99 6.3.1.5p1:
       //   When a float is promoted to double or long double, or a
       //   double is promoted to long double [...].
       if (!getLangOpts().CPlusPlus &&
----------------
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.


Repository:
  rL LLVM

http://reviews.llvm.org/D15120





More information about the cfe-commits mailing list