[libcxx-commits] [PATCH] D60097: Fix implementation of ::abs and std::abs LWG 2192.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 2 10:41:38 PDT 2019


ldionne added inline comments.


================
Comment at: include/math.h:800
+inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT {
+  return __builtin_fabsf(__lcpp_x);
+}
----------------
mclow.lists wrote:
> ldionne wrote:
> > We were not using the builtin before -- why the change?
> I agree. We can't use the intrinsics here w/o a check to see if the compiler supports them.
> 
> We'll probably want to use them in the future, when SG6 plasters `constexpr` all over `cmath`, but not right now.
> I agree. We can't use the intrinsics here w/o a check to see if the compiler supports them.

Just to be clear -- this is not what I'm claiming (although you might be right), but I just wanted to understand the reason for this drive-by change.



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

https://reviews.llvm.org/D60097





More information about the libcxx-commits mailing list