https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110304
--- Comment #9 from cqwrteur <unlvsur at live dot com> --- well. user can use __builtin_unreachablecor C++23 assume before calling that then it would be safe to know it is zero or one Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: unlvsur unlvsur <unlv...@live.com> Sent: Monday, June 19, 2023 2:32:24 AM To: jakub at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> Subject: Re: [Bug c++/110304] __builtin_adcs missing and jakub you miss the point of builtin_adcb for example lets assume you design the interface with both bool carryin and bool * carryout char unsigned carryin=foo(); bool carryout __builtin_addcl(a,b,carryin,&carryout);//carryin will do implicit cast for carryin here, therefore there is an extra comparison instruction. carryin will implicit cast to bool clang's interface does not do any implicit cast for carryin Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: jakub at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> Sent: Monday, June 19, 2023 2:22:10 AM To: unlv...@live.com <unlv...@live.com> Subject: [Bug c++/110304] __builtin_adcs missing and jakub you miss the point of builtin_adcb https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110304 --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The reason for | rather than + is clang compatibility with its misdesigned interface. It never returns 2 as carry-out, even if you add 0xffffffffU, 0xfffffffU and 0xfffffffU. But, if pattern matching can prove the carry-in is only in [0, 1] range, then all of +, | or ^ act the same and if target provides uaddc5/usubc5 patterns, it will be pattern matched. -- You are receiving this mail because: You are on the CC list for the bug. You reported the bug.