[libcxx-commits] [PATCH] D74163: [demangler] Fix the parsing of long double literals for PowerPC and S390

Ulrich Weigand via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Feb 22 06:06:13 PST 2020


uweigand added a comment.

In D74163#1887301 <https://reviews.llvm.org/D74163#1887301>, @xingxue wrote:

> @uweigand, Hi, I've addressed your comments.  Any further comments?


I'm not very familiar with this code base.  However, I am somewhat confused by your proposed change to "parseExprPrimary".   In particular, where you now parse 'e' literals as "double" on powerpc/s390x, and 'g' literals as "long double" everywhere.  This seems incorrect to me.

'e' literals really should be of "long double" *type* always.  It's just that on powerpc and s390x, in an old ABI selected via -mlong-double-64, the "long double" type was implemented as IEEE-64 (just like "double", but the type is nevertheless still "long double", not "double").

'g' literals on the other hand really should be of type "long double" only on powerpc and s390x; on some other platforms, in particular x86, they should be of type "__float128" (on yet other platforms, 'g' is not used at all).

But what confuses me even more is how this whole routine is even supposed to work in non-native mode: it just uses the native "double" or "long double" types, but the host implementation of those may be different from the one active on the target (whether this is because of cross-compilation to another target, or simply to another ABI mode like -mlong-double-64 vs. -mlong-double-128).   Is this routine only ever to be called natively?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74163/new/

https://reviews.llvm.org/D74163





More information about the libcxx-commits mailing list