https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103565
--- Comment #2 from Andrew Pinski ---
The difference is just argument and return register differences (and maybe a
register allocation issue).
That is the extra instructions are:
for add_carry_pattern_test:
movzx edi, dil
mov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103565
--- Comment #1 from cqwrteur ---
https://godbolt.org/z/bGfY6zh9x
#include
template
inline constexpr bool add_carry_pattern(bool carry,T a,T b,T& out) noexcept
{
T temp{carry+a};
out=temp+b;
return (out < b) | (temp < a)