@@ -66,15 +66,15 @@ template <typename T>
66
66
67
67
#define RETURN_IF (TYPE, BUILTIN ) \
68
68
if constexpr (cpp::is_same_v<T, TYPE>) \
69
- return BUILTIN(a, b, carry_in, carry_out);
69
+ return BUILTIN(a, b, carry_in, & carry_out);
70
70
71
71
// Returns the result of 'a + b' taking into account 'carry_in'.
72
72
// The carry out is stored in 'carry_out' it not 'nullptr', dropped otherwise.
73
73
// We keep the pass by pointer interface for consistency with the intrinsic.
74
74
template <typename T>
75
75
[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t <cpp::is_unsigned_v<T>, T>
76
76
add_with_carry (T a, T b, T carry_in, T &carry_out) {
77
- if constexpr (!cpp::is_constant_evaluated ()) {
77
+ if (!cpp::is_constant_evaluated ()) {
78
78
#if __has_builtin(__builtin_addcb)
79
79
RETURN_IF (unsigned char , __builtin_addcb)
80
80
#elif __has_builtin(__builtin_addcs)
@@ -100,7 +100,7 @@ add_with_carry(T a, T b, T carry_in, T &carry_out) {
100
100
template <typename T>
101
101
[[nodiscard]] LIBC_INLINE constexpr cpp::enable_if_t <cpp::is_unsigned_v<T>, T>
102
102
sub_with_borrow (T a, T b, T carry_in, T &carry_out) {
103
- if constexpr (!cpp::is_constant_evaluated ()) {
103
+ if (!cpp::is_constant_evaluated ()) {
104
104
#if __has_builtin(__builtin_subcb)
105
105
RETURN_IF (unsigned char , __builtin_subcb)
106
106
#elif __has_builtin(__builtin_subcs)
0 commit comments