[Bug target/103565] GCC emits more assembly than clang for carry flag
unlvsur at live dot com
gcc-bugzilla@gcc.gnu.org
Mon Dec 6 21:54:00 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103565
--- Comment #4 from cqwrteur <unlvsur at live dot com> ---
(In reply to Andrew Pinski from comment #3)
> The tree level looks good:
> _6 = (long long unsigned int) carry_1(D);
> _13 = .ADD_OVERFLOW (a_3(D), _6);
> temp_7 = REALPART_EXPR <_13>;
> _14 = IMAGPART_EXPR <_13>;
> _15 = .ADD_OVERFLOW (b_4(D), temp_7);
> _8 = REALPART_EXPR <_15>;
> _16 = IMAGPART_EXPR <_15>;
> *out_5(D) = _8;
> _9 = _16 != 0;
> _10 = _14 != 0;
> _11 = _9 | _10;
so is that possible to understand the pattern of addcarry in C or C++ for GCC?
clang does that by adding new builtins but Jakub said pattern matching is
better since the compiler can optimize it later.
I think it is totally possible for using pattern matching instead of built-in.
More information about the Gcc-bugs
mailing list