[libcxx-commits] [PATCH] D74163: [demangler] Fix the parsing of long double literals for PowerPC and S390
Hubert Tong via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 25 06:40:59 PST 2020
hubert.reinterpretcast added a comment.
In D74163#1891047 <https://reviews.llvm.org/D74163#1891047>, @uweigand wrote:
> I'm still wondering about Intel. Can there ever be a literal encoded using 'g' on Intel? If yes, then treating it as "long double" would still be wrong, because 'g' encodes IEEE128 (__float128), while "long double" is the Intel extended (80-bit) format, right?
A literal such as `1.Q` would appear as `g3fff0000000000000000000000000000`. As would `1.L` with `-mlong-double-128`.
>> `__cxa_demangle()` is a routine in runtime library libc++abi that is only built natively.
>
> OK, got it. Even more so, I guess we must also ensure that it is only built using the default compiler setting (e.g. it is built with the default -mlong-double-128 on s390x, not with -mlong-double-64). But that's probably a reasonable assumption.
The patch already adds a preprocessor check for that on Power. I've added an inline comment to do the same for s390x.
================
Comment at: libcxxabi/src/cxa_demangle.cpp:11
+ (!defined(__LONG_DOUBLE_128__) || defined(__LONG_DOUBLE_IEEE128__))
+#error "Demangler must be built in double-double long double 128 mode on PPC."
+#endif
----------------
A similar error for building with 64-bit long double on s390x would be appropriate.
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