[llvm] Enable logf128 constant folding for AArch64 (PR #96287)
Matthew Devereau via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 24 09:56:06 PDT 2024
MDevereau wrote:
>I don't understand how this works. logf128 is defined to take a _Float128, by the C standard. long double is not _Float128, and is not compatible with _Float128. Therefore, it should not be possible to implicitly convert a _Float128(*)(_Float128) to long double (*)(long double).
This was the rationale for the typedef of _Float128 to float128 for gcc versions higher than 12 and why the changes in ConstantFolding.cpp were warranted. It appears pre gcc13, logf128 did not use the _Float128 type but rather an alias of long double or __float128. What this typedef does is remove the implicit conversion which gives an error message.
https://godbolt.org/z/5bdneMz9o
https://godbolt.org/z/fMf8oKor1
You can see this was not an issue in gcc12
https://godbolt.org/z/vs5eaxvE9
https://github.com/llvm/llvm-project/pull/96287
More information about the llvm-commits
mailing list