[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
Fri Dec 11 05:15:40 PST 2015


nemanjai added inline comments.

================
Comment at: include/clang/Basic/TargetInfo.h:384
@@ +383,3 @@
+  unsigned getFloat128Width() const { return 128; }
+  unsigned getFloat128Align() const { return 128; }
+  const llvm::fltSemantics &getFloat128Format() const {
----------------
hubert.reinterpretcast wrote:
> This should probably not be hard-coded. On s390x-ibm-linux-gnu, the IEEE 128-bit binary format type has 8 byte alignment (not 16).
OK, I probably shouldn't have assumed anything about the alignment. I'll add fields to the target info that can be set as needed.

================
Comment at: lib/CodeGen/CGDebugInfo.cpp:539
@@ -538,2 +538,3 @@
   case BuiltinType::LongDouble:
+  case BuiltinType::Float128:
   case BuiltinType::Double:
----------------
hubert.reinterpretcast wrote:
> Is a PPCDoubleDouble "long double" and "__float128" distinguishable on PPC given this DWARF treatment?
Unless there's something put into the debugger to figure out which type something actually is, I don't think so. However, there isn't a consensus on what encoding will be used, so I'll just leave it as-is and put a FIXME in the code to note this.

================
Comment at: lib/Lex/LiteralSupport.cpp:604
@@ -596,3 +603,3 @@
       if (isLong || isLongLong) break;  // Cannot be repeated.
-      if (isFloat) break;               // LF invalid.
+      if (isFloat || isFloat128) break; // LF, QL invalid.
 
----------------
hubert.reinterpretcast wrote:
> minor: should the comment have FL instead of LF?
I agree that it probably should, but it was already there so I didn't change it. I'll change it on the next review.


Repository:
  rL LLVM

http://reviews.llvm.org/D15120





More information about the cfe-commits mailing list