[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

Evgeny Shulgin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 14:16:31 PDT 2022


Izaron added inline comments.


================
Comment at: clang/docs/LanguageExtensions.rst:96
+the constant evaluation of the corresponding builtin (for example,
+``std::fmax`` calls ``__builtin_fmax``) is supported in Clang.
+
----------------
Izaron wrote:
> Just to be clear: this isn't a true statement now (`std::fmax calls __builtin_fmax`), but soon will be, after @philnik commits this patch https://reviews.llvm.org/D134584 part by part
> 
> ```
> inline _LIBCPP_HIDE_FROM_ABI float fmax(float __x, float __y) _NOEXCEPT { return __builtin_fmaxf(__x, __y); }
> ```
BTW in future it could look something like this:
```
inline _LIBCPP_CONSTEXPR_CXX23_IF_CONSTEXPR_BUILTIN(__builtin_fmax) _LIBCPP_HIDE_FROM_ABI float fmax(float __x, float __y) _NOEXCEPT { return __builtin_fmaxf(__x, __y); }
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136036



More information about the cfe-commits mailing list