[libc-commits] [PATCH] D137453: [libc] Add add_with_carry to builtin wrapper.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Nov 4 12:43:58 PDT 2022


lntue marked an inline comment as done.
lntue added inline comments.


================
Comment at: libc/src/__support/builtin_wrappers.h:69
+template <typename T>
+inline constexpr T add_with_carry(T a, T b, T carry_in, T &carry_out) {
+  T tmp = a + carry_in;
----------------
orex wrote:
> Don't you think it will be good to add here static assert, that T is integer and unsigned for this implementation?
Use `enable_if` to restrict to unsigned integers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137453



More information about the libc-commits mailing list