__builtin_addc support??

Paul Koning paulkoning@comcast.net
Wed Oct 27 16:36:43 GMT 2021

> On Oct 27, 2021, at 12:12 PM, sotrdg sotrdg via Gcc <gcc@gcc.gnu.org> wrote:
> 79173 – add-with-carry and subtract-with-borrow support (x86_64 and others) (gnu.org)<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79173>
> What I find quite interesting is things like this.
> Since llvm clang provides __builtin_addc __builtin_subc for all targets. Can we provide something similar? Since currently no solutions we can access carry flag besides x86

Certainly some other targets could do this.  The LLVM builtins explicitly expose carry, which isn't actually what you want (you'd want the carry flag in the condition code to be propagated).  Presumably optimization would eliminate those explicit arguments and reduce them to CC references.


More information about the Gcc mailing list