[PATCH] D109751: [Clang] Support conversion between PPC double-double and IEEE float128

Qiu Chaofan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 16 21:16:30 PST 2021


qiucf added a comment.

In D109751#3131169 <https://reviews.llvm.org/D109751#3131169>, @nemanjai wrote:

> Please provide a description for this patch which includes justification for why we want to allow conversion between the two types.
> I am of the impression that allowing the two types to coexist in completely disjoint code should be fine, but I really don't see a compelling reason to allow conversions between the two types.

The motivating case is failure after D92815 <https://reviews.llvm.org/D92815>: `clang compiler-rt/test/builtins/Unit/multc3_test.c -I compiler-rt/lib/builtins/ -mfloat128 -mcpu=power9 -lm`

  compiler-rt/test/builtins/Unit/multc3_test.c:24:15: error: passing 'long double' to parameter of incompatible type '_Float128' (aka '__float128')

Because the piece of code will be expanded to:

  if ((__builtin_types_compatible_p(__typeof(creall(x)), _Float128)
           ? __isinff128(creall(x))
           : __builtin_isinf_sign(creall(x))) ||
      (__builtin_types_compatible_p(__typeof(cimagl(x)), _Float128)
           ? __isinff128(cimagl(x))
           : __builtin_isinf_sign(cimagl(x))))
    return inf;

which requires 'long double' (the same semantics to `__ibm128` by default) and '_Float128' are compatible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109751



More information about the cfe-commits mailing list