Fixes midpoint error of PR51430.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp | ||
---|---|---|
95 | Who sets the __LONG_DOUBLE_128__ macro — some vendor's compiler? #if defined(__PPC__) && (defined(__LONG_DOUBLE_128__) && __LONG_DOUBLE_128__) && !(defined(__LONG_DOUBLE_IEEE128__) && __LONG_DOUBLE_IEEE128__) to deal with the (hypothetical but I-don't-know-if-impossible) case of either __LONG_DOUBLE_128__ or __LONG_DOUBLE_IEEE128__ being defined as 0? |
libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp | ||
---|---|---|
95 | Due to the bug report is for the release I strongly suspect the compiler in question is Clang. Based on Clang's implementation I think the current approach is correct. if (LongDoubleWidth == 128) { Builder.defineMacro("__LONG_DOUBLE_128__"); Builder.defineMacro("__LONGDOUBLE128"); if (Opts.PPCIEEELongDouble) Builder.defineMacro("__LONG_DOUBLE_IEEE128__"); else Builder.defineMacro("__LONG_DOUBLE_IBM128__"); } I still would like @Conanap to validate this fixes that build error on PPC. |
Sorry for the late reply! There were some internal discussions before we came to a conclusion.
While this patch works, __LONG_DOUBLE_128__ should be defined (or at least we haven't hit a case where it's undefined), so we would prefer something similar:
#if defined(__PPC__) && __LONG_DOUBLE_128__ && (!defined(__LONG_DOUBLE_IEEE128__) || !__LONG_DOUBLE_IEEE128__)
The compiler in question is indeed Clang.
I have a patch of the preferred implementation here: https://reviews.llvm.org/D108352
Thanks for the help!
@Conanap I'm a bit confused now. Do you want me to fix this patch or do you want to land your patch?
No problem, but next time it would be easier to just add review comments to an existing review instead of creating a new review.
clang-format suggested style edits found: