[libcxx-commits] [PATCH] D136393: [libc++][math.h] Use builtins for all the functions

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 21 08:18:13 PST 2022


ldionne added inline comments.


================
Comment at: libcxx/include/math.h:1009
 
-inline _LIBCPP_HIDE_FROM_ABI float       hypot(float __x, float __y) _NOEXCEPT             {return ::hypotf(__x, __y);}
-inline _LIBCPP_HIDE_FROM_ABI long double hypot(long double __x, long double __y) _NOEXCEPT {return ::hypotl(__x, __y);}
+inline _LIBCPP_HIDE_FROM_ABI float       hypot(float __x, float __y) _NOEXCEPT             {return __builtin_hypotf(__x, __y);}
+inline _LIBCPP_HIDE_FROM_ABI long double hypot(long double __x, long double __y) _NOEXCEPT {return __builtin_hypotl(__x, __y);}
----------------
ldionne wrote:
> We also define `hypot` inside `<cmath>`. Do you know why?
Per discussion just now, the `<cmath>` version is a 3-arg overload and only available in C++17.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136393



More information about the libcxx-commits mailing list