[clang] [clang] constexpr built-in fma function. (PR #113020)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 29 11:39:24 PDT 2024
lntue wrote:
> I've created an issue for planning out the LLVM-libc + clang code sharing (#114109). That being said I think FMA might be fine to implement within clang, due to its simplicity. Additionally, LLVM-libc may call `__builtin_fma`: https://github.com/llvm/llvm-project/blob/main/libc/src/__support/FPUtil/FMA.h#L32
>
> CC: @lntue
On a side note, a completely correct FMA without hardware support is not straightforward, especially when the wider floating point type for intermediate computations is not available. LLVM libc uses `__builtin_fma` only when there is hardware support in order to get both fma instructions generated and compiler optimization support, since the latter one does not work so well with inline assembly.
https://github.com/llvm/llvm-project/pull/113020
More information about the cfe-commits
mailing list